private void OnEnable() { saveSettings = Resources.Load <SaveSettings>("SaveSettingsData"); if (saveSettings == null) { CreateAdSettings(); saveSettings = Resources.Load <SaveSettings>("SaveSettingsData"); } selectedSaveMethod = saveSettings.saveMethod; buildTargetGroup = saveSettings.buildTargetGroup; }
public static void CreateAdSettings() { SaveSettings asset = ScriptableObject.CreateInstance <SaveSettings>(); if (!AssetDatabase.IsValidFolder("Assets/GleyPlugins/AllPlatformsSave/Resources")) { AssetDatabase.CreateFolder("Assets/GleyPlugins/AllPlatformsSave", "Resources"); AssetDatabase.Refresh(); } AssetDatabase.CreateAsset(asset, "Assets/GleyPlugins/AllPlatformsSave/Resources/SaveSettingsData.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }