Assets/scripts/Player_Health.cs(16,26): error cs0117: “unityEngine.Screen” does not contain a definition for “weidht”
using UnityEngine;
using System.Collections;
public class Player_Health : MonoBehaviour
{
public int maxHealth=100;
private int _curHealth=100;
private float healthBarLenght;
void Start () {
healthBarLenght = Screen.weidht/2;
if(maxHealth<1) maxHealth=1;
_curHealth=maxHealth;}
void Update () {
}
void OnGUI () {
GUI.Box(new Rect(10,10,healthBarLenght,20),_curHealth + “/” + maxHealth);
}
public void AddjustCurrentHealth ( int adj){
_curHealth=adj;
if (_curHealth < 0) _curHealth=0;
if (_curHealth > maxHealth) _curHealth = maxHealth;
healthBarLenght = ( Screen.width / 2 ) * (_curHealth /(float) maxHealth);}
}