public void RenamePrefabTag(PrefabTag prefabTag, string newName)
 {
     if (ContainsPrefabTag(prefabTag))
     {
         _prefabTags.RenameEntity(prefabTag, newName);
     }
 }
Exemple #2
0
 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);
        }
Exemple #4
0
        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);
            }
        }
Exemple #6
0
        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();
        }
Exemple #10
0
 public bool IsAssociatedWith(PrefabTag prefabTag)
 {
     return(IsAssociatedWith(prefabTag.Name));
 }
Exemple #11
0
        public static void SendToInterestedListeners(PrefabTag prefabTag)
        {
            var message = new PrefabTagActiveStateWasChangedMessage(prefabTag);

            MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message);
        }
Exemple #12
0
        public static void SendToInterestedListeners(PrefabTag prefabTag)
        {
            var message = new PrefabTagWasRemovedFromDatabaseMessage(prefabTag);

            MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message);
        }
Exemple #13
0
 public PrefabTagActiveStateWasChangedMessage(PrefabTag prefabTag)
     : base(MessageType.PrefabTagActiveStateWasChanged)
 {
     _prefabTag = prefabTag;
 }
Exemple #14
0
 public PrefabTagWasCreatedInDatabaseMessage(PrefabTag prefabTag)
     : base(MessageType.PrefabTagWasCreatedInDatabase)
 {
     _prefabTag = prefabTag;
 }
Exemple #15
0
 public PrefabTagWasRemovedFromDatabaseMessage(PrefabTag prefabTag)
     : base(MessageType.PrefabTagWasRemovedFromDatabase)
 {
     _prefabTag = prefabTag;
 }
 public bool ContainsPrefabTag(PrefabTag prefabTag)
 {
     return(_prefabTags.ContainsEntity(prefabTag));
 }
Exemple #17
0
 public bool IsTagSelected(PrefabTag prefabTag)
 {
     return(IsTagSelected(prefabTag.Name));
 }
 public PrefabTagView(PrefabTag prefabTag)
 {
     _prefabTag = prefabTag;
 }
Exemple #19
0
 public void Associate(PrefabTag prefabTag)
 {
     Associate(prefabTag.Name);
 }
Exemple #20
0
        public bool IsAssociatedWith(string tagName)
        {
            PrefabTag prefabTagWithSpecifiedName = PrefabTagDatabase.Get().GetPrefabTagByName(tagName);

            return(_associatedTags.Contains(prefabTagWithSpecifiedName));
        }
Exemple #21
0
 public void ToggleAssociation(PrefabTag prefabTag)
 {
     ToggleAssociation(prefabTag.Name);
 }
Exemple #22
0
 public void RemoveAssociation(PrefabTag prefabTag)
 {
     RemoveAssociation(prefabTag.Name);
 }