public override void Interact() { if (CheckForPickup()) { if (inventoryManager.GetInventory() == "") { if (scriptToLoad != null) { dialogueRunner.StartDialogue(itemName + " Pick Up"); } inventoryManager.SetInventory(this); Respawn(); } else { if (scriptToLoad != null) { dialogueRunner.StartDialogue(itemName + " Hands Full"); } } } else { if (scriptToLoad != null) { dialogueRunner.StartDialogue(itemName + " Default"); } } }
public void ToDialog() { if (!dialogue.activeInHierarchy) { num++; DialogueRunner dialogueRunner = FindObjectOfType <Yarn.Unity.DialogueRunner>(); if (num == 1) { dialogueRunner.Add(dialog1); dialogueRunner.StartDialogue("Start1"); audio1.Play(); } if (num == 2) { dialogueRunner.Add(dialog2); dialogueRunner.StartDialogue("Start2"); audio1.Stop(); audio2.Play(); } if (num == 3) { dialogueRunner.Add(dialog3); dialogueRunner.StartDialogue("Start3"); audio2.Stop(); audio3.Play(); } } }
IEnumerator ReadyToStartLevel(int level) { //Time.timeScale = 0; mePlayer.transform.localScale = Vector3.one * 1.128379f; userControl = false; mePlayer.natureMoney = 1; mePlayer.borrowMoney = 0; mePlayer.myRig2D.velocity = Vector2.zero; mePlayer.moveRig2D.velocity = Vector2.zero; mePlayer.transform.position = Vector3.zero; GameObject levelStuff = GameObject.Instantiate(prefabLevels[level - 1]); //levelStuff.transform.parent = levelContainer; dialogueRunner.StartDialogue("Level" + level); while (dialogueRunner.isDialogueRunning) { yield return(null); } state = State.Gaming; userControl = true; //Time.timeScale = 1; yield break; }
public void StartDailyQustion() { waitingForOpen = false; notification.SetActive(false); dialogue.StartDialogue(currentDayQuestion.ToString()); currentDayQuestion++; }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1") && letter.activeSelf) { //first a press letter.SetActive(false); dialogueRunner.StartDialogue("DimitriFirst"); } if (Input.GetButtonDown("Start")) { GetComponent <AudioSource>().PlayOneShot(QuackFX); } if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } if (isTheEnd) { endCanvasGroup.alpha += 0.001f; } else { endCanvasGroup.alpha = 0; } }
// Update is called once per frame void Update() { if (menu.activeSelf == true && Input.GetKeyDown(KeyCode.P)) { menu.SetActive(false); } else if (Input.GetKeyDown(KeyCode.P)) { menu.SetActive(true); } // The physics2D detection need testing if (Input.GetMouseButtonDown(0) && !dr.IsDialogueRunning && Physics2D.OverlapPoint(UtilsClass.GetMouseWorldPosition()) == null) { Debug.Log("Start dialogue from click"); dr.StartDialogue(npc.talkToNode); } if (Input.GetKeyDown(KeyCode.Space)) { Debug.Log("Start dialogue"); dr.StartDialogue(npc.talkToNode); } //if(isDialogRunning && Input Mouse Left Click && options not up?) //yarncommand continue dialog / skip autocomplete / go to next line }
private void Day0() { if (numCurrentCustomers == 0 && numCustomersThatLeft == 0) { Ray ray = new Ray(player.GetComponentInChildren <Camera>().transform.position, player.GetComponentInChildren <Camera>().transform.forward); float rayDist = Mathf.Infinity; RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, rayDist)) { if (hit.transform.name.Contains("InitialCustomerTrigger")) { //for snaptriggerarea: if day == 1 CustomerIvory.SetActive(true); audioController.spotlightSfx.Play(); audioController.bgm1.Play(); dialogue.StartDialogue(); numCurrentCustomers++; } } } if (numCustomersThatLeft == 1) { CustomerIvory.SetActive(false); } }
IEnumerator Play() { nowPlayingText.text = "Now playing: " + schedule.musicSlot.name; yield return(new WaitForSeconds(playbackDelay)); dialogRunner.Add(weather); dialogRunner.StartDialogue(Random.Range(1, 6).ToString()); stage++; yield break; }
// Start is called before the first frame update private void OnTriggerEnter2D(Collider2D collision) { if (visitedTracker == false) { dialoguerunner.StartDialogue("Acid"); visitedTracker = true; } else { dialoguerunner.StartDialogue("AcidAlt"); } }
public void SwitchFromCloseupMode() { PlayerInteractionCollider.enabled = true; spriteRenderer.enabled = true; isInCloseup = false; var nextSceneObject = GameObject.Find("NextScene"); var nextScene = nextSceneObject.GetComponent <NextScene>(); DialogueRunner.StartDialogue(string.Format("{0}.Walk", nextScene.sceneName)); MenuBar.SwitchToNormalMode(); CurrentMouseMode = MouseMode.Walk; }
public void UseItem(Interactable item, DialogueRunner dialogueRunner) { string itemApplicationNode = string.Format(ItemApplicationNodeFormat, item.name, name); if (dialogueRunner.NodeExists(itemApplicationNode)) { dialogueRunner.StartDialogue(itemApplicationNode); } else { dialogueRunner.StartDialogue(DefaultNode); } }
public IEnumerator TestVariableValuesFromYarnScript() { // run all lines Runner.StartDialogue(Runner.startNode); yield return(null); VarStorage.TryGetValue <string>("$stringVar", out var actualStringResult); Assert.AreEqual("hola", actualStringResult); VarStorage.TryGetValue <bool>("$boolVar", out var actualBoolResult); Assert.AreEqual(true, actualBoolResult); VarStorage.TryGetValue <float>("$floatVar", out var actualFloatResult); Assert.AreEqual(1.420f, actualFloatResult); }
void HandTouchedEvent(EventE e) { if ((int)storage.GetValue("$gettingthehint").AsNumber == 1) { dialogue.StartDialogue("GotTheHint"); } else { int bustedVal = (int)storage.GetValue("$busted").AsNumber; prevNode = dialogue.currentNodeName; dialogue.StartDialogue("Busted" + bustedVal); } }
private void HandleDrop(GameObject DroppedEvidence) { EvidenceBase curEvidenceBase = DroppedEvidence.GetComponentInChildren <EvidenceBase>(); string CommentNode = ID + curEvidenceBase.ID; currentEvidence = curEvidenceBase.gameObject; print(curEvidenceBase.ID); myStateMachine.ChangeState(curEvidenceBase.ID); objectOver = false; Main.transform.localScale = initLocalScale; if (dr.NodeExists(CommentNode)) { dr.StartDialogue(CommentNode); } }
private void Update() { if (IsDialogueAvailable && m_Input.InteractInput && !IsInConversation && TalkToNPCAgainTimer <= 0) { //Start the dialogue and set everything up dialogueRunner.StartDialogue(NPCToTalk.talkToNode, targets); SetNormalLineDisplaySpeed(); IsInConversation = true; TimeBetweenLinesTimer = TimebetweenLinesCooldown; //disable movement m_Input.ReleaseControl(); } else if (IsInConversation && m_Input.InteractInput && IsLineBeingDisplayed) { if (TimeBetweenLinesTimer <= 0) { //Make the line display faster dialogueUI.textSpeed = LineDisplaySpeedFast; } } else if (IsInOptions) { HandleOptions(); } else if (IsInConversation && m_Input.InteractInput) { dialogueUI.MarkLineComplete(); TimeBetweenLinesTimer = TimebetweenLinesCooldown; } //Handle any timers needed HandleTimers(); }
private void OnTriggerEnter(Collider other) { //if other is player if (other.gameObject.CompareTag("Player")) { if (!string.IsNullOrEmpty(talkToNode)) { if (dialogueCanavas != null) { //move the Canvas to the object and off set dialogueCanavas.transform.SetParent(transform.parent.transform); // use the root to prevent scaling //dialogueCanavas.GetComponent<RectTransform>().anchoredPosition3D = transform.parent.TransformVector(PostionSpeachBubble); dialogueCanavas.GetComponent <RectTransform>().anchoredPosition3D = PostionSpeachBubble; dialogueCanavas.GetComponent <RectTransform>().localEulerAngles = RotationSpeechBubble; } if (dialogueRunner.IsDialogueRunning) { dialogueRunner.Stop(); } Debug.Log("start dialogue"); dialogueRunner.StartDialogue(talkToNode); } } }
void StartDialogue() { safeToInteract = true; audioController.bgm1.Play(); dialogueRunner.StartDialogue(); }
// Update is called once per frame void Update() { if (canInteract && playerControl.canInteract && !interacting && (Input.GetButtonDown("Fire1") || Input.GetButtonDown("Jump"))) { if (characterAnim != null) { characterAnim.SetTrigger("talk"); } interacting = true; playerControl.canWalk = false; dialogueRunner.StartDialogue(nodeName); } else if (interacting && !dialogueRunner.IsDialogueRunning) { if (characterAnim != null) { characterAnim.SetTrigger("stoptalk"); } if (!itemPickedUp) { itemPickedUp = true; AddItemToCollection(); } interacting = false; playerControl.canWalk = true; if (destroyOnExamination) { Destroy(gameObject); } } }
private void NextNode(string nextNode) { if (nextNode != null) { runner.StartDialogue(nextNode); } }
public override void OnBehaviourPlay(Playable playable, FrameData info) { if (dialogueRunner != null) { dialogueRunner.StartDialogue(nodeStart); } }
public bool Interact(MouseMode mouseMode, DialogueRunner dialogueRunner) { if (!MouseNodeDictionary.ContainsKey(mouseMode)) { if (string.IsNullOrEmpty(DefaultNode)) { return(false); } dialogueRunner.StartDialogue(DefaultNode); return(true); } dialogueRunner.StartDialogue(MouseNodeDictionary[mouseMode]); return(true); }
public void OnInteraction() { if (isInRange) { if (!isMajorAction || !GameManager.getInstance().MajorActionDone()) { dialogueRunner.StartDialogue(yarnNode); } else { dialogueRunner.StartDialogue(tiredNode); //buttonsEnabled = false; } } //TextboxManager.GetInstance().TextBoxActive(true); }
private void EndGradedPerformance() { if (gradedPerformance) { //Pause(); FadeToBlack(); pauseBtn.SetActive(false); gradedPerformance = false; timerText.gameObject.SetActive(false); trickGUI.FinalScore(targetScore); Debug.Log("Performance is done!"); string node = badEndSolo; if (donnaManager.isActiveAndEnabled) { donnaManager.EnableSprites(false); donnaManager.jumpWarning.SetActive(false); if (targetScore <= trickGUI.GetScore()) { node = goodEndDuo; } else { node = badEndDuo; } } else if (targetScore <= trickGUI.GetScore()) { node = goodEndSolo; } pmt.EnableSprites(false); dialogueRunner.StartDialogue(node); } }
public void StartChat(string nodeName) { /* * Starts dialogue with an NPC, running the node with the passed nodeName. */ dialogueRunner.StartDialogue(nodeName); }
private IEnumerator StartDialog() { yield return(null); yield return(null); runner.StartDialogue(); }
// Update is called once per frame void FixedUpdate() { if (!cinematicStarted) { cinematicStarted = true; dialogueRunner.StartDialogue("Cinematic Start"); } }
public void ActivateSpeech() { dR.StartDialogue(GeneralManager.Gm.currentNode.ToString()); speechBubble.SetActive(true); animator.SetBool("EnteredScene", true); currentEntered = true; }
// Update is called once per frame void Update() { // List<NarrativeEvent> triggered = new List<NarrativeEvent>(); for (int i = 0; i < narrativeEvents.Length; i++) { NarrativeEvent ev = narrativeEvents[i]; if (!ev.triggered && ev.triggerPercentage < comms.PercentageOfJourney && !allDead) { if (ev.waitForDialogue && dialogueRunner.isDialogueRunning) { continue; } // remove from array and trigger if (ev.eventToFire != null) { ev.eventToFire.Invoke(); } if (ev.nodeToPlay != null && ev.nodeToPlay != "") { dialogueRunner.StartDialogue(ev.nodeToPlay); } ev.triggered = true; narrativeEvents[i] = ev; } } }
void ChangeToPowered() { if (!hasStarted) { dialogueRunner.StartDialogue(startNode); hasStarted = true; } commsUI.gameObject.GetComponent <AudioSource>().mute = false; }
public void TalkTo() { if (isFirstTalk) { firstMeetingEvents?.Invoke(); isFirstTalk = false; } dialogueRunner.StartDialogue(talkToNode); }