public override void OnInspectorGUI() { progress = target as UIProgress; hSliderValue = GUILayout.HorizontalSlider(hSliderValue, 0.0f, 1.0f); progress.SetValue(hSliderValue); base.OnInspectorGUI(); }
void Update() { if (_ap == null) { return; } if (!_ap.isDone) { Debug.Log(_ap.progress); _prgLoading.SetValue(_ap.progress); } else { _ap = null; CloseWindow(); } }
public void SetInfo(BattleDataHeroInfo info, int totalDamage, int totalDamageGet, int totalKill, float totalTime) { _prgDamage.SetValue(1.0f * info.damage / info.totalDamage); _prgDamageGet.SetValue(1.0f * info.damageGet / info.totalDamageGet); _prgKill.SetValue(1.0f * info.kill / info.totalKill); _prgTime.SetValue(info.time / info.totalTime); _prgDamage.SetText(info.damage.ToString()); _prgDamageGet.SetText(info.damageGet.ToString()); _prgKill.SetText(info.kill.ToString()); _prgTime.SetText(Utils.GetCountDownString(info.time)); }
public void SetInfo(long heroID, int addExp) { HeroInfo info = UserManager.Instance.GetHeroInfo(heroID); if (info == null) { gameObject.SetActive(false); return; } _info = info; _addExp = addExp; _heroBg.sprite = ResourceManager.Instance.GetIconBgByQuality(info.StarLevel); _heroIcon.sprite = ResourceManager.Instance.GetHeroIcon(info.ConfigID); _heroLevel.text = "Lv " + info.Level; HeroLevelConfig expCfg = HeroLevelConfigLoader.GetConfig(info.Level); if (expCfg.ExpRequire == 0) { _heroExp.SetValue(1); if (_heroLevelUp != null) { _heroLevelUp.gameObject.SetActive(false); } } else { // 设置初始的进度 _heroExp._image.fillAmount = 1.0f * info.Exp / expCfg.ExpRequire; StartCoroutine(ProcessAnimation()); if (info.Exp + addExp >= expCfg.ExpRequire) { if (_heroLevelUp != null) { _heroLevelUp.gameObject.SetActive(true); } } else { if (_heroLevelUp != null) { _heroLevel.gameObject.SetActive(false); } } } _heroExp.SetText(Str.Get("UI_EXP") + "+" + addExp); }
static int SetValue(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); UIProgress obj = (UIProgress)ToLua.CheckObject(L, 1, typeof(UIProgress)); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.SetValue(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void SetProgressValue(float value) { _prgLoading.SetValue(value); }
/// <summary> /// 值修改 /// </summary> protected void OnValueChanged() { int leftTime = mDuration - mPassTime; if (leftTime < 0) { leftTime = 0; } ShowText(leftTime); if (Direct == DirectType.LeftToRight) { if (uiProgress) { if (mDuration <= 0) { uiProgress.SetValue(1.0f); } else { uiProgress.SetValue(mPassTime / (float)mDuration); } } if (uiSlider) { if (mDuration <= 0) { uiSlider.value = 1.0f; } else { uiSlider.value = mPassTime / (float)mDuration; } } } else if (Direct == DirectType.RightToLeft) { if (uiProgress) { if (leftTime <= 0) { uiProgress.SetValue(0.0f); } else { uiProgress.SetValue(leftTime / (float)mDuration); } } if (uiSlider) { if (leftTime <= 0) { uiSlider.value = 0.0f; } else { uiSlider.value = leftTime / (float)mDuration; } } } if (mPassTime >= mDuration) { Stop(); OnTimeEnd(); } }