Beispiel #1
0
 /// <summary>
 /// Draws a progress bar for a decimal property.
 /// </summary>
 protected override decimal DrawProgressBar(Rect rect, GUIContent label, decimal value, ProgressBarAttribute attribute, ProgressBarConfig config, string valueLabel)
 {
     if (attribute.Segmented)
     {
         return((decimal)SirenixEditorFields.SegmentedProgressBarField(rect, label, (long)value, (long)attribute.Min, (long)attribute.Max, config, valueLabel));
     }
     else
     {
         return((decimal)SirenixEditorFields.ProgressBarField(rect, label, (double)value, attribute.Min, attribute.Max, config, valueLabel));
     }
 }
Beispiel #2
0
 /// <summary>
 /// Draws a progress bar for a decimal property.
 /// </summary>
 protected override decimal DrawProgressBar(Rect rect, GUIContent label, double min, double max, ProgressBarConfig config, string valueLabel)
 {
     if (this.Attribute.Segmented)
     {
         return((decimal)SirenixEditorFields.SegmentedProgressBarField(rect, label, (long)this.ValueEntry.SmartValue, (long)min, (long)max, config, valueLabel));
     }
     else
     {
         return((decimal)SirenixEditorFields.ProgressBarField(rect, label, (double)this.ValueEntry.SmartValue, min, max, config, valueLabel));
     }
 }
Beispiel #3
0
    private float Bar(float value, GUIContent content)
    {
        Rect rect = EditorGUILayout.GetControlRect();

        ProgressBarConfig config = new ProgressBarConfig();

        config.Height          = Convert.ToInt16(rect.height);
        config.ForegroundColor = GetHealthBarColor(CurrentHealth);


        return((float)SirenixEditorFields.ProgressBarField(rect, CurrentHealth, 0, MaxHealth, config));
    }