45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
| 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<DataIAP> tIAPProducts = TableIAP.Instance.GetAll();
 | |
|             Dictionary<string, ProductType> tProductDic = new Dictionary<string, ProductType>();
 | |
|             for (int i = 0; i < tIAPProducts.Count; i++)
 | |
|             {
 | |
|                 tProductDic.Add(tIAPProducts[i].ProductID, ProductType.Consumable);
 | |
|             }
 | |
|             IAPTool.Instance.AddProducts(tProductDic);
 | |
|         }
 | |
| #endif
 | |
|         TKGSDKManager.Instance.InitSDK(SDKDone);
 | |
|         TKGSDKManager.Instance.SetGameFocusListener(AudioManager.Instance.SetListenerOn);
 | |
|         
 | |
|         if (GameConfig.Instance.IsDebug)
 | |
|         {
 | |
|             SRDebug.Init();
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     private void SDKDone()
 | |
|     {
 | |
|         PlayerData.Instance.Login();
 | |
|         MMOModule.Instance.Init(GameManager.Instance.LoadGame);
 | |
|     }
 | |
| } |