From 982c3bd90d05fff58de0911630e9e127d2513d10 Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Wed, 18 Nov 2020 17:10:49 +0800 Subject: [PATCH] 音效BUG --- Assets/Scripts/Manager/ManagerRoot.cs | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/Manager/ManagerRoot.cs b/Assets/Scripts/Manager/ManagerRoot.cs index 42bcdb4..0272d67 100644 --- a/Assets/Scripts/Manager/ManagerRoot.cs +++ b/Assets/Scripts/Manager/ManagerRoot.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Core.Utilities; using Protobuf; using UnityEngine; @@ -9,16 +10,20 @@ public class ManagerRoot : MonoBehaviour { - //private bool canChangeScene = false; - - public void Awake() + void Awake() { - gameObject.AddComponent<DoNotDestory>(); - gameObject.AddComponent<MasterSocket>(); - gameObject.AddComponent<TDAA_SDKManager>(); - gameObject.AddComponent<AudioSourceManager>(); + GameObject root = GameObject.Find("ManagerRoot"); + if (root == null) + { + root = new GameObject("ManagerRoot"); + root.AddComponent<DoNotDestory>(); + root.AddComponent<MasterSocket>(); + root.AddComponent<TDAA_SDKManager>(); + root.AddComponent<AudioSourceManager>(); - gameObject.AddComponent<ErrorLogOnGUIMyTools>(); + root.AddComponent<ErrorLogOnGUIMyTools>(); + } + //gameObject.AddComponent<JsonDataReader>(); } -- Gitblit v1.9.1