Beispiel #1
0
        /// <summary>
        /// Alternates which rotation mode is currently selected, and changes the text to match.
        /// </summary>
        /// <param name="isOn"></param>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        private void OnReferenceToggleClicked(bool isOn)
        {
            switch (_matcher.ReferenceMode)
            {
            case RotationMatcher.RotationReference.Absolute:
                // Was reset, now will center. Button allows users to reset again.
                _matcher.SetRelativeReference();
                _referenceLabel.text = ResetLabel;
                break;

            case RotationMatcher.RotationReference.Relative:
                // Was centered, now will reset. Button allows users to center again.
                _matcher.SetAbsoluteReference();
                _referenceLabel.text = CenterLabel;
                break;

            default:
                throw new ArgumentOutOfRangeException("ReferenceMode", _matcher.ReferenceMode, null);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Sets rotation to absolute mode.
 /// </summary>
 public void SetAbsoluteReference()
 {
     _matcher.SetAbsoluteReference();
 }