설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TMP_BaseHDRPLitShaderGUI.cs 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. #if HDRP_10_7_OR_NEWER
  2. using UnityEngine;
  3. using UnityEditor;
  4. using UnityEditor.Rendering.HighDefinition;
  5. namespace TMPro.EditorUtilities
  6. {
  7. /// <summary>Base class for TextMesh Pro shader GUIs.</summary>
  8. internal abstract class TMP_BaseHDRPLitShaderGUI : LightingShaderGraphGUI
  9. {
  10. /// <summary>Representation of a #pragma shader_feature.</summary>
  11. /// <description>It is assumed that the first feature option is for no keyword (underscores).</description>
  12. protected class ShaderFeature
  13. {
  14. public string undoLabel;
  15. public GUIContent label;
  16. /// <summary>The keyword labels, for display. Include the no-keyword as the first option.</summary>
  17. public GUIContent[] keywordLabels;
  18. /// <summary>The shader keywords. Exclude the no-keyword option.</summary>
  19. public string[] keywords;
  20. int m_State;
  21. public bool Active
  22. {
  23. get { return m_State >= 0; }
  24. }
  25. public int State
  26. {
  27. get { return m_State; }
  28. }
  29. public void ReadState(Material material)
  30. {
  31. for (int i = 0; i < keywords.Length; i++)
  32. {
  33. if (material.IsKeywordEnabled(keywords[i]))
  34. {
  35. m_State = i;
  36. return;
  37. }
  38. }
  39. m_State = -1;
  40. }
  41. public void SetActive(bool active, Material material)
  42. {
  43. m_State = active ? 0 : -1;
  44. SetStateKeywords(material);
  45. }
  46. public void DoPopup(MaterialEditor editor, Material material)
  47. {
  48. EditorGUI.BeginChangeCheck();
  49. int selection = EditorGUILayout.Popup(label, m_State + 1, keywordLabels);
  50. if (EditorGUI.EndChangeCheck())
  51. {
  52. m_State = selection - 1;
  53. editor.RegisterPropertyChangeUndo(undoLabel);
  54. SetStateKeywords(material);
  55. }
  56. }
  57. void SetStateKeywords(Material material)
  58. {
  59. for (int i = 0; i < keywords.Length; i++)
  60. {
  61. if (i == m_State)
  62. {
  63. material.EnableKeyword(keywords[i]);
  64. }
  65. else
  66. {
  67. material.DisableKeyword(keywords[i]);
  68. }
  69. }
  70. }
  71. }
  72. static GUIContent s_TempLabel = new GUIContent();
  73. protected static bool s_DebugExtended;
  74. static int s_UndoRedoCount, s_LastSeenUndoRedoCount;
  75. static float[][] s_TempFloats =
  76. {
  77. null, new float[1], new float[2], new float[3], new float[4]
  78. };
  79. protected static GUIContent[] s_XywhVectorLabels =
  80. {
  81. new GUIContent("X"),
  82. new GUIContent("Y"),
  83. new GUIContent("W", "Width"),
  84. new GUIContent("H", "Height")
  85. };
  86. protected static GUIContent[] s_LbrtVectorLabels =
  87. {
  88. new GUIContent("L", "Left"),
  89. new GUIContent("B", "Bottom"),
  90. new GUIContent("R", "Right"),
  91. new GUIContent("T", "Top")
  92. };
  93. protected static GUIContent[] s_CullingTypeLabels =
  94. {
  95. new GUIContent("Off"),
  96. new GUIContent("Front"),
  97. new GUIContent("Back")
  98. };
  99. static TMP_BaseHDRPLitShaderGUI()
  100. {
  101. // Keep track of how many undo/redo events happened.
  102. Undo.undoRedoPerformed += () => s_UndoRedoCount += 1;
  103. }
  104. bool m_IsNewGUI = true;
  105. float m_DragAndDropMinY;
  106. protected MaterialEditor m_Editor;
  107. protected Material m_Material;
  108. protected MaterialProperty[] m_Properties;
  109. void PrepareGUI()
  110. {
  111. m_IsNewGUI = false;
  112. ShaderUtilities.GetShaderPropertyIDs();
  113. // New GUI just got constructed. This happens in response to a selection,
  114. // but also after undo/redo events.
  115. if (s_LastSeenUndoRedoCount != s_UndoRedoCount)
  116. {
  117. // There's been at least one undo/redo since the last time this GUI got constructed.
  118. // Maybe the undo/redo was for this material? Assume that is was.
  119. TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material);
  120. }
  121. s_LastSeenUndoRedoCount = s_UndoRedoCount;
  122. }
  123. protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
  124. {
  125. m_Editor = materialEditor;
  126. m_Material = materialEditor.target as Material;
  127. this.m_Properties = properties;
  128. if (m_IsNewGUI)
  129. {
  130. PrepareGUI();
  131. }
  132. DoDragAndDropBegin();
  133. EditorGUI.BeginChangeCheck();
  134. DoGUI();
  135. if (EditorGUI.EndChangeCheck())
  136. {
  137. TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
  138. }
  139. DoDragAndDropEnd();
  140. }
  141. /// <summary>Override this method to create the specific shader GUI.</summary>
  142. protected abstract void DoGUI();
  143. static string[] s_PanelStateLabel = new string[] { "\t- <i>Click to collapse</i> -", "\t- <i>Click to expand</i> -" };
  144. protected bool BeginPanel(string panel, bool expanded)
  145. {
  146. EditorGUI.indentLevel = 0;
  147. EditorGUILayout.BeginVertical(EditorStyles.helpBox);
  148. Rect r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 18));
  149. r.x += 20;
  150. r.width += 6;
  151. bool enabled = GUI.enabled;
  152. GUI.enabled = true;
  153. expanded = TMP_EditorUtility.EditorToggle(r, expanded, new GUIContent(panel), TMP_UIStyleManager.panelTitle);
  154. r.width -= 30;
  155. EditorGUI.LabelField(r, new GUIContent(expanded ? s_PanelStateLabel[0] : s_PanelStateLabel[1]), TMP_UIStyleManager.rightLabel);
  156. GUI.enabled = enabled;
  157. EditorGUI.indentLevel += 1;
  158. EditorGUI.BeginDisabledGroup(false);
  159. return expanded;
  160. }
  161. protected bool BeginPanel(string panel, ShaderFeature feature, bool expanded, bool readState = true)
  162. {
  163. EditorGUI.indentLevel = 0;
  164. if (readState)
  165. {
  166. feature.ReadState(m_Material);
  167. }
  168. EditorGUI.BeginChangeCheck();
  169. EditorGUILayout.BeginVertical(EditorStyles.helpBox);
  170. GUILayout.BeginHorizontal();
  171. Rect r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 20, GUILayout.Width(20f)));
  172. bool active = EditorGUI.Toggle(r, feature.Active);
  173. if (EditorGUI.EndChangeCheck())
  174. {
  175. m_Editor.RegisterPropertyChangeUndo(feature.undoLabel);
  176. feature.SetActive(active, m_Material);
  177. }
  178. r = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20, 18));
  179. r.width += 6;
  180. bool enabled = GUI.enabled;
  181. GUI.enabled = true;
  182. expanded = TMP_EditorUtility.EditorToggle(r, expanded, new GUIContent(panel), TMP_UIStyleManager.panelTitle);
  183. r.width -= 10;
  184. EditorGUI.LabelField(r, new GUIContent(expanded ? s_PanelStateLabel[0] : s_PanelStateLabel[1]), TMP_UIStyleManager.rightLabel);
  185. GUI.enabled = enabled;
  186. GUILayout.EndHorizontal();
  187. EditorGUI.indentLevel += 1;
  188. EditorGUI.BeginDisabledGroup(!active);
  189. return expanded;
  190. }
  191. protected void EndPanel()
  192. {
  193. EditorGUI.EndDisabledGroup();
  194. EditorGUI.indentLevel -= 1;
  195. EditorGUILayout.EndVertical();
  196. }
  197. MaterialProperty BeginProperty(string name)
  198. {
  199. MaterialProperty property = FindProperty(name, m_Properties);
  200. EditorGUI.BeginChangeCheck();
  201. EditorGUI.showMixedValue = property.hasMixedValue;
  202. m_Editor.BeginAnimatedCheck(Rect.zero, property);
  203. return property;
  204. }
  205. bool EndProperty()
  206. {
  207. m_Editor.EndAnimatedCheck();
  208. EditorGUI.showMixedValue = false;
  209. return EditorGUI.EndChangeCheck();
  210. }
  211. protected void DoPopup(string name, string label, GUIContent[] options)
  212. {
  213. MaterialProperty property = BeginProperty(name);
  214. s_TempLabel.text = label;
  215. int index = EditorGUILayout.Popup(s_TempLabel, (int)property.floatValue, options);
  216. if (EndProperty())
  217. {
  218. property.floatValue = index;
  219. }
  220. }
  221. protected void DoCubeMap(string name, string label)
  222. {
  223. DoTexture(name, label, typeof(Cubemap));
  224. }
  225. protected void DoTexture2D(string name, string label, bool withTilingOffset = false, string[] speedNames = null)
  226. {
  227. DoTexture(name, label, typeof(Texture2D), withTilingOffset, speedNames);
  228. }
  229. void DoTexture(string name, string label, System.Type type, bool withTilingOffset = false, string[] speedNames = null)
  230. {
  231. float objFieldSize = 60f;
  232. bool smallLayout = EditorGUIUtility.currentViewWidth <= 440f && (withTilingOffset || speedNames != null);
  233. float controlHeight = smallLayout ? objFieldSize * 2 : objFieldSize;
  234. MaterialProperty property = FindProperty(name, m_Properties);
  235. m_Editor.BeginAnimatedCheck(Rect.zero, property);
  236. Rect rect = EditorGUILayout.GetControlRect(true, controlHeight);
  237. float totalWidth = rect.width;
  238. rect.width = EditorGUIUtility.labelWidth + objFieldSize;
  239. rect.height = objFieldSize;
  240. s_TempLabel.text = label;
  241. EditorGUI.BeginChangeCheck();
  242. Object tex = EditorGUI.ObjectField(rect, s_TempLabel, property.textureValue, type, false);
  243. if (EditorGUI.EndChangeCheck())
  244. {
  245. property.textureValue = tex as Texture;
  246. }
  247. float additionalHeight = controlHeight - objFieldSize;
  248. float xOffset = smallLayout ? rect.width - objFieldSize : rect.width;
  249. rect.y += additionalHeight;
  250. rect.x += xOffset;
  251. rect.width = totalWidth - xOffset;
  252. rect.height = EditorGUIUtility.singleLineHeight;
  253. if (withTilingOffset)
  254. {
  255. DoTilingOffset(rect, property);
  256. rect.y += (rect.height + 2f) * 2f;
  257. }
  258. m_Editor.EndAnimatedCheck();
  259. if (speedNames != null)
  260. {
  261. DoUVSpeed(rect, speedNames);
  262. }
  263. }
  264. void DoTilingOffset(Rect rect, MaterialProperty property)
  265. {
  266. float labelWidth = EditorGUIUtility.labelWidth;
  267. int indentLevel = EditorGUI.indentLevel;
  268. EditorGUI.indentLevel = 0;
  269. EditorGUIUtility.labelWidth = Mathf.Min(40f, rect.width * 0.40f);
  270. Vector4 vector = property.textureScaleAndOffset;
  271. bool changed = false;
  272. float[] values = s_TempFloats[2];
  273. s_TempLabel.text = "Tiling";
  274. Rect vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel);
  275. values[0] = vector.x;
  276. values[1] = vector.y;
  277. EditorGUI.BeginChangeCheck();
  278. EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values);
  279. if (EditorGUI.EndChangeCheck())
  280. {
  281. vector.x = values[0];
  282. vector.y = values[1];
  283. changed = true;
  284. }
  285. rect.y += rect.height + 2f;
  286. s_TempLabel.text = "Offset";
  287. vectorRect = EditorGUI.PrefixLabel(rect, s_TempLabel);
  288. values[0] = vector.z;
  289. values[1] = vector.w;
  290. EditorGUI.BeginChangeCheck();
  291. EditorGUI.MultiFloatField(vectorRect, s_XywhVectorLabels, values);
  292. if (EditorGUI.EndChangeCheck())
  293. {
  294. vector.z = values[0];
  295. vector.w = values[1];
  296. changed = true;
  297. }
  298. if (changed)
  299. {
  300. property.textureScaleAndOffset = vector;
  301. }
  302. EditorGUIUtility.labelWidth = labelWidth;
  303. EditorGUI.indentLevel = indentLevel;
  304. }
  305. void DoUVSpeed(Rect rect, string[] names)
  306. {
  307. float labelWidth = EditorGUIUtility.labelWidth;
  308. int indentLevel = EditorGUI.indentLevel;
  309. EditorGUI.indentLevel = 0;
  310. EditorGUIUtility.labelWidth = Mathf.Min(40f, rect.width * 0.40f);
  311. s_TempLabel.text = "Speed";
  312. rect = EditorGUI.PrefixLabel(rect, s_TempLabel);
  313. EditorGUIUtility.labelWidth = 10f;
  314. rect.width = rect.width * 0.5f - 2f;
  315. if (names.Length == 1)
  316. {
  317. DoFloat2(rect, names[0]);
  318. }
  319. else
  320. {
  321. DoFloat(rect, names[0], "X");
  322. rect.x += rect.width + 4f;
  323. DoFloat(rect, names[1], "Y");
  324. }
  325. EditorGUIUtility.labelWidth = labelWidth;
  326. EditorGUI.indentLevel = indentLevel;
  327. }
  328. protected void DoToggle(string name, string label)
  329. {
  330. MaterialProperty property = BeginProperty(name);
  331. s_TempLabel.text = label;
  332. bool value = EditorGUILayout.Toggle(s_TempLabel, property.floatValue == 1f);
  333. if (EndProperty())
  334. {
  335. property.floatValue = value ? 1f : 0f;
  336. }
  337. }
  338. protected void DoFloat(string name, string label)
  339. {
  340. MaterialProperty property = BeginProperty(name);
  341. Rect rect = EditorGUILayout.GetControlRect();
  342. rect.width = EditorGUIUtility.labelWidth + 55f;
  343. s_TempLabel.text = label;
  344. float value = EditorGUI.FloatField(rect, s_TempLabel, property.floatValue);
  345. if (EndProperty())
  346. {
  347. property.floatValue = value;
  348. }
  349. }
  350. protected void DoColor(string name, string label)
  351. {
  352. MaterialProperty property = BeginProperty(name);
  353. s_TempLabel.text = label;
  354. Color value = EditorGUI.ColorField(EditorGUILayout.GetControlRect(), s_TempLabel, property.colorValue, false, true, true);
  355. if (EndProperty())
  356. {
  357. property.colorValue = value;
  358. }
  359. }
  360. void DoFloat(Rect rect, string name, string label)
  361. {
  362. MaterialProperty property = BeginProperty(name);
  363. s_TempLabel.text = label;
  364. float value = EditorGUI.FloatField(rect, s_TempLabel, property.floatValue);
  365. if (EndProperty())
  366. {
  367. property.floatValue = value;
  368. }
  369. }
  370. void DoFloat2(Rect rect, string name)
  371. {
  372. MaterialProperty property = BeginProperty(name);
  373. float x = EditorGUI.FloatField(rect, "X", property.vectorValue.x);
  374. rect.x += rect.width + 4f;
  375. float y = EditorGUI.FloatField(rect, "Y", property.vectorValue.y);
  376. if (EndProperty())
  377. {
  378. property.vectorValue = new Vector2(x, y);
  379. }
  380. }
  381. protected void DoOffset(string name, string label)
  382. {
  383. MaterialProperty property = BeginProperty(name);
  384. s_TempLabel.text = label;
  385. Vector2 value = EditorGUI.Vector2Field(EditorGUILayout.GetControlRect(), s_TempLabel, property.vectorValue);
  386. if (EndProperty())
  387. {
  388. property.vectorValue = value;
  389. }
  390. }
  391. protected void DoSlider(string name, string label)
  392. {
  393. MaterialProperty property = BeginProperty(name);
  394. Vector2 range = property.rangeLimits;
  395. s_TempLabel.text = label;
  396. float value = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, property.floatValue, range.x, range.y);
  397. if (EndProperty())
  398. {
  399. property.floatValue = value;
  400. }
  401. }
  402. protected void DoSlider(string name, Vector2 range, string label)
  403. {
  404. MaterialProperty property = BeginProperty(name);
  405. s_TempLabel.text = label;
  406. float value = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, property.floatValue, range.x, range.y);
  407. if (EndProperty())
  408. {
  409. property.floatValue = value;
  410. }
  411. }
  412. protected void DoSlider(string propertyName, string propertyField, string label)
  413. {
  414. MaterialProperty property = BeginProperty(propertyName);
  415. Vector2 range = property.rangeLimits;
  416. s_TempLabel.text = label;
  417. Vector4 value = property.vectorValue;
  418. switch (propertyField)
  419. {
  420. case "X":
  421. value.x = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.x, range.x, range.y);
  422. break;
  423. case "Y":
  424. value.y = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.y, range.x, range.y);
  425. break;
  426. case "Z":
  427. value.z = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.z, range.x, range.y);
  428. break;
  429. case "W":
  430. value.w = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.w, range.x, range.y);
  431. break;
  432. }
  433. if (EndProperty())
  434. {
  435. property.vectorValue = value;
  436. }
  437. }
  438. protected void DoSlider(string propertyName, string propertyField, Vector2 range, string label)
  439. {
  440. MaterialProperty property = BeginProperty(propertyName);
  441. s_TempLabel.text = label;
  442. Vector4 value = property.vectorValue;
  443. switch (propertyField)
  444. {
  445. case "X":
  446. value.x = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.x, range.x, range.y);
  447. break;
  448. case "Y":
  449. value.y = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.y, range.x, range.y);
  450. break;
  451. case "Z":
  452. value.z = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.z, range.x, range.y);
  453. break;
  454. case "W":
  455. value.w = EditorGUI.Slider(EditorGUILayout.GetControlRect(), s_TempLabel, value.w, range.x, range.y);
  456. break;
  457. }
  458. if (EndProperty())
  459. {
  460. property.vectorValue = value;
  461. }
  462. }
  463. protected void DoVector2(string name, string label)
  464. {
  465. MaterialProperty property = BeginProperty(name);
  466. s_TempLabel.text = label;
  467. Vector4 value = EditorGUILayout.Vector3Field(s_TempLabel, property.vectorValue);
  468. if (EndProperty())
  469. {
  470. property.vectorValue = value;
  471. }
  472. }
  473. protected void DoVector3(string name, string label)
  474. {
  475. MaterialProperty property = BeginProperty(name);
  476. s_TempLabel.text = label;
  477. Vector4 value = EditorGUILayout.Vector3Field(s_TempLabel, property.vectorValue);
  478. if (EndProperty())
  479. {
  480. property.vectorValue = value;
  481. }
  482. }
  483. protected void DoVector(string name, string label, GUIContent[] subLabels)
  484. {
  485. MaterialProperty property = BeginProperty(name);
  486. Rect rect = EditorGUILayout.GetControlRect();
  487. s_TempLabel.text = label;
  488. rect = EditorGUI.PrefixLabel(rect, s_TempLabel);
  489. Vector4 vector = property.vectorValue;
  490. float[] values = s_TempFloats[subLabels.Length];
  491. for (int i = 0; i < subLabels.Length; i++)
  492. {
  493. values[i] = vector[i];
  494. }
  495. EditorGUI.MultiFloatField(rect, subLabels, values);
  496. if (EndProperty())
  497. {
  498. for (int i = 0; i < subLabels.Length; i++)
  499. {
  500. vector[i] = values[i];
  501. }
  502. property.vectorValue = vector;
  503. }
  504. }
  505. void DoDragAndDropBegin()
  506. {
  507. m_DragAndDropMinY = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true)).y;
  508. }
  509. void DoDragAndDropEnd()
  510. {
  511. Rect rect = GUILayoutUtility.GetRect(0f, 0f, GUILayout.ExpandWidth(true));
  512. Event evt = Event.current;
  513. if (evt.type == EventType.DragUpdated)
  514. {
  515. DragAndDrop.visualMode = DragAndDropVisualMode.Generic;
  516. evt.Use();
  517. }
  518. else if (
  519. evt.type == EventType.DragPerform &&
  520. Rect.MinMaxRect(rect.xMin, m_DragAndDropMinY, rect.xMax, rect.yMax).Contains(evt.mousePosition)
  521. )
  522. {
  523. DragAndDrop.AcceptDrag();
  524. evt.Use();
  525. Material droppedMaterial = DragAndDrop.objectReferences[0] as Material;
  526. if (droppedMaterial && droppedMaterial != m_Material)
  527. {
  528. PerformDrop(droppedMaterial);
  529. }
  530. }
  531. }
  532. void PerformDrop(Material droppedMaterial)
  533. {
  534. Texture droppedTex = droppedMaterial.GetTexture(ShaderUtilities.ID_MainTex);
  535. if (!droppedTex)
  536. {
  537. return;
  538. }
  539. Texture currentTex = m_Material.GetTexture(ShaderUtilities.ID_MainTex);
  540. TMP_FontAsset requiredFontAsset = null;
  541. if (droppedTex != currentTex)
  542. {
  543. requiredFontAsset = TMP_EditorUtility.FindMatchingFontAsset(droppedMaterial);
  544. if (!requiredFontAsset)
  545. {
  546. return;
  547. }
  548. }
  549. foreach (GameObject o in Selection.gameObjects)
  550. {
  551. if (requiredFontAsset)
  552. {
  553. TMP_Text textComponent = o.GetComponent<TMP_Text>();
  554. if (textComponent)
  555. {
  556. Undo.RecordObject(textComponent, "Font Asset Change");
  557. textComponent.font = requiredFontAsset;
  558. }
  559. }
  560. TMPro_EventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial);
  561. EditorUtility.SetDirty(o);
  562. }
  563. }
  564. }
  565. }
  566. #endif