public void Shooting() { anim.SetBool("Attack", false); if (anim.GetInteger("WeaponType") < 2) { if (Values.HaveBullets) { for (int i = 0; i <= anim.GetInteger("WeaponType"); i++) { Values.Shoot(); if (anim.GetInteger("WeaponType") != i) { GameObject newBullet = Instantiate(Bullets [anim.GetInteger("WeaponType")], FirePoints [2].transform.position, transform.rotation) as GameObject; newBullet.gameObject.transform.SetParent(InstantsPlace.transform); } else { GameObject newBullet = Instantiate(Bullets [anim.GetInteger("WeaponType")], FirePoints [i].transform.position, transform.rotation) as GameObject; newBullet.gameObject.transform.SetParent(InstantsPlace.transform); } } } } else { // GetComponent<Animator> ().SetBool ("Weapon", false); anim.SetInteger("WeaponType", 2); } }