Exemplo n.º 1
0
 public override void End()
 {
     base.End();
     m_PositionChecker.Check(Vector3.zero);
     m_RotationChecker.Check(Quaternion.identity);
     m_VertexDataSource.Check(enum_VertexData.None);
     m_SelectedPolygon     = -1;
     m_SelectedVertexIndex = -1;
     m_VertexEditMode      = enum_VertexEditMode.Position;
     m_VertexDatas.Clear();
     m_SubPolygons.Clear();
     m_VertexDatas.Clear();
 }
Exemplo n.º 2
0
        public override void OnEditorWindowGUI()
        {
            base.OnEditorWindowGUI();
            SelectVectorData((enum_VertexData)EditorGUILayout.EnumPopup("Data Source", m_VertexDataSource));

            GUILayout.BeginHorizontal();
            GUILayout.Label("Scene GUI Size (Z X):");
            m_GUISize = GUILayout.HorizontalSlider(m_GUISize, s_GUISizeRange.start, s_GUISizeRange.end);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Edit Same Vertex (Tab):");
            m_EditSameVertex = GUILayout.Toggle(m_EditSameVertex, "");
            GUILayout.EndHorizontal();
            m_VertexEditMode = (enum_VertexEditMode)EditorGUILayout.EnumPopup("Vertex Edit Mode (Q , E):", m_VertexEditMode);
        }
Exemplo n.º 3
0
        public override void OnKeyboradInteract(KeyCode _keycode)
        {
            base.OnKeyboradInteract(_keycode);
            switch (_keycode)
            {
            case KeyCode.W:
                m_VertexEditMode = enum_VertexEditMode.Position;
                break;

            case KeyCode.E:
                m_VertexEditMode = enum_VertexEditMode.Rotation;
                break;

            case KeyCode.R:
                ResetVertex(m_SelectedVertexIndex);
                break;

            case KeyCode.Tab:
                m_EditSameVertex = !m_EditSameVertex;
                break;

            case KeyCode.Escape:
            {
                if (m_SelectingVertex)
                {
                    SelectVertex(-1);
                }
                else if (m_SelectingPolygon)
                {
                    SelectPolygon(-1);
                }
            }
            break;

            case KeyCode.Z: m_GUISize = Mathf.Clamp(m_GUISize - .1f, s_GUISizeRange.start, s_GUISizeRange.end); break;

            case KeyCode.X: m_GUISize = Mathf.Clamp(m_GUISize + .1f, s_GUISizeRange.start, s_GUISizeRange.end); break;
            }
        }