#if UNITY_EDITOR using UnityEngine; using UnityEditor; namespace Beyond { public static class bScriptableObjectUtility { /// /// Create new asset from type with unique Name at /// selected folder in project window. Asset creation can be cancelled by pressing /// escape key when asset is initially being named. /// /// Type of scriptable object. /// public static void CreateAsset() where T : ScriptableObject { var asset = ScriptableObject.CreateInstance(); ProjectWindowUtil.CreateAsset(asset, "New " + typeof(T).Name + ".asset"); } } } #endif