public override void OnInspectorGUI() { base.OnInspectorGUI(); m_UI_Bar = (target as UI_Bar); float old = m_progress; EditorGUILayout.MinMaxSlider(ref m_progress, ref m_progress, 0, 1); if (old != m_progress) { m_UI_Bar.SetProgress(m_progress); } }
void UpdateProgress(float new_progress) { if (this == null) { return; } Bar.gameObject.SetActive(true); CurrentLevelTF.gameObject.SetActive(true); CurrentProgressTF.gameObject.SetActive(true); Bar.SetProgress(m_levels.GetProgressInLevel()); CurrentProgressTF.text = m_levels.GetProgressInLevelAbsolute().ToString() + "/" + m_levels.GetRequiredforNextLevel(); CurrentLevelTF.text = "Level " + m_levels.GetCurrentLevel().ToString(); }
public void SetView(MissionOutcome outcome) { player_level.gameObject.SetActive(true); player_level.Init(PlayerLevel.Instance); old_bar.gameObject.SetActive(true); player_level.CurrentLevelTF.GetComponent <UI_Anim_BlinkOnEnable>().enabled = outcome.NewLevel; if (outcome.NewLevel) { player_level.CurrentLevelTF.text += " [level up]"; } player_level.CurrentProgressTF.text = "+" + outcome.SuppliesGainedFinal; old_bar.enabled = !outcome.NewLevel; old_bar.SetProgress(outcome.ProgressBefore); }