nail carpenter swing support

This commit is contained in:
minenice55 2024-04-07 00:54:57 -04:00
parent 4918d40baa
commit ce98178dc8
6 changed files with 11 additions and 8 deletions

View file

@ -3,5 +3,5 @@ guid: 3ca4cc3a8f8bda94cb89a0b7ff76e9d7
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: ctrbear/common assetBundleName: agbcalligraphy/common
assetBundleVariant: assetBundleVariant:

View file

@ -3,5 +3,5 @@ guid: 6d72fff7cc3bd794db624e2bc63f9856
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: ctrbear/common assetBundleName: agbsickbeats/common
assetBundleVariant: assetBundleVariant:

View file

@ -24,6 +24,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
{ {
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_RegPress, WeakHammmerJust, null, null); game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_RegPress, WeakHammmerJust, null, null);
} }
targetBeat = Conductor.instance.GetUnSwungBeat(targetBeat);
Update(); Update();
} }
@ -69,7 +70,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
if (cond.isPlaying && !cond.isPaused) if (cond.isPlaying && !cond.isPaused)
{ {
double beat = cond.songPositionInBeats; double beat = cond.unswungSongPositionInBeatsAsDouble;
Vector3 pos = transform.position; Vector3 pos = transform.position;
pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond); pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond);
transform.position = pos; transform.position = pos;

View file

@ -24,6 +24,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
{ {
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_AltPress, StrongHammmerJust, null, null); game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_AltPress, StrongHammmerJust, null, null);
} }
targetBeat = Conductor.instance.GetUnSwungBeat(targetBeat);
Update(); Update();
} }
@ -67,7 +68,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
if (cond.isPlaying && !cond.isPaused) if (cond.isPlaying && !cond.isPaused)
{ {
double beat = cond.songPositionInBeats; double beat = cond.unswungSongPositionInBeatsAsDouble;
Vector3 pos = transform.position; Vector3 pos = transform.position;
pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond); pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond);
transform.position = pos; transform.position = pos;

View file

@ -214,7 +214,7 @@ namespace HeavenStudio.Games
void Update() void Update()
{ {
var currentBeat = conductor.songPositionInBeatsAsDouble; double currentBeat = conductor.unswungSongPositionInBeatsAsDouble;
if (!conductor.isPlaying) return; if (!conductor.isPlaying) return;
@ -234,8 +234,8 @@ namespace HeavenStudio.Games
} }
// Board scroll. // Board scroll.
var boardPos = boardTrans.localPosition; Vector3 boardPos = boardTrans.localPosition;
var newBoardX = currentBeat * scrollMetresPerBeat; double newBoardX = currentBeat * scrollMetresPerBeat;
newBoardX %= boardWidth; newBoardX %= boardWidth;
boardTrans.localPosition = new Vector3((float)newBoardX, boardPos.y, boardPos.z); boardTrans.localPosition = new Vector3((float)newBoardX, boardPos.y, boardPos.z);

View file

@ -34,6 +34,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
AwakeAnim(); AwakeAnim();
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_SweetsHit, HammmerJust, null, null); game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_SweetsHit, HammmerJust, null, null);
targetBeat = Conductor.instance.GetUnSwungBeat(targetBeat);
Update(); Update();
if (sweetType == sweetsType.Pudding) if (sweetType == sweetsType.Pudding)
@ -109,7 +110,7 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
if (cond.isPlaying && !cond.isPaused) if (cond.isPlaying && !cond.isPaused)
{ {
double beat = cond.songPositionInBeats; double beat = cond.unswungSongPositionInBeatsAsDouble;
Vector3 pos = transform.position; Vector3 pos = transform.position;
pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond); pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond);
transform.position = pos; transform.position = pos;