SHADE_Y3/Assets/Scripts/Gameplay/SC_JumpPad.cs

27 lines
767 B
C#

using SHADE;
using SHADE_Scripting.Audio;
using System;
public class JumpPad : Script
{
protected override void awake()
{
AudioHandler.audioClipHandlers["SFXJumpPad"] = Audio.CreateAudioClip("event:/Props/jumppad_boing");
}
protected override void update()
{
}
protected override void onCollisionEnter(CollisionInfo info)
{
if (info.GameObject.GetScript<PlayerController>() && info.GameObject.GetScript<PlayerController>().currentState == PlayerController.RaccoonStates.FALLING)
{
Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["SFXJumpPad"], GameObject.EntityId);
AudioHandler.audioClipHandlers["SFXJumpPad"].Play();
info.GameObject.GetScript<PlayerController>().landedOnJumpPad = true;
}
}
}