Reworked the dialogue system
Now the dialogue can use tags to add special effects Reorganized project structure, updating may require adding some using statements
This commit is contained in:
parent
95bad523b9
commit
0e8b8b1835
25 changed files with 1912 additions and 1266 deletions
|
@ -1,50 +1,53 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
[CreateAssetMenu(fileName = "Sounds", menuName = "Simple Tools/Sounds", order = 11)]
|
||||
public class Sounds : ScriptableObject{
|
||||
namespace SimpleTools.AudioManager {
|
||||
[CreateAssetMenu(fileName = "Sounds", menuName = "Simple Tools/Sounds", order = 11)]
|
||||
public class Sounds : ScriptableObject {
|
||||
|
||||
[Tooltip("The music mixer.")]
|
||||
public AudioMixerGroup mainMixer = default;
|
||||
[Tooltip("The SFX mixer.")]
|
||||
public AudioMixerGroup sfxMixer = default;
|
||||
[Tooltip("The music mixer.")]
|
||||
public AudioMixerGroup mainMixer = default;
|
||||
[Tooltip("The SFX mixer.")]
|
||||
public AudioMixerGroup sfxMixer = default;
|
||||
|
||||
public List[] sounds;
|
||||
public List[] sounds;
|
||||
|
||||
[System.Serializable] public class List{
|
||||
[Tooltip("Name of the sound. Each name has to be different between each other.")]
|
||||
public string name;
|
||||
[System.Serializable]
|
||||
public class List {
|
||||
[Tooltip("Name of the sound. Each name has to be different between each other.")]
|
||||
public string name;
|
||||
|
||||
public AudioClip clip;
|
||||
public AudioClip clip;
|
||||
|
||||
[System.Serializable] public enum Type { Music, SFX }
|
||||
[Space]
|
||||
[Tooltip("Is it part of the music or the SFX?")] public Type type;
|
||||
[System.Serializable] public enum Type { Music, SFX }
|
||||
[Space]
|
||||
[Tooltip("Is it part of the music or the SFX?")] public Type type;
|
||||
|
||||
[Space]
|
||||
[Tooltip("Default volume of the sound."), Range(0f, 1f)] public float volume;
|
||||
[Tooltip("Variance percentage of the volume"), Range(0f, 1f)] public float volumeVariance;
|
||||
[Tooltip("Default pitch of the sound."), Range(.1f, 3f)] public float pitch;
|
||||
[Tooltip("Variance percentage of the pitch"), Range(0f, 1f)] public float pitchVariance;
|
||||
[Space]
|
||||
[Tooltip("Default volume of the sound."), Range(0f, 1f)] public float volume;
|
||||
[Tooltip("Variance percentage of the volume"), Range(0f, 1f)] public float volumeVariance;
|
||||
[Tooltip("Default pitch of the sound."), Range(.1f, 3f)] public float pitch;
|
||||
[Tooltip("Variance percentage of the pitch"), Range(0f, 1f)] public float pitchVariance;
|
||||
|
||||
public bool loop;
|
||||
public bool loop;
|
||||
|
||||
[HideInInspector] public AudioSource source;
|
||||
[HideInInspector] public AudioSource source;
|
||||
|
||||
float randomVolume;
|
||||
public float RandomVolume{
|
||||
get{
|
||||
randomVolume = volume * (1f + Random.Range(-volumeVariance / 2f, volumeVariance / 2f));
|
||||
return randomVolume;
|
||||
}
|
||||
}
|
||||
float randomVolume;
|
||||
public float RandomVolume {
|
||||
get {
|
||||
randomVolume = volume * (1f + Random.Range(-volumeVariance / 2f, volumeVariance / 2f));
|
||||
return randomVolume;
|
||||
}
|
||||
}
|
||||
|
||||
float randomPitch;
|
||||
public float RandomPitch{
|
||||
get{
|
||||
randomPitch = pitch * (1f + Random.Range(-pitchVariance / 2f, pitchVariance / 2f));
|
||||
return randomPitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
float randomPitch;
|
||||
public float RandomPitch {
|
||||
get {
|
||||
randomPitch = pitch * (1f + Random.Range(-pitchVariance / 2f, pitchVariance / 2f));
|
||||
return randomPitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue