using UnityEngine;
using System.Collections;
using UnityEditor;
public class Windows : EditorWindow {
private GUIStyle stlye = new GUIStyle();
[MenuItem("遊戲控制器視窗/2D/RPG MAKER")]
static void Init() {
Windows window = (Windows)EditorWindow.GetWindow(typeof(Windows));
window.Show();
}
void OnGUI() {
// GUI 風格
stlye.fontSize = 18;
stlye.normal.textColor = Color.white;
// 背景圖片
EditorGUILayout.BeginHorizontal();
if (GUI.Button(new Rect(5, 30, 100, 30), GUIContent.none))
backGroundFunction();
GUILayout.BeginArea(new Rect(5, 30, 100, 30));
GUILayout.Label("背景圖片", stlye);
GUILayout.EndArea();
EditorGUILayout.EndHorizontal();
}
void backGroundFunction() {
GameObject backGround = new GameObject("背景圖片");
}
}
----------------------------
結果圖:
沒有留言:
張貼留言