I have this class:
[System.Serializable]
public class Dialogue
{
public string displayName;
[TextArea(3, 10)]
public string sentence;
[Range(1, 120)]
public float textSpeed = 30f;
[Range(0, 3)]
public float pitch = 1f;
}
And also this class:
public class DialogueTrigger : MonoBehaviour
{
public Dialogue[] dialogues;
public string[] choices;
public void TriggerDialogue()
{
FindObjectOfType<DialogueManager>().StartDialogue(this);
}
}
However, in the Unity inspector, when I add a DialogueTrigger component to a game object, and then change the size of Dialogues from 0 to anything else, the new Dialogues won’t show in the inspector with their assigned default values (ie textSpeed = 30f, pitch = 1f), instead they will all default to 0. It’s something I can live with, but it’s pretty annoying. Anybody knows how to fix this? Thank you very much.