Last active
September 3, 2019 16:30
-
-
Save mao-test-h/1c90b5d8712e523c6eabfdb704363c4c to your computer and use it in GitHub Desktop.
阿部寛のホームページを表示するためのEditor拡張 ※Unity2017.2.0p1で動作確認
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 System.Reflection; | |
using UnityEditor; | |
/// <summary> | |
/// 阿部寛のホームページを表示するためのEditor拡張 | |
/// </summary> | |
public static class AbeHirosh_HP_Window | |
{ | |
[MenuItem(@"Window/阿部寛のホームページ")] | |
static void Open() | |
{ | |
var type = Assembly.Load("UnityEditor.dll").GetType("UnityEditor.Web.WebViewEditorWindowTabs"); | |
var methodInfo = type.GetMethod("Create", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy); | |
methodInfo = methodInfo.MakeGenericMethod(type); | |
string title = "阿部寛のホームページ"; | |
string sourcePath = @"http://abehiroshi.la.coocan.jp/"; | |
int minWidth, minHeight, maxWidth, maxHeight; | |
minWidth = maxWidth = 1280; | |
minHeight = maxHeight = 720; | |
methodInfo.Invoke(null, new object[] { title, sourcePath, minWidth, minHeight, maxWidth, maxHeight }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment