Ошибка "a namespace can only contain types and namespace declarations" в первой строчке. Вот сам код:
Код
private float HeatlthBarLenght;
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public int myHealth = 100;
private bool IsLife = true;
void Start () {
HealthBarLength = Screen.width / 3;
if (myHealth < 10)
myHealth = 10;
}
void OnGUI()
{
GUI.Box (new Rect(10, 10, HealthBarLength, 20), myHealth + '.');
}
public void adjustHealth(int _health)
{
myHealth += _health;
if (myHealth < 0)
myHealth = 0;
HealthBarLength = Screen.width / 3 * myHealth / 100;
if (myHealth == 0)
{
IsLife = false;
Time.timeScale = 0;
MouseLook _ml = GameObject.Find("Main Camera").GetComponent<MouseLook>();
MouseLook _cl = GameObject.FindGameObjectWithTag("Player").GetComponent<MouseLook>();
_ml.enabled = false;
_cl.enabled = false;
}
}
}
Прошу, исправьте.