コード例 #1
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        MushroomBlow mp = gameObject.GetComponentInParent <MushroomBlow>();

        if (mp != null)
        {
            mp.SetBlow(collision.gameObject);
        }
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        MushroomBlow mp = gameObject.GetComponentInParent <MushroomBlow>();

        if (collision.gameObject.tag == "player")
        {
            collision.gameObject.GetComponent <PlayerControl>().SetCanJump(true);
        }

        if (mp != null)
        {
            mp.SetBlow(collision.gameObject);
        }
    }