using System.Collections; using System.Collections.Generic; using UnityEngine; #if USE_IAP using UnityEngine.Purchasing; #endif public class InitLogic : MonoBehaviour { private void Start() { Application.targetFrameRate = 60; Input.multiTouchEnabled = false; AudioManager.Instance.SetSoundOn(SettingData.Instance.IsSoundOn); VibrateManager.Instance.SetVibrateOn(SettingData.Instance.IsVibrateOn); GameManager.Instance.GameSpeed = 1; #if USE_IAP if (GameConfig.Instance.UseDiamond) { List tIAPProducts = TableIAP.Instance.GetAll(); Dictionary tProductDic = new Dictionary(); for (int i = 0; i < tIAPProducts.Count; i++) { tProductDic.Add(tIAPProducts[i].ProductID, ProductType.Consumable); } IAPTool.Instance.AddProducts(tProductDic); } #endif PlayerData.Instance.Login(); MMOModule.Instance.EnableMMO(TKGSDKManager.Instance.IsIAPEnabled); TKGSDKManager.Instance.InitSDK(SDKDone); TKGSDKManager.Instance.IsRemoveAds = PlayerData.Instance.IsNoAds; TKGSDKManager.Instance.SetGameFocusListener(AudioManager.Instance.SetListenerOn); if (GameConfig.Instance.IsDebug) { SRDebug.Init(); } } private void SDKDone() { MMOModule.Instance.Init(GameManager.Instance.LoadGame); } }