From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Client/Assembly-CSharp/SoundStarter.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Client/Assembly-CSharp/SoundStarter.cs (limited to 'Client/Assembly-CSharp/SoundStarter.cs') diff --git a/Client/Assembly-CSharp/SoundStarter.cs b/Client/Assembly-CSharp/SoundStarter.cs new file mode 100644 index 0000000..0a1258e --- /dev/null +++ b/Client/Assembly-CSharp/SoundStarter.cs @@ -0,0 +1,23 @@ +using System; +using UnityEngine; + +public class SoundStarter : MonoBehaviour +{ + public string Name; + + public AudioClip SoundToPlay; + + public bool StopAll; + + [Range(0f, 1f)] + public float Volume = 1f; + + public void Awake() + { + if (this.StopAll) + { + SoundManager.Instance.StopAllSound(); + } + SoundManager.Instance.CrossFadeSound(this.Name, this.SoundToPlay, this.Volume, 1.5f); + } +} -- cgit v1.1-26-g67d0