Vector2 but with bools.
More...
|
| CUIBool2 (bool x=false, bool y=false) |
|
override string | ToString () |
|
Vector2 but with bools.
Definition at line 16 of file CUIBool2.cs.
◆ CUIBool2()
CrabUI.CUIBool2.CUIBool2 |
( |
bool | x = false, |
|
|
bool | y = false ) |
Definition at line 21 of file CUIBool2.cs.
22 {
23 X = x;
24 Y = y;
25 }
◆ Parse()
static CUIBool2 CrabUI.CUIBool2.Parse |
( |
string | s | ) |
|
|
static |
Definition at line 28 of file CUIBool2.cs.
29 {
30 string content = s.Substring(
31 s.IndexOf('[') + 1,
32 s.IndexOf(']') - s.IndexOf('[') - 1
33 );
34
35 var components = content.Split(',').Select(a => a.Trim());
36
37 string sx = components.ElementAtOrDefault(0);
38 string sy = components.ElementAtOrDefault(1);
39
40 bool x = false;
41 bool y = false;
42
43 if (sx != null && sx != "") x = bool.Parse(sx);
44 if (sy != null && sy != "") y = bool.Parse(sy);
45
46 return new CUIBool2(x, y);
47 }
The documentation for this struct was generated from the following file: