mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Small script engine improvements
- Fixed script class name not visible in Component Editor - Retain user assembly file system watcher (fixed deletion while handling events) - Fixed crash when a scritp constains a List or Array (by ignoring them for now) - Fixed Typo in Genericinst - Scene: Invoke OnCreate for copied entity scripts
This commit is contained in:
@@ -841,6 +841,9 @@ namespace GlitchyEngine.World
|
||||
|
||||
// TODO: Copy Data from one instance to another
|
||||
//ScriptEngine.CopyFieldsToInstance(targetScript, sourceScript);
|
||||
|
||||
// TODO: Only if we are in Runtime
|
||||
targetScript.Instance.InvokeOnCreate();
|
||||
}
|
||||
|
||||
// This is kinda slow because it's in O(n*m) where n is the tree depth and m is the total number of entities in the scene...
|
||||
@@ -920,6 +923,14 @@ namespace GlitchyEngine.World
|
||||
}
|
||||
}
|
||||
|
||||
private void OnComponentRemoved(Entity entity, Type componentType, void* component)
|
||||
{
|
||||
if (_onComponentAddedHandlers.TryGetValue(componentType, let handler))
|
||||
{
|
||||
handler(entity, componentType, component);
|
||||
}
|
||||
}
|
||||
|
||||
public WorldEnumerator<TComponent> GetEntities<TComponent>() where TComponent : struct
|
||||
{
|
||||
return _ecsWorld.Enumerate<TComponent>();
|
||||
|
||||
Reference in New Issue
Block a user