Exemple #1
0
 /// <summary>
 /// Opens a new window and display the provided content.
 /// </summary>
 /// <param name="content">The content to display.</param>
 /// <param name="options">The options used to configure the host <see cref="UnityEditor.EditorWindow"/></param>
 /// <exception cref="ArgumentNullException">The content cannot be <see langword="null"/>.</exception>
 /// <typeparam name="T">The typeof the content. Must be default constructable.</typeparam>
 public static void ShowInWindow <T>(T content, ContentWindowParameters options)
     where T : ContentProvider, new()
 {
     if (EqualityComparer <T> .Default.Equals(content, default))
     {
         throw new ArgumentNullException(nameof(content));
     }
     ContentWindow.Show(content, options);
 }
Exemple #2
0
 /// <summary>
 /// Opens a new window and display the provided <see cref="UnityEngine.Object"/>.
 /// </summary>
 /// <param name="content">The <see cref="UnityEngine.Object"/> to display.</param>
 /// <param name="options">The options used to configure the host <see cref="UnityEditor.EditorWindow"/></param>
 /// <exception cref="ArgumentNullException">The content cannot be <see langword="null"/>.</exception>
 public static void ShowInWindow(UnityEngine.Object content, ContentWindowParameters options)
 {
     if (null == content || !content)
     {
         throw new ArgumentNullException(nameof(content));
     }
     ContentWindow.Show(new UnityObjectContentProvider {
         Object = content
     }, options);
 }