Ejemplo n.º 1
0
        public StubbContext(EcsWorld world, IEcsDebug debug = null)
        {
            Stubb.AddContext(this);

            _world      = world;
            _debugger   = debug;
            RootSystems = new EcsSystems(_world, $"{GetType()}Systems");

            InitFeatures();
        }
Ejemplo n.º 2
0
        public virtual void Dispose()
        {
            RootSystems.Destroy();
            RootSystems = null;
            _debugger   = null;

            if (_world != null && _world.IsAlive())
            {
                _world.Destroy();
                _world = null;
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 public StubbContext(IEcsDebug debug) : this(new EcsWorld(), debug)
 {
 }