mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Native scripting
This commit is contained in:
@@ -4,6 +4,8 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.World
|
||||
{
|
||||
using internal ScriptableEntity;
|
||||
|
||||
class Scene
|
||||
{
|
||||
internal EcsWorld _ecsWorld = new .() ~ delete _;
|
||||
@@ -22,6 +24,18 @@ namespace GlitchyEngine.World
|
||||
{
|
||||
//TransformSystem.Update(_ecsWorld);
|
||||
|
||||
for (var (entity, script) in _ecsWorld.Enumerate<NativeScriptComponent>())
|
||||
{
|
||||
if (script.Instance == null)
|
||||
{
|
||||
script.Instance = script.InstantiateFunction();
|
||||
script.Instance._entity = Entity(entity, this);
|
||||
script.Instance.[Friend]OnCreate();
|
||||
}
|
||||
|
||||
script.Instance.[Friend]OnUpdate(gameTime);
|
||||
}
|
||||
|
||||
Camera* primaryCamera = null;
|
||||
Matrix* primaryCameraTransform = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user