Created
March 9, 2014 10:06
-
-
Save masa795/9445526 to your computer and use it in GitHub Desktop.
EditorWindow上に通知を表示する
This file contains hidden or 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 UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class WindowNotification : EditorWindow { | |
// Add menu item to the Window menu | |
[MenuItem ("Window/Window Notification")] | |
static void Init () { | |
// Get existing open window or if none, make a new one: | |
EditorWindow.GetWindow<WindowNotification> (false, "Window Notification"); | |
} | |
// Implement your own editor GUI here. | |
void OnGUI () { | |
if (GUILayout.Button("通知テスト", GUI.skin.button)) | |
{ | |
Texture tTexture = (Texture)AssetDatabase.LoadAssetAtPath("Assets/Editor/Img/vJEvWNuY.png", typeof(Texture2D)); | |
GUIContent guiContent = new GUIContent(); | |
guiContent.text = "通知内容を表示する!!"; | |
guiContent.image = tTexture; | |
this.ShowNotification(guiContent); | |
} | |
if (GUILayout.Button("通知 削除", GUI.skin.button)) | |
{ | |
this.RemoveNotification(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment