123456789101112131415161718192021222324252627282930313233 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Sirenix.OdinInspector;
- namespace KairoEngine.CharacterSystem
- {
- [CreateAssetMenu(fileName = "footsteps", menuName = "KairoEngine/Footsteps Library", order = 2)]
- public class FootstepsLibrary : ScriptableObject
- {
- [ShowInInspector]
- public List<AudioClip> dirtSounds = new List<AudioClip>();
- [ShowInInspector]
- public List<AudioClip> concreteSounds = new List<AudioClip>();
- public List<AudioClip> GetSounds(string key)
- {
- //Debug.Log(key);
- if(key == "Dirt") return dirtSounds;
- if(key == "Concrete") return concreteSounds;
- else return new List<AudioClip>();
- }
- public AudioClip GetRandomSound(string key)
- {
- //Debug.Log(key);
- if(key == "Dirt") return dirtSounds[Random.Range(0, dirtSounds.Count)];
- if(key == "Concrete") return concreteSounds[Random.Range(0, concreteSounds.Count)];
- else return null;
- }
- }
- }
|