middle monkey anims

This commit is contained in:
Rapandrasmus 2023-08-07 23:06:49 +02:00
parent 7049f41226
commit 3b1a480f3a
3 changed files with 13 additions and 1 deletions

View file

@ -21570,6 +21570,7 @@ MonoBehaviour:
monkeyClockArrow: {fileID: 8220690735241008560}
monkeyHandler: {fileID: 8572779002997729184}
backgroundHandler: {fileID: 2778587498033096836}
middleMonkey: {fileID: 5520703815918216618}
fullZoomOut: 80
--- !u!1 &6181011653585253546
GameObject:

View file

@ -48,7 +48,11 @@ namespace HeavenStudio.Games.Scripts_MonkeyWatch
public void PlayerClap(bool big, bool barely, bool whiff)
{
if (playerMonkeyAnim.IsPlayingAnimationName("PlayerClapBarely") && whiff) return;
if (whiff) SoundByte.PlayOneShot("miss");
if (whiff)
{
game.middleMonkey.DoScaledAnimationAsync("MiddleMonkeyMiss", 0.4f);
SoundByte.PlayOneShot("miss");
}
if (barely || whiff)
{
playerMonkeyAnim.DoScaledAnimationAsync("PlayerClapBarely", 0.4f);

View file

@ -132,6 +132,7 @@ namespace HeavenStudio.Games
public MonkeyClockArrow monkeyClockArrow;
[SerializeField] private WatchMonkeyHandler monkeyHandler;
[SerializeField] private WatchBackgroundHandler backgroundHandler;
public Animator middleMonkey;
[Header("Properties")]
[SerializeField] private float fullZoomOut = 40f;
@ -154,9 +155,15 @@ namespace HeavenStudio.Games
CameraUpdate();
}
private double lastReportedBeat = 0;
private void Update()
{
CameraUpdate();
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
{
middleMonkey.DoScaledAnimationAsync("MiddleMonkeyBop", 0.4f);
}
}
public void PlayerMonkeyClap(bool big, bool barely)