Adding in the characters
Added debug buttons to cycle through the characters Bug fixes
This commit is contained in:
@@ -6,10 +6,12 @@ public class DialogueController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private DialoguePanel m_dialoguePanel;
|
||||
|
||||
private int m_currentIndex = 0;
|
||||
|
||||
// DEBUG - Will need replacing with the character you selected.
|
||||
private void Start()
|
||||
{
|
||||
DisplayCharacterText(CharacterManager.Instance.CharacterDatas[0]);
|
||||
DisplayCharacterText(CharacterManager.Instance.CharacterDatas[m_currentIndex]);
|
||||
|
||||
m_dialoguePanel.OnQuestionsFinished += OnQuestionsFinished;
|
||||
}
|
||||
@@ -28,4 +30,22 @@ public class DialogueController : MonoBehaviour
|
||||
// TODO: stop the dialogue and return to gameplay...
|
||||
// TODO: we could probably show a "Quit" button highlighted.
|
||||
}
|
||||
|
||||
public void Debug_NextCharacter()
|
||||
{
|
||||
if (m_currentIndex + 1 >= CharacterManager.Instance.CharacterDatas.Count)
|
||||
return;
|
||||
|
||||
m_currentIndex++;
|
||||
DisplayCharacterText(CharacterManager.Instance.CharacterDatas[m_currentIndex]);
|
||||
}
|
||||
|
||||
public void Debug_PreviousCharacter()
|
||||
{
|
||||
if (m_currentIndex - 1 < 0)
|
||||
return;
|
||||
|
||||
m_currentIndex--;
|
||||
DisplayCharacterText(CharacterManager.Instance.CharacterDatas[m_currentIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ public class DialoguePanel : MonoBehaviour
|
||||
{
|
||||
Cleanup();
|
||||
|
||||
if (m_characterSheet != null)
|
||||
{
|
||||
// Clear the old sheet
|
||||
m_characterSheet.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
m_questionsAsked = 0;
|
||||
m_currentCharacter = characterData;
|
||||
m_characterNameText.text = characterData.name;
|
||||
@@ -52,6 +58,7 @@ public class DialoguePanel : MonoBehaviour
|
||||
m_characterSheet.SetName(characterData.name);
|
||||
m_characterSheet.gameObject.SetActive(true);
|
||||
|
||||
m_questionHolder.gameObject.SetActive(true);
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user