Skip to content

Commit

Permalink
#596 pilot gesture profile handles hold and drag gestures
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldgenerator7 committed Jul 19, 2024
1 parent 5a8b86a commit 129406f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Assets/Scripts/PlayerController/Input/PilotGestureProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,23 @@ public override void processTapGesture(Vector3 curMPWorld)
{
Managers.PlayerPilot.processTapGesture(curMPWorld);
}

public override void processHoldGesture(Vector3 curMPWorld, float holdTime, bool finished)
{
Managers.PlayerPilot.processHoldGesture(curMPWorld, holdTime, finished);
}

public override void processDragGesture(Vector3 origMPWorld, Vector3 newMPWorld, GestureInput.DragType dragType, bool finished)
{
//If the player drags on Merky,
if (dragType == GestureInput.DragType.DRAG_PLAYER)
{
//Activate the ForceLaunch ability
Managers.PlayerPilot.processDragGesture(origMPWorld, newMPWorld, finished);
}
else if (dragType == GestureInput.DragType.DRAG_CAMERA)
{
base.processDragGesture(origMPWorld, newMPWorld, dragType, finished);
}
}
}
10 changes: 10 additions & 0 deletions Assets/Scripts/PlayerController/PlayerPilotController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ public void processTapGesture(Vector3 curMPWorld)
}
public delegate void TapProcessed(Vector2 curMPWorld);
public event TapProcessed tapProcessed;

public void processHoldGesture(Vector3 holdPos, float holdTime, bool finished)
{
playerController.processHoldGesture(holdPos, holdTime, finished);
}

public void processDragGesture(Vector3 origPos, Vector3 newPos, bool finished)
{
playerController.processDragGesture(origPos, newPos, finished);
}
}

0 comments on commit 129406f

Please sign in to comment.