2023-03-27 03:12:23 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using HeavenStudio.Util;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Scripts_DoubleDate
|
|
|
|
{
|
|
|
|
public class DoubleDateWeasels : MonoBehaviour
|
|
|
|
{
|
|
|
|
bool canBop = true;
|
|
|
|
Animator anim;
|
|
|
|
private DoubleDate game;
|
2023-04-22 19:20:01 +00:00
|
|
|
bool notHit = true;
|
|
|
|
float lastGacha = float.MinValue;
|
2023-03-27 03:12:23 +00:00
|
|
|
|
|
|
|
void Awake()
|
|
|
|
{
|
|
|
|
game = DoubleDate.instance;
|
|
|
|
anim = GetComponent<Animator>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Bop()
|
|
|
|
{
|
2023-04-22 19:20:01 +00:00
|
|
|
if (canBop && notHit && Conductor.instance.songPositionInBeats > lastGacha)
|
2023-03-27 03:12:23 +00:00
|
|
|
{
|
2023-04-22 19:20:01 +00:00
|
|
|
anim.DoScaledAnimationAsync("WeaselsBop", 0.5f);
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Happy()
|
|
|
|
{
|
2023-04-22 19:20:01 +00:00
|
|
|
if (notHit && Conductor.instance.songPositionInBeats > lastGacha)
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsHappy", 0.5f);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Jump()
|
|
|
|
{
|
|
|
|
if (notHit && Conductor.instance.songPositionInBeats > lastGacha)
|
|
|
|
{
|
|
|
|
lastGacha = Conductor.instance.songPositionInBeats + 1f;
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsJump", 0.5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:17:06 +00:00
|
|
|
public void Hide(double beat)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
if (notHit)
|
|
|
|
{
|
|
|
|
notHit = false;
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsHide", 0.5f);
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 1.45f, delegate
|
|
|
|
{
|
|
|
|
lastGacha = Conductor.instance.songPositionInBeats + 0.5f;
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsAppearUpset", 0.5f);
|
|
|
|
notHit = true;
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Surprise()
|
|
|
|
{
|
|
|
|
if (notHit && Conductor.instance.songPositionInBeats > lastGacha)
|
|
|
|
{
|
|
|
|
lastGacha = Conductor.instance.songPositionInBeats + 0.5f;
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsSurprised", 0.5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:17:06 +00:00
|
|
|
public void Hit(double beat)
|
2023-04-22 19:20:01 +00:00
|
|
|
{
|
|
|
|
if (notHit)
|
|
|
|
{
|
|
|
|
notHit = false;
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsHit", 0.5f);
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat + 2f, delegate
|
|
|
|
{
|
|
|
|
lastGacha = Conductor.instance.songPositionInBeats + 0.5f;
|
|
|
|
anim.DoScaledAnimationAsync("WeaselsAppearUpset", 1f);
|
|
|
|
notHit = true;
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
}
|
2023-03-27 03:12:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ToggleBop()
|
|
|
|
{
|
|
|
|
canBop = !canBop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|