예제 #1
0
        public void Start(Type systemType)
        {
            var system = GetBySystemType(systemType);

            if (system == null)
            {
                return;
            }

            system.Start();

            SystemStarted?.Invoke(this, new SystemStartedEventArgs(system));
        }
예제 #2
0
        private void RegisterManagers()
        {
            // Entity events
            EntityManager.Register(this);
            EntityManager.EntityAdded      += EntityManagerOnEntityAdded;
            EntityManager.EntityRemoved    += EntityManagerOnEntityRemoved;
            EntityManager.ComponentAdded   += EntityManagerOnComponentAdded;
            EntityManager.ComponentRemoved += EntityManagerOnComponentRemoved;

            // Systems events
            Systems.Register(this);
            Systems.SystemAdded   += (sender, args) => SystemAdded?.Invoke(sender, args);
            Systems.SystemStarted += (sender, args) => SystemStarted?.Invoke(sender, args);
            Systems.SystemRemoved += (sender, args) => SystemRemoved?.Invoke(sender, args);
            Systems.SystemStopped += (sender, args) => SystemStopped?.Invoke(sender, args);
        }