Exemple #1
0
 public void RenameEntity(EntityType entity, string newName)
 {
     if (!string.IsNullOrEmpty(newName))
     {
         entity.Name = UniqueEntityNameGenerator.GenerateUniqueName(newName, GetAllEntityNames());
     }
 }
Exemple #2
0
        private static ObjectPlacementPathTileConnectionConfiguration CreateNewConfigurationWithUniqueName(string configurationName, List <string> existingConfigurationNames)
        {
            ObjectPlacementPathTileConnectionConfiguration newConfiguration = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <ObjectPlacementPathTileConnectionConfiguration>();

            newConfiguration.Name = UniqueEntityNameGenerator.GenerateUniqueName(configurationName, existingConfigurationNames);

            return(newConfiguration);
        }
Exemple #3
0
        private static ObjectPlacementPathHeightPattern CreateNewPatternWithUniqueName(string name, List <string> existingPatternNames)
        {
            ObjectPlacementPathHeightPattern newPattern = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <ObjectPlacementPathHeightPattern>();

            newPattern.Name = UniqueEntityNameGenerator.GenerateUniqueName(name, existingPatternNames);

            return(newPattern);
        }
        private static PrefabCategory CreateNewPrefabCategoryWithUniqueName(string name, List <string> existingCategoryNames)
        {
            PrefabCategory newPrefabCategory = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <PrefabCategory>();

            newPrefabCategory.Name = UniqueEntityNameGenerator.GenerateUniqueName(name, existingCategoryNames);

            return(newPrefabCategory);
        }
        private static DecorPaintObjectPlacementBrush CreateNewBrushWithUniqueName(string name, List <string> existingBrushNames)
        {
            DecorPaintObjectPlacementBrush newBrush = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <DecorPaintObjectPlacementBrush>();

            newBrush.Name = UniqueEntityNameGenerator.GenerateUniqueName(name, existingBrushNames);

            return(newBrush);
        }
        private static PrefabTag CreatePrefabTagWithUniqueName(string name, List <string> existingTagNames)
        {
            PrefabTag prefabTag = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <PrefabTag>();

            prefabTag.Name = UniqueEntityNameGenerator.GenerateUniqueName(name, existingTagNames);

            return(prefabTag);
        }
Exemple #7
0
        private static ObjectGroup CreateNewObjectGroupWithUniqueName(string name, List <string> existingGroupNames)
        {
            GameObject groupParent = new GameObject();

            UndoEx.RegisterCreatedGameObject(groupParent);

            ObjectGroup newObjectGroup = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <ObjectGroup>();

            newObjectGroup.Name        = UniqueEntityNameGenerator.GenerateUniqueName(name, existingGroupNames);
            newObjectGroup.GroupObject = groupParent;

            return(newObjectGroup);
        }
Exemple #8
0
        public static ObjectGroup Create(GameObject gameObject, List <string> existingGroupNames)
        {
            if (gameObject == null || string.IsNullOrEmpty(gameObject.name))
            {
                return(null);
            }

            ObjectGroup newObjectGroup = Octave3DWorldBuilder.ActiveInstance.CreateScriptableObject <ObjectGroup>();

            newObjectGroup.Name        = UniqueEntityNameGenerator.GenerateUniqueName(gameObject.name, existingGroupNames);
            newObjectGroup.GroupObject = gameObject;

            return(newObjectGroup);
        }