Exemple #1
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "MinuteHand" || collision.gameObject.tag == "HourHand")
        {
            target     = collision.gameObject;
            hasBeenHit = true;
        }

        if (collision.gameObject.tag == "Floor")
        {
            onFloor = true;
        }

        if (collision.gameObject.tag == "Coin")
        {
            if (twoPlayer == 1)
            {
                ScoreVar.p1Score++;
                slowEnemy();
            }
            else
            {
                GameManager.instance.TimeIncrease(5.0f);
            }
            Destroy(collision.gameObject);
            newCoin.spawnNewCoin();
        }
    }
Exemple #2
0
 public void NewCoin()
 {
     spawner.spawnNewCoin();
 }