void Catch() { print("Player was caught!"); target.transform.GetChild(0).gameObject.GetComponent <Interact> ().Discard(target.transform.position); //Make player focus on guard that caught them. target.GetComponent <FirstPersonController> ().IsCaught(gameObject); manager.EndEscape(); isChasing = false; CancelInvoke("Chase"); InvokeRepeating("Wander", wanderRate, wanderRate); }
public void Interact(string interactedItem) { if (interactedItem == exitType) { int hostA = PlayerPrefs.GetInt("sucessfulEscapes"); float hostB = PlayerPrefs.GetInt("sucessfulTimer"); player.GetComponent <FirstPersonController>().PlayVictorySound(); hostA += 1; hostB += manager.alarmTimer; PlayerPrefs.SetInt("sucessfulEscapes", hostA); PlayerPrefs.SetFloat("sucessfulTimer", hostB); exitType = "closed"; PlayerPrefs.SetInt("PlayerEscaped" + manager.currentPlayer.ToString(), 1); print("Player escaped!"); manager.EndEscape(); } }