Asgard.Core.System.ObjectMapper.DestroyEntity C# (CSharp) Метод

DestroyEntity() публичный статический Метод

public static DestroyEntity ( Entity ent, bool destoryEntity = true ) : void
ent Entity
destoryEntity bool
Результат void
        public static void DestroyEntity(Entity ent, bool destoryEntity=true)
        {
            List<NetworkObject> objCache;
            if (_netObjectCache.TryGetValue(ent, out objCache))
            {
                _netObjectCache.Remove(ent);

                foreach(var obj in objCache)
                {
                    if (obj is DefinitionNetworkObject)
                    {
                        (obj as DefinitionNetworkObject).Destroy = true;
                        (obj as DefinitionNetworkObject).OnDestroyed(_instance, ent, false);
                    }
                }
            }

            if (destoryEntity)
            {
                _manager.Remove(ent);
            }
        }