Пример #1
0
        private void ChangeMode(Mode mode)
        {
            // Assembly reference may be lost here when called from OnRemove.

            // Toggle mode.
            if (mode == m_mode)
            {
                mode = Mode.None;
            }

            m_selection.Clear();
            RemoveAllChildren();

            m_mode    = mode;
            m_subMode = SubMode.None;

            if (m_mode == Mode.Shape)
            {
                ShapeCreateTool = new ShapeCreateTool(Assembly.gameObject);
            }
            else if (m_mode == Mode.Constraint)
            {
                ConstraintCreateTool = new ConstraintCreateTool(Assembly.gameObject, true);
            }
        }
Пример #2
0
        private void HandleModeShapeGUI(GUISkin skin)
        {
            if (ShapeCreateTool == null)
            {
                ChangeMode(Mode.None);
                return;
            }

            GUI.Separator3D();

            ShapeCreateTool.OnInspectorGUI(skin);
        }