From 6ce8b9e22fc13be34b442c7b6af48b42cd44275a Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Wed, 13 Mar 2024 11:00:58 +0800 Subject: +init --- SFXPlayer.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 SFXPlayer.cs (limited to 'SFXPlayer.cs') diff --git a/SFXPlayer.cs b/SFXPlayer.cs new file mode 100644 index 0000000..ec85233 --- /dev/null +++ b/SFXPlayer.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using UnityEngine; + +public class SFXPlayer : MonoBehaviour +{ + public List metal; + + public List other; + + internal void Play(RaycastHit hit) + { + AudioSource component = GetComponent(); + component.mute = true; + //List list = new List(); + //list = ((!hit.rigidbody) ? other : metal); + //if (!hit.rigidbody) + //{ + // component.volume *= 0.5f; + //} + //component.clip = list[Random.Range(0, list.Count)]; + //component.Play(); + } +} -- cgit v1.1-26-g67d0