Compare commits
10 Commits
managers
...
character_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab1c3d1e26 | ||
|
|
4697a647ef | ||
|
|
7ab1e2cf4c | ||
|
|
ae768baaaa | ||
|
|
4d086fd5b9 | ||
|
|
c4b5d7dac3 | ||
| 0e5c432dd5 | |||
|
|
3da424b722 | ||
|
|
be5e2556c6 | ||
|
|
92fd23b6f0 |
File diff suppressed because it is too large
Load Diff
@@ -1,28 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class AdventurerInteractable : MonoBehaviour
|
|
||||||
{
|
|
||||||
public DialogueController dialogueController;
|
|
||||||
|
|
||||||
[SerializeField] private string m_name = string.Empty;
|
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnMouseDown()
|
|
||||||
{
|
|
||||||
PlayerController.Instance.cameraMovement = false;
|
|
||||||
CharacterData character = CharacterManager.Instance.GetCharacterDataByName(m_name);
|
|
||||||
dialogueController.DisplayCharacterText(character);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a7fa9a36f8ebb0f4fa2ea09dac222d2d
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class AdventurerManager : MonoBehaviour
|
|
||||||
{
|
|
||||||
|
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a0025e0659889a54c8e7b136b75e4254
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class CharacterManager : MonoBehaviour
|
public class CharacterManager : MonoBehaviour
|
||||||
@@ -36,9 +35,4 @@ public class CharacterManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
m_interviewed.Add(name, true);
|
m_interviewed.Add(name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CharacterData GetCharacterDataByName(string name)
|
|
||||||
{
|
|
||||||
return m_characterDatas.Where(i => i.m_name == name).FirstOrDefault();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,10 @@ public class DialogueController : MonoBehaviour
|
|||||||
|
|
||||||
private int m_currentIndex = 0;
|
private int m_currentIndex = 0;
|
||||||
|
|
||||||
public bool DialogueInProgress => m_dialoguePanel.gameObject.activeSelf;
|
|
||||||
|
|
||||||
|
|
||||||
// DEBUG - Will need replacing with the character you selected.
|
// DEBUG - Will need replacing with the character you selected.
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
//DisplayCharacterText(CharacterManager.Instance.CharacterDatas[m_currentIndex]);
|
DisplayCharacterText(CharacterManager.Instance.CharacterDatas[m_currentIndex]);
|
||||||
|
|
||||||
m_dialoguePanel.OnQuestionsFinished += OnQuestionsFinished;
|
m_dialoguePanel.OnQuestionsFinished += OnQuestionsFinished;
|
||||||
}
|
}
|
||||||
@@ -30,7 +27,6 @@ public class DialogueController : MonoBehaviour
|
|||||||
|
|
||||||
CharacterManager.Instance.SetInterviewed(characterName);
|
CharacterManager.Instance.SetInterviewed(characterName);
|
||||||
|
|
||||||
PlayerController.Instance.cameraMovement = true;
|
|
||||||
// TODO: stop the dialogue and return to gameplay...
|
// TODO: stop the dialogue and return to gameplay...
|
||||||
// TODO: we could probably show a "Quit" button highlighted.
|
// TODO: we could probably show a "Quit" button highlighted.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class DialoguePanel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
m_skipped = false;
|
m_skipped = false;
|
||||||
m_characterText.text = "";
|
m_characterText.text = "";
|
||||||
m_questionIndexAsked.Clear();
|
|
||||||
StopAllCoroutines();
|
StopAllCoroutines();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class GameManager : MonoBehaviour
|
|
||||||
{
|
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a7d6a699566d0234aae77a22105ba6b5
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class Journal : MonoBehaviour
|
|
||||||
{
|
|
||||||
public GameObject journal;
|
|
||||||
private List<CharacterData> m_availableAdventurers = new List<CharacterData>();
|
|
||||||
|
|
||||||
public Transform adventurerPage;
|
|
||||||
public Transform questPage;
|
|
||||||
|
|
||||||
private int m_selectedAdventurer = 0;
|
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnMouseDown()
|
|
||||||
{
|
|
||||||
Debug.Log("MOUSE DOWN ON INVENTORY");
|
|
||||||
m_availableAdventurers.Clear();
|
|
||||||
foreach (var character in CharacterManager.Instance.CharacterDatas)
|
|
||||||
{
|
|
||||||
if (CharacterManager.Instance.CharacterInterviewed(character.name)) {
|
|
||||||
Debug.Log("Available Adventurer:" + character.name);
|
|
||||||
m_availableAdventurers.Add(character);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SetJournalQuestPage();
|
|
||||||
|
|
||||||
if (m_availableAdventurers.Count > 0)
|
|
||||||
{
|
|
||||||
SetJournalAdventurerPage(m_selectedAdventurer);
|
|
||||||
adventurerPage.gameObject.SetActive(true);
|
|
||||||
}
|
|
||||||
journal.SetActive(true);
|
|
||||||
PlayerController.Instance.cameraMovement = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CloseJournal()
|
|
||||||
{
|
|
||||||
journal.SetActive(false);
|
|
||||||
adventurerPage.gameObject.SetActive(false);
|
|
||||||
PlayerController.Instance.cameraMovement = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetJournalAdventurerPage(int id)
|
|
||||||
{
|
|
||||||
CharacterData chara = m_availableAdventurers[id];
|
|
||||||
TMP_Text nameLabel = adventurerPage.Find("AdventurerName").gameObject.GetComponent<TMP_Text>();
|
|
||||||
nameLabel.text = chara.m_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetJournalQuestPage()
|
|
||||||
{
|
|
||||||
Quest quest = QuestManager.Instance.GetActiveQuest();
|
|
||||||
questPage.Find("QuestName").gameObject.GetComponent<TMP_Text>().text = quest.name;
|
|
||||||
questPage.Find("QuestDescription").gameObject.GetComponent<TMP_Text>().text = quest.description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void NextAdventurer()
|
|
||||||
{
|
|
||||||
m_selectedAdventurer = ++m_selectedAdventurer % m_availableAdventurers.Count();
|
|
||||||
SetJournalAdventurerPage(m_selectedAdventurer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PreviousAdventurer()
|
|
||||||
{
|
|
||||||
m_selectedAdventurer = --m_selectedAdventurer;
|
|
||||||
if (m_selectedAdventurer < 0)
|
|
||||||
{
|
|
||||||
m_selectedAdventurer = m_availableAdventurers.Count() - 1;
|
|
||||||
}
|
|
||||||
SetJournalAdventurerPage(m_selectedAdventurer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,24 +4,15 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class PlayerController : MonoBehaviour
|
public class PlayerController : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static PlayerController Instance;
|
|
||||||
|
|
||||||
public Vector3 forward;
|
public Vector3 forward;
|
||||||
public Camera playerCam;
|
public Camera playerCam;
|
||||||
public float xLimit = 45;
|
public float xLimit = 45;
|
||||||
public float yLimit = 25;
|
public float yLimit = 25;
|
||||||
public bool cameraMovement = true;
|
public bool cameraMovement = true;
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
if (Instance == null)
|
|
||||||
{
|
|
||||||
Instance = this;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogWarning("There can only be one instance of the CharacterManager class");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
|||||||
35
Assets/Scripts/QuestLogInteractable.cs
Normal file
35
Assets/Scripts/QuestLogInteractable.cs
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class QuestLogInteractable : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
public GameObject journal;
|
||||||
|
public PlayerController playerController;
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMouseDown()
|
||||||
|
{
|
||||||
|
Debug.Log("MOUSE DOWN ON INVENTORY");
|
||||||
|
journal.SetActive(true);
|
||||||
|
playerController.cameraMovement = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CloseJournal()
|
||||||
|
{
|
||||||
|
Cursor.lockState = CursorLockMode.Locked;
|
||||||
|
journal.SetActive(false);
|
||||||
|
playerController.cameraMovement = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,26 +4,12 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class QuestManager : MonoBehaviour
|
public class QuestManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static QuestManager Instance;
|
|
||||||
public int activeQuest = 0;
|
public int activeQuest = 0;
|
||||||
|
|
||||||
public Quest[] quests = {
|
public Quest[] quests = {
|
||||||
new Quest(_name: "Advert Quest 1", _desc: "Find someone to hand out flyers to advertise our tavern to adventurers. Strength, dexterity, intelligence: doesn<73>t matter, find someone who would do this for as little money as possible.", _failedStr: "Damn, that didn<64>t work at all. That robot just randomly started playing an instrument, much to the dismay of the townspeople.", _strength: 0, _intelligence: 0, _charisma: 5),
|
new Quest(_name: "Advert Quest 1", _desc: "Find someone to hand out flyers to advertise our tavern to adventurers. Strength, dexterity, intelligence: doesn<73>t matter, find someone who would do this for as little money as possible.", _failedStr: "Damn, that didn<64>t work at all. That robot just randomly started playing an instrument, much to the dismay of the townspeople.", _strength: 0, _intelligence: 0, _charisma: 5),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
if (Instance == null)
|
|
||||||
{
|
|
||||||
Instance = this;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogWarning("There can only be one instance of the CharacterManager class");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
@@ -34,12 +20,12 @@ public class QuestManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Quest GetActiveQuest()
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
{
|
{
|
||||||
return quests[activeQuest];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class Quest
|
public class Quest
|
||||||
|
|||||||
Reference in New Issue
Block a user