PS:一些常用的GUILayout
DefinitionParameter
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class MyLayoutWindow : EditorWindow
{
[MenuItem("Tools/MyLayoutWindow")]
public static void Init()
{
EditorWindow window = GetWindow<MyLayoutWindow>();
window.Show();
}
#region 定义
//选择对象
GameObject Obj;
//Toggle控制(if)范围内的内容显示或隐藏
bool showBtn = true;
//创建密码字段并可视化在密码字段有什么键入
string text = "Some text here";//设定初始密码
bool showBtns = true;
//数字
int clones = 1;
//滑动条
float scale = 0.0f;
//弹出选择菜单
string[] options = { "Cube", "Sphere", "Plane" };
int index = 0;
//枚举弹出选择菜单
enum OPTIONS
{
CUBE = 0,
SPHERE = 1,
PLANE = 2
}
OPTIONS op = OPTIONS.CUBE;
//ToolBar工具栏
int m_SelectedPage = 0;
string[] m_ButtonStr = new string[4] { "Combine Animation", "Check Part", "Create RootMotion", "CheckunUsedPrefab" };
string[]m_ButtonSTR = new string[4]{"Combine Animation ."Check Part","Creat Rmotin"}
//坐标距离
float distance = 0;
Vector3 p1, p2, p3;
//路径