// Update is called once per frame void FixedUpdate() { if (pressFire) { //Debug.Log (timer_out); if (ifFire) { anim_gun.SetBool("isFire", true); if (timer_out > 0) { timer_out -= Time.deltaTime; } else { FireAnimation.ifFire = false; } } else { anim_gun.SetBool("isFire", false); timer_out = 10f; } if (timer_out < 0) { ActiveDeButtons.StackActionForStatus(false); //timer_out = 10f; ifFire = false; StopBonusFire(); StopAnimator(); } gunX = Gun.transform.position.x; //Debug.Log (gunX); time_create_left -= Time.deltaTime; time_create_right -= Time.deltaTime; //if (ifFire) { //anim_gun.Play(); anim_gun.speed = speed_gun; if (ifFire) { if (isLeftFire && time_create_left < 0) { //Debug.Log (" isLeftFire " + isLeftFire); GameObject newObject = Instantiate(ammoShot) as GameObject; newObject.transform.position = new Vector3(gunX - 0.4f, y_PosKar, 0); newObject.gameObject.tag = "Shot"; time_create_left = 0.1f; } if (isRightFire && time_create_right < 0) { GameObject newObject = Instantiate(ammoShot) as GameObject; newObject.transform.position = new Vector3(gunX + 0.4f, y_PosKar, 0); newObject.gameObject.tag = "Shot"; time_create_right = 0.1f; } } } //} }
void BonusSelecter(string _name) { //Life / unLife //Debug.Log ("Bonus selecter Active"); //Debug.Log (_name); if (_name == "Bomb(Clone)") { BonusBombAction(); } if (_name == "Life(Clone)" || _name == "Life") { AddLife(); } //Size ball if (_name == "Ball_small(Clone)" || _name == "Small_size(Clone)" || _name == "Ball_small") { SmallBall(); } if (_name == "Ball_normal(Clone)" || _name == "Normal_size(Clone)") { ResizeNornal(); } //Speed if (_name == "SpeedUP(Clone)" || _name == "SpeedUP") { GlobalSpeed.IncGlobalSpeed(); } ; if (_name == "SpeedDown(Clone)" || _name == "SpeedDown") { GlobalSpeed.DecGlobalSpeed(); } ; //Gun if (_name == "Gun" || _name == "Gun(Clone)") { FireAnimation.ifFire = true; FireAnimation.ResetTimer(); ActiveDeButtons.StackActionForStatus(true); } ; //Shield if (_name == "Big_shield" || _name == "Big_shield(Clone)") { incShield(); } ; if (_name == "Small_shield" || _name == "Small_shield(Clone)") { decreateShield(); } ; //Multiple if (_name == "Multipli3" || _name == "Multipli3(Clone)") { Multiple3(); } ; if (_name == "Multipli5" || _name == "Multipli5(Clone)") { Multiple5(); } ; //FireBall if (_name == "Fire_ball" || _name == "Fire_ball(Clone)") { Debug.Log("ЗАГЛУШКА"); } ; }