Set default to avoid compiler warnings

This commit is contained in:
Adam Ramberg 2020-03-02 20:27:38 +01:00
parent 254352f4a2
commit f8a73c143f
7 changed files with 14 additions and 14 deletions

View File

@ -64,25 +64,25 @@ namespace UnityAtoms
/// Event used if `Usage` is set to `Event`.
/// </summary>
[SerializeField]
private E _event;
private E _event = default(E);
/// <summary>
/// EventInstancer used if `Usage` is set to `EventInstancer`.
/// </summary>
[SerializeField]
private EI _eventInstancer;
private EI _eventInstancer = default(EI);
/// <summary>
/// Variable used if `Usage` is set to `Variable`.
/// </summary>
[SerializeField]
private V _variable;
private V _variable = default(V);
/// <summary>
/// Variable Instancer used if `Usage` is set to `VariableInstancer`.
/// </summary>
[SerializeField]
private VI _variableInstancer;
private VI _variableInstancer = default(VI);
protected AtomEventReference()
{

View File

@ -44,7 +44,7 @@ namespace UnityAtoms
/// </summary>
[SerializeField]
[Tooltip("Value that will be used when using the Raise button in the editor inspector.")]
private T _inspectorRaiseValue;
private T _inspectorRaiseValue = default(T);
/// <summary>
/// Raise the Event.

View File

@ -5,7 +5,7 @@ namespace UnityAtoms
{
public class ObservableVoidEvent : IObservable<Void>
{
private Action<Action> _unregister;
private Action<Action> _unregister = default(Action<Action>);
private List<IObserver<Void>> _observers = new List<IObserver<Void>>();
public ObservableVoidEvent(Action<Action> register, Action<Action> unregister)

View File

@ -73,25 +73,25 @@ namespace UnityAtoms
/// Value used if `Usage` is set to `Value`.
/// </summary>
[SerializeField]
private T _value;
private T _value = default(T);
/// <summary>
/// Constant used if `Usage` is set to `Constant`.
/// </summary>
[SerializeField]
private C _constant;
private C _constant = default(C);
/// <summary>
/// Variable used if `Usage` is set to `Variable`.
/// </summary>
[SerializeField]
private V _variable;
private V _variable = default(V);
/// <summary>
/// Variable Instancer used if `Usage` is set to `VariableInstancer`.
/// </summary>
[SerializeField]
private VI _variableInstancer;
private VI _variableInstancer = default(VI);
protected AtomReference()
{

View File

@ -29,7 +29,7 @@ namespace UnityAtoms.MonoHooks
}
[SerializeField]
private Collider2DGameObjectEventReference _eventWithGameObjectReference;
private Collider2DGameObjectEventReference _eventWithGameObjectReference = default(Collider2DGameObjectEventReference);
protected override void RaiseWithGameObject(Collider2D value, GameObject gameObject)
{

View File

@ -29,7 +29,7 @@ namespace UnityAtoms.MonoHooks
}
[SerializeField]
private ColliderGameObjectEventReference _eventWithGameObjectReference;
private ColliderGameObjectEventReference _eventWithGameObjectReference = default(ColliderGameObjectEventReference);
protected override void RaiseWithGameObject(Collider value, GameObject gameObject)
{

View File

@ -21,13 +21,13 @@ namespace UnityAtoms.MonoHooks
public E Event { get => _eventReference.GetEvent<E>(); set => _eventReference.SetEvent<E>(value); }
[SerializeField]
private ER _eventReference;
private ER _eventReference = default(ER);
/// <summary>
/// Selector function for the Event `EventWithGameObjectReference`. Makes it possible to for example select the parent GameObject and pass that a long to the `EventWithGameObjectReference`.
/// </summary>
[SerializeField]
protected F _selectGameObjectReference;
protected F _selectGameObjectReference = default(F);
protected void OnHook(EV value)
{