Ejemplo n.º 1
0
        public override void Unsubscribe(KeyCode code, ButtonState state, Action <ButtonInputEventArgs> listener)
        {
            ButtonInputDetector detector = getDetector(code);

            switch (state)
            {
            case ButtonState.Down:
                detector.OnDown -= listener;
                break;

            case ButtonState.Pressed:
                detector.OnPress -= listener;
                break;

            case ButtonState.Released:
                detector.OnReleased -= listener;
                break;

            case ButtonState.None:
                throw new ArgumentException($"The provided argument {nameof(ButtonState.None)} is not valid");

            default:
                throw new NotImplementedException($"The provided argument {nameof(ButtonState)} ({state}) has not been implemented yet");
            }
        }
Ejemplo n.º 2
0
 private void Construct(ButtonInputDetector detectorPrefab)
 {
     _detectorPrefab = detectorPrefab;
 }