Skip to content

Commit

Permalink
Change refactor to make run method of ASignal private
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesDeml committed Mar 10, 2020
1 parent b63c788 commit 30d0949
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
6 changes: 4 additions & 2 deletions Scripts/Runtime/ASignal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ public void Consume()
state = State.Consumed;
}

protected void CleanupForDispatch()
protected void StartDispatch()
{
currentIndex = 0;
state = State.Running;

Run();
}

protected void Run()
private void Run()
{
while (true)
{
Expand Down
20 changes: 8 additions & 12 deletions Scripts/Runtime/Signal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ public void Dispatch()
{
BeginSignalProfilerSample("Dispatch Signal");

CleanupForDispatch();
Run();

StartDispatch();

EndSignalProfilerSample();
}

Expand Down Expand Up @@ -173,10 +172,9 @@ public void Dispatch(T context0)
{
BeginSignalProfilerSample("Dispatch Signal");

CleanupForDispatch();
this.context0 = context0;
Run();
StartDispatch();

EndSignalProfilerSample();
}

Expand Down Expand Up @@ -268,11 +266,10 @@ public void Dispatch(T context0, U context1)
{
BeginSignalProfilerSample("Dispatch Signal");

CleanupForDispatch();
this.context0 = context0;
this.context1 = context1;
Run();
StartDispatch();

EndSignalProfilerSample();
}

Expand Down Expand Up @@ -366,12 +363,11 @@ public void Dispatch(T context0, U context1, V context2)
{
BeginSignalProfilerSample("Dispatch Signal");

CleanupForDispatch();
this.context0 = context0;
this.context1 = context1;
this.context2 = context2;
Run();
StartDispatch();

EndSignalProfilerSample();
}

Expand Down

0 comments on commit 30d0949

Please sign in to comment.