Refactoring failed

This commit is contained in:
fu-majime 2024-04-07 22:16:18 +09:00
parent b7cbd70931
commit f2a3ef03c9
2 changed files with 164 additions and 199 deletions

View file

@ -2171,7 +2171,7 @@ ParticleSystem:
donutRadius: 0.2 donutRadius: 0.2
m_Position: {x: 0, y: 0, z: 0} m_Position: {x: 0, y: 0, z: 0}
m_Rotation: {x: 0, y: 0, z: 0} m_Rotation: {x: 0, y: 0, z: 0}
m_Scale: {x: 1, y: 1, z: 1} m_Scale: {x: 1, y: 0, z: 1}
placementMode: 0 placementMode: 0
m_MeshMaterialIndex: 0 m_MeshMaterialIndex: 0
m_MeshNormalOffset: 0 m_MeshNormalOffset: 0
@ -6731,10 +6731,6 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: leafs (4) value: leafs (4)
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3324563509541492245, guid: db186a9c93598ed49b6d45d6135a38bf, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3697501304178671121, guid: db186a9c93598ed49b6d45d6135a38bf, type: 3} - target: {fileID: 3697501304178671121, guid: db186a9c93598ed49b6d45d6135a38bf, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 3
@ -6859,10 +6855,6 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: leafs (3) value: leafs (3)
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3324563509541492245, guid: db186a9c93598ed49b6d45d6135a38bf, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3697501304178671121, guid: db186a9c93598ed49b6d45d6135a38bf, type: 3} - target: {fileID: 3697501304178671121, guid: db186a9c93598ed49b6d45d6135a38bf, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 2
@ -6983,42 +6975,6 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 4337885411777812744} m_TransformParent: {fileID: 4337885411777812744}
m_Modifications: m_Modifications:
- target: {fileID: 3047306057988244668, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalPosition.x
value: -0.38
objectReference: {fileID: 0}
- target: {fileID: 3047306057988244668, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalPosition.y
value: -2.3
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalPosition.x
value: -0.192
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalPosition.y
value: -4.65
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5608574033249632159, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7392517377544777057, guid: a195026c0abb13b47b49c10d3217c559, type: 3} - target: {fileID: 7392517377544777057, guid: a195026c0abb13b47b49c10d3217c559, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 1

View file

@ -78,105 +78,18 @@ namespace HeavenStudio.Games
{ {
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress)) if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress))
{ {
if (!isHold && !isGone) ScoreMiss();
{ HoldFastAnim(cond.songPositionInBeatsAsDouble);
ScoreMiss();
isGone = true;
isPrepare = false;
var currentBeat = cond.songPositionInBeatsAsDouble;
UpdatePos();
LotusAnims[0].DoScaledAnimationAsync("hold", 0.5f);
frogAnim.DoScaledAnimationAsync("hold", 0.5f);
SoundByte.PlayOneShotGame("frogPrincess/lean");
SoundByte.PlayOneShotGame("frogPrincess/A");
princessAnim.DoScaledAnimationAsync("fallForward", 0.5f);
princessAnim.DoScaledAnimationAsync("surpriseFall", 0.5f);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(currentBeat + 0.75, delegate
{
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
frogAnim.DoScaledAnimationAsync("release", 0.5f);
}),
});
Appear(currentBeat, false);
}
} }
if (PlayerInput.GetIsAction(InputAction_FlickRelease) && !IsExpectingInputNow(InputAction_FlickRelease)) if (PlayerInput.GetIsAction(InputAction_FlickRelease) && !IsExpectingInputNow(InputAction_FlickRelease))
{ {
if (isHold && !isGone) ScoreMiss();
{ JumpFastAnim(cond.songPositionInBeatsAsDouble);
ScoreMiss();
isHold = false;
isGone = true;
var currentBeat = cond.songPositionInBeatsAsDouble;
UpdatePos();
SoundByte.PlayOneShotGame("frogPrincess/jump");
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
StartCoroutine(MoveCo(Lotuses, currentBeat, moveTime, moveDistance));
StartCoroutine(MoveCo(Leaves, currentBeat, moveTime, moveDistance));
frogAnim.DoScaledAnimationAsync("jumpFast", 0.5f);
princessAnim.DoScaledAnimationAsync("jumpFast", 0.5f);
princessAnim.Play("idle", 1, 0);
ParticleSystem spawnedParticle = Instantiate(splashEffect, transform);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(currentBeat + 0.5, delegate
{
SoundByte.PlayOneShotGame("frogPrincess/A");
spawnedParticle.PlayScaledAsync(0.5f);
}),
new BeatAction.Action(currentBeat + 1, delegate
{
Destroy(spawnedParticle);
}),
});
Appear(currentBeat, true);
}
} }
if (PlayerInput.PlayerHasControl() && PlayerInput.CurrentControlStyle is InputSystem.InputController.ControlStyles.Touch) if (PlayerInput.GetIsAction(InputAction_BasicRelease) && PlayerInput.PlayerHasControl() && PlayerInput.CurrentControlStyle is InputSystem.InputController.ControlStyles.Touch)
{ {
if (PlayerInput.GetIsAction(InputAction_BasicRelease)) ScoreMiss();
{ JumpFastAnim(cond.songPositionInBeatsAsDouble);
if (isHold && !isGone)
{
ScoreMiss();
isHold = false;
isGone = true;
var currentBeat = cond.songPositionInBeatsAsDouble;
UpdatePos();
SoundByte.PlayOneShotGame("frogPrincess/jump");
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
StartCoroutine(MoveCo(Lotuses, currentBeat, moveTime, moveDistance));
StartCoroutine(MoveCo(Leaves, currentBeat, moveTime, moveDistance));
frogAnim.DoScaledAnimationAsync("jumpFast", 0.5f);
princessAnim.DoScaledAnimationAsync("jumpFast", 0.5f);
princessAnim.Play("idle", 1, 0);
ParticleSystem spawnedParticle = Instantiate(splashEffect, transform);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(currentBeat + 0.5, delegate
{
SoundByte.PlayOneShotGame("frogPrincess/A");
spawnedParticle.PlayScaledAsync(0.5f);
}),
new BeatAction.Action(currentBeat + 1, delegate
{
Destroy(spawnedParticle);
}),
});
Appear(currentBeat, true);
}
}
} }
UpdateBackgroundColor(); UpdateBackgroundColor();
} }
@ -189,32 +102,8 @@ namespace HeavenStudio.Games
isPrepare = true; isPrepare = true;
BeatAction.New(instance, new List<BeatAction.Action>() BeatAction.New(instance, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat, delegate new BeatAction.Action(beat, delegate { ReadyAnim();}),
{ new BeatAction.Action(beat + 1, delegate { ReadyAnim();}),
if (!isGone)
{
SoundByte.PlayOneShotGame("frogPrincess/ready");
if (!frogAnim.IsPlayingAnimationNames("jump"))
{
frogAnim.DoScaledAnimationAsync("ready", 0.5f);
princessAnim.DoScaledAnimationAsync("ready", 0.5f);
princessAnim.DoScaledAnimationAsync("wary", 0.5f);
}
}
}),
new BeatAction.Action(beat + 1, delegate
{
if (!isGone)
{
SoundByte.PlayOneShotGame("frogPrincess/ready");
if (!frogAnim.IsPlayingAnimationNames("jump"))
{
frogAnim.DoScaledAnimationAsync("ready", 0.5f);
princessAnim.DoScaledAnimationAsync("ready", 0.5f);
princessAnim.DoScaledAnimationAsync("wary", 0.5f);
}
}
}),
}); });
ScheduleInput(beat, 2, InputAction_BasicPress, JustHold, MissHold, Empty, CanHold); ScheduleInput(beat, 2, InputAction_BasicPress, JustHold, MissHold, Empty, CanHold);
@ -223,29 +112,89 @@ namespace HeavenStudio.Games
void JustHold(PlayerActionEvent caller, float state) void JustHold(PlayerActionEvent caller, float state)
{ {
isHold = true; var currentBeat = caller.timer + caller.startBeat;
ScheduleInput(currentBeat, 1, InputAction_FlickRelease, JustJump, MissJump, Empty, CanJump);
UpdatePos();
ScheduleInput(caller.timer + caller.startBeat, 1, InputAction_FlickRelease, JustJump, MissJump, Empty, CanJump);
LotusAnims[0].DoScaledAnimationAsync("hold", 0.5f);
frogAnim.DoScaledAnimationAsync("hold", 0.5f);
if (state >= 1f || state <= -1f) if (state >= 1f || state <= -1f)
{ {
SoundByte.PlayOneShotGame("frogPrincess/lean"); HoldBarelyAnim();
SoundByte.PlayOneShotGame("frogPrincess/7");
princessAnim.DoScaledAnimationAsync("holdBarely", 0.5f);
princessAnim.DoScaledAnimationAsync("surpriseHoldBarely", 0.5f);
return; return;
} }
HoldAnim();
}
void MissHold(PlayerActionEvent caller)
{
HoldMissAnim(caller.timer + caller.startBeat);
}
bool CanHold() { return isPrepare;}
void JustJump(PlayerActionEvent caller, float state)
{
var currentBeat = caller.timer + caller.startBeat;
if (state >= 1f || state <= -1f)
{
JumpBarelyAnim(currentBeat);
return;
}
JumpAnim(currentBeat);
}
void MissJump(PlayerActionEvent caller)
{
JumpMissAnim(caller.timer + caller.startBeat);
}
bool CanJump() { return isHold && !isGone;}
void Empty(PlayerActionEvent caller) { }
void ReadyAnim()
{
if (!isGone)
{
SoundByte.PlayOneShotGame("frogPrincess/ready");
if (!frogAnim.IsPlayingAnimationNames("jump"))
{
frogAnim.DoScaledAnimationAsync("ready", 0.5f);
princessAnim.DoScaledAnimationAsync("ready", 0.5f);
princessAnim.DoScaledAnimationAsync("wary", 0.5f);
}
}
}
void HoldAnim()
{
isHold = true;
UpdatePos();
LotusAnims[0].DoScaledAnimationAsync("hold", 0.5f);
frogAnim.DoScaledAnimationAsync("hold", 0.5f);
SoundByte.PlayOneShotGame("frogPrincess/lean"); SoundByte.PlayOneShotGame("frogPrincess/lean");
princessAnim.DoScaledAnimationAsync("hold", 0.5f); princessAnim.DoScaledAnimationAsync("hold", 0.5f);
princessAnim.Play("idle", 1, 0); princessAnim.Play("idle", 1, 0);
} }
void MissHold(PlayerActionEvent caller) void HoldBarelyAnim()
{
isHold = true;
UpdatePos();
LotusAnims[0].DoScaledAnimationAsync("hold", 0.5f);
frogAnim.DoScaledAnimationAsync("hold", 0.5f);
SoundByte.PlayOneShotGame("frogPrincess/lean");
SoundByte.PlayOneShotGame("frogPrincess/7");
princessAnim.DoScaledAnimationAsync("holdBarely", 0.5f);
princessAnim.DoScaledAnimationAsync("surpriseHoldBarely", 0.5f);
}
void HoldMissAnim(double beat)
{ {
if (isPrepare) if (isPrepare)
{ {
@ -257,32 +206,46 @@ namespace HeavenStudio.Games
frogAnim.DoScaledAnimationAsync("fall", 0.5f); frogAnim.DoScaledAnimationAsync("fall", 0.5f);
princessAnim.DoScaledAnimationAsync("fallBackward", 0.5f); princessAnim.DoScaledAnimationAsync("fallBackward", 0.5f);
Appear(caller.timer + caller.startBeat + 0.5, false); Appear(beat + 0.5, false);
} }
} }
bool CanHold() { return isPrepare;} void HoldFastAnim(double beat)
{
if (!isHold && !isGone)
{
isGone = true;
isPrepare = false;
void JustJump(PlayerActionEvent caller, float state) UpdatePos();
LotusAnims[0].DoScaledAnimationAsync("hold", 0.5f);
frogAnim.DoScaledAnimationAsync("hold", 0.5f);
SoundByte.PlayOneShotGame("frogPrincess/lean");
SoundByte.PlayOneShotGame("frogPrincess/A");
princessAnim.DoScaledAnimationAsync("fallForward", 0.5f);
princessAnim.DoScaledAnimationAsync("surpriseFall", 0.5f);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.75, delegate
{
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
frogAnim.DoScaledAnimationAsync("release", 0.5f);
}),
});
Appear(beat, false);
}
}
void JumpAnim(double beat)
{ {
isHold = false; isHold = false;
var currentBeat = caller.timer + caller.startBeat;
UpdatePos(); UpdatePos();
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f); LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
StartCoroutine(MoveCo(Lotuses, currentBeat, moveTime, moveDistance)); StartCoroutine(MoveCo(Lotuses, beat, moveTime, moveDistance));
StartCoroutine(MoveCo(Leaves, currentBeat, moveTime, moveDistance)); StartCoroutine(MoveCo(Leaves, beat, moveTime, moveDistance));
if (state >= 1f || state <= -1f)
{
SoundByte.PlayOneShotGame("frogPrincess/jump");
SoundByte.PlayOneShotGame("frogPrincess/7", currentBeat + 0.5);
LotusAnims[1].DoScaledAnimationAsync("jumpBarely", 0.5f);
frogAnim.DoScaledAnimationAsync("jumpBarely", 0.5f);
princessAnim.DoScaledAnimationAsync("jumpBarely", 0.5f);
princessAnim.DoScaledAnimationAsync("surpriseJumpBarely", 0.5f);
return;
}
SoundByte.PlayOneShotGame("frogPrincess/jump"); SoundByte.PlayOneShotGame("frogPrincess/jump");
LotusAnims[1].DoScaledAnimationAsync("jump", 0.5f); LotusAnims[1].DoScaledAnimationAsync("jump", 0.5f);
@ -291,13 +254,29 @@ namespace HeavenStudio.Games
princessAnim.DoScaledAnimationAsync("happy", 0.5f); princessAnim.DoScaledAnimationAsync("happy", 0.5f);
} }
void MissJump(PlayerActionEvent caller) void JumpBarelyAnim(double beat)
{
isHold = false;
UpdatePos();
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
StartCoroutine(MoveCo(Lotuses, beat, moveTime, moveDistance));
StartCoroutine(MoveCo(Leaves, beat, moveTime, moveDistance));
SoundByte.PlayOneShotGame("frogPrincess/jump");
SoundByte.PlayOneShotGame("frogPrincess/7", beat + 0.5);
LotusAnims[1].DoScaledAnimationAsync("jumpBarely", 0.5f);
frogAnim.DoScaledAnimationAsync("jumpBarely", 0.5f);
princessAnim.DoScaledAnimationAsync("jumpBarely", 0.5f);
princessAnim.DoScaledAnimationAsync("surpriseJumpBarely", 0.5f);
}
void JumpMissAnim(double beat)
{ {
if (isHold && !isGone) if (isHold && !isGone)
{ {
isHold = false; isHold = false;
isGone = true; isGone = true;
var currentBeat = caller.timer + caller.startBeat;
UpdatePos(); UpdatePos();
SoundByte.PlayOneShotGame("frogPrincess/A"); SoundByte.PlayOneShotGame("frogPrincess/A");
@ -305,13 +284,43 @@ namespace HeavenStudio.Games
frogAnim.DoScaledAnimationAsync("fall", 0.5f); frogAnim.DoScaledAnimationAsync("fall", 0.5f);
princessAnim.DoScaledAnimationAsync("fallForward", 0.5f); princessAnim.DoScaledAnimationAsync("fallForward", 0.5f);
Appear(currentBeat, false); Appear(beat, false);
} }
} }
bool CanJump() { return isHold && !isGone;} void JumpFastAnim(double beat)
{
if (isHold && !isGone)
{
isHold = false;
isGone = true;
void Empty(PlayerActionEvent caller) { } UpdatePos();
SoundByte.PlayOneShotGame("frogPrincess/jump");
LotusAnims[0].DoScaledAnimationAsync("release", 0.5f);
StartCoroutine(MoveCo(Lotuses, beat, moveTime, moveDistance));
StartCoroutine(MoveCo(Leaves, beat, moveTime, moveDistance));
frogAnim.DoScaledAnimationAsync("jumpFast", 0.5f);
princessAnim.DoScaledAnimationAsync("jumpFast", 0.5f);
princessAnim.Play("idle", 1, 0);
ParticleSystem spawnedParticle = Instantiate(splashEffect, transform);
BeatAction.New(instance, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + 0.5, delegate
{
SoundByte.PlayOneShotGame("frogPrincess/A");
spawnedParticle.PlayScaledAsync(0.5f);
}),
new BeatAction.Action(beat + 1, delegate
{
Destroy(spawnedParticle);
}),
});
Appear(beat, true);
}
}
public float moveDistance; public float moveDistance;
public float moveTime; public float moveTime;