void Attack() { BulletRock clone = Instantiate <BulletRock> (bullet, transform.position, Quaternion.identity); clone.Init(spriteRenderer.flipX ? Direction.left : Direction.right); }
void FastAttack() { BulletRock clone = Instantiate <BulletRock>(bullet, transform.position, Quaternion.identity); //BulletRock bulletRock = clone.GetComponent<BulletRock>(); clone.Init(10); clone.InitDirection(spriteRenderer.flipX ? BulletRock.Direction.left : BulletRock.Direction.right); }
private void OnCollisionEnter2D(Collision2D collision) { BulletRock bullet = collision.gameObject.GetComponent <BulletRock>(); if (bullet != null) { animator.SetBool("isDeath", true); } }
void OnCollisionEnter2D(Collision2D collision) { Debug.Log(""); BulletRock bullet = collision.gameObject.GetComponent <BulletRock> (); if (bullet) { animator.SetBool("isdeath", true); } }
void FastAttack() { BulletRock clone = Instantiate <BulletRock> (bullet, transform.position, Quaternion.identity); clone.Init(10f); }