private bool _hitSomething = false; //!indicates if we have hit a player or not //! Use this for initialization void Start() { Trajectory = Path; LifeTimer = new X8Timer(LifeLimit); LifeTimer.TurnTimerOn(); //get the timer that is attached to this object }
/*! Constructor for the charger that takes a charge time and intializes the private variables * \param ChargeTime is the time that the charger will take to fully charge * */ public RaydraCharger(float ChargeTime) { if (ChargeTime < 1f) { ChargeTime = 1f; } ChargeTimer = new X8Timer(ChargeTime); ChargeTimer.TimeLimitReached = FullyCharged; //call is medthod whenever the timer has reached its limit IsCharged = false; }
// Use this for initialization void Start() { ShootTimer = new X8Timer(1f); Bolts = new List <RaydraProjectile>(); for (int i = 0; i < Bolts.Count; ++i) { Bolts[i] = null; //initialize the array elements to null } Center = GameObject.Find("GoalCenter"); ShootTimer.TimeLimitReached = TimerLimitReached; }
Animator X8Animator; //the animator that is attached to this object void Start() { Bolts = new List <RaydraProjectile>(); for (int i = 0; i < Bolts.Count; ++i) { Bolts[i] = null; //initialize the array elements to null } X8Animator = this.GetComponentInParent <Animator>(); ChargeTimer = new X8Timer(1f); //assign a medthod to be called once the time limit is reached //TimeLimitReached is a delegate ChargeTimer.TimeLimitReached = WeaponIsCharged; //set the initial weapon charge WeaponCharged = false; X8Animator.SetBool("Shoot", false); }