void AnimateEnd(GameObject panel, EnumAnimation animation) { switch (animation) { case EnumAnimation.Default: panel.SetActive(false); break; case EnumAnimation.PopOut: LeanTween.scale(panel, new Vector2(2.5f, 2.5f), 0.25f).setOnComplete(() => { panel.SetActive(false); }) .setIgnoreTimeScale(true); LeanTween.value(1f, 0f, 0.25f).setOnUpdate(ChangeAnimationEndAlpha).setIgnoreTimeScale(true); break; case EnumAnimation.PopIn: LeanTween.scale(panel, Vector3.zero, 0.25f).setOnComplete(() => { panel.SetActive(false); }) .setIgnoreTimeScale(true); LeanTween.value(1f, 0f, 0.25f).setOnUpdate(ChangeAnimationEndAlpha).setIgnoreTimeScale(true); break; case EnumAnimation.SlideOut: LeanTween.moveLocalX(panel, -1080, 0.25f).setOnComplete(() => { panel.SetActive(false); }) .setIgnoreTimeScale(true); break; } }
void Start() { animator = GetComponent <Animator>(); BoxColliderClick = gameObject.GetComponent <SpriteRenderer>(); _UIManager = GameObject.Find("GameMaster").GetComponent <UIManager>(); _UIManager.SetPlayHPMax(3); _UIManager.SetPlayMPMax(100); mSensor_Bandit = gameObject.transform.GetChild(0).gameObject.GetComponent <Sensor_Bandit>(); playStatu = 0; }
void AnimateStart(GameObject panel, EnumAnimation animation) { switch (animation) { case EnumAnimation.PopIn: _animationStartCanvasGroup.alpha = 0f; panel.transform.localScale = Vector3.zero; LeanTween.scale(panel.gameObject, Vector3.one, 0.25f).setIgnoreTimeScale(true); LeanTween.value(0f, 1f, 0.25f).setOnUpdate(ChangeAnimationStartAlpha).setIgnoreTimeScale(true); break; case EnumAnimation.PopOut: _animationStartCanvasGroup.alpha = 0f; panel.transform.localScale = new Vector2(2.5f, 2.5f); LeanTween.scale(panel.gameObject, Vector3.one, 0.25f).setIgnoreTimeScale(true); LeanTween.value(0f, 1f, 0.25f).setOnUpdate(ChangeAnimationStartAlpha).setIgnoreTimeScale(true); break; case EnumAnimation.SlideIn: panel.transform.localPosition = new Vector3(1080, 0, 0); LeanTween.moveLocalX(panel.gameObject, 0, 0.25f).setIgnoreTimeScale(true); break; } }