Exemplo n.º 1
0
        protected override void OnGUI()
        {
            m_SkeletonController.view.defaultControlID = 0;

            if (skeleton != null && mode != SkeletonMode.Disabled)
            {
                m_RectSelectionTool.OnGUI();
                m_SkeletonController.view.defaultControlID = m_RectSelectionTool.controlID;
            }

            m_SkeletonController.OnGUI();
            m_UnselectTool.OnGUI();
        }
Exemplo n.º 2
0
        protected override void OnGUI()
        {
            if (m_Mesh == null)
            {
                return;
            }

            SetupGUI();

            var handlesMatrix = Handles.matrix;

            Handles.matrix *= m_Mesh.sprite.GetLocalToWorldMatrixFromMode();

            BeginPositionOverride();

            EditorGUI.BeginChangeCheck();

            var guiEnabled = GUI.enabled;
            var moveAction = m_SpriteMeshController.spriteMeshView.IsActionHot(MeshEditorAction.MoveEdge) || m_SpriteMeshController.spriteMeshView.IsActionHot(MeshEditorAction.MoveVertex);

            GUI.enabled = (!skinningCache.IsOnVisualElement() && guiEnabled) || moveAction;
            m_SpriteMeshController.OnGUI();
            GUI.enabled = guiEnabled;

            if (EditorGUI.EndChangeCheck())
            {
                UpdateMesh();
            }

            m_RectSelectionTool.OnGUI();
            m_UnselectTool.OnGUI();

            Handles.matrix = handlesMatrix;

            EndPositionOverride();
        }