Coin Toss Functionnal (Needs Miss and Blank animation)

This commit is contained in:
Pengu123
2022-05-01 22:10:00 +02:00
parent fdfcbe8948
commit 72b4ef1aeb
11 changed files with 175 additions and 86 deletions

View File

@ -27,16 +27,16 @@ namespace HeavenStudio.Games
{
public static CoinToss instance { get; set; }
public Boolean isThrowing;
public GameObject coin_cue;
[Header("Animators")]
public Animator handAnimator;
private void Awake()
{
instance = this;
isThrowing = false;
}
private void Update()
@ -55,7 +55,24 @@ namespace HeavenStudio.Games
handAnimator.Play("Throw", 0, 0);
isThrowing = true;
GameObject coin = Instantiate(coin_cue);
coin.SetActive(true);
Coin c = coin.GetComponent<Coin>();
c.startBeat = beat;
}
public void Catch_Success()
{
Jukebox.PlayOneShotGame("coinToss/catch");
handAnimator.Play("Catch_success", 0, 0);
isThrowing = false;
}
public void Catch_Miss()
{
Jukebox.PlayOneShotGame("coinToss/miss");
}
}
}