private void Initialize() { if (this.animType == ShowAnimType.scaleAnim) { this.defaultScale = Vector3.one; this.gameObject.transform.localScale = Vector3.zero; } else if (this.animType == ShowAnimType.positionAnim) { this.gameObject.transform.localScale = Vector3.one; showPosMoveLength = UIManager.Instance.size.x * 0.5f; this.gameObject.transform.localPosition = new Vector3(this.showPosMoveLength, 0f, 0f); } else if (this.animType == ShowAnimType.curveAnim) { if (this.mAnimator == null) { this.animType = ShowAnimType.scaleAnim; this.defaultScale = Vector3.one; this.gameObject.transform.localScale = Vector3.zero; } else { this.mAnimator.Play("Open"); this.mAnimator.Update(0.0f); AnimatorStateInfo info = this.mAnimator.GetCurrentAnimatorStateInfo(0); this.mCurveAnimTime = info.length; } } }
public virtual void Show() { if (this.visibleType == VisibleType.SHOW) { return; } this.mAnimator = this.gameObject.GetComponent <Animator>(); if (this.mAnimator != null) { this.animType = ShowAnimType.curveAnim; } this.Initialize(); this.visibleAnimationTimer = 0f; this.visibleType = VisibleType.SHOW; }