コード例 #1
0
 private void Init(Rect buttonRect)
 {
   if ((UnityEngine.Object) SpriteEditorMenu.s_Setting == (UnityEngine.Object) null)
     SpriteEditorMenu.s_Setting = ScriptableObject.CreateInstance<SpriteEditorMenuSetting>();
   buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
   Vector2 windowSize = new Vector2(300f, 145f);
   this.ShowAsDropDown(buttonRect, windowSize);
   Undo.undoRedoPerformed += new Undo.UndoRedoCallback(this.UndoRedoPerformed);
 }
コード例 #2
0
        private void Init(Rect buttonRect)
        {
            if ((UnityEngine.Object)SpriteEditorMenu.s_Setting == (UnityEngine.Object)null)
            {
                SpriteEditorMenu.s_Setting = ScriptableObject.CreateInstance <SpriteEditorMenuSetting>();
            }
            buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
            Vector2 windowSize = new Vector2(300f, 145f);

            this.ShowAsDropDown(buttonRect, windowSize);
            Undo.undoRedoPerformed += new Undo.UndoRedoCallback(this.UndoRedoPerformed);
        }
コード例 #3
0
        private void Init(Rect buttonRect)
        {
            if (s_Setting == null)
            {
                s_Setting = ScriptableObject.CreateInstance <SpriteEditorMenuSetting>();
            }
            buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
            float   y          = 145f;
            Vector2 windowSize = new Vector2(300f, y);

            base.ShowAsDropDown(buttonRect, windowSize, null, ShowMode.PopupMenuWithKeyboardFocus);
            Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
        }
コード例 #4
0
        private void Init(Rect buttonRect, SpriteFrameModule sf, ITextureDataProvider dataProvider)
        {
            if (SpriteEditorMenu.s_Setting == null)
            {
                SpriteEditorMenu.s_Setting = ScriptableObject.CreateInstance <SpriteEditorMenuSetting>();
            }
            this.m_SpriteFrameModule   = sf;
            this.m_TextureDataProvider = dataProvider;
            buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
            float   y          = 145f;
            Vector2 windowSize = new Vector2(300f, y);

            base.ShowAsDropDown(buttonRect, windowSize, null, ShowMode.PopupMenuWithKeyboardFocus);
            Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
        }
コード例 #5
0
        private void Init(Rect buttonRect, SpriteFrameModule sf, ITextureDataProvider dataProvider)
        {
            // Create for once if setting was not created before.
            if (s_Setting == null)
            {
                s_Setting = CreateInstance <SpriteEditorMenuSetting>();
            }

            m_SpriteFrameModule   = sf;
            m_TextureDataProvider = dataProvider;

            buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
            float windowHeight = 145;
            var   windowSize   = new Vector2(300, windowHeight);

            ShowAsDropDown(buttonRect, windowSize, null, ShowMode.PopupMenuWithKeyboardFocus);

            Undo.undoRedoPerformed += UndoRedoPerformed;
        }
コード例 #6
0
ファイル: SpriteEditorMenu.cs プロジェクト: demelev/projectHL
 private void Init(Rect buttonRect)
 {
     if (s_Setting == null)
     {
         s_Setting = ScriptableObject.CreateInstance<SpriteEditorMenuSetting>();
     }
     buttonRect = GUIUtility.GUIToScreenRect(buttonRect);
     float y = 145f;
     Vector2 windowSize = new Vector2(300f, y);
     base.ShowAsDropDown(buttonRect, windowSize);
     Undo.undoRedoPerformed = (Undo.UndoRedoCallback) Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
 }