Wiec mam problem ze skryptem, bo wyświetla mi się end-of-file oraz kilka innych błędow. Skrypt jest z kursu C# dla leniwych
a tutaj skrypt:
using UnityEngine;
using System.Collections;
public class PlayerStats : MonoBehaviour
{
private float maxHealth = 100;
private float currentHealth = 100;
private float maxArmour = 100;
private float currentArmour = 100;
private float maxStamina = 100;
private float currentStamina = 100;
public Texture2D healthTexture;
public Texture2D armourTexture;
public Texture2D staminaTexture;
private float barWidth;
private float barHeight;
void Awake()
{
barHeight = Screen.height * 0.02f;
barWidth = barHeight * 10.0f;
// Use this for initialization
}
void OnGUI()
{
GUI.DrawTexture (new Rect (Screen.width - barWidth - 10,
Screen.height - barHeight - 10,
currentHealth * barWidth / maxHealth,
barHeight),
healthTexture);
GUI.DrawTexture (new Rect (Screen.width - barWidth - 10,
Screen.height - barHeight * 2 - 20,
currentArmour * barWidth / maxArmour,
barHeigth),
armourTexture);
GUI.DrawTexture (new Rect (Screen.width - barWidth - 10,
Screen.height - barHeight - *3 - 30,
currentStamina * barWidth / maxStamina,
barHeight),
staminaTexture);
}
void Update()
{
if(Input.GetKeyDown(KeyCode.P)) {
takeHit (30);
}
}
}