public static void SaveVariableAsset(VariablesAsset asset, string fileName) { var path = Path.Combine(BoltCore.Paths.variableResources, fileName + ".asset"); if (String.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset))) { var assetDatabasePath = PathUtility.FromProject(path); PathUtility.CreateParentDirectoryIfNeeded(path); AssetDatabase.CreateAsset(asset, assetDatabasePath); AssetDatabase.SaveAssets(); } }
public static void Load() { _asset = Resources.Load <VariablesAsset>(assetPath) ?? ScriptableObject.CreateInstance <VariablesAsset>(); }