Example #1
0
 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++;
         }
     }
 }
Example #2
0
 public void ShowFloatingText(string text)
 {
     if (!MogoWorld.showFloatText)
     {
         return;
     }
     m_floatMsg.Show(text);
 }