public StubbContext(EcsWorld world, IEcsDebug debug = null) { Stubb.AddContext(this); _world = world; _debugger = debug; RootSystems = new EcsSystems(_world, $"{GetType()}Systems"); InitFeatures(); }
public virtual void Dispose() { RootSystems.Destroy(); RootSystems = null; _debugger = null; if (_world != null && _world.IsAlive()) { _world.Destroy(); _world = null; } }
private void Awake() { log.AddAppender(UnityLogAppender.LogDelegate); _debug = CreateDebug(); _context = CreateContext(); _physicsContext = CreatePhysicsContext(); _MapServices(); Construct(_context); if (!enableUiEmitter) { return; } var emitter = gameObject.GetComponent <EcsUiEmitter>(); if (emitter != null) { _context.MainFeature.InternalSystems.InjectUi(emitter); } }
public StubbContext(IEcsDebug debug) : this(new EcsWorld(), debug) { }