无法在皮肤 'DarkSkin' 布局中找到样式“”

Unable to find style '' in skin 'DarkSkin' Layout

Unity 编辑器脚本抛出此警告,

Unable to find style '' in skin 'DarkSkin' Layout

...并导致编辑器上的样式为 'break'。

编辑脚本:

using UnityEditor;
using UnityEngine;

namespace ONCCK.PlayerModel
{
    [CustomEditor(typeof(PlayerModelMaker))]
    public class PlayerModelMakerEditor : Editor
    {
        private string _playerModelName;
        private string _playerModelDescription;

        public override void OnInspectorGUI()
        {
            PlayerModelMaker instance = (PlayerModelMaker)target;

            if (instance.PlayerModel == null)
                EditorGUILayout.HelpBox("Player model reference is null.", MessageType.Error);

            if (instance.HeadReference == null || instance.RightHandReference == null || instance.LeftHandReference == null)
                EditorGUILayout.HelpBox("Player model maker is not set up correctly!", MessageType.Error);

            // Descriptor
            EditorGUILayout.TextField("Player model name", _playerModelName);
            EditorGUILayout.TextArea("Player model description", _playerModelDescription); // Line 24. This is throwing the warning.

            base.OnInspectorGUI();

            EditorGUILayout.Space();

            // Buttons

            if (GUILayout.Button("Create avatar"))
                instance.Setup();

            if (GUILayout.Button("Align hands"))
                throw new System.NotImplementedException();
        }
    }
}

控制台输出:

TextArea 没有标签参数。你可以这样做

EditorGUILayout.BeginHorizontal();
EditorGUILayout.PrefixLabel("Player model description");
_playerModelDescription = EditorGUILayout.TextArea(_playerModelDescription);
EditorGUILayout.EndHorizontal();