From 452c75675679c44cc39b04bdb7d330d7c5c14d5c Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Tue, 29 Dec 2020 10:48:06 +0800 Subject: [PATCH] 增加多SDK支持。常规使用SDKChannel.KTGM 偶哈游的是空SDK --- Assets/Scripts/Manager/ManagerRoot.cs | 42 +++++++++++++++++++++++++++++++++--------- 1 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/Manager/ManagerRoot.cs b/Assets/Scripts/Manager/ManagerRoot.cs index 7ea87fa..50fd909 100644 --- a/Assets/Scripts/Manager/ManagerRoot.cs +++ b/Assets/Scripts/Manager/ManagerRoot.cs @@ -1,6 +1,8 @@ using System; using System.Collections; using System.Collections.Generic; +using Core.Utilities; +using DG.Tweening; using Protobuf; using UnityEngine; @@ -8,18 +10,40 @@ { public class ManagerRoot : MonoBehaviour { - - //private bool canChangeScene = false; - - public void Awake() + void Awake() { - gameObject.AddComponent<DoNotDestory>(); - gameObject.AddComponent<MasterSocket>(); - gameObject.AddComponent<GA_SDK_Manager>(); + GameObject root = GameObject.Find("ManagerRoot"); + if (root == null) + { + GameConfig.useSDK = SDKConfig.sdkChannel == SDKChannel.KTGM; - //gameObject.AddComponent<ErrorLogOnGUIMyTools>(); + if (Application.platform == RuntimePlatform.WindowsEditor || + Application.platform == RuntimePlatform.WindowsPlayer) + { + GameConfig.useSDK = false; + GameConfig.OpenDebug = true; + SDKConfig.sdkChannel = SDKChannel.KTGM; + } + + //PlayerPrefs.DeleteAll(); + Application.targetFrameRate = 60; + //Debug.Log("设置了帧数为60"); + DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10); + + root = new GameObject("ManagerRoot"); + // if (GameConfig.useSDK) + // root.AddComponent<SDKCallBack>(); + root.AddComponent<DoNotDestory>(); + root.AddComponent<MasterSocket>(); + root.AddComponent<TDAA_SDKManager>(); + root.AddComponent<AudioSourceManager>(); + root.AddComponent<JsonDataReader>(); + root.AddComponent<JsonDataInit>(); + root.AddComponent<LanguageManager>(); + // root.AddComponent<ErrorLogOnGUIMyTools>(); + } + //gameObject.AddComponent<JsonDataReader>(); - } // public void AfterRead() -- Gitblit v1.9.1