示例#1
0
        public static BuildRAtlasSO CreateWallSectionAtlasAsset(string name = null, string directory = null)
        {
            BuildRAtlasSO buildRAtlas = CreateInstance <BuildRAtlasSO>();

            if (Application.isPlaying)
            {
                return(buildRAtlas);
            }
            if (name != null)
            {
                buildRAtlas.name = name;
            }
#if UNITY_EDITOR
            if (directory == null)
            {
                UnityEditor.AssetDatabase.CreateAsset(buildRAtlas, AssetCreator.GeneratePath("buildrAtlas.asset", "BuildRAtlases"));
            }
            else
            {
                UnityEditor.AssetDatabase.CreateAsset(buildRAtlas, Path.Combine(directory, "buildrAtlas.asset"));
            }
#endif

            return(buildRAtlas);
        }
示例#2
0
        public static Facade CreateFacade(string name = null, string directory = null)
        {
            HUtils.log();
            Debug.Log("调用了Facade.cs CreateFacade(string name = null, string directory = null) name=" + name + "  directory=" + directory);
            Facade newFacade = CreateInstance <Facade>();

            if (Application.isPlaying)
            {
                return(newFacade);
            }
            if (name != null)
            {
                newFacade.name = name;
            }
#if UNITY_EDITOR
            if (directory == null)
            {
                UnityEditor.AssetDatabase.CreateAsset(newFacade, AssetCreator.GeneratePath("newFacade.asset", "Facades"));
            }
            else
            {
                UnityEditor.AssetDatabase.CreateAsset(newFacade, Path.Combine(directory, "newFacade.asset"));
            }
#endif
            return(newFacade);
        }
示例#3
0
        public static WallSection CreateWallSection(string name = null, string directory = null)
        {
            WallSection wallSection = CreateInstance <WallSection>();

            if (Application.isPlaying)
            {
                return(wallSection);
            }
            if (name != null)
            {
                wallSection.name = name;
            }
#if UNITY_EDITOR
            if (directory == null)
            {
                UnityEditor.AssetDatabase.CreateAsset(wallSection, AssetCreator.GeneratePath("newWallSection.asset", "WallSections"));
            }
            else
            {
                UnityEditor.AssetDatabase.CreateAsset(wallSection, Path.Combine(directory, "newWallSection.asset"));
            }
#endif

            BuildRSettings settings = BuildRSettings.GetSettings();
            wallSection._openingWidthAbs  = settings.defaultWindowWidth;
            wallSection._openingHeightAbs = settings.defaultWindowHeight;
            wallSection._openingDepth     = settings.defaultWindowDepth;

            return(wallSection);
        }
示例#4
0
        private static BuildRAtlasSO MenuCreateAtlasB()
        {
            string        activeFolder = AssetCreator.ActiveSelectionPath();
            BuildRAtlasSO output       = CreateWallSectionAtlasAsset(null, activeFolder);

            UnityEditor.Selection.activeObject = output;
            return(output);
        }
示例#5
0
        private static Chimney MenuCreateNewChimneynB()
        {
            string  activeFolder = AssetCreator.ActiveSelectionPath();
            Chimney output       = CreateChimney(null, activeFolder);

            UnityEditor.Selection.activeObject = output;
            return(output);
        }
示例#6
0
        private static Facade MenuCreateNewFacadeB()
        {
            string activeFolder = AssetCreator.ActiveSelectionPath();
            Facade output       = CreateFacade(null, activeFolder);

            UnityEditor.Selection.activeObject = output;
            return(output);
        }
示例#7
0
        private static WallSection MenuCreateNewWallSectionB()
        {
            string      activeFolder = AssetCreator.ActiveSelectionPath();
            WallSection output       = CreateWallSection(null, activeFolder);

            UnityEditor.Selection.activeObject = output;
            return(output);
        }
示例#8
0
        public static Gable CreateGable()
        {
            Gable output = CreateInstance <Gable>();

#if UNITY_EDITOR
            UnityEditor.AssetDatabase.CreateAsset(output, AssetCreator.GeneratePath("newGable.asset", "Gables"));
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
#endif
            return(output);
        }
示例#9
0
        public static Model CreateModel()
        {
            Model newModelInstance = CreateInstance <Model>();

#if UNITY_EDITOR
            UnityEditor.AssetDatabase.CreateAsset(newModelInstance, AssetCreator.GeneratePath("newModel.asset", "Models"));
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
#endif
            return(newModelInstance);
        }
示例#10
0
        public static Surface CreateSurface()
        {
            Surface newSurface = CreateInstance <Surface>();

#if UNITY_EDITOR
            UnityEditor.AssetDatabase.CreateAsset(newSurface, AssetCreator.GeneratePath("newSurface.asset", "Surfaces"));
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
#endif
            return(newSurface);
        }
示例#11
0
        public static RoomStyle CreateRoomStyle()
        {
            RoomStyle roomStyle = CreateInstance <RoomStyle>();

#if UNITY_EDITOR
            UnityEditor.AssetDatabase.CreateAsset(roomStyle, AssetCreator.GeneratePath("newRoomStyle.asset", "RoomStyles"));
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
#endif
            return(roomStyle);
        }
示例#12
0
        public static Portal CreateDoor()
        {
            Portal newPortalInstance = CreateInstance <Portal>();

            newPortalInstance.type = Types.Door;
#if UNITY_EDITOR
            UnityEditor.AssetDatabase.CreateAsset(newPortalInstance, AssetCreator.GeneratePath("newDoor.asset", "Windows and Doors"));
            UnityEditor.AssetDatabase.SaveAssets();
            UnityEditor.AssetDatabase.Refresh();
#endif
            return(newPortalInstance);
        }
示例#13
0
        public static Chimney CreateChimney(string name = null, string directory = null)
        {
            Chimney chimney = CreateInstance <Chimney>();

            if (name != null)
            {
                chimney.name = name;
            }
#if UNITY_EDITOR
            if (directory == null)
            {
                UnityEditor.AssetDatabase.CreateAsset(chimney, AssetCreator.GeneratePath("newChimney.asset", ""));
            }
            else
            {
                UnityEditor.AssetDatabase.CreateAsset(chimney, Path.Combine(directory, "newChimney.asset"));
            }
#endif
            return(chimney);
        }