void Awake() { _instance = this; sprite = this.GetComponent <UISprite> (); //this.gameObject.SetActive (false); sprite.alpha = 0; }
void Awake() { instance = this; sprite = GetComponent<UISprite>(); sprite.alpha = 0; }
void Awake() { _instance = this; sprite = this.GetComponent <UISprite>(); //this.gameObject.SetActive(false); sprite.alpha = 0; hpLabel = transform.Find("hpLabel").GetComponent <UILabel>(); harmLabel = transform.Find("harmLabel").GetComponent <UILabel>(); }
void Awake() { //单例模式,其他类可以方便使用该类的方法 _instance = this; sprite = this.GetComponent <UISprite>(); // //this.gameObject.SetActive(false); sprite.alpha = 0; hpLabel = this.transform.Find("hp_label").GetComponent <UILabel>(); attackLabel = this.transform.Find("attack_label").GetComponent <UILabel>(); destroylabel = this.transform.Find("destroylabel").GetComponent <UILabel>(); }
void Awake() { _instance = this; sprite = this.GetComponent<UISprite>(); //this.gameObject.SetActive(false); sprite.alpha = 0; hpLabel = this.transform.Find("hpLabel").GetComponent<UILabel>(); harmLabel = this.transform.Find("harmLabel").GetComponent<UILabel>(); if (harmLabel == null) { Debug.Log("null"); } }
private void Awake() { _instance = this; this.gameObject.SetActive(false); }