示例#1
0
 private void Kill()
 {
     if (isAlive)
     {
         CounterManager.addScore(30);
     }
     isAlive = false;
     StartCoroutine(KillToad());
 }
示例#2
0
    // Mario collides the base
    private void OnTriggerEnter2D(Collider2D other)
    {
        var isSuperMarioHead = other.tag == "SuperMarioHead";

        if (isSuperMarioHead)
        {
            CounterManager.addScore(10);
            var position = new Vector3(transform.position.x, transform.position.y + 1f, transform.position.z);
            Instantiate(Coin, position, transform.rotation);
            StartCoroutine(KillObject());
        }
    }
 private void OnCollisionEnter2D(Collision2D otherObject)
 {
     if (otherObject.collider.tag == "Floor")
     {
         isGrounded = true;
     }
     if (otherObject.collider.tag == "Vitals")
     {
         isColliderWithVitals = true;
         counterManager.addScore();
         Destroy(otherObject.gameObject);
     }
 }
示例#4
0
    private void OnCollisionEnter2D(Collision2D other)
    {
        var isMario = other.gameObject.CompareTag("Mario");

        if (isMario)
        {
            if (gameObject.tag == "Coin")
            {
                CounterManager.addScore(100);
                CounterManager.addCoin();
            }
            else if (gameObject.tag == "MushroomItem")
            {
                CounterManager.addScore(300);
            }

            KillObject();
        }
    }