2022-02-19 18:51:46 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
using HeavenStudio.Util;
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
namespace HeavenStudio.Games
|
2022-02-19 18:51:46 +00:00
|
|
|
{
|
2022-03-12 04:10:13 +00:00
|
|
|
using Scripts_TapTrial;
|
|
|
|
|
2022-02-19 18:51:46 +00:00
|
|
|
public class TapTrial : Minigame
|
|
|
|
{
|
2022-02-19 21:03:45 +00:00
|
|
|
[Header("References")]
|
|
|
|
public TapTrialPlayer player;
|
2022-02-28 17:17:50 +00:00
|
|
|
public GameObject tap;
|
2022-02-19 21:03:45 +00:00
|
|
|
|
|
|
|
public static TapTrial instance { get; set; }
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
|
|
|
}
|
|
|
|
|
2022-02-28 00:17:12 +00:00
|
|
|
// The following is all solely animations for placeholder. This isn't playable
|
|
|
|
|
2022-02-19 21:03:45 +00:00
|
|
|
public void Tap(float beat)
|
|
|
|
{
|
2022-02-28 17:17:50 +00:00
|
|
|
Jukebox.PlayOneShotGame("tapTrial/ook");
|
|
|
|
player.anim.Play("TapPrepare", 0, 0);
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-02-28 17:17:50 +00:00
|
|
|
CreateTap(beat);
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void DoubleTap(float beat)
|
|
|
|
{
|
2022-02-28 00:17:12 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("tapTrial/ookook", beat),
|
2022-02-28 17:17:50 +00:00
|
|
|
new MultiSound.Sound("tapTrial/ookook", beat + 0.5f)
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-02-28 17:17:50 +00:00
|
|
|
player.anim.Play("DoubleTapPrepare", 0, 0);
|
|
|
|
|
2022-02-28 00:17:12 +00:00
|
|
|
GameObject beatAction = new GameObject();
|
|
|
|
beatAction.transform.SetParent(this.transform);
|
|
|
|
BeatAction.New(beatAction, new List<BeatAction.Action>()
|
|
|
|
{
|
2022-02-28 17:17:50 +00:00
|
|
|
new BeatAction.Action(beat + 0.0f, delegate { CreateTap(beat, 1); }),
|
|
|
|
new BeatAction.Action(beat + 0.5f, delegate { CreateTap(beat + 0.5f, 1); }),
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void TripleTap(float beat)
|
|
|
|
{
|
2022-02-28 00:17:12 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("tapTrial/ooki1", beat),
|
2022-02-28 17:17:50 +00:00
|
|
|
new MultiSound.Sound("tapTrial/ooki2", beat + 0.5f)
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
|
2022-02-28 17:17:50 +00:00
|
|
|
player.anim.Play("PosePrepare", 0, 0);
|
|
|
|
player.tripleOffset = 0;
|
|
|
|
|
2022-02-28 00:17:12 +00:00
|
|
|
GameObject beatAction = new GameObject();
|
|
|
|
beatAction.transform.SetParent(this.transform);
|
|
|
|
BeatAction.New(beatAction, new List<BeatAction.Action>()
|
|
|
|
{
|
2022-02-28 17:17:50 +00:00
|
|
|
new BeatAction.Action(beat + 1.0f, delegate { CreateTap(beat + 1.0f, 2); }),
|
|
|
|
new BeatAction.Action(beat + 1.5f, delegate { CreateTap(beat + 1.5f, 2); }),
|
|
|
|
new BeatAction.Action(beat + 2.0f, delegate { CreateTap(beat + 2.0f, 2); }),
|
2022-02-28 00:17:12 +00:00
|
|
|
});
|
2022-02-19 21:03:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void JumpTap(float beat)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void FinalJumpTap(float beat)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2022-02-28 17:17:50 +00:00
|
|
|
|
|
|
|
public void CreateTap(float beat, int type = 0)
|
|
|
|
{
|
|
|
|
GameObject _tap = Instantiate(tap);
|
|
|
|
_tap.transform.parent = tap.transform.parent;
|
|
|
|
_tap.SetActive(true);
|
|
|
|
Tap t = _tap.GetComponent<Tap>();
|
|
|
|
t.startBeat = beat;
|
|
|
|
t.type = type;
|
|
|
|
}
|
2022-02-19 18:51:46 +00:00
|
|
|
}
|
|
|
|
}
|