// Update is called once per frame void Update() { if (healthScript.getHealth() > 0) { health = healthScript.getHealth(); } else { health = 0; } }
// Use this for initialization void Start() { currentLevel = 0; house = GameObject.Find("House"); healthScript = (HouseScript)house.GetComponent(typeof(HouseScript)); health = healthScript.getHealth(); gold = 200; playerScript = script; }