ShowAtPosition() static private method

static private ShowAtPosition ( Rect buttonRect, IAnimationRecordingState state, OnNewCurveAdded newCurveCallback ) : bool
buttonRect UnityEngine.Rect
state IAnimationRecordingState
newCurveCallback OnNewCurveAdded
return bool
Exemplo n.º 1
0
        private void DoAddCurveButton(Rect rect, AnimationWindowHierarchyNode node, int row)
        {
            float num   = (rect.width - 230f) / 2f;
            float num2  = 10f;
            Rect  rect2 = new Rect(rect.xMin + num, rect.yMin + num2, rect.width - num * 2f, rect.height - num2 * 2f);

            if (this.DoTreeViewButton(this.m_HierarchyItemButtonControlIDs[row], rect2, this.k_AnimatePropertyLabel, GUI.skin.button))
            {
                AddCurvesPopupHierarchyDataSource.showEntireHierarchy = true;
                if (AddCurvesPopup.ShowAtPosition(rect2, this.state, new AddCurvesPopup.OnNewCurveAdded(this.OnNewCurveAdded)))
                {
                    GUIUtility.ExitGUI();
                }
            }
        }
        private void DoAddCurveButton(Rect rect)
        {
            float num2     = (rect.width - 230f) / 2f;
            float num3     = 10f;
            Rect  position = new Rect(rect.xMin + num2, rect.yMin + num3, rect.width - (num2 * 2f), rect.height - (num3 * 2f));

            if (GUI.Button(position, this.k_AnimatePropertyLabel))
            {
                AddCurvesPopup.gameObject = this.state.activeRootGameObject;
                AddCurvesPopupHierarchyDataSource.showEntireHierarchy = true;
                if (AddCurvesPopup.ShowAtPosition(position, this.state))
                {
                    GUIUtility.ExitGUI();
                }
            }
        }
Exemplo n.º 3
0
        private void DoAddCurveButton(Rect rect)
        {
            float num1  = (float)(((double)rect.width - 230.0) / 2.0);
            float num2  = 10f;
            Rect  rect1 = new Rect(rect.xMin + num1, rect.yMin + num2, rect.width - num1 * 2f, rect.height - num2 * 2f);

            if (!GUI.Button(rect1, this.k_AnimatePropertyLabel))
            {
                return;
            }
            AddCurvesPopup.gameObject = this.state.activeRootGameObject;
            AddCurvesPopupHierarchyDataSource.showEntireHierarchy = true;
            if (!AddCurvesPopup.ShowAtPosition(rect1, this.state))
            {
                return;
            }
            GUIUtility.ExitGUI();
        }
        private void DoAddCurveButton(Rect rect)
        {
            float num   = (rect.width - 230f) / 2f;
            float num2  = 10f;
            Rect  rect2 = new Rect(rect.xMin + num, rect.yMin + num2, rect.width - num * 2f, rect.height - num2 * 2f);

            if (GUI.Button(rect2, this.k_AnimatePropertyLabel))
            {
                if (!this.state.m_AnimationWindow.EnsureAnimationMode())
                {
                    return;
                }
                AddCurvesPopup.gameObject = this.state.m_RootGameObject;
                AddCurvesPopupHierarchyDataSource.showEntireHierarchy = true;
                if (AddCurvesPopup.ShowAtPosition(rect2, this.state))
                {
                    GUIUtility.ExitGUI();
                }
            }
        }
        private void DoAddCurveButton(Rect rect, AnimationWindowHierarchyNode node, int row)
        {
            const int k_ButtonWidth = 230;
            float     xMargin       = (rect.width - k_ButtonWidth) / 2f;
            float     yMargin       = 10f;

            Rect rectWithMargin = new Rect(rect.xMin + xMargin, rect.yMin + yMargin, rect.width - xMargin * 2f, rect.height - yMargin * 2f);

            // case 767863.
            // This control id is unique to the hierarchy node it refers to.
            // The tree view only renders the elements that are visible, and will cause
            // the control id counter to shift when scrolling through the view.
            if (DoTreeViewButton(m_HierarchyItemButtonControlIDs[row], rectWithMargin, k_AnimatePropertyLabel, GUI.skin.button))
            {
                AddCurvesPopupHierarchyDataSource.showEntireHierarchy = true;

                if (AddCurvesPopup.ShowAtPosition(rectWithMargin, state, OnNewCurveAdded))
                {
                    GUIUtility.ExitGUI();
                }
            }
        }