Esempio n. 1
0
 public void SetupInDanageView(LocalAvatarHealthMode mode)
 {
     if (mode != this._healthyMode)
     {
         this._healthyMode = mode;
         Sprite sprite = (this._healthyMode != LocalAvatarHealthMode.Healthy) ? this.unhealthyHPSprite : this.healthyHPSprite;
         foreach (MonoMaskSlider slider in this._sliders)
         {
             slider.transform.Find("Slider/Fill").GetComponent <Image>().sprite = sprite;
         }
     }
 }
Esempio n. 2
0
        public void Init()
        {
            this._sliders     = base.GetComponentsInChildren <MonoMaskSlider>();
            this._segmentNum  = this._sliders.Length;
            this._healthyMode = LocalAvatarHealthMode.Healthy;
            this._perRatio    = 1f / ((float)this._segmentNum);
            Material material = this._sliders[0].GetComponentInChildren <ImageForSmoothMask>().material;

            for (int i = 0; i < this._segmentNum; i++)
            {
                this._sliders[i].maxValue = 1f;
                this._sliders[i].GetComponent <Image>().material = material;
                this._sliders[i].GetComponentInChildren <ImageForSmoothMask>().material = material;
            }
        }