public void StartAnimate(string msgStr) { msgLabel = SDKUtils.GetChildComponent <Text>("Label", transform); msgBackground = SDKUtils.GetChildComponent <Image>("Background", transform); Debug.Assert(msgLabel); Debug.Assert(msgBackground); msgLabel.text = msgStr; StartCoroutine(MsgCoroutine()); }
public void OnInit() { if (!IsInit) { m_MsgTempllatePool = new Stack <XUIMidMsgAnimator>(); MsgTemplate = SDKUtils.GetChildComponent <Transform>(transform, "MsgTemplate"); if (MsgTemplate) { MsgTemplate.gameObject.SetActive(false); } else { Debug.LogError("MsgTemplate 在子节点找不到,请检查!"); } IsInit = true; } }