Skip to content

Instantly share code, notes, and snippets.

@anchan828
Created October 2, 2013 09:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchan828/82b87f61389c52d4020a to your computer and use it in GitHub Desktop.
Save anchan828/82b87f61389c52d4020a to your computer and use it in GitHub Desktop.
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