//返回已经播放的百分比 public float TickGameMsg(out GameMsgEvent msg) { if (curMsgIndex < msgQueue.Count) { msg = msgQueue[curMsgIndex]; return(((float)curMsgIndex++) / msgQueue.Count); } msg = new GameMsgEvent(); return(1.0f); }
public void ReadAllMsg() { var bEnd = false; while (bEnd == false) { var msg = new GameMsgEvent(); try { msg.ReadData(bwReader); msgQueue.Add(msg); } catch (EndOfStreamException e) { Debug.Log("读到文件末尾!"); bEnd = true; } } curMsgIndex = 0; }