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 ShowDisplaySettings(DisplayConditions showSettings) { showSettings.useSessionsCount = EditorGUILayout.Toggle("Use Sessions Count:", showSettings.useSessionsCount); if (showSettings.useSessionsCount) { showSettings.minSessiosnCount = EditorGUILayout.IntField("Number of Sessions:", showSettings.minSessiosnCount); } showSettings.useCustomEvents = EditorGUILayout.Toggle("Use Custom Events:", showSettings.useCustomEvents); if (showSettings.useCustomEvents) { showSettings.minCustomEvents = EditorGUILayout.IntField("Number of Custom Events:", showSettings.minCustomEvents); } showSettings.useInGameTime = EditorGUILayout.Toggle("Use In Game Time:", showSettings.useInGameTime); if (showSettings.useInGameTime) { showSettings.gamePlayTime = EditorGUILayout.IntField("Number of minutes:", showSettings.gamePlayTime); } showSettings.useRealTime = EditorGUILayout.Toggle("Use Real Time: ", showSettings.useRealTime); if (showSettings.useRealTime) { showSettings.realTime = EditorGUILayout.FloatField("Number Of Hours:", showSettings.realTime); } if (showSettings.useSessionsCount == false && showSettings.useCustomEvents == false && showSettings.useInGameTime == false) { EditorGUILayout.LabelField("The rate popup will be shown when ShowRatePopup() method is called (no delay)"); } else { string text = "The rate popup will be shown after"; if (showSettings.useSessionsCount) { text += " " + showSettings.minSessiosnCount + " sessions"; } if (showSettings.useCustomEvents) { if (showSettings.useSessionsCount) { text += " and"; } text += " " + showSettings.minCustomEvents + " custom events"; } if (showSettings.useInGameTime) { if (showSettings.useCustomEvents || showSettings.useSessionsCount) { text += " and"; } text += " " + showSettings.gamePlayTime + " game play minutes"; } if (showSettings.useRealTime) { if (showSettings.useInGameTime || showSettings.useCustomEvents || showSettings.useSessionsCount) { text += " and"; } text += " " + showSettings.realTime + " real time hours after app was first open"; } EditorGUILayout.LabelField(text); } }