9 [RequireComponent(typeof(CompoundButton))]
19 public bool DisableText {
24 if (disableText != value) {
31 [ShowIfBoolValue(
"DisableText",
false)]
35 if (TextMesh == null) {
41 TextMesh.text = value;
45 [ShowIfBoolValue(
"DisableText",
false)]
59 [ShowIfBoolValue(
"DisableText",
false)]
60 [Tooltip(
"Disregard the text style in the profile")]
61 public bool OverrideFontStyle =
false;
63 [ShowIfBoolValue(
"OverrideFontStyle")]
64 [ShowIfBoolValue(
"DisableText",
false)]
65 [Tooltip(
"Style to use for override.")]
68 [ShowIfBoolValue(
"DisableText",
false)]
69 [Tooltip(
"Disregard the anchor in the profile.")]
70 public bool OverrideAnchor =
false;
72 [ShowIfBoolValue(
"OverrideAnchor")]
73 [ShowIfBoolValue(
"DisableText",
false)]
74 [Tooltip(
"Anchor to use for override.")]
77 [ShowIfBoolValue(
"DisableText",
false)]
78 [Tooltip(
"Disregard the size in the profile.")]
79 public bool OverrideSize =
false;
81 [ShowIfBoolValue(
"OverrideSize")]
82 [ShowIfBoolValue(
"DisableText",
false)]
83 [Tooltip(
"Size to use for override.")]
86 [ShowIfBoolValue(
"DisableText",
false)]
87 [Tooltip(
"When true, no offset is applied to the text object.")]
88 public bool OverrideOffset =
false;
92 private float alpha = 1f;
96 private bool disableText =
false;
98 private void OnEnable()
103 private void UpdateStyle()
105 if (TextMesh == null)
107 Debug.LogWarning(
"Text mesh was null in CompoundButtonText " + name);
113 TextMesh.gameObject.SetActive(
false);
120 TextMesh.font = Profile.Font;
121 TextMesh.fontStyle = Profile.Style;
122 TextMesh.fontSize = OverrideSize ? Size : Profile.Size;
123 TextMesh.fontStyle = OverrideFontStyle ? Style : Profile.Style;
124 TextMesh.anchor = OverrideAnchor ? Anchor : Profile.Anchor;
125 TextMesh.alignment = Profile.Alignment;
126 Color c = Profile.Color;
133 TextMesh.transform.localPosition = Profile.GetOffset(TextMesh.anchor);
136 TextMesh.gameObject.SetActive(
true);
141 private void OnDrawGizmos ()
148 public class CustomEditor : MRTKEditor { }