//驱动所有的故事板 public static void runStoryBoards() { long currentTicks = getMyTimer(); //Debug.WriteLine("runStoryBoards elapsedTicks=" + (currentTicks - LastRunStoryTicks) + ", stage.frameRate=" + stage.frameRate + ", DateTimeTicks=" + (DateTime.Now.toString("yyyy-MM-dd HH:mm:ss"))); LastRunStoryTicks = currentTicks; List <StoryBoard4Client> list = new List <StoryBoard4Client>(); lock (StoryBoardDict) { foreach (var sb in StoryBoardDict.Values) { list.Add(sb); } } for (int i = 0; i < list.Count; i++) { StoryBoard4Client sb = list[i]; if (null != sb) { sb.Run(currentTicks); } } }
public static StoryBoard4Client StopStoryBoard(int roleID, long clientTicks) { StoryBoard4Client storyBd = null; lock (StoryBoard4Client.StoryBoardDict) { if (!StoryBoard4Client.StoryBoardDict.TryGetValue(roleID, out storyBd)) { return(null); } StoryBoard4Client.StoryBoardDict.Remove(roleID); } if (null != storyBd) { storyBd.Run(clientTicks); } return(storyBd); }
public static void runStoryBoards() { long currentTicks = StoryBoard4Client.getMyTimer(); StoryBoard4Client.LastRunStoryTicks = currentTicks; List <StoryBoard4Client> list = new List <StoryBoard4Client>(); lock (StoryBoard4Client.StoryBoardDict) { foreach (StoryBoard4Client sb in StoryBoard4Client.StoryBoardDict.Values) { list.Add(sb); } } for (int i = 0; i < list.Count; i++) { StoryBoard4Client sb = list[i]; if (null != sb) { sb.Run(currentTicks); } } }