Skip to content

Instantly share code, notes, and snippets.

@daniele-quero
Last active November 4, 2022 08:20
Show Gist options
  • Save daniele-quero/fd821db89f4eec746998b9c3b26b8e04 to your computer and use it in GitHub Desktop.
Save daniele-quero/fd821db89f4eec746998b9c3b26b8e04 to your computer and use it in GitHub Desktop.
public void PlayNext()
{
HorseState currentState = horseAnimationHandler.GetCurrentState();
switch (currentState)
{
case HorseState.stillHorse:
case HorseState.muscleToHorse:
prevButton.interactable = true;
horseAnimationHandler.Play(HorseState.horseToMuscle.ToString());
break;
case HorseState.boneToMuscle:
case HorseState.horseToMuscle:
horseAnimationHandler.Play(HorseState.muscleToBone.ToString());
nextButton.interactable = false;
break;
case HorseState.muscleToBone:
break;
default:
break;
}
}
public void PlayPrev()
{
HorseState currentState = horseAnimationHandler.GetCurrentState();
switch (currentState)
{
case HorseState.stillHorse:
case HorseState.muscleToHorse:
break;
case HorseState.boneToMuscle:
case HorseState.horseToMuscle:
horseAnimationHandler.Play(HorseState.muscleToHorse.ToString());
prevButton.interactable = false;
break;
case HorseState.muscleToBone:
horseAnimationHandler.Play(HorseState.boneToMuscle.ToString());
nextButton.interactable = true;
break;
default:
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment