Ejemplo n.º 1
0
    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;
    }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 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);
         }
     }
 }
Ejemplo n.º 4
0
 void DebugAddHealth(int health)
 {
     healthScript.AddHealth(health);
 }