mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
Added for AtomReference a check to see if an Atom is actually assigned. (#202)
This commit is contained in:
parent
8f6392c373
commit
c552881254
@ -67,6 +67,23 @@ namespace UnityAtoms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <returns>True if the `Usage` is an AtomType and is unassigned. False otherwise.</returns>
|
||||||
|
/// </summary>
|
||||||
|
public bool IsUnassigned
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (_usage)
|
||||||
|
{
|
||||||
|
case (AtomReferenceUsage.CONSTANT): return _constant == null;
|
||||||
|
case (AtomReferenceUsage.VARIABLE): return _variable == null;
|
||||||
|
case (AtomReferenceUsage.VARIABLE_INSTANCER): return _variableInstancer == null;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Value used if `Usage` is set to `Value`.
|
/// Value used if `Usage` is set to `Value`.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -123,7 +140,7 @@ namespace UnityAtoms
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get event by type.
|
/// Get event by type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="E"></typeparam>
|
/// <typeparam name="E"></typeparam>
|
||||||
/// <returns>The event.</returns>
|
/// <returns>The event.</returns>
|
||||||
|
Loading…
Reference in New Issue
Block a user