Exemplo n.º 1
0
        public void RemoveAndDestroyPrefabTag(PrefabTag prefabTag)
        {
            if (ContainsPrefabTag(prefabTag))
            {
                _prefabTags.RemoveEntity(prefabTag);
                PrefabTagWasRemovedFromDatabaseMessage.SendToInterestedListeners(prefabTag);

                UndoEx.DestroyObjectImmediate(prefabTag);
            }
        }
        private void RespondToMessage(PrefabTagWasRemovedFromDatabaseMessage message)
        {
            List <PrefabCategory> allPrefabCategories = _prefabCategories.GetAllEntities();

            foreach (PrefabCategory prefabCategory in allPrefabCategories)
            {
                List <Prefab> allPrefabsInCategory = prefabCategory.GetAllPrefabs();
                foreach (Prefab prefab in allPrefabsInCategory)
                {
                    prefab.TagAssociations.RemoveNullEntries();
                }
            }
        }
Exemplo n.º 3
0
        public void RemoveAndDestroyAllPrefabTags()
        {
            List <PrefabTag> allPrefabTags = GetAllPrefabTags();

            foreach (PrefabTag prefabTag in allPrefabTags)
            {
                _prefabTags.RemoveEntity(prefabTag);
                PrefabTagWasRemovedFromDatabaseMessage.SendToInterestedListeners(prefabTag);
            }

            foreach (PrefabTag prefabTag in allPrefabTags)
            {
                UndoEx.DestroyObjectImmediate(prefabTag);
            }
        }
Exemplo n.º 4
0
 private void RespondToMessage(PrefabTagWasRemovedFromDatabaseMessage message)
 {
     Repaint();
 }
Exemplo n.º 5
0
        public static void SendToInterestedListeners(PrefabTag prefabTag)
        {
            var message = new PrefabTagWasRemovedFromDatabaseMessage(prefabTag);

            MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message);
        }
Exemplo n.º 6
0
 private void RespondToMessage(PrefabTagWasRemovedFromDatabaseMessage message)
 {
     // Note: If we don't do this here, when a tag is removed, its prefab associations will be lost.
     UndoEx.RecordForToolAction(this);
     _associatedTags.Remove(message.PrefabTag);
 }