Эх сурвалжийг харах

修复exe启动会报错的问题

大爷 2 жил өмнө
parent
commit
6ab903ba15

+ 1 - 16
Unity/Assets/Scenes/Init.unity

@@ -805,7 +805,6 @@ GameObject:
   m_Component:
   - component: {fileID: 1270058932}
   - component: {fileID: 1270058933}
-  - component: {fileID: 1270058934}
   m_Layer: 0
   m_Name: Audio
   m_TagString: Untagged
@@ -849,7 +848,7 @@ AudioSource:
   Priority: 128
   DopplerLevel: 1
   MinDistance: 1
-  MaxDistance: 200
+  MaxDistance: 500
   Pan2D: 0
   rolloffMode: 0
   BypassEffects: 0
@@ -924,20 +923,6 @@ AudioSource:
     m_PreInfinity: 2
     m_PostInfinity: 2
     m_RotationOrder: 4
---- !u!114 &1270058934
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1270058931}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 34b0cf3d7495149429324838ac38fbc8, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  Source: {fileID: 1270058933}
-  Listener: {fileID: 1984349701}
 --- !u!850595691 &1972482029
 LightingSettings:
   m_ObjectHideFlags: 0

+ 3 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Sound/SoundManager.cs

@@ -37,9 +37,11 @@ public class SoundManager : Singleton<SoundManager>, ISingletonAwake
     }
     public void Awake()
     {
-        UnityAudioSource = AudioComponent.Instance.Source;
+        UnityAudioSource = GameObject.Find("/Global/Audio").GetComponent<AudioSource>();
         UnityAudioSource.loop = true;
         UnityAudioSource.volume = 1f;
+        UnityAudioSource.playOnAwake = false;
+        UnityAudioSource.mute = false;
     }
 
     public async ETTask PlayBgm(string name)

+ 0 - 16
Unity/Assets/Scripts/Codes/Mono/AudioComponent.cs

@@ -1,16 +0,0 @@
-using UnityEngine;
-
-namespace Mono
-{
-    public class AudioComponent : MonoBehaviour
-    {
-        public static AudioComponent Instance;
-        public AudioSource Source;
-        public AudioListener Listener;
-
-        protected void Awake()
-        {
-            Instance = this;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/Mono/AudioComponent.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 34b0cf3d7495149429324838ac38fbc8
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: