private GameObject InitUIPanel(GameObject nameObj, GameObject sRoot) { GameObject obj = GameObject.Instantiate(nameObj) as GameObject; //if (uiBundlePre != null) //{ // uiBundlePre.Unload(false); // uiBundlePre = null; //} obj.name = nameObj.name; if (obj != null) { obj.transform.parent = sRoot.transform; obj.transform.position = Vector3.zero; obj.transform.localScale = new Vector3(1, 1, 1); obj.transform.rotation = new Quaternion(0, 0, 0, 0); if (obj.name.Equals("AttackPanel")) { AttaclPanel panel = obj.GetComponent <AttaclPanel>(); if (panel != null) { panel.HideUI(); } } } return(obj); }
void Start() { UIPanel panel = gameObject.GetComponent <UIPanel> (); panel.depth = 21; attackPanel = GameObject.Find("AttackPanel").GetComponent <AttaclPanel>(); scrollView = gameObject.GetComponent <ScrollViewPanel> (); grid = gameObject.GetComponentInChildren <UIGrid> (); curMp = GamePlayer.Instance.GetIprop(PropertyType.PT_MpCurr); //InitData (); //item.SetActive (false); UIEventListener.Get(closeBtn).onClick = CloseClick; AttaclEvent.getInstance.SkillEvent = RefreshData; zhiyeLabe.text = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel)).jobName_; //Recovery(); }
void Awake() { AttackP = this; }