Skip to content

Instantly share code, notes, and snippets.

@masa795
Created March 9, 2014 10:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masa795/9445526 to your computer and use it in GitHub Desktop.
Save masa795/9445526 to your computer and use it in GitHub Desktop.
EditorWindow上に通知を表示する
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