2023-01-13 22:24:26 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
using HeavenStudio.Util;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Scripts_DoubleDate
|
|
|
|
{
|
|
|
|
public class Football : PlayerActionObject
|
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
private DoubleDate game;
|
2023-01-13 22:24:26 +00:00
|
|
|
|
|
|
|
void Awake()
|
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
game = DoubleDate.instance;
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
|
|
|
|
2023-03-27 03:12:23 +00:00
|
|
|
public void Init(float beat)
|
2023-01-13 22:24:26 +00:00
|
|
|
{
|
2023-03-27 03:12:23 +00:00
|
|
|
game.ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, Just, Miss, Empty);
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
|
|
|
|
void Just(PlayerActionEvent caller, float state)
|
|
|
|
{
|
|
|
|
if (state >= 1f || state <= -1f)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShot("miss");
|
|
|
|
game.Kick(false);
|
|
|
|
Destroy(gameObject); //Remove this when doing the ball movement
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Hit();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Hit()
|
|
|
|
{
|
|
|
|
game.Kick(true, true);
|
|
|
|
Jukebox.PlayOneShotGame("doubleDate/footballKick");
|
|
|
|
Destroy(gameObject); //Remove this when doing the ball movement
|
|
|
|
}
|
|
|
|
|
|
|
|
void Miss(PlayerActionEvent caller)
|
|
|
|
{
|
|
|
|
Jukebox.PlayOneShotGame("doubleDate/weasel_hit");
|
|
|
|
Jukebox.PlayOneShotGame("doubleDate/weasel_scream");
|
|
|
|
Destroy(gameObject); //Remove this when doing the ball movement
|
|
|
|
}
|
|
|
|
|
|
|
|
void Empty(PlayerActionEvent caller) { }
|
2023-01-13 22:24:26 +00:00
|
|
|
}
|
|
|
|
}
|