Ejemplo n.º 1
0
        private void OnDisable()
        {
            this.onDefineOrientation  = null;
            this.onDefineOrientation2 = null;

            if (OwnerWindow != null)
            {
                OwnerWindow.Repaint();
                OwnerWindow = null;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Display orientation selection window.
 /// </summary>
 /// <example>
 /// <para>The following source code demonstrates how to use this window:</para>
 /// <code language="csharp"><![CDATA[
 /// using Rotorz.Tile;
 /// using Rotorz.Tile.Editor;
 /// using UnityEditor;
 /// using UnityEngine;
 ///
 /// public static class SelectOrientationExample
 /// {
 ///     [MenuItem("Window/Select Orientation Example")]
 ///     private static void DoExample()
 ///     {
 ///         DefineOrientationWindow.ShowWindow(OnSelectOrientation);
 ///     }
 ///
 ///     private static void OnSelectOrientation(int orientation)
 ///     {
 ///         Debug.Log("Orientation Mask: " + orientation);
 ///         Debug.Log("Orientation Name: " + OrientationUtility.NameFromMask(orientation));
 ///     }
 /// }
 /// ]]></code>
 ///
 /// <para>Orientation selection window can also be prefilled with an orientation upon being shown:</para>
 /// <code language="csharp"><![CDATA[
 /// DefineOrientationWindow window = DefineOrientationWindow.ShowWindow(OnSelectOrientation);
 /// window.Orientation = OrientationUtility.MaskFromName("11100111");
 /// ]]></code>
 ///
 /// </example>
 /// <param name="callback">Invoked when orientation is defined.</param>
 /// <returns>
 /// The window.
 /// </returns>
 public static DefineOrientationWindow ShowWindow(DefineOrientationDelegate callback)
 {
     return(ShowWindow(TileLang.ParticularText("Action", "Select Orientation"), callback));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Display define orientation selection window with custom title.
 /// </summary>
 /// <example>
 /// <para>The following source code demonstrates how to use this window with a custom title:</para>
 /// <code language="csharp"><![CDATA[
 /// using Rotorz.Tile;
 /// using Rotorz.Tile.Editor;
 /// using UnityEditor;
 /// using UnityEngine;
 ///
 /// public static class SelectOrientationExample
 /// {
 ///     [MenuItem("Window/Select Orientation Example")]
 ///     private static void DoExample()
 ///     {
 ///         DefineOrientationWindow.ShowWindow("Find Orientation", OnSelectOrientation);
 ///     }
 ///
 ///     private static void OnSelectOrientation(int orientation)
 ///     {
 ///         Debug.Log("Orientation Mask: " + orientation);
 ///         Debug.Log("Orientation Name: " + OrientationUtility.NameFromMask(orientation));
 ///     }
 ///
 /// }
 /// ]]></code>
 ///
 /// <para>Orientation selection window can also be prefilled with an orientation upon being shown:</para>
 /// <code language="csharp"><![CDATA[
 /// var window = DefineOrientationWindow.ShowWindow("Find Orientation", OnSelectOrientation);
 /// window.Orientation = OrientationUtility.MaskFromName("11100111");
 /// ]]></code>
 ///
 /// </example>
 /// <param name="title">Title for window.</param>
 /// <param name="callback">Invoked when orientation is defined.</param>
 /// <returns>
 /// The window.
 /// </returns>
 public static DefineOrientationWindow ShowWindow(string title, DefineOrientationDelegate callback)
 {
     DoShowWindow(title);
     Instance.onDefineOrientation = callback;
     return(Instance);
 }