Example #1
0
 void Init(Rect buttonRect, GridPaintPaletteWindow owner)
 {
     m_Owner    = owner;
     m_CellSize = new Vector3(1, 1, 0);
     buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
     ShowAsDropDown(buttonRect, new Vector2(312, 150), null, ShowMode.PopupMenuWithKeyboardFocus);
 }
Example #2
0
 void Init(Rect buttonRect, GridPaintPaletteWindow owner)
 {
     m_Owner    = owner;
     m_CellSize = new Vector3(1, 1, 0);
     buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
     ShowAsDropDown(buttonRect, new Vector2(312, 150));
 }
 private void Init(Rect buttonRect, GridPaintPaletteWindow owner)
 {
     this.m_Owner    = owner;
     this.m_CellSize = new Vector3(1f, 1f, 0f);
     buttonRect      = GUIUtility.GUIToScreenRect(buttonRect);
     base.ShowAsDropDown(buttonRect, new Vector2(312f, 140f), null, ShowMode.PopupMenuWithKeyboardFocus);
 }
Example #4
0
        internal static bool ShowAtPosition(Rect buttonRect, GridPaintPaletteWindow owner)
        {
            // We could not use realtimeSinceStartUp since it is set to 0 when entering/exitting playmode, we assume an increasing time when comparing time.
            long nowMilliSeconds = System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond;
            bool justClosed      = nowMilliSeconds < s_LastClosedTime + 50;

            if (!justClosed)
            {
                Event.current.Use();
                if (s_Instance == null)
                {
                    s_Instance = ScriptableObject.CreateInstance <GridPaletteAddPopup>();
                }

                s_Instance.Init(buttonRect, owner);
                return(true);
            }
            return(false);
        }
        internal static bool ShowAtPosition(Rect buttonRect, GridPaintPaletteWindow owner)
        {
            long num = DateTime.Now.Ticks / 10000L;
            bool result;

            if (num >= GridPaletteAddPopup.s_LastClosedTime + 50L)
            {
                Event.current.Use();
                if (GridPaletteAddPopup.s_Instance == null)
                {
                    GridPaletteAddPopup.s_Instance = ScriptableObject.CreateInstance <GridPaletteAddPopup>();
                }
                GridPaletteAddPopup.s_Instance.Init(buttonRect, owner);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Example #6
0
        public static void OpenTilemapPalette()
        {
            GridPaintPaletteWindow w = GetWindow <GridPaintPaletteWindow>();

            w.titleContent = tilePalette;
        }
Example #7
0
        public static void OpenTilemapPalette()
        {
            GridPaintPaletteWindow window = EditorWindow.GetWindow <GridPaintPaletteWindow>();

            window.titleContent = GridPaintPaletteWindow.tilePalette;
        }