HeavenStudio/Assets/Scripts/Games/DoubleDate/DoubleDateWeasels.cs
minenice55 2272416fa7
Double Date Balls (#396)
* al l anims done yay

* make balls follow paths

added FollowPath objects

* added 2 grass and changed sky

* make balls rotate

todo: shadows

* complete SuperCurve

add dropshadows
add weasel hit

* make football stop dropshadow when hit

* finish animation

add scrolling clouds

* tint shader

* oops

* slow down clouds

---------

Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
2023-04-22 19:20:01 +00:00

97 lines
2.8 KiB
C#

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;
bool notHit = true;
float lastGacha = float.MinValue;
void Awake()
{
game = DoubleDate.instance;
anim = GetComponent<Animator>();
}
public void Bop()
{
if (canBop && notHit && Conductor.instance.songPositionInBeats > lastGacha)
{
anim.DoScaledAnimationAsync("WeaselsBop", 0.5f);
}
}
public void Happy()
{
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);
}
}
public void Hide(float beat)
{
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);
}
}
public void Hit(float beat)
{
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;
}),
});
}
}
public void ToggleBop()
{
canBop = !canBop;
}
}
}