/// <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); } }
/// <summary> /// Sets rotation to absolute mode. /// </summary> public void SetAbsoluteReference() { _matcher.SetAbsoluteReference(); }