void Awake() { instance = this; }
void Awake() { instance = this; //when game starts, this is stored into the instance which will return the health }
private void Awake() { instance = this; }
protected void Start() { healthBar = GetComponentInChildren <UIHealthBar>(); InitializeHealthBar(); }
void Awake() { uiHealthBar = HealthBar.GetComponent <UIHealthBar>(); DisableUnitUI(); }
void Awake() { instance = this; originalSize = mask.rectTransform.rect.width; }
// Use this for initialization void Awake() { Instance = this; }
private void Awake() //It's called when the object is created, in this case when the game starts { healtBar = this; //this = Special C# keyword that means "the object that currently runs that function" }
private void Start() { mHealth = gameObject.GetComponent <UIHealthBar>(); // Get the Health Script mHealth.DestroyGameObject += DestroyGameObject; // Attach the Function }
private void Awake() { // 创建单例 instance = this; }
float originalSize; //Set size void Awake() { instance = this; //Set the instance to this gameobject }
void Awake() { _healthBar = GetComponentInChildren <UIHealthBar>(); }