/// <summary> /// Checks to see if the asset exists or not, if it doesn't create it /// </summary> public static void FirstSave() { if (!File.Exists("Assets/" + PrefabDatabase.FullAssetPathNameWithExt)) { ScriptableObjectUtility.CreateAssetAtPath(PrefabDatabase.pathToAsset, PrefabDatabase.assetName, PrefabDatabase.Instance); } }
private static void OnTypeSelectedEvent(Type type) { if (type == null) throw new ArgumentNullException("type"); string path = ScriptableObjectUtility.GetSelectionAssetPath(type.Name); if (path == null) throw new ArgumentNullException("path"); ScriptableObject asset = ScriptableObjectUtility.CreateAssetAtPath(type, path, "New " + type.Name); EditorUtility.FocusProjectWindow(); EditorUtility.SetDirty(asset); Selection.activeObject = asset; window.Close(); }
void OnWizardCreate() { string[] dirs = Directory.GetDirectories(texturePath); SheetList sl = ScriptableObjectUtility.CreateAssetAtPath <SheetList>("Songs", listDestination); SheetObject[] sheetArray = new SheetObject[dirs.Length]; for (int i = 0; i < dirs.Length; i++) { string name = new DirectoryInfo(dirs[i]).Name; Debug.Log("name = " + name); SheetObject so = ScriptableObjectUtility.CreateAssetAtPath <SheetObject> (name, objDestination); so.persistentBorderLayerPath = name + ".border"; so.persistentFrontOutlinePath = name + ".outline"; sheetArray[i] = so; EditorUtility.SetDirty(so); } sl.sheetList = sheetArray; EditorUtility.SetDirty(sl); AssetDatabase.SaveAssets(); }
public void CreateBuffData() { InspectObject(ScriptableObjectUtility.CreateAssetAtPath <BuffData>("Assets/Resources/BuffsData")); }
public void CreateItemsData() { InspectObject(ScriptableObjectUtility.CreateAssetAtPath <ItemData>("Assets/Resources/ItemsData")); }
public void CreateMiniGameData() { InspectObject(ScriptableObjectUtility.CreateAssetAtPath <MiniGameData>("Assets/Resources/MiniGameData")); }
public void CreateSaveState() { InspectObject(ScriptableObjectUtility.CreateAssetAtPath <GameStateData>("Assets/Resources/SaveState")); }
public void CreateEntityData() { InspectObject(ScriptableObjectUtility.CreateAssetAtPath <EntityData>("Assets/Resources/EntityData")); }
public static void CreateAssetAtPath(string path) { ScriptableObjectUtility.CreateAssetAtPath(path, RuntimeSettings.assetName, RuntimeSettings.Instance); }
public static void CreateAssetAtPath() { ScriptableObjectUtility.CreateAssetAtPath(AssetDatabase.GetAssetPath(RuntimeSettings.Instance), RuntimeSettings.assetName, RuntimeSettings.Instance); }