Ejemplo n.º 1
0
        private void FeelingCheck <T>(SurvivalBookStats.DisplayElement elem, T value)
        {
            if (elem._feelingCheck)
            {
                float num  = 3.40282347E+38f;
                float num2 = Convert.ToSingle(value);
                switch (elem._feelingCalculationMethod)
                {
                case SurvivalBookStats.DisplayElement.FeelingCalculationMethods.One:
                    num = num2;
                    break;

                case SurvivalBookStats.DisplayElement.FeelingCalculationMethods.Inverse:
                    num = 1f - num2;
                    break;

                case SurvivalBookStats.DisplayElement.FeelingCalculationMethods.Over100:
                    num = num2 / 100f;
                    break;

                case SurvivalBookStats.DisplayElement.FeelingCalculationMethods.Over100Inverse:
                    num = 1f - num2 / 100f;
                    break;
                }
                if (num < 0.5f && num < this._currentFeelingAlpha)
                {
                    this._currentFeelingAlpha = num;
                    this._currentFeeling      = elem;
                }
            }
        }
Ejemplo n.º 2
0
 private void UpdateDisplay(SurvivalBookStats.DisplayElement elem, string value)
 {
     if (elem.StrVal != value)
     {
         elem.StrVal = value;
         if (elem._textMesh)
         {
             elem._textMesh.text = string.Format(elem.Format, elem.StrVal);
         }
     }
 }
Ejemplo n.º 3
0
 private void UpdateDisplay(SurvivalBookStats.DisplayElement elem, bool value)
 {
     if (elem._textMesh && elem._textMesh.gameObject.activeSelf != value)
     {
         elem._textMesh.gameObject.SetActive(value);
     }
     if (elem._go && elem._go.activeSelf != value)
     {
         elem._go.SetActive(value);
     }
 }
Ejemplo n.º 4
0
 private void UpdateDisplay(SurvivalBookStats.DisplayElement elem, int value)
 {
     if (elem.IntVal != value)
     {
         elem.IntVal = value;
         if (elem._textMesh)
         {
             elem._textMesh.text = string.Format(elem.Format, elem.IntVal);
         }
     }
     this.FeelingCheck <int>(elem, value);
 }
Ejemplo n.º 5
0
 private void FeelingCheck <T>(SurvivalBookStats.DisplayElement elem, T value)
 {
     if (elem._feelingCheck)
     {
         float fValue        = Convert.ToSingle(value);
         float modifiedFloat = this.GetModifiedFloat(elem._feelingCalculationMethod, fValue);
         if (modifiedFloat < 0.5f && modifiedFloat < this._currentFeelingAlpha)
         {
             this._currentFeelingAlpha = modifiedFloat;
             this._currentFeeling      = elem;
         }
     }
 }
Ejemplo n.º 6
0
 private void UpdateDisplay(SurvivalBookStats.DisplayElement elem, float value, float value2)
 {
     if (elem.FloatVal != value || elem.FloatVal2 != value2)
     {
         elem.FloatVal  = value;
         elem.FloatVal2 = value2;
         if (elem._textMesh)
         {
             elem._textMesh.text = string.Format(elem.Format, elem.FloatVal, elem.FloatVal2);
         }
     }
     this.FeelingCheck <float>(elem, value);
 }
Ejemplo n.º 7
0
 private void UpdateDisplay(SurvivalBookStats.DisplayElement elem, float value)
 {
     if (elem.FloatVal != value)
     {
         elem.FloatVal = value;
         if (elem._textMesh)
         {
             if (elem._clampValue)
             {
                 value = Mathf.Clamp01(elem.FloatVal);
             }
             elem._textMesh.text = string.Format(elem.Format, this.GetModifiedFloat(elem._percentCalculationMethod, value));
             if (elem._progressBar)
             {
                 elem._progressBar.localScale = new Vector3(this.GetModifiedFloat(elem._progressBarCalculationMethod, value), 1f, 1f);
             }
             if (elem._tilingRenderer)
             {
                 elem._tilingRenderer.material.SetVector("_MainTex_ST", new Vector4(this.GetModifiedFloat(elem._progressBarCalculationMethod, value), 1f, 1f, 1f));
             }
         }
     }
     this.FeelingCheck <float>(elem, value);
 }