コード例 #1
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();
        }
    }