コード例 #1
0
    new void OnCollisionEnter2D(Collision2D collision2D)
    {
        KeyMoveSprite keyMoveSprite = collision2D.collider.GetComponent <KeyMoveSprite> ();

        if (keyMoveSprite != null)
        {
            keyMoveSprite.health -= damage;
        }

        base.OnCollisionEnter2D(collision2D);
    }
コード例 #2
0
    new void OnCollisionEnter2D(Collision2D collision2D)
    {
        KeyMoveSprite keyMoveSprite = collision2D.collider.GetComponent <KeyMoveSprite> ();

        if (keyMoveSprite != null)
        {
            keyMoveSprite.health += healthIncrease;
        }

        ComputerSprite computerSprite = collision2D.collider.GetComponent <ComputerSprite> ();

        if (computerSprite != null)
        {
            computerSprite.transform.localScale *= 2;
        }

        base.OnCollisionEnter2D(collision2D);

        Destroy(gameObject);
    }