EditorGUIUtility.wideMode

作者:追风剑情 发布于:2019-6-15 20:11 分类:Unity3d

示例

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(Test))]
[CanEditMultipleObjects]
public class TestInspector : Editor
{
    protected Test mTest;
    protected virtual void OnEnable()
    {
        mTest = target as Test;
    }

    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        EditorGUIUtility.wideMode = true;//宽模式
        EditorGUILayout.Vector3Field("position", Vector3.zero);
        EditorGUILayout.Vector4Field("rotation", Vector4.zero);

        EditorGUIUtility.wideMode = false;
        EditorGUILayout.Vector3Field("position", Vector3.zero);
        EditorGUILayout.Vector4Field("rotation", Vector4.zero);
    }
}

效果

1111.png

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号