Exemplo n.º 1
0
        public static void DestroyHActor(HActor hActor)
        {
            var gameObject = hActor.GameObject;

            HEvents <DestroyedGameObject> .AddEvent(new DestroyedGameObject(gameObject, hActor));

            HCleanUp.Destroy(hActor);
        }
Exemplo n.º 2
0
        public static bool DestroyComponent <C>(HActor hActor) where C : HComponent
        {
            C component = null;

            if (!hActor.TryGetComponents <C>(out component))
            {
                return(false);
            }

            HEvents <DestroyedComponent <C> > .AddEvent(new DestroyedComponent <C>(component, hActor));

            HCleanUp <C> .Destroy(hActor, component);

            return(true);
        }
Exemplo n.º 3
0
        public static void Update()
        {
            foreach (var system in activeSystems)
            {
#if UNITY_EDITOR
                if (system.enabled)
                {
                    system.Update();
                }
#else
                system.Update();
#endif
            }

            HEvents.Invoke();

            HCleanUp.CleanUp();
        }
Exemplo n.º 4
0
        public static void Start()
        {
            activeSystems.Clear();
            foreach (var system in _systems)
            {
                foreach (var hActor in HActors.hActors)
                {
                    system.CreateBundle(hActor);
                }
            }

            HEvents.Start();

            foreach (var system in activeSystems)
            {
                system.Start();
            }

            HEvents.Invoke();

            HCleanUp.CleanUp();
        }