unity 编辑器扩展 Popup下拉菜单


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

public class EditorGUILayoutPopup : EditorWindow {


	public string[] options = new string[]{"cube","sphere","plane"};


	public int index = 0;

	[MenuItem("Examples/Editor GUILayout Popup usage")]
	static void Init()
	{
		EditorWindow window = GetWindow(typeof(EditorGUILayoutPopup));
		window.Show();
	}


	void OnGUI()
	{
		index = EditorGUILayout.Popup(index,options);


	}

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM