コード例 #1
0
 private void Awake()
 {
     if (Application.isEditor)
     {
         if (_scriptableData == null)
         {
             _scriptableData = ScriptableDataUtils.TryLoadScriptableFromJSON <ExampleScriptableData>(_path);
         }
     }
     else
     {
         try
         {
             _scriptableData = ScriptableDataUtils.LoadScriptableFromJSON <ExampleScriptableData>(_path);
         }
         catch (FileNotFoundException e)
         {
             Debug.Log($"Saved data for {_scriptableData} not found. {e}");
         }
     }
 }
コード例 #2
0
 private void SaveData()
 {
     ScriptableDataUtils.SaveScriptableToJSON(_path, _scriptableData);
 }