Hide
Rate

A rating stars tool for an int field.

Parameters:

  • int min minimum value of the rating. Must be equal to or greater than 0.

    When it's equal to 0, it'll draw a red slashed star to select 0.

    When it's greater than 0, it will draw min number of fixed stars that you can not un-rate.

  • int max maximum value of the rating. Must be greater than min.

  • Allow Multiple: No

using SaintsField; [Rate(0, 5)] public int rate0To5; [Rate(1, 5)] public int rate1To5; [Rate(3, 5)] public int rate3To5;

It works with ShowInInspector:

[ShowInInspector, Rate(0, 5)] public int ShowRate0To5 { get => rate0To5; set => rate0To5 = value; }

It works with ShowInInspector/Button parameters and return value:

[ShowInInspector] [Rate(1, 5)] private int ShowRate([Rate(0, 5)] int rate) => rate; [Button] [Rate(1, 5)] private int ShowRate([Rate(0, 5)] int rate) => rate;