Created
March 15, 2019 01:14
-
-
Save neon-izm/a17b437f80d88baa199dd59722154813 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
/// <summary> | |
/// ポップアップしてメッセージをユーザに伝える | |
/// Debug.LogErrorは読んでもらえないがち…それはそう… | |
/// </summary> | |
public class PopupContentMessage : PopupWindowContent | |
{ | |
private string showmessage = "default message"; | |
/// <summary> | |
/// サイズを取得する | |
/// </summary> | |
public override Vector2 GetWindowSize() | |
{ | |
return new Vector2(300, 150); | |
} | |
/// <summary> | |
/// GUI描画 | |
/// </summary> | |
public override void OnGUI(Rect rect) | |
{ | |
GUIStyle centerbold = new GUIStyle() | |
{ | |
//alignment = TextAnchor.MiddleCenter, | |
//fontStyle = FontStyle.Bold, | |
wordWrap = true, | |
richText = true | |
}; | |
EditorGUILayout.LabelField(showmessage,centerbold); | |
//if (GUILayout.Button("OK")) | |
{ | |
} | |
} | |
public void SetMessage(string newContent) | |
{ | |
showmessage = newContent; | |
} | |
/// <summary> | |
/// 開いたときの処理 | |
/// </summary> | |
public override void OnOpen() | |
{ | |
} | |
/// <summary> | |
/// 閉じたときの処理 | |
/// </summary> | |
public override void OnClose() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
HogeBehaviour.cs