void Awake() { dialogueRoot = this.transform; Visible = false; dialogueRoot.localPosition = hiddenLocalPosition; Instance = this; }
void Awake() { instance = this; Dialogue.dd = this; DialogueManager.dd = this; manager = GameObject.Find("DialogueManager").GetComponent <Transform>(); dm = manager.GetComponent <DialogueManager> (); background = manager.Find("Background").GetComponent <Image>(); illustObject = manager.Find("Illust"); portrait = manager.Find("Portrait").GetComponent <Image>(); nameBox = manager.Find("NameBox").GetComponent <Image>(); nameText = manager.Find("NameBox").Find("NameText").GetComponent <Text>(); contentBox = manager.Find("ContentBox").GetComponent <Image>(); contentText = manager.Find("ContentBox").Find("ContentText").GetComponent <Text>(); statChangeBox = manager.Find("StatChangeBox").gameObject; statChangeText = statChangeBox.transform.Find("StatChangeText").GetComponent <Text> (); choiceButtonsContainer = manager.Find("ChoiceButtonsContainer"); dialogueLogScrollView = manager.Find("DialogueLogScrollView").gameObject; dialogueLogBox = GameObject.Find("DialogueLogBox").gameObject; dialogueLogNameText = dialogueLogBox.transform.Find("DialogueLogNameText").GetComponent <Text>(); dialogueLogContentText = dialogueLogBox.transform.Find("DialogueLogContentText").GetComponent <Text> (); dialogueLogScrollView.SetActive(false); skipButtonText = manager.Find("SkipButton").transform.GetComponentInChildren <Text> (); transparentSprite = Resources.Load <Sprite> ("UIImages/transparent"); SCREENSCALE = new Vector2(Screen.width / 1280f, Screen.height / 720f); dialogueLogs = new List <DialogueLog> (); }
private void OnDialogueStart(DialogueDisplay d) { //Debug.Log("OnDialogueStart() called"); input.enabled = true; EventSystem.current.SetSelectedGameObject(null); EventSystem.current.SetSelectedGameObject(nextLine); }
void UpdateDisplay() { yourBox.Deactivate(); theirBox.Deactivate(); if (sequenceIndex >= sequence.dialogue.Length) { yourBox.Deactivate(); theirBox.Deactivate(); manager.EndDialogue(sequence.storySequence); gameObject.SetActive(false); return; } DialogueSequence.Dialogue current = sequence.dialogue[sequenceIndex]; DialogueSequence.Character character = sequence.GetCharacter(current.characterIndex); DialogueDisplay box = character.flipSide ? theirBox : yourBox; box.Show(current.character, current.text, character.characterSprite); if (character.gameObject && current.target) { movement mv = character.gameObject.GetComponent <movement>(); if (mv) { mv.SetTarget(current.target, false); } } }
private void CheckOffended(DialogueDisplay d) //cheat { string whoTalk = dialogueDisplay.conversation.convoOwner; if (this.gameObject.name == whoTalk) { this.isOffended = true; this.questHolderIndex = 4; //cheat this.dialogueHolderIndex = 4; } }
private void LevelUp(DialogueDisplay d) { roomLevel += 1; //we can add more parameter changes here Debug.Log("Room Level = " + roomLevel); if (OnRoomLevelUp != null) { OnRoomLevelUp(this); } }
void SetCurrentQuestion(DialogueDisplay d) //change function to get specific question { Debug.Log("recieved msg from DialogueDisplay"); int questionBlock = dialogueDisplay.blockNumber; currentQuestion = questions; questionArea.SetActive(true); factText.text = currentQuestion.fact; //show the question to the UI correctAnswer.text = currentQuestion.correctAnswer; wrongAnswer.text = currentQuestion.wrongAnswer; }
private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } activeLineIndex = 0; }
private void QuestStart(DialogueDisplay d) { //Ideal path: //Get the quest name from the conversation //Set the quest requirements //Announce isQuesting = true; if (OnQuesting != null) { OnQuesting(this); } }
public static event Action <NpcBehavior> OnTalkStart; //Announce if the NPC innitiate a talk at Talk() void Start() { dialogueHolderIndex = myLevel; sign = transform.Find("Sign").gameObject; dialogue = GameObject.Find("Dialogue"); dialogueDisplay = dialogue.GetComponent <DialogueDisplay>(); dialogueHolder = GetComponent <DialogueHolder>(); input = GetComponent <PlayerInput>(); DialogueDisplay.OnStartConversation += DisableInput; //Observe if the dialogue ends, enable input DialogueDisplay.OnEndtoNothing += EnableInput; //Observe if the dialogue starts, disable input RoomState.OnRoomLevelUp += NpcLevelup; //Observe if the room level up }
private void CheckOffended(DialogueDisplay d) { //questReq -= 1; questPoint -= 1; if (questReq <= 0) { roomLevel += 1; //we can add more parameter changes here Debug.Log("Room Level = " + roomLevel); if (OnRoomLevelUp != null) { OnRoomLevelUp(this); } } }
private void CheckQuest(DialogueDisplay d) //Cheat { Debug.Log("Observed OnQuestCheck"); string whoTalk = dialogueDisplay.conversation.convoOwner; Debug.Log(whoTalk); if (this.gameObject.name == whoTalk) { this.myQuestLevel += 1; Debug.Log(this.gameObject.name + " Level Up Quest"); this.questHolderIndex += 1; if (OnQuestCheck != null) { OnQuestCheck(this); } } }
void Start() { gameManager = GameManager.instance; canvas = transform.GetChild(0).transform; inventoryPanel = Instantiate(inventoryPanelPrefab, canvas); inventoryPanel.SetActive(false); dialoguePanel = Instantiate(dialoguePanelPrefab, canvas); dialogueDisplay = dialoguePanel.GetComponent <DialogueDisplay>(); dialoguePanel.SetActive(false); hudPanel = Instantiate(hudPanelPrefab, canvas); hudDisplay = hudPanel.GetComponent <HUDDisplay>(); storePanel = Instantiate(storePanelPrefab, canvas); storePanel.SetActive(false); }
void Start() { dialogueHolderIndex = myLevel; sign = transform.Find("Sign").gameObject; dialogue = GameObject.Find("Dialogue"); dialogueDisplay = dialogue.GetComponent <DialogueDisplay>(); dialogueHolder = GetComponent <DialogueHolder>(); questHolder = GetComponent <QuestHolder>(); input = GetComponent <PlayerInput>(); DialogueDisplay.OnStartConversation += DisableInput; //Observe if the dialogue ends, enable input DialogueDisplay.OnEndtoNothing += EnableInput; //Observe if the dialogue starts, disable input RoomState.OnRoomLevelUp += NpcLevelup; //Observe if the room level up RoomState.OnQuesting += QuestSetup; RoomState.OnQuestFail += QuestFailState; RoomState.OnQuestSuccess += QuestSuccess; DialogueDisplay.OnQuestCheck += CheckQuest; DialogueDisplay.OnOffendedCheck += CheckOffended; }
protected override void SetReferences() { Instance = this; base.SetReferences(); dialogue = GetComponentInChildren <DialogueDisplay>(); }
private void DisableInput(DialogueDisplay d) { //Debug.Log(gameObject.name + " Alright DialogueManager, we disable our Player Input!"); input.enabled = false; }
private void EnableInput(DialogueDisplay d) { //Debug.Log(gameObject.name + " read notif from dialogue manager, we can initiate talk again"); Invoke("EnablingInput", 1); //cheat the input enable }
private void BadEnding(DialogueDisplay d) { anim.SetTrigger("ending"); Invoke("LoadBadEnding", 1f); }
private void EnableMovement(DialogueDisplay d) { playerMode = PlayerMode.walking; Debug.Log(gameObject.name + "Read notif from the dialogue display, CONTROL ENABLED"); input.enabled = true; }
void Start() { dialogueDisplay = dialogue.GetComponent <DialogueDisplay>(); DialogueDisplay.OnEndtoQuestion += SetCurrentQuestion; }
void Start() { DialogMsg = GetComponent <DialogueDisplay>(); DialogMsg.enabled = false; }
private void OnDialogueEnd(DialogueDisplay d) { //Debug.Log("OnDialogueEnd() called"); input.enabled = false; }
private void EnableInput(DialogueDisplay d) { //Debug.Log(gameObject.name + " read notif from dialogue manager, we can initiate talk again"); input.enabled = true; }