Firstborn/Library/PackageCache/com.unity.inputsystem@1.5.1/InputSystem/Utilities/Observables/Observer.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

32 lines
669 B
C#

using System;
namespace UnityEngine.InputSystem.Utilities
{
internal class Observer<TValue> : IObserver<TValue>
{
private Action<TValue> m_OnNext;
private Action m_OnCompleted;
public Observer(Action<TValue> onNext, Action onCompleted = null)
{
m_OnNext = onNext;
m_OnCompleted = onCompleted;
}
public void OnCompleted()
{
m_OnCompleted?.Invoke();
}
public void OnError(Exception error)
{
Debug.LogException(error);
}
public void OnNext(TValue evt)
{
m_OnNext?.Invoke(evt);
}
}
}