コード例 #1
0
        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();
            }
        }
コード例 #2
0
 public static void Load()
 {
     _asset = Resources.Load <VariablesAsset>(assetPath) ?? ScriptableObject.CreateInstance <VariablesAsset>();
 }