Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        health = 100;
        power  = 100;
        //gameOver = false;



        GameObject gameControlObject = GameObject.FindWithTag("UI");

        if (gameControlObject != null)
        {
            //gameOverScript = gameControlObject.GetComponent<GameOverScript>();
            healthInstance = healthBarController.GetComponent <HealthBarController>();
            powerInstance  = powerBarController.GetComponent <PowerBarController>();

            healthInstance.setMaxHealth(100.0f);
            healthInstance.setHealth(100.0f);

            powerInstance.setMaxPower(100.0f);
            powerInstance.setPower(100.0f);
        }
        if (gameControlObject == null)
        {
            Debug.Log("Sorry ,Couldn't find object");
        }
    }
Ejemplo n.º 2
0
 void updatePower(float power)
 {
     powerInstance.setPower(power);
 }