예제 #1
0
파일: Ego.cs 프로젝트: starikcetin/EgoCS
        public static void DestroyGameObject(EgoComponent egoComponent)
        {
            var gameObject = egoComponent.gameObject;

            EgoEvents <DestroyedGameObject> .AddEvent(new DestroyedGameObject(gameObject, egoComponent));

            EgoCleanUp.Destroy(egoComponent.gameObject);
        }
예제 #2
0
파일: Ego.cs 프로젝트: starikcetin/EgoCS
        public static bool DestroyComponent <C>(EgoComponent egoComponent) where C : Component
        {
            C component = null;

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

            var e = new DestroyedComponent <C>(component, egoComponent);

            EgoEvents <DestroyedComponent <C> > .AddEvent(e);

            EgoCleanUp <C> .Destroy(egoComponent, component);

            return(true);
        }