// Update is called once per frame void Update() { if (gameState.CurrentState() == "Dialogue" && initiated != true) { if (gameState.GetInterlocutor() == characterName) { // Logic can be added here for which dialogue tree to start from Initialize(); gameState.SetMusicState("Dialogue"); if (gameState.GetArcState() == 2) { Current = Reprimand1; Current(-1); } else { Current = Silence; Current(-1); } } } if (gameState.CurrentState() == "Overworld" && initiated == true) { initiated = false; } if (initiated == true) { Current(GetChoice()); } }
// Update is called once per frame void Update() { if (gameState.CurrentState() == "Dialogue" && initiated != true) { if (gameState.GetInterlocutor() == characterName) { // Logic can be added here for which dialogue tree to start from Initialize(); gameState.SetMusicState("Dialogue"); /* LOGIC GOES HERE! FOR NOW: GO TO THE ONLY DECISION */ if (gameState.GetArcState() == 1) { Current = Hello1; Current(-1); } else if (gameState.GetArcState() == 2) { Current = Appointment1; Current(-1); } } } if (gameState.CurrentState() == "Overworld" && initiated == true) { initiated = false; } if (initiated == true) { Current(GetChoice()); } }
// Update is called once per frame void Update() { if (gameState.CurrentState() == "Dialogue" && initiated != true) { if (gameState.GetInterlocutor() == characterName) { // Logic can be added here for which dialogue tree to start from Initialize(); /* LOGIC GOES HERE! FOR NOW: GO TO THE ONLY DECISION */ Current = Decision1; Current(-1); } } if (gameState.CurrentState() == "Overworld" && initiated == true) { initiated = false; } if (initiated == true) { Current(GetChoice()); } }
// Update is called once per frame void Update() { if (gameState.CurrentState() == "Dialogue") { rigidBody.constraints = RigidbodyConstraints2D.FreezeAll; } else if (gameState.CurrentState() == "Overworld") { rigidBody.constraints = RigidbodyConstraints2D.FreezeRotation; } }
// Update is called once per frame void Update() { if (gameState.CurrentState() == "Overworld") { transform.rotation = Quaternion.Euler(0, 0, 0); } else if (gameState.CurrentState() == "Dialogue") { transform.rotation = Quaternion.Euler(180, 0, 0); } }
void OnGUI() { if (gameState.CurrentState() == "Dialogue") { GUI.Label(portraitRect, portrait, textStyle); GUI.Label(dialogue.rect, displayText, textStyle); if (!monologue) { if (finished) { GUI.Label(choice1.rect, choice1.text, textStyle); GUI.Label(choice2.rect, choice2.text, textStyle); GUI.Label(choice3.rect, choice3.text, textStyle); } } else { // Center "..." where the choices would be if (finished) { GUI.Label(new Rect(Screen.width / 2 - 25, Screen.height * 0.75f, 50, 20), "...", textStyle); } } } }
void PlayMusic(string currentState) { switch (currentState) { case "Dialogue": gameMusic.clip = music["FlushedTestSong1"]; break; case "Overworld": gameMusic.clip = music["FlushedTestSong2"]; break; case "Siren": gameMusic.clip = music["Siren"]; gameMusic.loop = false; break; case "None": gameMusic.Stop(); break; } //Debug.Log(gameMusic.clip); if (PlayOverworldMusic == false && gameState.CurrentState() == "Overworld") { gameMusic.Stop(); } else { gameMusic.Play(); } }
// Update is called once per frame void Update() { if (gameState.CurrentState() == "Dialogue" && initiated != true) { if (gameState.GetInterlocutor() == characterName) { // Logic can be added here for which dialogue tree to start from Initialize(); if (gameState.GetArcState() < 2) { gameState.SetMusicState("None"); Debug.Log("hello"); } else if (gameState.GetArcState() >= 2) { gameState.SetMusicState("Siren"); } if (gameState.GetArcState() == 0) { Current = Hello1; Current(-1); } else if (gameState.GetArcState() == 2 || gameState.GetArcState() == 3) { Current = Prognosis1; Current(-1); } else { Current = Silence; Current(-1); } } } if (gameState.CurrentState() == "Overworld" && initiated == true) { initiated = false; } if (initiated == true) { Current(GetChoice()); } }
// Update is called once per frame void Update() { //lerps the npc back and forth if (gameState.CurrentState() == "Overworld") { float distCovered = Mathf.PingPong((Time.time - startTime) * moveSpeed, 1); float fracJourney = (distCovered / travelDist * 2); transform.position = Vector2.Lerp(startPos, endPos, fracJourney); } }
// Update is called once per frame void Update() { //npc follows player if in range if (followingPlayer && !gameState.Safe() && gameState.CurrentState() == "Overworld" && !halt.isHalted()) { float step = moveSpeed * Time.deltaTime; Vector2 moveToPlayer = Vector2.MoveTowards(transform.position, player.transform.position, step); transform.position = moveToPlayer; circle.transform.position = moveToPlayer; } }