using UnityEngine;
using UnityEditor;
using System.Collections;
public class ryo_dir : EditorWindow
{
[MenuItem("ZCustom/ryo_direct",false, priority:1)]//메뉴생성
static void ShowWindow()
{
// 생성되어있는 윈도우를 가져온다. 없으면 새로 생성한다. 싱글턴 구조인듯하다
ryo_dir window = (ryo_dir)EditorWindow.GetWindow(typeof(ryo_dir));
}
public string ABB;
int BoxMaker=1;
Object GoObject = null;
Object SceneObject3 = null;
void OnGUI()
{
ABB = EditorGUI.TextField(new Rect(10,10,300,17), "글자써봐", ABB);
//버튼으로 오브젝트 실행
BoxMaker = EditorGUI.IntField(new Rect(10, 30, 300, 17), "게임오브젝트", BoxMaker);
if (GUI.Button(new Rect(100, 80, 80, 40), "BoxMaker"))
{
for (int i = 0; i < BoxMaker; i++)
{
GameObject obj = new GameObject();
obj.name = "GameObject" + i;
}
}
//버튼 위치보기
GUI.Button(new Rect(100, 140, 80, 40), "Button2"); // 가로위치,세로위치,박스세로, 박스가로
//버튼 띄우기
GUILayout.Space(200);
//오브젝트필드
GoObject = EditorGUILayout.ObjectField("오브젝트넣기", GoObject, typeof(GameObject));
//씬넣기
GUILayout.Space(5);
SceneObject3 = EditorGUILayout.ObjectField("씬넣기", SceneObject3, typeof(SceneAsset));
}
// 또하나의 탭만들기
[MenuItem("ZCustom/ryo_what2",false,priority:2)]
static void Twwoo()
{
}
}
이것저것 모아봤습니다.
'Unity > C#' 카테고리의 다른 글
Scene 재시작 (0) | 2020.11.21 |
---|---|
캐릭터 랜덤 모션 (0) | 2020.11.02 |
간단한 애니메이션 스크립트 (0) | 2020.09.08 |
C# 기초 기억창고 (0) | 2020.08.09 |
MiniPorfiler (0) | 2020.07.29 |