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); }
private static BuildRAtlasSO MenuCreateAtlas() { BuildRAtlasSO output = CreateWallSectionAtlasAsset(); UnityEditor.Selection.activeObject = output; return(output); }
private static BuildRAtlasSO MenuCreateAtlasB() { string activeFolder = AssetCreator.ActiveSelectionPath(); BuildRAtlasSO output = CreateWallSectionAtlasAsset(null, activeFolder); UnityEditor.Selection.activeObject = output; return(output); }
private void OnEnable() { _wallSection = (BuildRAtlasSO)target; }