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); }
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); }
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); }
private static BuildRAtlasSO MenuCreateAtlasB() { string activeFolder = AssetCreator.ActiveSelectionPath(); BuildRAtlasSO output = CreateWallSectionAtlasAsset(null, activeFolder); UnityEditor.Selection.activeObject = output; return(output); }
private static Chimney MenuCreateNewChimneynB() { string activeFolder = AssetCreator.ActiveSelectionPath(); Chimney output = CreateChimney(null, activeFolder); UnityEditor.Selection.activeObject = output; return(output); }
private static Facade MenuCreateNewFacadeB() { string activeFolder = AssetCreator.ActiveSelectionPath(); Facade output = CreateFacade(null, activeFolder); UnityEditor.Selection.activeObject = output; return(output); }
private static WallSection MenuCreateNewWallSectionB() { string activeFolder = AssetCreator.ActiveSelectionPath(); WallSection output = CreateWallSection(null, activeFolder); UnityEditor.Selection.activeObject = output; return(output); }
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); }
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); }
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); }
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); }
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); }
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); }