Esempio n. 1
0
 internal SearchValue(SearchColor color)
 {
     this.type   = ValueType.Color;
     this.number = float.NaN;
     this.text   = null;
     this.color  = color;
 }
Esempio n. 2
0
 public SearchValue(Color color)
 {
     this.type   = ValueType.Color;
     this.number = float.NaN;
     this.text   = null;
     this.color  = new SearchColor(color);
 }
Esempio n. 3
0
 public SearchValue(string text)
 {
     this.type   = ValueType.Text;
     this.number = float.NaN;
     this.text   = text;
     this.color  = default;
 }
Esempio n. 4
0
 public SearchValue(double number)
 {
     this.type   = ValueType.Number;
     this.number = number;
     this.text   = null;
     this.color  = default;
 }
Esempio n. 5
0
 public SearchValue(float number)
 {
     this.type   = ValueType.Number;
     this.number = Convert.ToDouble(number);
     this.text   = null;
     this.color  = default;
 }
Esempio n. 6
0
 public SearchValue(bool v)
 {
     this.type   = ValueType.Bool;
     this.number = v ? 1d : 0f;
     this.text   = null;
     this.color  = default;
 }
 internal SearchValue(UnityEngine.Object obj)
 {
     this.type   = ValueType.Object;
     this.text   = SearchUtils.GetObjectPath(obj);
     this.number = float.NaN;
     this.color  = default;
     this.v4     = default;
 }
 internal SearchValue(Vector4 v, int dim)
 {
     this.type   = dim == 2 ? ValueType.Vector2 : (dim == 3 ? ValueType.Vector3 : ValueType.Vector4);
     this.number = float.NaN;
     this.text   = null;
     this.color  = default;
     this.v4     = v;
 }
Esempio n. 9
0
 public SearchValue(object v)
 {
     if (v == null)
     {
         this.type   = ValueType.Nil;
         this.number = float.NaN;
         this.text   = null;
         this.color  = default;
     }
     else if (v is bool b)
     {
         this.type   = ValueType.Bool;
         this.number = b ? 1 : 0;
         this.text   = null;
         this.color  = default;
     }
     else if (v is string s)
     {
         this.type   = ValueType.Text;
         this.number = float.NaN;
         this.text   = s;
         this.color  = default;
     }
     else if (v is Color c)
     {
         this.type   = ValueType.Color;
         this.number = float.NaN;
         this.text   = null;
         this.color  = new SearchColor(c);
     }
     else if (Utils.TryGetNumber(v, out var d))
     {
         this.type   = ValueType.Number;
         this.number = (float)d;
         this.text   = null;
         this.color  = default;
     }
     else
     {
         this.type   = ValueType.Text;
         this.number = float.NaN;
         this.text   = v.ToString();
         this.color  = default;
     }
 }