private void GetConfig() { if (_configSO == null) { _configSO = Resources.Load <GameConfigSO>("SmartMobileCore/MainConfig"); } }
//[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] void Awake() { gameConfig = Resources.Load <GameConfigSO>("SmartMobileCore/MainConfig"); #pragma warning disable CS0618 // Тип или член устарел API = this; #pragma warning restore CS0618 // Тип или член устарел Prepare(); InitInternal(); }
public override void OnInspectorGUI() { serializedObject.Update(); if (gameConfig == null) { gameConfig = serializedObject.FindProperty("gameConfig"); //gameConfig configSO } //GameManager gm = this.target as GameManager; //GameConfigSO cfg = gm.cfgEditor; // GameConfigSO cfg = gameConfig.objectReferenceValue as GameConfigSO; GameConfigSO cfg = Resources.Load <GameConfigSO>("SmartMobileCore/MainConfig"); bool b_ads = false; bool b_stat = false; bool b_iap = false; if (cfg != null) { if (!string.IsNullOrEmpty(cfg.ADS_APP_KEY)) { if (cfg.ADS_ENABLE_BANNER || cfg.ADS_ENABLE_VIDEO) { b_ads = true; } } if (!string.IsNullOrEmpty(cfg.ANALYTICS_APP_KEY)) { b_stat = true; } #if UNITY_PURCHASING b_iap = true; #endif } GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (b_ads) { if (icon_ads_on) { GUILayout.Label(icon_ads_on); } } else if (icon_ads_off) { GUILayout.Label(icon_ads_off); } if (b_stat) { if (icon_stat_on) { GUILayout.Label(icon_stat_on); } } else if (icon_stat_off) { GUILayout.Label(icon_stat_off); } if (b_iap) { if (icon_iap_on) { GUILayout.Label(icon_iap_on); } } else if (icon_iap_off) { GUILayout.Label(icon_iap_off); } GUILayout.EndHorizontal(); EditorGUILayout.Space(); if (!b_iap) { EditorGUILayout.HelpBox("Для активации внутриигровых покупок (IAP), включите In-App Purchasing в окне Services [Ctrl+0]", MessageType.Info); } if (!b_stat) { EditorGUILayout.HelpBox("Для активации аналитики (STAT), задайте ключь ANALYTICS_APP_KEY в GameConfig", MessageType.Info); } if (!b_ads) { EditorGUILayout.HelpBox("Для активации рекламы (ADS), задайте ключь ADS_APP_KEY в GameConfig и активируйте Видео и/или Баннер рекламу", MessageType.Info); } //if (Levels == null) return; //var d_num = Levels.FindPropertyRelative("CurrentNumber").intValue; //var d_score = _Data.FindPropertyRelative("score").intValue; //var d_stars = _Data.FindPropertyRelative("stars").floatValue; //EditorGUILayout.BeginVertical(); // EditorGUILayout.LabelField("- Ядро --------------------------------------------------------------------"); //EditorGUILayout.LabelField("Уровень: " + d_num + " / " + "Очки: " + d_score + " / " + "Звезды: " + d_stars); // EditorGUILayout.LabelField("Уровней: " + d_num); // EditorGUILayout.LabelField("------------------------------------------------------------------------------------"); //EditorGUILayout.EndVertical(); //EditorGUILayout.PropertyField(m); serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); }