Ejemplo n.º 1
0
        public override void Unsubscribe(int index, ButtonState state, Action <PointerButtonInputEventArgs> listener)
        {
            PointerButtonInputDetector detector = getDetector(index);

            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(PointerButtonInputDetector detectorPrefab)
 {
     _detectorPrefab = detectorPrefab;
 }