コード例 #1
0
 protected override void OnRefinementStarted()
 {
     base.OnRefinementStarted();
     if (refinementMode == RefinableModelMode.Placed)
     {
         refinementMode = RefinableModelMode.Placing;
     }
 }
コード例 #2
0
        /// <summary>
        /// Switches the UI and interactive elements of the model to enable
        /// the specified mode.
        /// </summary>
        /// <param name="newMode">
        /// The mode to switch to.
        /// </param>
        protected virtual void SwitchMode(RefinableModelMode newMode)
        {
            switch (newMode)
            {
            case RefinableModelMode.Placed:

                // Disable all components
                DisableBoundingBox();
                DisableTapToPlace();
                DisableTwoHand();

                break;

            case RefinableModelMode.Placing:

                // Disable bounds and hands
                DisableBoundingBox();
                DisableTwoHand();

                // Enable Tap to Place
                EnableTapToPlace();
                break;

            case RefinableModelMode.Refining:

                // Disable TapToPlace
                DisableTapToPlace();

                // Enable which components?
                if (useBoundingBoxRig)
                {
                    EnableBoundingBox();
                }
                if (useTwoHand)
                {
                    EnableTwoHand();
                }
                break;

            default:
                throw new InvalidOperationException("Unexpected Branch");
            }

            // Store new mode
            lastMode       = newMode;
            refinementMode = newMode;

            // Notify
            OnModeChanged();
        }