Skip to content

Commit 0e49eab

Browse files
committed
stash
1 parent 18a9a49 commit 0e49eab

3 files changed

Lines changed: 44 additions & 12 deletions

File tree

org.mixedrealitytoolkit.standardassets/Fonts/Selawik-Semibold-MRTKIcons.asset

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ MonoBehaviour:
104104
value: 60390
105105
- key: Icon 26
106106
value: 60227
107-
- key: Icon 25
108-
value: 59977
109107
- key: Icon 24
110108
value: 59846
111109
- key: Icon 23
@@ -148,8 +146,6 @@ MonoBehaviour:
148146
value: 62982
149147
- key: Play Circle
150148
value: 62984
151-
- key: Brightness
152-
value: 59456
153149
- key: Unpin
154150
value: 62980
155151
- key: Pin
@@ -196,16 +192,12 @@ MonoBehaviour:
196192
value: 59512
197193
- key: Movie
198194
value: 62810
199-
- key: Thumb Up
200-
value: 63518
201195
- key: Location On
202196
value: 62713
203197
- key: Refresh
204198
value: 61758
205199
- key: Location Off
206200
value: 59523
207-
- key: Thumb Down
208-
value: 63520
209201
- key: Videocam
210202
value: 63565
211203
- key: Undo
@@ -296,6 +288,16 @@ MonoBehaviour:
296288
value: 62318
297289
- key: Cut
298290
value: 62267
291+
- key: Icon 62700
292+
value: 62700
293+
- key: Thumb Down
294+
value: 63518
295+
- key: Thumb Up
296+
value: 63520
297+
- key: Brightness
298+
value: 59456
299+
- key: Save As
300+
value: 59977
299301
iconFontAsset: {fileID: 11400000, guid: 533bdd8d5c92b52448ee2ecf7bd828a4, type: 2}
300302
optionalEditorMaterial: {fileID: 0}
301303
fontIconSetDefinition: {fileID: 11400000, guid: e63daff880b56ed439a2e852b6e6993a, type: 2}

org.mixedrealitytoolkit.uxcore/Editor/Inspectors/FontIconSet/FontIconSelectorInspector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ private void OnEnable()
3939
/// </summary>
4040
public override void OnInspectorGUI()
4141
{
42+
serializedObject.Update();
43+
4244
if (!initializedStyle)
4345
{
4446
currentButtonStyle = new GUIStyle(GUI.skin.button);
@@ -57,6 +59,9 @@ public override void OnInspectorGUI()
5759
EditorGUILayout.PropertyField(tmProProp);
5860
EditorGUILayout.Space();
5961

62+
EditorGUILayout.PropertyField(serializedObject.FindProperty("migratedSuccessfully"));
63+
EditorGUILayout.Space();
64+
6065
if (fontIconsProp.objectReferenceValue == null)
6166
{
6267
EditorGUILayout.HelpBox(noFontIconsMessage, MessageType.Warning);

org.mixedrealitytoolkit.uxcore/FontIcons/FontIconSelector.cs

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private void Awake()
6666
{
6767
textMeshProComponent = GetComponent<TMP_Text>();
6868
}
69+
TryMigrate();
6970
SetIcon(currentIconName);
7071
}
7172

@@ -74,6 +75,7 @@ private void Awake()
7475
/// </summary>
7576
private void OnValidate()
7677
{
78+
//TryMigrate();
7779
SetIcon(currentIconName);
7880
}
7981

@@ -95,27 +97,50 @@ private void SetIcon(string newIconName)
9597
}
9698
}
9799

98-
void ISerializationCallbackReceiver.OnBeforeSerialize() { }
99-
100-
void ISerializationCallbackReceiver.OnAfterDeserialize()
100+
private void TryMigrate()
101101
{
102+
uint unicodeValue1 = FontIconSet.ConvertHexStringToUnicode(textMeshProComponent.text);
103+
Debug.Log($"============================================={unicodeValue1} | {migratedSuccessfully} | {currentIconName}");
104+
102105
if (!migratedSuccessfully && fontIcons != null && fontIcons.FontIconSetDefinition != null && textMeshProComponent != null)
103106
{
104107
uint unicodeValue = FontIconSet.ConvertHexStringToUnicode(textMeshProComponent.text);
108+
109+
if (currentIconName == "Icon 4")
110+
{
111+
Debug.Log($"============================================={unicodeValue}");
112+
}
113+
105114
foreach (KeyValuePair<string, uint> kv in fontIcons.GlyphIconsByName)
106115
{
116+
117+
107118
if (kv.Value == unicodeValue)
108119
{
109120
if (currentIconName != kv.Key)
110121
{
111122
Debug.Log($"[{nameof(FontIconSelector)}] Successfully migrated icon: \"{currentIconName}\" to \"{kv.Key}\"", this);
112-
currentIconName = kv.Key;
123+
CurrentIconName = kv.Key;
113124
migratedSuccessfully = true;
114125
}
126+
else
127+
{
128+
Debug.Log($"[{nameof(FontIconSelector)}] Tried to migrate icon: \"{unicodeValue}\" | \"{currentIconName}\"", this);
129+
}
115130
break;
116131
}
117132
}
118133
}
119134
}
135+
136+
void ISerializationCallbackReceiver.OnBeforeSerialize()
137+
{
138+
TryMigrate();
139+
}
140+
141+
void ISerializationCallbackReceiver.OnAfterDeserialize()
142+
{
143+
TryMigrate();
144+
}
120145
}
121146
}

0 commit comments

Comments
 (0)