public static WebViewEditorWindow CreateBase(string title, string sourcesPath, int minWidth, int minHeight, int maxWidth, int maxHeight) { WebViewEditorWindow window = EditorWindow.GetWindow <WebViewEditorWindow>(title); window.minSize = new Vector2((float)minWidth, (float)minHeight); window.maxSize = new Vector2((float)maxWidth, (float)maxHeight); window.m_InitialOpenURL = sourcesPath; window.m_GlobalObjectTypeName = null; window.Init(); window.Show(); return(window); }
public static WebViewEditorWindow Create <T>(string title, string sourcesPath, int minWidth, int minHeight, int maxWidth, int maxHeight) where T : new() { WebViewEditorWindow window = ScriptableObject.CreateInstance <WebViewEditorWindow>(); window.titleContent = new GUIContent(title); window.minSize = new Vector2((float)minWidth, (float)minHeight); window.maxSize = new Vector2((float)maxWidth, (float)maxHeight); window.m_InitialOpenURL = sourcesPath; window.m_GlobalObjectTypeName = typeof(T).FullName; window.Init(); window.Show(); return(window); }