using UnityEditor; | |
using UnityEngine; | |
public class Question2_practical : EditorWindow | |
{ | |
[MenuItem("Window/Question2")] | |
static void OpenWindow() | |
{ | |
GetWindow<Question2>(); | |
} | |
private Texture2D texture; | |
private string username; | |
private int hp, atk, agi; | |
void OnGUI() | |
{ | |
EditorGUILayout.BeginHorizontal("box"); | |
EditorGUILayout.BeginVertical(); | |
username = EditorGUILayout.TextField("名前", username); | |
hp = EditorGUILayout.IntSlider("HP", hp, 0, 10); | |
atk = EditorGUILayout.IntSlider("力", atk, 0, 10); | |
agi = EditorGUILayout.IntSlider("すばやさ", agi, 0, 10); | |
EditorGUILayout.EndVertical(); | |
texture = (Texture2D)EditorGUILayout.ObjectField(texture, typeof(Texture2D), false, GUILayout.Width(64), GUILayout.Height(64)); | |
EditorGUILayout.EndHorizontal(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment