Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.