SHADE_Y3/Assets/Scripts/Gameplay/SC_JumpPad.cs

27 lines
767 B
C#
Raw Normal View History

2023-02-18 22:21:23 +08:00
using SHADE;
2023-03-04 00:19:35 +08:00
using SHADE_Scripting.Audio;
2023-02-18 22:21:23 +08:00
using System;
public class JumpPad : Script
{
protected override void awake()
{
2023-03-04 00:19:35 +08:00
AudioHandler.audioClipHandlers["SFXJumpPad"] = Audio.CreateAudioClip("event:/Props/jumppad_boing");
2023-02-18 22:21:23 +08:00
}
protected override void update()
{
}
protected override void onCollisionEnter(CollisionInfo info)
{
if (info.GameObject.GetScript<PlayerController>() && info.GameObject.GetScript<PlayerController>().currentState == PlayerController.RaccoonStates.FALLING)
{
2023-03-04 00:19:35 +08:00
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXJumpPad"], GameObject.EntityId);
AudioHandler.audioClipHandlers["SFXJumpPad"].Play();
2023-02-18 22:21:23 +08:00
info.GameObject.GetScript<PlayerController>().landedOnJumpPad = true;
}
}
}