public static void DestroyHActor(HActor hActor) { var gameObject = hActor.GameObject; HEvents <DestroyedGameObject> .AddEvent(new DestroyedGameObject(gameObject, hActor)); HCleanUp.Destroy(hActor); }
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); }