예제 #1
0
        public void HandleDestruction(IEntity owner, bool isWreck)
        {
            var eventArgs = new DestructionEventArgs
            {
                Owner        = owner,
                IsSpawnWreck = isWreck
            };
            var destroyActs = owner.GetAllComponents <IDestroyAct>().ToList();

            foreach (var destroyAct in destroyActs)
            {
                destroyAct.OnDestroy(eventArgs);
            }
            owner.Delete();
        }
예제 #2
0
        public void HandleDestruction(IEntity owner)
        {
            var eventArgs = new DestructionEventArgs
            {
                Owner = owner
            };

            var destroyActs = owner.GetAllComponents <IDestroyAct>().ToList();

            foreach (var destroyAct in destroyActs)
            {
                destroyAct.OnDestroy(eventArgs);
            }

            owner.QueueDelete();
        }