private void _UpdateUI(UItype type, int per) { if (per > 99) { per = 100; } switch (type) { case UItype.DownloadProgress: progressBar_download.Value = Math.Min(per, 100); break; case UItype.UzipProgress: progressBar_uzip.Value = Math.Min(per, 100); break; case UItype.UpdateProgress: progressBar_update.Value = Math.Min(per, 100); break; case UItype.Downloadtext: lable_download.Text = "下载文件失败"; lable_download.BackColor = Color.Red; break; case UItype.Uziptext: label_uzip.Text = "解压失败"; label_uzip.BackColor = Color.Red; break; case UItype.Updatetext: label_update.Text = "更新失败"; label_update.BackColor = Color.Red; break; default: Console.WriteLine("!!!other"); break; } }
/// <summary> /// Gets the UI selected. /// </summary> /// <returns>the UI Gameobject.</returns> /// <param name="type">Type.</param> public GameObject GetChildPanel(UItype type) { switch (type) { case UItype.TileMenu: return(UIPanelList [0]); case UItype.TurretMenu: return(UIPanelList [1]); case UItype.GameplayUI: return(UIPanelList[2]); case UItype.WaveMenu: return(UIPanelList[3]); } return(null); }
private void _UpdateUIAsy(UItype type, int per) { this.Invoke(new UIperDelegate(_UpdateUI), new object[] { type, per }); }