Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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();
        }
    }