Question by
Sameh-Massoud · Nov 27, 2017 at 09:42 PM ·
animationanimatorpause gameuikit
after press resume animation on the game still stopped
public void OnGamePause () {
if (!(shownDialogType == DialogType.NONE || shownDialogType == Game.DialogType.PAUSE)) {
return;
}
pauseButtonCollider.enabled = false;
dialogsComponent.pauseDialog.SetActive (true);
Animator dialogAnimator = dialogsComponent.pauseDialog.GetComponent<Animator> ();
GameObject.Find("Player").rigidbody2D.isKinematic=true;
Animator World= GameObject.Find ("World").GetComponent<Animator> ();
World.speed=0F;
if (dialogAnimator.GetBool ("isFadingIn")) {
dialogAnimator.SetBool ("isFadingIn", false);
dialogAnimator.SetBool ("isFadingOut", true);
blackScreenAnimatorComp.SetBool ("isFadingIn", false);
blackScreenAnimatorComp.SetBool ("isFadingOut", true);
if (!timerComp.isDone)
timerComp.Play ();
shownDialogType = Game.DialogType.NONE;
} else {
SFX.instance.audioSources [1].clip = SFX.instance.pauseSFX;
AudioManager.PlayClip (SFX.instance.audioSources [1]);
dialogAnimator.SetBool ("isFadingOut", false);
dialogAnimator.SetBool ("isFadingIn", true);
blackScreenAnimatorComp.SetBool ("isFadingOut", false);
blackScreenAnimatorComp.SetBool ("isFadingIn", true);
if (!timerComp.isDone)
timerComp.Pause ();
shownDialogType = Game.DialogType.PAUSE;
}
}
Comment