private void OnEnable() { rateSettings = Resources.Load <RateGameSettings>("RateGameSettingsData"); if (rateSettings == null) { CreateAdSettings(); rateSettings = Resources.Load <RateGameSettings>("RateGameSettingsData"); } //load asset values iosAppID = rateSettings.iosAppID; ratePopupType = rateSettings.ratePopupType; googlePlayBundleID = rateSettings.googlePlayBundleID; mainText = rateSettings.mainText; yesButtonText = rateSettings.yesButton; noButton = rateSettings.noButton; laterButton = rateSettings.laterButton; sendButton = rateSettings.sendButton; notNowButton = rateSettings.notNowButton; neverButton = rateSettings.neverButton; firstShowSettings = rateSettings.firstShowSettings; postponeSettings = rateSettings.postponeSettings; minStarsToSend = rateSettings.minStarsToSend; usePlaymaker = rateSettings.usePlaymaker; useBolt = rateSettings.useBolt; useGameFlow = rateSettings.useGameFlow; #if UNITY_EDITOR clearSave = rateSettings.clearSave; #endif }
private void CreateAdSettings() { RateGameSettings asset = ScriptableObject.CreateInstance <RateGameSettings>(); if (!AssetDatabase.IsValidFolder("Assets/GleyPlugins/RateGame/Resources")) { AssetDatabase.CreateFolder("Assets/GleyPlugins/RateGame", "Resources"); AssetDatabase.Refresh(); } AssetDatabase.CreateAsset(asset, "Assets/GleyPlugins/RateGame/Resources/RateGameSettingsData.asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }