public static MumuTools GetInstance() { if (instance == null) { instance = new MumuTools(); } return(instance); }
private Size viewportSize; //有缓存的话想更新这个数据必须重启 public Size GetViewportSize() { if (bGotViewportSize) { return(viewportSize); //缓存 } var viewportRect = MumuTools.GetInstance().GetMumuViewportRect(); viewportSize = new Size(viewportRect.Width, viewportRect.Height); bGotViewportSize = true; //缓存 return(viewportSize); }