Beispiel #1
0
        /// <summary>
        /// Creates entity with single component at specified EcsWorld.
        /// </summary>
        /// <param name="world">World instance.</param>
        public static Inc1 Create(EcsWorld world)
        {
            world.GetFilter <EcsFilterSingle <Inc1> > ();
            var data = world.CreateEntityWith <Inc1> ();

            world.ProcessDelayedUpdates();
            return(data);
        }
Beispiel #2
0
        /// <summary>
        /// Closes registration for new systems, initialize all registered.
        /// </summary>
        public void Initialize()
        {
#if DEBUG
            if (_inited)
            {
                throw new Exception("Group already initialized.");
            }
            for (var i = 0; i < _runSystemsCount; i++)
            {
                DisabledInDebugSystems.Add(false);
            }
            _inited = true;
#endif
            for (var i = 0; i < _initSystemsCount; i++)
            {
                _initSystems[i].Initialize();
                _world.ProcessDelayedUpdates();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Closes registration for new systems, initialize all registered.
        /// </summary>
        public void Initialize()
        {
#if DEBUG
            if (_inited)
            {
                throw new Exception("Group already initialized.");
            }
            _inited = true;
#endif
            for (var i = 0; i < _preInitSystems.Count; i++)
            {
                _preInitSystems[i].PreInitialize();
                _world.ProcessDelayedUpdates();
            }
            for (var i = 0; i < _initSystems.Count; i++)
            {
                _initSystems[i].Initialize();
                _world.ProcessDelayedUpdates();
            }
        }