private void HandleBar(UpdateBar msg) { if (msg.barID == BarID) { SetBarValue(msg.currentValue); content.fillAmount = Map(msg.currentValue, msg.minValue, msg.maxValue); } }
private void Start() { if (bar == null) { Q.WarningPrint(transform, this.GetType().ToString()); return; } barClass = bar.GetComponent <UpdateBar>(); SetBar(); }
private void SetProgress(string text, float progress) { if (this.progressBar1.InvokeRequired) { UpdateBar d = new UpdateBar(SetProgress); this.Invoke(d, new object[] { text, progress }); } else { if (progress > -1) { progressBar1.Value = (int)((progress > 0 ? progress : 0) * 100.0); } textBox1.Text = text + "\r\n" + textBox1.Text; } }
public LayerMask safeLayers = -1; //安全层 /// <summary> /// 在派生类中调用以进行初始化 /// </summary> protected void Init() { m_Actor = GetComponent <BaseActor>(); if (hp_bar) { HP_barClass = hp_bar.GetComponent <UpdateBar>(); HP_barClass.currSlashValue = hp; HP_barClass.MaxSlashValue = maxHp; } if (mp_bar) { MP_barClass = mp_bar.GetComponent <UpdateBar>(); MP_barClass.currSlashValue = mp; MP_barClass.MaxSlashValue = maxMp; } }
public ProductUpdateBar(IProductUpdateService productUpdateService) { InitializeComponent(); if (productUpdateService == null) { throw new ArgumentNullException("productUpdateService"); } _productUpdateService = productUpdateService; _productUpdateService.UpdateAvailable += OnUpdateAvailable; // Set DynamicResource binding in code // The reason we can't set it in XAML is that the VsBrushes class come from either // Microsoft.VisualStudio.Shell.10 or Microsoft.VisualStudio.Shell.11 assembly, // depending on whether NuGet runs inside VS10 or VS11. UpdateBar.SetResourceReference(Border.BackgroundProperty, VsBrushes.InfoBackgroundKey); UpdateBar.SetResourceReference(Border.BorderBrushProperty, VsBrushes.ActiveBorderKey); StatusMessage.SetResourceReference(TextBlock.ForegroundProperty, VsBrushes.InfoTextKey); }
private void btnGo_Click(object sender, EventArgs e) { //Product deserializedProduct = JsonConvert.DeserializeObject<Product>(json); MyThreadClass myThr = new MyThreadClass(this); List<FileInfo> lstFiles = null; try { if (myThread != null && myThread.IsAlive) return; //btnGo.Enabled = false; txtLog.Text = ""; lstFiles = getFiles(); if (lstFiles == null || lstFiles.Count() == 0) return; delegateUpdateBar = new UpdateBar(methodUpdateBar); delegateUpdateLog = new UpdateLog(methodUpdatetxtLog); pBar1.Minimum = 0; pBar1.Maximum = lstFiles.Count(); pBar1.Value = 0; pBar1.Step = 1; myThread = new Thread(() => myThr.myThread(lstFiles)); myThread.Start(); } catch { throw; } finally { //btnGo.Enabled = true; } }
private void _CheckClientVersion(string _remoteAssetPath, Action <float> onCheckUF, UpdateBar onUpdateBar, Action onUpdateOver) { if (Config.Detail_Debug_Log()) { Debug.Log("check client version 3->" + ResLoader.IsInited() + "^" + inited + "^" + over); } if (!ResLoader.IsInited() || !inited || over) { return; } if (Config.Detail_Debug_Log()) { Debug.Log("check client version 4"); } remoteAssetPath = _remoteAssetPath; doUpdateUIOver = onUpdateOver; doUpdateBarV = onUpdateBar; doCheckUF = onCheckUF; InitVersionFile(() =>// check local version in dowload directory { if (Config.Detail_Debug_Log()) { Debug.LogError("check client version 5"); } StartCoroutine(InitStreamingAssetVersionInfo(() => // check loacal version in streamAsset directory { if (Config.Detail_Debug_Log()) { Debug.LogError("check client version 6"); } BeginCheckVersion();// })); }); }
private void UpdateHealthOrStamina(float currentValue, float minValue, float maxValue, int barID) { UpdateBar msg = new UpdateBar(currentValue, minValue, maxValue, barID); GameUtilities.Broadcast("HandleBar", msg); }
// ================ // IGNORED MESSAGES // ================ void HandleBar(UpdateBar msg) { // No-op }
public static void CheckClientVersion(string _remoteAssetPath, Action <float> onCheckUF, UpdateBar onUpdateBar, Action onUpdateOver) { if (Config.Detail_Debug_Log()) { Debug.Log("check client version 1"); } if (instance == null) { return; } if (Config.DirectlyLoadResource()) { onCheckUF(1); onUpdateBar(1, 1, 1, 1, 1); onUpdateOver(); } else { if (Config.Detail_Debug_Log()) { Debug.Log("check client version 2"); } instance._CheckClientVersion(_remoteAssetPath, onCheckUF, onUpdateBar, onUpdateOver); } }
private void UpdateHealthOrStamina(float currentValue, float minValue, float maxValue, int barID) { UpdateBar msg = new UpdateBar(currentValue, minValue, maxValue, barID); OwningGame.BroadcastMessage("HandleBar", msg, GameUtilities.DONT_CARE_RECIEVER); }
private void Awake() { bar = GetComponent <UpdateBar>(); }