wangguan
2020-11-18 60571ce1c77c5c323dff0d13e0fcd1ae9c22b40a
添加Manager的时候初始化DOTween
切换场景的时候clear了
3 files modified
16 ■■■■■ changed files
Assets/Scripts/GameAnalytics_SDK/UI/LoginUI.cs 11 ●●●●● patch | view | raw | blame | history
Assets/Scripts/Manager/ManagerRoot.cs 3 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs 2 ●●● patch | view | raw | blame | history
Assets/Scripts/GameAnalytics_SDK/UI/LoginUI.cs
@@ -8,6 +8,7 @@
using UnityEngine.Networking;
using Protobuf;
using Google.Protobuf;
using DG.Tweening;
public class LoginUI : MonoBehaviour
{
@@ -69,15 +70,20 @@
        if (!GameConfig.isFirstStart)//后续直接加载
        {
            waitTime = 2f;
            OnClickLoginBtn();
        }
        else
        {
            waitTime = 0f;
            //第一次启动,初始化并且埋点
            TDAA_SDKManager.Ins.SDKInit(ChannelID.Gm.ToString());
            TDAA_SDKManager.Ins.Statistics(1);//成功加载登陆界面的人数
        }
    }
    float waitTime;
    // private void OnEnable()
    // {
@@ -138,6 +144,11 @@
    IEnumerator loginMy()
    {
        progressSlider.value = 0.0f;
        System.GC.Collect();
        DOTween.Clear();
        Debug.Log("开始清理GC,清理DOTween");
        yield return new WaitForSeconds(waitTime);
        int displayProgress = 0;
        int toProgress = 0;
        AsyncOperation op = SceneManager.LoadSceneAsync("Endless2D");
Assets/Scripts/Manager/ManagerRoot.cs
@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using Core.Utilities;
using DG.Tweening;
using Protobuf;
using UnityEngine;
@@ -15,6 +16,8 @@
            GameObject root = GameObject.Find("ManagerRoot");
            if (root == null)
            {
                DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);
                root = new GameObject("ManagerRoot");
                root.AddComponent<DoNotDestory>();
                root.AddComponent<MasterSocket>();
Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -2155,7 +2155,7 @@
            base.Awake();
            randomTowerBtn = transform.Find("BottomCanvas/Panel/TowerBuyBtn").GetComponent<Button>();
            DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);
            //DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);
            state = State.Normal;
            m_Camera = GameObject.Find("SceneCamera3D").GetComponent<Camera>();