|
1 | 1 | |
| 2 | +using TMPro; |
2 | 3 | using UnityEngine; |
3 | 4 | using System.Reflection; |
4 | 5 | using System.IO; |
@@ -67,35 +68,48 @@ public void ApplyStyle() |
67 | 68 | if (markup.styleClass == UIStyleMarkup.StyleClass.TextHighlight) |
68 | 69 | { |
69 | 70 | InputField input = markup.GetComponent<InputField>(); |
| 71 | + TMP_InputField inputTmp = markup.GetComponent<TMP_InputField>(); |
| 72 | + VRCUrlInputField vrcInput = markup.GetComponent<VRCUrlInputField>(); |
70 | 73 |
|
71 | 74 | if (input != null) |
72 | 75 | { |
73 | 76 | Undo.RecordObject(input, "Apply UI Style"); |
74 | 77 | input.selectionColor = graphicColor; |
75 | 78 | RecordObject(input); |
76 | 79 | } |
77 | | - else |
| 80 | + else if (inputTmp != null) |
| 81 | + { |
| 82 | + Undo.RecordObject(inputTmp, "Apply UI Style"); |
| 83 | + inputTmp.selectionColor = graphicColor; |
| 84 | + RecordObject(inputTmp); |
| 85 | + } |
| 86 | + else if (vrcInput != null) |
78 | 87 | { |
79 | | - VRCUrlInputField vrcInput = markup.GetComponent<VRCUrlInputField>(); |
80 | 88 | Undo.RecordObject(vrcInput, "Apply UI Style"); |
81 | 89 | vrcInput.selectionColor = graphicColor; |
82 | 90 | RecordObject(vrcInput); |
83 | 91 | } |
84 | | - |
85 | 92 | } |
86 | 93 | else if (markup.styleClass == UIStyleMarkup.StyleClass.TextCaret) |
87 | 94 | { |
88 | 95 | InputField input = markup.GetComponent<InputField>(); |
| 96 | + TMP_InputField inputTmp = markup.GetComponent<TMP_InputField>(); |
| 97 | + VRCUrlInputField vrcInput = markup.GetComponent<VRCUrlInputField>(); |
89 | 98 |
|
90 | 99 | if (input != null) |
91 | 100 | { |
92 | 101 | Undo.RecordObject(input, "Apply UI Style"); |
93 | 102 | input.caretColor = graphicColor; |
94 | 103 | RecordObject(input); |
95 | 104 | } |
96 | | - else |
| 105 | + else if (inputTmp != null) |
| 106 | + { |
| 107 | + Undo.RecordObject(inputTmp, "Apply UI Style"); |
| 108 | + inputTmp.caretColor = graphicColor; |
| 109 | + RecordObject(inputTmp); |
| 110 | + } |
| 111 | + else if (vrcInput != null) |
97 | 112 | { |
98 | | - VRCUrlInputField vrcInput = markup.GetComponent<VRCUrlInputField>(); |
99 | 113 | Undo.RecordObject(vrcInput, "Apply UI Style"); |
100 | 114 | vrcInput.caretColor = graphicColor; |
101 | 115 | RecordObject(vrcInput); |
|
0 commit comments