설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Observer.cs 669B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. namespace UnityEngine.InputSystem.Utilities
  3. {
  4. internal class Observer<TValue> : IObserver<TValue>
  5. {
  6. private Action<TValue> m_OnNext;
  7. private Action m_OnCompleted;
  8. public Observer(Action<TValue> onNext, Action onCompleted = null)
  9. {
  10. m_OnNext = onNext;
  11. m_OnCompleted = onCompleted;
  12. }
  13. public void OnCompleted()
  14. {
  15. m_OnCompleted?.Invoke();
  16. }
  17. public void OnError(Exception error)
  18. {
  19. Debug.LogException(error);
  20. }
  21. public void OnNext(TValue evt)
  22. {
  23. m_OnNext?.Invoke(evt);
  24. }
  25. }
  26. }