Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class CustomWindow : EditorWindow
string charaName = "Animations";
static void Open()
EditorWindow.GetWindow<CustomWindow>("Custom window");
void OnGUI()
printCustomLabel("パラメータ設定", Color.white,, 18);
savePath = EditorGUILayout.TextField("名前", savePath);
if (GUILayout.Button("生成"))
void printCustomLabel(string text, Color textColor, Color backColor, int fontSize, FontStyle fontStyle = FontStyle.Bold)
Color beforeBackColor = GUI.backgroundColor;
GUIStyle guiStyle = new GUIStyle();
GUIStyleState styleState = new GUIStyleState();
styleState.textColor = textColor;
styleState.background = Texture2D.whiteTexture;
GUI.backgroundColor = backColor;
guiStyle.normal = styleState;
guiStyle.fontSize = fontSize;
GUILayout.Label(text, guiStyle); //labelFieldだとうまくいかない?
GUI.backgroundColor = beforeBackColor;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment