// Sets max energy and health. Sets current energy and health to max. Adjusts slider according to percentage.
 void Start()
 {
     energyBar.value = CalculateEnergy();
     currentHealth   = maxHealth;
     healthBar.value = CalculateHealth();
     energyCircle.SetActive(false);
     lowHealth      = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
     playerDeathSFX = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
     shieldCharged  = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
 }
Example #2
0
 // Start is called before the first frame update. Gets Animator Component and Starts infinite Coroutine to make enemies fire.
 void Start()
 {
     animator = GetComponent <Animator>();
     StartCoroutine(StartFire());
     playShot = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
 }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     animator         = GetComponent <Animator>();
     destroyEnemyShip = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
 }
 // Start is called before the first frame update
 void Start()
 {
     anim      = GetComponent <Animator>();
     shieldHit = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
     colonyHit = GameObject.FindObjectOfType(typeof(SFXscript)) as SFXscript;
 }