public void ChangePlayerCurrentProp(PropType type, float value, PropEventDelegate hander) { if (type == PropType.Pressure) { playerCurrentProp.Pressure = (int)value; BattleUIPanel.ShowChangePressureSlider(hander); } }
public static void ShowChangePlayerBattlePressureSlider(float changeValue, PropEventDelegate hander = null) { SetBattlePressSliderPos(); CharacterPropBase propData = CharacterPropManager.Instance.GetPlayerProp(); float needvalue = changeValue / propData.Pressure; if (needvalue != 0) { IEnumeratorManager.Instance.StartCoroutine(ChangePressureSlider_IEnumerator_PlayerBattle(needvalue, hander)); } }
public static void ShowChangePressureSlider(PropEventDelegate hander = null) { CharacterPropBase propData = CharacterPropManager.Instance.GetPlayerProp(); CharacterPropBase currentData = CharacterPropManager.Instance.GetPlayerCureentProp(); float sliderValue = currentData.Pressure / propData.Pressure; float needvalue = sliderValue - pressureSlider.value; pressureSlider.gameObject.SetActive(true); TweenAlpha ta = pressureSlider.GetComponent <TweenAlpha>(); ta.onFinished.Clear(); ta.enabled = true; ta.ResetToBeginning(); IEnumeratorManager.Instance.StartCoroutine(ChangePressureSlider_IEnumerator(needvalue, hander)); }
public void ShowPlayerBattleSlider(float neeedValue, PropEventDelegate OnSliderFished = null) { GameObject panel = GUIManager.FindPanel("BattleUIPanel"); if (!panel.activeSelf) { GUIManager.ShowView("BattleUIPanel"); } BattleUIPanel.ShowChangePlayerBattlePressureSlider(neeedValue, OnSliderFished); GameObject player = GameObject.FindWithTag("Player"); if (neeedValue == 0) { return; } GUIManager.ShowView("ExpressionEffectPanel"); ExpressionEffectPanel.ShowPressEffect(player, (int)neeedValue); }
private static IEnumerator ChangePressureSlider_IEnumerator(float needValue, PropEventDelegate hander = null) { float time = 10.0f * Mathf.Abs(needValue); int count = (int)(time / 0.02f); float rate = needValue / count; for (int i = 0; i < count; i++) { yield return(new WaitForSeconds(0.02f)); pressureSlider.value += rate; if (i == count - 1) { if (hander != null) { yield return(new WaitForSeconds(1.0f)); pressureSlider.gameObject.SetActive(false); hander(); hander = null; } } } }