Skip to content

Commit

Permalink
updated doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jheiling committed Aug 13, 2018
1 parent d0a209d commit bdf0ea4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 10 additions & 0 deletions Scripts/Signal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace Signals
{
/// <summary>
/// Signal with no value.
/// Implements the <see cref="ISignal"/> interface.
/// </summary>
[CreateAssetMenu(menuName = "Signals/Signal")]
public class Signal : ScriptableObject, ISignal
{
Expand All @@ -15,6 +19,9 @@ public class Signal : ScriptableObject, ISignal
#endif
[SerializeField] UnityEvent _onTriggered;

/// <summary>
/// Invoked when <see cref="Trigger"/> is called.
/// </summary>
public UnityEvent OnTriggered
{
get
Expand All @@ -23,6 +30,9 @@ public UnityEvent OnTriggered
}
}

/// <summary>
/// Triggers the <see cref="OnTriggered"/> event.
/// </summary>
public void Trigger()
{
_onTriggered.Invoke();
Expand Down
11 changes: 4 additions & 7 deletions Scripts/SignalListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ public class SignalListener : MonoBehaviour
#pragma warning restore
#endif
[SerializeField] Signal _signal;

[SerializeField] UnityEvent _onTriggered;

[SerializeField] bool _invokeImmediately;


protected virtual void Awake()
{
if (_onTriggered == null) _onTriggered = new UnityEvent();
Expand All @@ -37,6 +34,7 @@ protected virtual void OnDisable()
{
RemoveListener();
}

/// <summary>
/// The signal whose <see cref="Signal.OnTriggered"/> event is propagated.
/// </summary>
Expand All @@ -54,9 +52,8 @@ public Signal Signal
}
}


/// <summary>
/// Invoked when the <see cref="Signal.OnTriggered"/> of the signal has changed.
/// Invoked when <see cref="Signal.Trigger"/> of the <see cref="Signal"/> is called.
/// </summary>
public UnityEvent OnTriggered
{
Expand All @@ -67,7 +64,7 @@ public UnityEvent OnTriggered
}

/// <summary>
/// If true the OnChanged event will also be invoked when the SignalListener is enabled or <see cref="Signal"/> is set.
/// If true the <see cref="OnChanged"/> event will also be invoked when the SignalListener is enabled or <see cref="Signal"/> is set.
/// </summary>
public bool InvokeImmediately
{
Expand Down Expand Up @@ -148,7 +145,7 @@ public ET OnChanged
}

/// <summary>
/// If true the OnChanged event will also be invoked when the SignalListener is enabled or <see cref="Signal"/> is set.
/// If true the <see cref="OnChanged"/> event will also be invoked when the SignalListener is enabled or <see cref="Signal"/> is set.
/// </summary>
public bool InvokeImmediately
{
Expand Down

0 comments on commit bdf0ea4

Please sign in to comment.