示例#1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        KinematicBubble kinematicBubble = other.GetComponent <KinematicBubble>();

        if (kinematicBubble)
        {
            StartCoroutine(kinematicBubble.DestroyBubble());
        }
    }
示例#2
0
    private void OnCollisionEnter2D(Collision2D other)
    {
        KinematicBubble kinematicBubble = other.collider.GetComponent <KinematicBubble>();

        if (kinematicBubble)
        {
            StartCoroutine(kinematicBubble.DestroyBubble());
            myAnimator.SetBool(fireBubbleBlowBoolName, true);
            gameObject.layer = 11;
        }
        // should chagne to corotine
        // maybe handle in animation event
    }