End event setup

This commit is contained in:
Rapandrasmus 2023-06-25 15:14:37 +02:00
parent aab89a124f
commit bb8a15bef9
9 changed files with 345 additions and 6 deletions

View file

@ -32,6 +32,90 @@ Transform:
m_Father: {fileID: 840478359318578090} m_Father: {fileID: 840478359318578090}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &822756201458366926
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2147286864263159364}
- component: {fileID: 7232777666375322427}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2147286864263159364
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 822756201458366926}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -6.5, y: -1.49, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6177218130025753291}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7232777666375322427
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 822756201458366926}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 5
m_Sprite: {fileID: -1214346626, guid: 425aa48453840844d9f049d7ebd849ce, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1.81, y: 1.85}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &909896576730141613 --- !u!1 &909896576730141613
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -255,6 +339,38 @@ Transform:
m_Father: {fileID: 840478359318578090} m_Father: {fileID: 840478359318578090}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2174098948178628587
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6177218130025753291}
m_Layer: 0
m_Name: Star
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &6177218130025753291
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2174098948178628587}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2147286864263159364}
m_Father: {fileID: 2033698246912533277}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2784166155208804841 --- !u!1 &2784166155208804841
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -403,6 +519,7 @@ Transform:
m_Children: m_Children:
- {fileID: 3224445989681038566} - {fileID: 3224445989681038566}
- {fileID: 840478359318578090} - {fileID: 840478359318578090}
- {fileID: 6177218130025753291}
m_Father: {fileID: 3309616054814014854} m_Father: {fileID: 3309616054814014854}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -427,6 +544,7 @@ MonoBehaviour:
- {fileID: 4923294060630520358} - {fileID: 4923294060630520358}
- {fileID: 435934720256010376} - {fileID: 435934720256010376}
- {fileID: 6809338130218058776} - {fileID: 6809338130218058776}
star: {fileID: 2174098948178628587}
randomMinBalloonX: -0.45 randomMinBalloonX: -0.45
randomMaxBalloonX: 0.45 randomMaxBalloonX: 0.45
--- !u!95 &8149215091084911589 --- !u!95 &8149215091084911589

View file

@ -241,7 +241,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 1
--- !u!4 &9016694733661613840 --- !u!4 &9016694733661613840
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -0,0 +1,116 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EndPop
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Rod/light
classID: 1
script: {fileID: 0}
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 2115410046, guid: 425aa48453840844d9f049d7ebd849ce, type: 3}
- time: 0.05
value: {fileID: -199434903, guid: 425aa48453840844d9f049d7ebd849ce, type: 3}
attribute: m_Sprite
path: Rod
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 2539502518
attribute: 2086281974
script: {fileID: 0}
typeID: 1
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 952365541
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 2115410046, guid: 425aa48453840844d9f049d7ebd849ce, type: 3}
- {fileID: -199434903, guid: 425aa48453840844d9f049d7ebd849ce, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.06666667
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_IsActive
path: Rod/light
classID: 1
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4d2555ebc5db61d46964e3ddf0750840
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -52,6 +52,32 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &-4839982000027670488
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EndPop
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 4d2555ebc5db61d46964e3ddf0750840, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &-523919434421660029 --- !u!1107 &-523919434421660029
AnimatorStateMachine: AnimatorStateMachine:
serializedVersion: 6 serializedVersion: 6
@ -94,6 +120,9 @@ AnimatorStateMachine:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: 8858605399677872664} m_State: {fileID: 8858605399677872664}
m_Position: {x: 550, y: 650, z: 0} m_Position: {x: 550, y: 650, z: 0}
- serializedVersion: 1
m_State: {fileID: -4839982000027670488}
m_Position: {x: 585, y: 715, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []

View file

@ -68,6 +68,14 @@ namespace HeavenStudio.Games.Loaders
}, },
preFunctionLength = 1 preFunctionLength = 1
}, },
new GameAction("end", "End")
{
parameters = new List<Param>()
{
new Param("minAmount", new EntityTypes.Integer(0, 10000, 20), "Minimum Jumps Required"),
new Param("minAmount", new EntityTypes.Integer(0, 10000, 100), "Minimum Jumps Required (Persistent)"),
}
},
new GameAction("noJump", "No Jumping") new GameAction("noJump", "No Jumping")
{ {
defaultLength = 4, defaultLength = 4,
@ -97,7 +105,7 @@ namespace HeavenStudio.Games.Loaders
new Param("am", new EntityTypes.Integer(0, 100, 1), "Star Amount", "How many stars will evolve?"), new Param("am", new EntityTypes.Integer(0, 100, 1), "Star Amount", "How many stars will evolve?"),
new Param("repeat", new EntityTypes.Integer(0, 100, 1), "Repeat Amount", "How many times will this event repeat?"), new Param("repeat", new EntityTypes.Integer(0, 100, 1), "Repeat Amount", "How many times will this event repeat?"),
} }
} },
}); });
} }
} }
@ -146,6 +154,12 @@ namespace HeavenStudio.Games
} }
[NonSerialized] public int evolveAmount = 1; [NonSerialized] public int evolveAmount = 1;
[NonSerialized] public int hitJumps;
[NonSerialized] public static int hitJumpsPersist;
[NonSerialized] public double endBeat = double.MaxValue;
[NonSerialized] public int requiredJumps;
[NonSerialized] public int requiredJumpsP;
new void OnDrawGizmos() new void OnDrawGizmos()
{ {
@ -205,6 +219,15 @@ namespace HeavenStudio.Games
} }
} }
private void OnDestroy()
{
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
if (!Conductor.instance.isPlaying) hitJumpsPersist = 0;
}
public void ForceEvolve(double beat, float length, int starAmount, int repeatAmount) public void ForceEvolve(double beat, float length, int starAmount, int repeatAmount)
{ {
List<BeatAction.Action> actions = new(); List<BeatAction.Action> actions = new();
@ -243,13 +266,21 @@ namespace HeavenStudio.Games
public override void OnGameSwitch(double beat) public override void OnGameSwitch(double beat)
{ {
SetCountInBeat(beat); SetCountInBeat(beat);
SetEndValues(beat);
platformHandler.SpawnPlatforms(beat); platformHandler.SpawnPlatforms(beat);
} }
public override void OnPlay(double beat) public override void OnPlay(double beat)
{ {
SetCountInBeat(beat); SetCountInBeat(beat);
SetEndValues(beat);
platformHandler.SpawnPlatforms(beat); platformHandler.SpawnPlatforms(beat);
hitJumpsPersist = 0;
}
public void SetEndValues(double beat)
{
} }
public static void FishSound(double beat) public static void FishSound(double beat)

View file

@ -127,10 +127,13 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
{ {
new BeatAction.Action(endBeat, delegate new BeatAction.Action(endBeat, delegate
{ {
if (canKick && !stopped) if (!stopped)
{ {
SoundByte.PlayOneShotGame("nightWalkAgb/boxKick"); SoundByte.PlayOneShotGame("nightWalkAgb/boxKick");
anim.Play("Kick", 0, 0); if (canKick)
{
anim.Play("Kick", 0, 0);
}
} }
}) })
}); });
@ -256,6 +259,17 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
break; break;
} }
game.starHandler.Evolve(game.evolveAmount); game.starHandler.Evolve(game.evolveAmount);
game.hitJumps++;
AgbNightWalk.hitJumpsPersist++;
}
private void JustEnd(PlayerActionEvent caller, float state)
{
anim.DoScaledAnimationAsync("EndPop", 0.5f);
handler.StopAll();
handler.DestroyPlatforms(caller.timer + caller.startBeat + 4, endBeat - 2, endBeat + 1);
game.playYan.Float(Conductor.instance.songPositionInBeats);
handler.DevolveAll();
} }
private void Miss(PlayerActionEvent caller) private void Miss(PlayerActionEvent caller)

View file

@ -98,6 +98,11 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
stopStars = true; stopStars = true;
} }
public void DevolveAll()
{
starHandler.Devolve();
}
public bool PlatformsStopped() public bool PlatformsStopped()
{ {
return allPlatforms[0].stopped; return allPlatforms[0].stopped;

View file

@ -15,12 +15,14 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
Jumping, Jumping,
Shocked, Shocked,
Falling, Falling,
Whiffing Whiffing,
Floating
} }
private JumpingState jumpingState; private JumpingState jumpingState;
private AgbNightWalk game; private AgbNightWalk game;
private double jumpBeat; private double jumpBeat;
[SerializeField] private List<Animator> balloons = new List<Animator>(); [SerializeField] private List<Animator> balloons = new List<Animator>();
[SerializeField] private GameObject star;
private Path jumpPath; private Path jumpPath;
private Path whiffPath; private Path whiffPath;
private Animator anim; private Animator anim;
@ -88,6 +90,12 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
Walk(); Walk();
} }
break; break;
case JumpingState.Floating:
float normalizedFloatBeat = cond.GetPositionFromBeat(playYanFallBeat, 10);
EasingFunction.Function funcF = EasingFunction.GetEasingFunction(EasingFunction.Ease.Linear);
float newPlayYanYF = funcF(fallStartY, 12, normalizedFloatBeat);
transform.localPosition = new Vector3(0, newPlayYanYF);
break;
} }
} }
} }
@ -109,6 +117,16 @@ namespace HeavenStudio.Games.Scripts_AgbNightWalk
Update(); Update();
} }
public void Float(double beat)
{
jumpingState = JumpingState.Floating;
anim.Play("Jump", 0, 0);
playYanFallBeat = beat;
fallStartY = transform.localPosition.y;
star.SetActive(true);
Update();
}
public void Jump(double beat) public void Jump(double beat)
{ {
jumpingState = JumpingState.Jumping; jumpingState = JumpingState.Jumping;