Fixed touch controls
FIxed touch controls being a miss no matter what
This commit is contained in:
parent
c809a2d976
commit
02131c2795
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,8 @@ using NaughtyBezierCurves;
|
|||
using DG.Tweening;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
using HeavenStudio.InputSystem;
|
||||
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_NailCarpenter
|
||||
{
|
||||
|
@ -19,9 +21,12 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
|
|||
{
|
||||
game = NailCarpenter.instance;
|
||||
|
||||
game.ScheduleInput(targetBeat, 1f, NailCarpenter.InputAction_AltPress, HammmerJust, HammmerMiss, Empty);
|
||||
game.ScheduleInput(targetBeat, 1f, NailCarpenter.InputAction_AltStart, HammmerJust, HammmerMiss, Empty);
|
||||
// wrongInput
|
||||
game.ScheduleUserInput(targetBeat, 1f, NailCarpenter.InputAction_BasicPress, weakHammmerJust, Empty, Empty);
|
||||
if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
|
||||
{
|
||||
game.ScheduleUserInput(targetBeat, 1f, NailCarpenter.InputAction_RegPress, weakHammmerJust, Empty, Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void HammmerJust(PlayerActionEvent caller, float state)
|
||||
|
|
|
@ -5,6 +5,8 @@ using NaughtyBezierCurves;
|
|||
using DG.Tweening;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
using HeavenStudio.InputSystem;
|
||||
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_NailCarpenter
|
||||
{
|
||||
|
@ -19,8 +21,12 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
|
|||
{
|
||||
game = NailCarpenter.instance;
|
||||
|
||||
game.ScheduleInput(targetBeat, 0, NailCarpenter.InputAction_BasicPress, HammmerJust, HammmerMiss, Empty);
|
||||
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_AltPress, strongHammmerJust, Empty, Empty);
|
||||
game.ScheduleInput(targetBeat, 0, NailCarpenter.InputAction_RegPress, HammmerJust, HammmerMiss, Empty);
|
||||
//wrong input
|
||||
if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
|
||||
{
|
||||
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_AltStart, strongHammmerJust, Empty, Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void HammmerJust(PlayerActionEvent caller, float state)
|
||||
|
|
|
@ -99,10 +99,18 @@ namespace HeavenStudio.Games
|
|||
{
|
||||
return PlayerInput.GetSqueezeDown(out dt);
|
||||
}
|
||||
|
||||
protected static bool IA_TouchRegularPress(out double dt)
|
||||
{
|
||||
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt)
|
||||
&& instance.IsExpectingInputNow(InputAction_RegPress)
|
||||
&& !instance.IsExpectingInputNow(InputAction_AltStart);
|
||||
}
|
||||
protected static bool IA_TouchAltPress(out double dt)
|
||||
{
|
||||
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt)
|
||||
&& instance.IsExpectingInputNow(InputAction_AltPress);
|
||||
&& instance.IsExpectingInputNow(InputAction_AltStart)
|
||||
&& !instance.IsExpectingInputNow(InputAction_RegPress);
|
||||
}
|
||||
|
||||
protected static bool IA_PadAltRelease(out double dt)
|
||||
|
@ -114,7 +122,11 @@ namespace HeavenStudio.Games
|
|||
return PlayerInput.GetSqueezeUp(out dt);
|
||||
}
|
||||
|
||||
public static PlayerInput.InputAction InputAction_AltPress =
|
||||
|
||||
public static PlayerInput.InputAction InputAction_RegPress =
|
||||
new("PcoNailRegStart", new int[] { IAPressCat, IAPressCat, IAPressCat },
|
||||
IA_PadBasicPress, IA_TouchRegularPress, IA_BatonBasicPress);
|
||||
public static PlayerInput.InputAction InputAction_AltStart =
|
||||
new("PcoNailAltStart", new int[] { IAAltDownCat, IAAltDownCat, IAAltDownCat },
|
||||
IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress);
|
||||
public static PlayerInput.InputAction InputAction_AltFinish =
|
||||
|
@ -147,14 +159,14 @@ namespace HeavenStudio.Games
|
|||
|
||||
// Debug.Log(newBeat);
|
||||
|
||||
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress))
|
||||
if (PlayerInput.GetIsAction(InputAction_RegPress) && !IsExpectingInputNow(InputAction_RegPress))
|
||||
{
|
||||
SoundByte.PlayOneShot("miss");
|
||||
Carpenter.DoScaledAnimationAsync("carpenterHit", 0.25f);
|
||||
hasSlurped = false;
|
||||
// ScoreMiss();
|
||||
}
|
||||
if (PlayerInput.GetIsAction(InputAction_AltPress) && !IsExpectingInputNow(InputAction_AltPress))
|
||||
if (PlayerInput.GetIsAction(InputAction_AltStart) && !IsExpectingInputNow(InputAction_AltStart))
|
||||
{
|
||||
SoundByte.PlayOneShot("miss");
|
||||
Carpenter.DoScaledAnimationAsync("carpenterHit", 0.25f);
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
|
|||
game = NailCarpenter.instance;
|
||||
|
||||
AwakeAnim();
|
||||
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_BasicPress, HammmerJust, Empty, Empty);
|
||||
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_RegPress, HammmerJust, Empty, Empty);
|
||||
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_AltFinish, HammmerJust, Empty, Empty);
|
||||
}
|
||||
private void AwakeAnim()
|
||||
|
|
Loading…
Reference in a new issue