//when the player is shoot with a bullet the sheilds go doen // void OnCollisionStay(Collision Entity) void DecreaseShield() { shieldPercentage -= 5; //decrement the shields when the shield are hit if (shieldPercentage < 0) { shieldPercentage = 0; //make sure we stay in the bounds of the number we want } if (shieldPercentage > 100) { shieldPercentage = 100; //make sure we stay in the bounds of the number we want } ShieldTimer.Reset(); //reset the time to ShieldTimer.TurnTimerOn(); //turn the timer back on }
/*! Resets the weapon charge */ public void ChargerReset()//resets the timer { IsCharged = false; ChargeTimer.Reset(); }
// Update is called once per frame void Update() { AnimatorStateInfo Layer1State = X8Animator.GetCurrentAnimatorStateInfo(1); for (int i = 0; i < Bolts.Count; ++i) { if (Bolts[i].IsTicking == false) //if the timer is off and hence beyond its age limit { RaydraProjectile CurrentBolt = Bolts[i]; //get the instance Bolts.RemoveAt(i); Destroy(CurrentBolt.gameObject); } else { Bolts[i].transform.position += Bolts[i].TravelPath; //move the projecti } } if (Input.GetButton("Shoot")) { if (X8Animator.GetBool("Shoot") == false) { X8Animator.SetBool("Shoot", true); } ChargeTimer.TurnTimerOn(); //turn on the charge timer ChargeTimer.Update(); } else { X8Animator.SetBool("Shoot", false); } if (Input.GetButtonUp("Shoot")) { //fire the weapon upon the release of the the button this.ShootWeapon(CameraFocus.transform.position - Camera.main.transform.position); if (WeaponCharged == true) //reset the the charged state of the weapon { WeaponCharged = false; } ChargeTimer.Reset(); //reset the charge time } if (Layer1State.IsName("Shoot")) { X8Animator.SetLayerWeight(1, 1);//increase the weigt of the layer with the shoot animation } else { /// ThePlayer.PlayerAttackState = AttackMode.NotFiringAbility; X8Animator.SetLayerWeight(1, 0); if (this.WeaponFired == true) { this.WeaponFired = false; } } }
/*!resets the shoot timer*/ public void ResetShootTimer() { ShootTimer.Reset(); }