Beispiel #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        String name = other.tag;

        if (name == "Hole")
        {
            if (hasBomb)
            {
                colurControle.SetTimerOff();
                hasBomb = false;
                Destroy(other.gameObject);

                spawner.SetBomb();
                spawner.SetHole();
                pointCounter.madePoint();
            }
        }
        else if (name == "Bomb")
        {
            if (!hasBomb)
            {
                colurControle.SetTimer(1f);
                hasBomb = true;

                Destroy(other.gameObject);

                BombTimer bombTimer = (BombTimer)other.gameObject.GetComponent("BombTimer");

                fuse          = bombTimer.fuse;
                explosionTime = bombTimer.TimeNow;
            }
        }
        else if (name == "Explosion")
        {
            stunned = 2.5f;
        }
    }