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(); } } }
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); } }
private void RespondToMessage(PrefabTagWasRemovedFromDatabaseMessage message) { Repaint(); }
public static void SendToInterestedListeners(PrefabTag prefabTag) { var message = new PrefabTagWasRemovedFromDatabaseMessage(prefabTag); MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message); }
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); }