Example #1
0
        void Attack()
        {
            BulletRock clone = Instantiate <BulletRock> (bullet, transform.position, Quaternion.identity);

            clone.Init(spriteRenderer.flipX ?
                       Direction.left :
                       Direction.right);
        }
Example #2
0
        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);
        }
Example #3
0
        private void OnCollisionEnter2D(Collision2D collision)
        {
            BulletRock bullet = collision.gameObject.GetComponent <BulletRock>();

            if (bullet != null)
            {
                animator.SetBool("isDeath", true);
            }
        }
Example #4
0
        void OnCollisionEnter2D(Collision2D collision)
        {
            Debug.Log("");
            BulletRock bullet = collision.gameObject.GetComponent <BulletRock> ();

            if (bullet)
            {
                animator.SetBool("isdeath", true);
            }
        }
Example #5
0
        void FastAttack()
        {
            BulletRock clone = Instantiate <BulletRock> (bullet, transform.position, Quaternion.identity);

            clone.Init(10f);
        }