예제 #1
0
        /// <inheritdoc />
        protected override void OnRefinementStarted()
        {
            // Capture input handler (released in StopAndCleanup)
            InputManager.Instance.PushModalInputHandler(gameObject);

            // Start
            currentStep = RayRefinementStep.None;
            NextStep();

            // Pass to base to notify
            base.OnRefinementStarted();
        }
예제 #2
0
        /// <summary>
        /// Stops refinement and cleans up any refinement related resources.
        /// </summary>
        private void StopAndCleanup()
        {
            // No longer modal
            InputManager.Instance.PopModalInputHandler();

            // No longer in any step
            currentStep = RayRefinementStep.None;

            // Cleanup resources
            Cleanup(ref modelOrigin);
            Cleanup(ref modelDirection);
            Cleanup(ref placementOrigin);
            Cleanup(ref placementDirection);

            // Reset placeholders
            lastTargetPosition = Vector3.zero;
            modelLine          = null;
            placementLine      = null;
            targetInterpolator = null;
        }