void EndEncounter() { if (currentChoice.text == "The Hermocrates.") { toTempleTransition.SetActive(true); var indyAgent = indy.GetComponent <NavMeshAgent>(); indyAgent.Warp(new Vector3(160.6526f, 15.35716f, -74.86929f)); if (indyAgent.enabled) { indyAgent.SetDestination(new Vector3(163.42f, 15.67f, -75.42f)); } var sophiaAgent = sophia.GetComponent <NavMeshAgent>(); sophiaAgent.Warp(new Vector3(161.9f, 15f, -70.3f)); sophiaAgent.SetDestination(new Vector3(171.91f, 15f, -83.05f)); sophia.GetComponent <HumanFollow>().isFollowing = false; var sternhartAgent = sternhart.GetComponent <NavMeshAgent>(); sternhartAgent.Warp(new Vector3(161.9f, 15f, -70.3f)); sternhartAgent.SetDestination(new Vector3(171.91f, 15f, -83.05f)); } UIActionManager.instance.isTalking = false; dialogCanvas.SetActive(false); Cursor.visible = true; Cursor.lockState = CursorLockMode.None; inventory.SetActive(true); actions.SetActive(true); }
// Specific to use the snake tree when the rodent has been eaten public void UseSnakeTree() { if (!snakeProp.activeSelf) { UIActionManager.instance.canWalk = false; // charTalkText.gameObject.SetActive(false); charTalkText.GetComponent <NavMeshAgent>().Warp(new Vector3(17.016f, 18.119f, -4.999f)); charTalkText.transform.Rotate(0f, 121.493f, 0f); charTalkText.gameObject.SetActive(false); // Trigger Cut Scene treeCutScene.SetActive(true); // Warp the characters to their specific positions var sophia = GameObject.Find("Sophia"); sophia.GetComponent <NavMeshAgent>().Warp(new Vector3(20.722f, 18.41f, -6.984f)); sophia.transform.Rotate(0f, 219.629f, 0f); sophia.GetComponent <HumanFollow>().IsFollowing = true; sophia.SetActive(false); var sternhart = GameObject.Find("Sternhart"); sternhart.GetComponent <NavMeshAgent>().Warp(new Vector3(20.72f, 19.341f, -1.747f)); sternhart.transform.Rotate(0f, 207.839f, 0f); sternhart.SetActive(false); } }