Skip to content

Commit

Permalink
Merge pull request #247 from hackerspace-ntnu/fix/ddr-arrow
Browse files Browse the repository at this point in the history
Fix DDR issues
  • Loading branch information
Fueredoriku authored Oct 17, 2023
2 parents f030281 + 01a2329 commit f70ab42
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 11 additions & 2 deletions Assets/Scripts/Augment/AugmentImplementations/DDRBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class DDRBody : GunBody

private const float targetHeight = 3;
private const float startHeight = targetHeight - screenHeight;
private const float lowestCheckHeight = 2.5f;

[SerializeField]
private Precision[] precisionsGoodToBad;
Expand Down Expand Up @@ -126,6 +127,9 @@ private void Fire(InputAction.CallbackContext ctx)

private void ArrowSelect(InputAction.CallbackContext ctx)
{
if (arrowHeight < lowestCheckHeight)
return;

switch (arrowDirection)
{
case ArrowDirection.NORTH:
Expand Down Expand Up @@ -193,7 +197,12 @@ private void ResetArrow()

private void OnDestroy()
{
if (gunController)
gunController.player.inputManager.onMovePerformed -= ArrowSelect;
if (!gunController)
return;
if (!gunController.player)
return;

gunController.player.inputManager.onFirePerformed -= Fire;
gunController.player.inputManager.onMovePerformed -= ArrowSelect;
}
}
6 changes: 3 additions & 3 deletions Assets/Shaders/ddrShader.shadergraph
Original file line number Diff line number Diff line change
Expand Up @@ -4171,9 +4171,9 @@
"m_ShaderOutputName": "Emission",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
"x": 0.037735819816589358,
"y": 0.037522222846746448,
"z": 0.037522222846746448
},
"m_DefaultValue": {
"x": 0.0,
Expand Down

0 comments on commit f70ab42

Please sign in to comment.