Skip to content

Instantly share code, notes, and snippets.

@ZeredaGames
Last active February 28, 2019 10:18
Show Gist options
  • Save ZeredaGames/46df0bd123e0c654699cbfc38b11e668 to your computer and use it in GitHub Desktop.
Save ZeredaGames/46df0bd123e0c654699cbfc38b11e668 to your computer and use it in GitHub Desktop.
#region using
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
#endregion
#region Script
namespace AssemblyCSharp.ZeredaGamesEngine.Scripts.Core.ScriptableObjects
{
[System.Serializable]
public class #SCRIPTNAME# : ScriptableObject
{
public static #SCRIPTNAME# asset;
public static string Path=Application.dataPath+"/Resources";
public static string FolderName="";
public static string AssetName="";
#if UNITY_EDITOR
[MenuItem ("Editors/ZeredaGames/Game Making Tools/Create New/#SCRIPTNAME#")]
public static #SCRIPTNAME# CreateNew#SCRIPTNAME#AssetDatabase()
{
#SCRIPTNAME# asset = ScriptableObject.CreateInstance<CHANGE_ME_TO_A_SCRIPTABLE_OBJECT>();
AssetDatabase.CreateAsset(asset, Path + FolderName + "/"+AssetName+".asset");
Debug.Log ("New Asset Created in: " + FolderName + " @ setPath("+Path + FolderName + "/"+AssetName+".asset) \t AssetName");
AssetDatabase.SaveAssets();
Selection.activeObject = asset;
EditorUtility.FocusProjectWindow ();
return asset;
}
#endif
}
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment