Ejemplo n.º 1
0
        void OnCollisionEnter2D(Collision2D collision)
        {
            BulletLog bullet =
                collision.gameObject.GetComponent <BulletLog>();

            if (bullet)
            {
                animator.SetBool("isdeath", true);
                Destroy(GetComponent <CapsuleCollider2D>());
                Destroy(GetComponent <Rigidbody2D>());
            }
        }
Ejemplo n.º 2
0
        void FastAttack()
        {
            BulletLog clone = Instantiate <BulletLog>(
                bullet,
                transform.position,
                Quaternion.identity);

            clone.Init(10f,
                       spriteRenderer.flipX ?
                       Direction.left :
                       Direction.right);
        }