Exemplo n.º 1
0
 private void UpdateGauge(TargetPlate.GaugeParam param, GradientGauge gauge)
 {
     if (param == null || param.Colors == null || UnityEngine.Object.op_Equality((UnityEngine.Object)gauge, (UnityEngine.Object)null))
     {
         return;
     }
     gauge.UpdateColors(param.Colors);
     gauge.AnimateRangedValue(param.Current, param.Max, 0.0f);
 }
Exemplo n.º 2
0
        private void SetGaugeParamInternal(ref TargetPlate.GaugeParam Gauge, TargetPlate.EGaugeType Type, int CurrentValue, int MaxValue, int PlusValue)
        {
            GameSettings instance  = GameSettings.Instance;
            Color32      color32_1 = (Color32)null;
            Color32      color32_2 = (Color32)null;
            Color32      color32_3 = (Color32)null;

            switch (Type)
            {
            case TargetPlate.EGaugeType.PLAYER_HP:
                color32_1 = instance.Gauge_PlayerHP_Base;
                color32_2 = instance.Gauge_PlayerHP_Damage;
                color32_3 = instance.Gauge_PlayerHP_Heal;
                break;

            case TargetPlate.EGaugeType.ENEMY_HP:
                color32_1 = instance.Gauge_EnemyHP_Base;
                color32_2 = instance.Gauge_EnemyHP_Damage;
                color32_3 = instance.Gauge_EnemyHP_Heal;
                break;
            }
            if (0 > PlusValue)
            {
                Color32[] color32Array = new Color32[2] {
                    color32_1, null
                };
                color32Array[0].a = (__Null)(int)(byte)((double)Mathf.Clamp01((float)(CurrentValue + PlusValue) / (float)CurrentValue) * (double)byte.MaxValue);
                color32Array[1]   = color32_2;
                color32Array[1].a = (__Null)(int)(byte)((int)byte.MaxValue - color32Array[0].a);
                Gauge.Colors      = color32Array;
                Gauge.Current     = CurrentValue;
                Gauge.Max         = MaxValue;
            }
            else if (0 < PlusValue)
            {
                Color32[] color32Array = new Color32[2] {
                    color32_1, null
                };
                float num = Mathf.Min((float)CurrentValue + (float)PlusValue, (float)MaxValue);
                color32Array[0].a = (__Null)(int)(byte)((double)Mathf.Clamp01((float)CurrentValue / num) * (double)byte.MaxValue);
                color32Array[1]   = color32_3;
                color32Array[1].a = (__Null)(int)(byte)((int)byte.MaxValue - color32Array[0].a);
                Gauge.Colors      = color32Array;
                Gauge.Current     = (int)num;
                Gauge.Max         = MaxValue;
            }
            else
            {
                Color32[] color32Array = new Color32[1] {
                    color32_1
                };
                Gauge.Colors  = color32Array;
                Gauge.Current = CurrentValue;
                Gauge.Max     = MaxValue;
            }
        }
Exemplo n.º 3
0
 private void UpdateGauge(TargetPlate.GaugeParam param, GradientGauge gauge, GradientGauge max_gauge = null)
 {
     if (param == null || param.Colors == null || UnityEngine.Object.op_Equality((UnityEngine.Object)gauge, (UnityEngine.Object)null))
     {
         return;
     }
     gauge.UpdateColors(param.Colors);
     gauge.AnimateRangedValue(param.Current, param.Max, 0.0f);
     if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)max_gauge))
     {
         return;
     }
     max_gauge.UpdateValue(param.MaxValue);
     gauge.UpdateValue(Mathf.Clamp01(gauge.Value * max_gauge.Value));
 }