public static UIAnimationHelp Get(GameObject go) { UIAnimationHelp load = go.GetComponent <UIAnimationHelp>(); if (load == null) { load = go.AddComponent <UIAnimationHelp>(); } return(load); }
private void Update() { if (m_Start) { m_curTime += Time.deltaTime; if (m_curTime > m_maxTime) { HUDInfo hudInfo = m_tempList[0]; //Debug.Log("hud:" + hudInfo.txt); Transform item; if (m_cacheList.First != null) { item = m_cacheList.First.Value.transform; m_cacheList.RemoveFirst(); } else { item = GameObject.Instantiate(m_item).transform; } item.SetParent(m_parent); item.gameObject.SetActiveNew(true); item.localPosition = hudInfo.pos; item.SetParent(GUIManager.m_PanelRoot); string text = hudInfo.txt; GameObject txtObj = UIItem.SetText(item, UIItemTitle.txt, text); UIAnimationHelp help = UIAnimationHelp.Get(txtObj); help.m_param = item.gameObject; help.Init(); help.Play(OnAnimaEnd); m_curTime = 0; m_tempList.RemoveAt(0); if (m_tempList.Count == 0) { m_Start = false; } } } }