void Update() { if ((uint)((Time.time - beginTime) * 1000) > length && textQueue.Count > 0) { beginTime = Time.time; int count = 0; while (textQueue.Count > 0) { string text = textQueue.Dequeue() as string; //����һ���ı���������Ʈ var index = count; AssetCacheMgr.GetUIInstance("MsgBoxFloat.prefab", (str, id, obj) => { GameObject go = obj as GameObject; Mogo.Util.Utils.MountToSomeObjWithoutPosChange(go.transform, transform); FloatMsg floatMsg = go.AddComponent <FloatMsg>(); floatMsg.m_tweenPosition.from = new Vector3(0, 0 - index * 40, 0); floatMsg.m_tweenPosition.to = new Vector3(0, 180 - index * 40, 0); floatMsg.Show(text); TimerHeap.AddTimer(length + 500, 0, () => { AssetCacheMgr.ReleaseInstance(go); }); }); count++; } } }
void Awake() { Init(); m_myTransform = transform; //m_goOKCancelBox = m_myTransform.FindChild("MsgBox").GetComponentsInChildren<OKMsgBox>(true)[0]; m_goOKCancelBox = m_myTransform.Find("MsgBox").gameObject.AddComponent <OKMsgBox>(); //m_floatMsg = m_myTransform.FindChild("MsgBoxFloat").GetComponentsInChildren<FloatMsg>(true)[0]; m_floatMsg = m_myTransform.Find("MsgBoxFloat").gameObject.AddComponent <FloatMsg>(); m_waveMsg = m_myTransform.Find("MsgBoxWave").gameObject; m_waveMsgLbl = GetUIChild("MsgBoxWaveLbl").GetComponent <UILabel>(); m_waveMsgTweenPostion = m_waveMsgLbl.GetComponent <TweenPosition>(); m_waveMsgTweenPostion.enabled = false; m_waveMsg.SetActive(false); m_msgBoxCamera = GameObject.Find("MsgCameraForPower"); //m_msgBoxCamera.SetActive(false); InitFloatMsgForPower(); }
void Awake() { Init(); m_myTransform = transform; //m_goOKCancelBox = m_myTransform.FindChild("MsgBox").GetComponentsInChildren<OKMsgBox>(true)[0]; m_goOKCancelBox = m_myTransform.FindChild("MsgBox").gameObject.AddComponent<OKMsgBox>(); //m_floatMsg = m_myTransform.FindChild("MsgBoxFloat").GetComponentsInChildren<FloatMsg>(true)[0]; m_floatMsg = m_myTransform.FindChild("MsgBoxFloat").gameObject.AddComponent<FloatMsg>(); m_waveMsg = m_myTransform.FindChild("MsgBoxWave").gameObject; m_waveMsgLbl = GetUIChild("MsgBoxWaveLbl").GetComponent<UILabel>(); m_waveMsgTweenPostion = m_waveMsgLbl.GetComponent<TweenPosition>(); m_waveMsgTweenPostion.enabled = false; m_waveMsg.SetActive(false); m_msgBoxCamera = GameObject.Find("MsgCameraForPower"); //m_msgBoxCamera.SetActive(false); InitFloatMsgForPower(); }