public void Update() { dis.text = "km: " + getDistance().ToString(); // Changes the Text UI object. Gets the distance and converts it to string. if (divisible != (distance / 10000)) { health.AddHealth(500); } //Debug.Log (divisible + " " + score / 10000); //Debug.Log (distance / 10000); divisible = distance / 10000; }
void lifeChange() { if (health <= 10000) // if health is less than or equal to 10000 { healthScript.AddHealth(200); // health is set to 10000. } if (health <= 0) { Debug.Log("Game Over"); } if (shield >= 100) { //shield = 100; } }
private void OnTriggerEnter(Collider other) { if (!ready) { return; } if (other.gameObject.tag == "Player") { HealthScript health = other.gameObject.GetComponent <HealthScript>(); if (health != null) { health.AddHealth(value); Destroy(gameObject); } } }
void DebugAddHealth(int health) { healthScript.AddHealth(health); }