Пример #1
0
        protected virtual void Awake()
        {
            hitInvulnTimer   = new CooldownTimer(hitInvuln, 0);
            healthRegenTimer = new ExpirationTimer(healthRegenDelay);

            ResetHealth();
        }
Пример #2
0
        protected override void Start()
        {
            base.Start();

            shields = maxShields;

            shieldRegenTimer = new ExpirationTimer(shieldRegenDelay);
        }
Пример #3
0
        // Use this for initialization
        protected virtual void Start()
        {
            health = maxHealth;

            healthRegenTimer = new ExpirationTimer(healthRegenDelay);

            if (healthbarPrefab)
            {
                healthbar        = Instantiate(healthbarPrefab).GetComponent <Healthbar>();
                healthbar.target = this;

                healthbar.transform.SetParent(FindObjectOfType <Canvas>().transform, false);
            }
        }
Пример #4
0
 /// <summary>
 /// Construct a new Magazine with given size and reload time.
 /// </summary>
 /// <param name="size">Number of uses before reload.</param>
 /// <param name="reloadTime">Time it takes to reload.</param>
 public Magazine(int size, float reloadTime)
 {
     reloadTimer    = new ExpirationTimer(reloadTime);
     remainingShots = size;
     clipSize       = size;
 }
Пример #5
0
 private void Awake()
 {
     displayTimer = new ExpirationTimer(displayDuration);
 }