public void PlayOneShot(string audio_name) { var clip = ScriptableObjectUtil.GetScriptableObject <AudioClips>().GetClip(audio_name); _audio.pitch = Random.Range(1.0f, 2.0f); _audio.PlayOneShot(clip); }
private void Awake() { this.gameObject.AddComponent <AudioListener>(); bgmSource = this.gameObject.AddComponent <AudioSource>(); clips = ScriptableObjectUtil.GetScriptableObject <AudioClips>(); }
private void Awake() { if (!GetComponent <AudioSource>()) { _audio = gameObject.AddComponent <AudioSource>(); } clips = ScriptableObjectUtil.GetScriptableObject <AudioClips>(); }
public static void InitByScriptableObject() { var prefabs = ScriptableObjectUtil.GetScriptableObject <GameObjectPoolPrefabs>(); foreach (var item in prefabs.Prefabs) { if (!pools.ContainsKey(item.prefab_name)) { pools.Add(item.prefab_name, new GameObjectPool(item.prefab)); } } }
public static GameObject GetGameObjectByScripteableObject(string key) { var prefabs = ScriptableObjectUtil.GetScriptableObject <GameObjectPoolPrefabs>(); return(prefabs.Prefabs.Find(a => { return a.prefab_name == key; }).prefab); }
private void Awake() { levelScenes = ScriptableObjectUtil.GetScriptableObject <LevelScenes>(); }