Example #1
0
 void EndGame()
 {
     if (Stop == true)
     {
         GameManager.EndGame();
         print("endgame");
     }
 }
Example #2
0
    void OnCollisionEnter2D(Collision2D other)
    {
        if (other.gameObject.tag == "Enemy")
        {
            Destroy(gameObject);
            EndGame.Stop = true;
            GameManager.EndGame();
        }


        if (other.gameObject.tag == "Fin")
        {
            player.Speed = 0;
            EndGame.Stop = true;
            Idle.SetTrigger("End");
            GameManager.EndGame();
        }
    }
Example #3
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Portable"))
     {
         encolere = true;
         GameManager.EndGame();
         print("lol");
     }
 }
Example #4
0
    IEnumerator timer()
    {
        while (time > 0)
        {
            yield return(new WaitForSeconds(1f));

            time--;
            GetComponent <Text>().text = time.ToString();
        }
        if (time == 0)
        {
            GameManager.EndGame();
        }
    }
Example #5
0
 void EndGame()
 {
     GameManager.EndGame();
     print("End Game");
 }
Example #6
0
    void Update()
    {
        if (win >= 3)
        {
            Debug.Log("win");
            GameManager.EndGame();
        }

        if (WaitingForKey == 0)
        {
            if (QTEGen == 1)
            {
                DisplayBox.GetComponent <Text>().text = "[E]";
            }
            if (QTEGen == 2)
            {
                DisplayBox.GetComponent <Text>().text = "[R]";
            }
            if (QTEGen == 3)
            {
                DisplayBox.GetComponent <Text>().text = "[T]";
            }

            if (QTEGen == 1)
            {
                if (Input.anyKeyDown && (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.S)))
                {
                    if (Input.GetButtonDown("E"))
                    {
                        CorrectKey = 1;
                        StartCoroutine(KeyPressing());
                    }
                    else
                    {
                        CorrectKey = 2;
                        StartCoroutine(KeyPressing());
                    }
                }
            }
            if (QTEGen == 2)
            {
                if (Input.anyKeyDown && (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.S)))
                {
                    if (Input.GetButtonDown("R"))
                    {
                        CorrectKey = 1;
                        StartCoroutine(KeyPressing());
                    }
                    else
                    {
                        CorrectKey = 2;
                        StartCoroutine(KeyPressing());
                    }
                }
            }
            if (QTEGen == 3)
            {
                if (Input.anyKeyDown && (!Input.GetKey(KeyCode.A) && !Input.GetKey(KeyCode.S)))
                {
                    if (Input.GetButtonDown("T"))
                    {
                        CorrectKey = 1;
                        StartCoroutine(KeyPressing());
                    }
                    else
                    {
                        CorrectKey = 2;
                        StartCoroutine(KeyPressing());
                    }
                }
            }
        }
    }