StringAssetEditor.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
  2. #if UNITY_EDITOR
  3. using UnityEditor;
  4. namespace Animancer.Editor
  5. {
  6. /// <summary>[Editor-Only] A custom Inspector for <see cref="StringAsset"/>s.</summary>
  7. /// https://kybernetik.com.au/animancer/api/Animancer.Editor/StringAssetEditor
  8. [CustomEditor(typeof(StringAsset), true)]
  9. public class StringAssetEditor : UnityEditor.Editor
  10. {
  11. /************************************************************************************************************************/
  12. private const string InfoMessage = "This is a String Asset." +
  13. "\n\nThe name of this asset is what differentiates it from others" +
  14. " so it should be unique to avoid conflicts." +
  15. "\n\nThe Editor Comment field isn't used for anything and is excluded from runtime builds." +
  16. " It's recommended to explain what you're using this key for.";
  17. /************************************************************************************************************************/
  18. /// <inheritdoc/>
  19. public override void OnInspectorGUI()
  20. {
  21. EditorGUILayout.HelpBox(InfoMessage, MessageType.Info);
  22. DrawDefaultInspector();
  23. }
  24. /************************************************************************************************************************/
  25. }
  26. }
  27. #endif