Skip to content

Commit

Permalink
fix(Pointers): ensure correct order for pointer actions
Browse files Browse the repository at this point in the history
There was a race condition where the activation action could be
registered before the selection action meaning doing things like
select on release would not work as the activation action was
being called before the selection action so the pointer would be
disabled before it could select anything.

This fix moves around some of the registration logic to ensure
the correct order for actions.
  • Loading branch information
thestonefox committed Jun 7, 2019
1 parent b7e745c commit a75b655
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public virtual void ConfigureActivationAction()
/// </summary>
public virtual void ConfigureSelectionType()
{
ActivationAction.gameObject.SetActive(false);
switch (Facade.SelectionMethod)
{
case PointerFacade.SelectionType.SelectOnActivate:
Expand All @@ -137,6 +138,9 @@ public virtual void ConfigureSelectionType()
SelectOnDeactivatedAction.gameObject.SetActive(true);
break;
}
ConfigureSelectionAction();
ConfigureActivationAction();
ActivationAction.gameObject.SetActive(true);
}

/// <summary>
Expand Down Expand Up @@ -197,8 +201,6 @@ protected virtual void OnEnable()
{
ConfigureTargetValidity();
ConfigureFollowSources();
ConfigureSelectionAction();
ConfigureActivationAction();
ConfigureSelectionType();
}
}
Expand Down

0 comments on commit a75b655

Please sign in to comment.