public void RenamePrefabTag(PrefabTag prefabTag, string newName) { if (ContainsPrefabTag(prefabTag)) { _prefabTags.RenameEntity(prefabTag, newName); } }
public static void AssociatePrefabsWithTag(List <Prefab> prefabs, PrefabTag tag) { foreach (Prefab prefab in prefabs) { prefab.TagAssociations.Associate(tag); } }
private static PrefabTag CreatePrefabTagWithUniqueName(string name, List <string> existingTagNames) { PrefabTag prefabTag = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <PrefabTag>(); prefabTag.Name = UniqueEntityNameGenerator.GenerateUniqueName(name, existingTagNames); return(prefabTag); }
public void Associate(string tagName) { PrefabTag prefabTagWithSpecifiedName = PrefabTagDatabase.Get().GetPrefabTagByName(tagName); if (prefabTagWithSpecifiedName != null) { _associatedTags.Add(prefabTagWithSpecifiedName); } }
public void RemoveAndDestroyPrefabTag(PrefabTag prefabTag) { if (ContainsPrefabTag(prefabTag)) { _prefabTags.RemoveEntity(prefabTag); PrefabTagWasRemovedFromDatabaseMessage.SendToInterestedListeners(prefabTag); UndoEx.DestroyObjectImmediate(prefabTag); } }
private void SetTagSelected(PrefabTag prefabTag, bool isSelected) { ViewData.HasSelectionChanged = true; if (isSelected) { ViewData.AddTagNameToTagSelection(prefabTag.Name); } else { ViewData.RemoveTagNameFromTagSelection(prefabTag.Name); } }
public PrefabTag CreatePrefabTag(string tagName) { if (!string.IsNullOrEmpty(tagName)) { PrefabTag newPrefabTag = PrefabTagFactory.Create(tagName, GetAllPrefabTagNames()); _prefabTags.AddEntity(newPrefabTag); PrefabTagWasCreatedInDatabaseMessage.SendToInterestedListeners(newPrefabTag); return(newPrefabTag); } return(null); }
private void CreateTagsForDroppedFolderIfNecessaryAndAssociate(PrefabFolderDropData prefabFolderDropData) { string lastFolderNameInFoderPath = prefabFolderDropData.FolderNameInPath; if (PrefabTagDatabase.Get().ContainsPrefabTag(lastFolderNameInFoderPath)) { PrefabActions.AssociatePrefabsWithTag(prefabFolderDropData.ValidPrefabs, lastFolderNameInFoderPath); } else { UndoEx.RecordForToolAction(PrefabTagDatabase.Get()); PrefabTag prefabTag = PrefabTagDatabase.Get().CreatePrefabTag(lastFolderNameInFoderPath); PrefabActions.AssociatePrefabsWithTag(prefabFolderDropData.ValidPrefabs, prefabTag); } }
private static void WritePrefabTag(XmlTextWriter xmlWriter, PrefabTag prefabTag) { xmlWriter.WriteNewLine(2); xmlWriter.WriteStartElement(PrefabConfigXMLInfo.PrefabTagNode); xmlWriter.WriteNewLine(3); xmlWriter.WriteStartElement(PrefabConfigXMLInfo.PrefabTagNameNode); xmlWriter.WriteString(prefabTag.Name); xmlWriter.WriteEndElement(); xmlWriter.WriteNewLine(3); xmlWriter.WriteStartElement(PrefabConfigXMLInfo.PrefabTagActiveNode); xmlWriter.WriteString(prefabTag.IsActive.ToString()); xmlWriter.WriteEndElement(); xmlWriter.WriteNewLine(2); xmlWriter.WriteEndElement(); }
public bool IsAssociatedWith(PrefabTag prefabTag) { return(IsAssociatedWith(prefabTag.Name)); }
public static void SendToInterestedListeners(PrefabTag prefabTag) { var message = new PrefabTagActiveStateWasChangedMessage(prefabTag); MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message); }
public static void SendToInterestedListeners(PrefabTag prefabTag) { var message = new PrefabTagWasRemovedFromDatabaseMessage(prefabTag); MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message); }
public PrefabTagActiveStateWasChangedMessage(PrefabTag prefabTag) : base(MessageType.PrefabTagActiveStateWasChanged) { _prefabTag = prefabTag; }
public PrefabTagWasCreatedInDatabaseMessage(PrefabTag prefabTag) : base(MessageType.PrefabTagWasCreatedInDatabase) { _prefabTag = prefabTag; }
public PrefabTagWasRemovedFromDatabaseMessage(PrefabTag prefabTag) : base(MessageType.PrefabTagWasRemovedFromDatabase) { _prefabTag = prefabTag; }
public bool ContainsPrefabTag(PrefabTag prefabTag) { return(_prefabTags.ContainsEntity(prefabTag)); }
public bool IsTagSelected(PrefabTag prefabTag) { return(IsTagSelected(prefabTag.Name)); }
public PrefabTagView(PrefabTag prefabTag) { _prefabTag = prefabTag; }
public void Associate(PrefabTag prefabTag) { Associate(prefabTag.Name); }
public bool IsAssociatedWith(string tagName) { PrefabTag prefabTagWithSpecifiedName = PrefabTagDatabase.Get().GetPrefabTagByName(tagName); return(_associatedTags.Contains(prefabTagWithSpecifiedName)); }
public void ToggleAssociation(PrefabTag prefabTag) { ToggleAssociation(prefabTag.Name); }
public void RemoveAssociation(PrefabTag prefabTag) { RemoveAssociation(prefabTag.Name); }