private void ReloadGameModules() { LocalizeModule localizeModule = ModuleMgr.Instance.GetModule <LocalizeModule>((byte)GameModuleTypes.LOCALIZE_MODULE); if (localizeModule == null) { ModuleMgr.Instance.AddModule <LocalizeModule>((byte)GameModuleTypes.LOCALIZE_MODULE, true); } else { localizeModule.InitLocalizeLanguage(); } //#if UNITY_ANDROID || UNITY_IOS GameIAPModule IAPModule = ModuleMgr.Instance.GetModule <GameIAPModule>((byte)GameModuleTypes.IAP_MODULE); if (IAPModule == null) { ModuleMgr.Instance.AddModule <GameIAPModule>((byte)GameModuleTypes.IAP_MODULE, true); } #if UNITY_DEBUG GMModule.InitAllGMCommand(); #endif GameEvents.System_Events.PlayMainBGM(true); LoadNext(); }
public override void Start() { base.Start(); m_instance = this; AutoStart = true; IAPTools.instance.m_Usr_ReqVerifyTransaction += DoReqVerifyTransaction; #if UNITY_IOS && PLATFROM_ID IAPTools.instance.m_Usr_Get_Products += DoGetProductsIOS; #else IAPTools.instance.m_Usr_Get_Products += DoGetProducts; #endif IAPTools.instance.m_Usr_Transction_Done_IOS += DoTransactionDoneIOS; IAPTools.instance.m_Usr_Transction_Done += DoTransactionDone; GameEvents.IAPEvents.Sys_BuyProductEvent += BuyProduct; GameEvents.IAPEvents.Sys_BuyProductIOSEvent += BuyProductIOS; GameEvents.IAPEvents.Sys_GetPriceEvent += GetPrice; GameEvents.IAPEvents.Sys_GetPriceIOSEvent += GetPriceIOS; GameEvents.IAPEvents.Sys_GetUSDPriceEvent += GetUSDPrice; #if UNITY_ANDROID MessageHandler.RegisterMessageHandler(MessageDefine.SCGooglePayChargeResponse, DoRspVerifyTransaction); #elif UNITY_IOS MessageHandler.RegisterMessageHandler(MessageDefine.SCIOSPayChargeResponse, DoRspVerifyTransaction); #else MessageHandler.RegisterMessageHandler(MessageDefine.SCGooglePayChargeResponse, DoRspVerifyTransaction); #endif }
/// <summary> /// 初始化游戏逻辑Module /// </summary> private void InitGameLogicModules() { UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.InitGameLogicModules); //ModuleMgr.Instance.AddModule<SceneModule>((byte)GameModuleTypes.SCENE_MODULE, true); /******* * 内购初始化会激发上次未完成的订单,所以需要登陆后,获得playerid后,初始化。 */ //#if UNITY_ANDROID || UNITY_IOS GameIAPModule IAPModule = ModuleMgr.Instance.GetModule <GameIAPModule>((byte)GameModuleTypes.IAP_MODULE); IAPModule.InitIAP(); //#endif LoadNext(); }