using System.Collections; using System.Collections.Generic; using UnityEngine; public class SoundManagerScript : MonoBehaviour { public static AudioClip jumpSound; static AudioSource audioSrc; // Start is called before the first frame update void Start() { jumpSound = Resources.Load("Audio/Jump"); audioSrc = GetComponent(); } // Update is called once per frame void Update() { } public static void PlaySound(string clip) { switch (clip) { case "jump": audioSrc.PlayOneShot(jumpSound); break; } } }