public override void OnClickEnd() { switch (Type) { case ControlType.Button: if (_menu.PressingButton == this) { _menu.PressingButton = null; } else { return; } SetValue(0); break; case ControlType.Toggle: if (RadialMenuUtility.Is(GetValue(), ActiveValue)) { SetValue(0); } else { SetControlValue(); } break; case ControlType.SubMenu: if (!_subMenu) { break; } SetControlValue(); _menu.OpenMenu(_subMenu, _parameter, ActiveValue); break; case ControlType.TwoAxisPuppet: _menu.OpenPuppet(new TwoAxisPuppet(this)); break; case ControlType.FourAxisPuppet: _menu.OpenPuppet(new FourAxisPuppet(this)); break; case ControlType.RadialPuppet: _menu.OpenPuppet(new RadialPuppet(this)); break; default: throw new ArgumentOutOfRangeException(); } }
private bool Is(float value) => RadialMenuUtility.Is(Get(), value);