| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | namespace DCL.ECSComponents |
| | 4 | | { |
| | 5 | | public static class PBTextShape_Defaults |
| | 6 | | { |
| | 7 | | public static float GetFontSize(this PBTextShape self) |
| | 8 | | { |
| 22 | 9 | | return self.HasFontSize ? self.FontSize : 10.0f; |
| | 10 | | } |
| | 11 | |
|
| | 12 | | public static TextAlignMode GetTextAlign(this PBTextShape self) |
| | 13 | | { |
| 0 | 14 | | return self.HasTextAlign ? self.TextAlign : TextAlignMode.TamMiddleCenter; |
| | 15 | | } |
| | 16 | |
|
| | 17 | | public static float GetWidth(this PBTextShape self) |
| | 18 | | { |
| 4 | 19 | | return self.HasWidth ? self.Width : 1.0f; |
| | 20 | | } |
| | 21 | |
|
| | 22 | | public static float GetHeight(this PBTextShape self) |
| | 23 | | { |
| 4 | 24 | | return self.HasHeight ? self.Height : 1.0f; |
| | 25 | | } |
| | 26 | |
|
| | 27 | | public static Color3 GetShadowColor(this PBTextShape self) |
| | 28 | | { |
| 3 | 29 | | return self.ShadowColor ?? new Color3() { R = 1.0f, G = 1.0f, B = 1.0f }; |
| | 30 | | } |
| | 31 | |
|
| | 32 | | public static Color3 GetOutlineColor(this PBTextShape self) |
| | 33 | | { |
| 3 | 34 | | return self.OutlineColor ?? new Color3() { R = 1.0f, G = 1.0f, B = 1.0f }; |
| | 35 | | } |
| | 36 | |
|
| | 37 | | public static Color4 GetTextColor(this PBTextShape self) |
| | 38 | | { |
| 22 | 39 | | return self.TextColor ?? new Color4() { R = 1.0f, G = 1.0f, B = 1.0f, A = 1.0f}; |
| | 40 | | } |
| | 41 | |
|
| | 42 | | public static bool GetTextWrapping(this PBTextShape self) |
| | 43 | | { |
| 44 | 44 | | return self.HasTextWrapping && self.TextWrapping; |
| | 45 | | } |
| | 46 | |
|
| | 47 | | public static int GetLineCount(this PBTextShape self) |
| | 48 | | { |
| 23 | 49 | | return self.HasLineCount ? self.LineCount : 0; |
| | 50 | | } |
| | 51 | |
|
| | 52 | | public static bool GetFontAutoSize(this PBTextShape self) |
| | 53 | | { |
| 0 | 54 | | return self.HasFontAutoSize && self.FontAutoSize; |
| | 55 | | } |
| | 56 | |
|
| | 57 | | public static Vector4 GetPadding(this PBTextShape self) |
| | 58 | | { |
| 22 | 59 | | return new Vector4( |
| | 60 | | x: self.HasPaddingLeft ? self.PaddingLeft : 0, |
| | 61 | | y: self.HasPaddingTop ? self.PaddingTop : 0, |
| | 62 | | z: self.HasPaddingRight ? self.PaddingRight : 0, |
| | 63 | | w: self.HasPaddingBottom ? self.PaddingBottom : 0 |
| | 64 | | ); |
| | 65 | | } |
| | 66 | |
|
| | 67 | | public static float GetLineSpacing(this PBTextShape self) |
| | 68 | | { |
| 22 | 69 | | return self.HasLineSpacing ? self.LineSpacing : 0; |
| | 70 | | } |
| | 71 | |
|
| | 72 | | public static Font GetFont(this PBTextShape self) |
| | 73 | | { |
| 0 | 74 | | return self.HasFont ? self.Font : Font.FSansSerif; |
| | 75 | | } |
| | 76 | |
|
| | 77 | | public static float GetShadowOffsetX(this PBTextShape self) |
| | 78 | | { |
| 3 | 79 | | return self.HasShadowOffsetX ? self.ShadowOffsetX : 0; |
| | 80 | | } |
| | 81 | |
|
| | 82 | | public static float GetShadowOffsetY(this PBTextShape self) |
| | 83 | | { |
| 3 | 84 | | return self.HasShadowOffsetY ? self.ShadowOffsetY : 0; |
| | 85 | | } |
| | 86 | |
|
| | 87 | | public static float GetShadowBlur(this PBTextShape self) |
| | 88 | | { |
| 3 | 89 | | return self.HasShadowBlur ? self.ShadowBlur : 0; |
| | 90 | | } |
| | 91 | |
|
| | 92 | | public static float GetOutlineWidth(this PBTextShape self) |
| | 93 | | { |
| 3 | 94 | | return self.HasOutlineWidth ? self.OutlineWidth : 0; |
| | 95 | | } |
| | 96 | | } |
| | 97 | | } |