| | |
| | | {
|
| | | [SerializeField] RectTransform m_StaticBackGround;
|
| | | [SerializeField] Image m_BackGroundImage;
|
| | | [SerializeField] RectTransform m_DynamicBackGround;
|
| | | [SerializeField] SkeletonGraphic m_SkeletonGraphic;
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | |
|
| | | GameObject loginEffect;
|
| | |
|
| | | bool useStaticBackGround = false;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | loginEffect = this.transform.Find("Pivot/Effect_DengLu").gameObject;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var sprite = BuiltInLoader.LoadSprite("LoginBackGround");
|
| | | useStaticBackGround = sprite != null;
|
| | |
|
| | | if (useStaticBackGround)
|
| | | {
|
| | | m_BackGroundImage.overrideSprite = sprite;
|
| | | m_StaticBackGround.gameObject.SetActive(true);
|
| | | m_DynamicBackGround.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StaticBackGround.gameObject.SetActive(false);
|
| | | m_DynamicBackGround.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (loginEffect != null)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(false);
|
| | | }
|
| | | m_BackGroundImage.overrideSprite = sprite;
|
| | | m_StaticBackGround.gameObject.SetActive(true);
|
| | |
|
| | | this.transform.SetAsFirstSibling();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish += ShowLoginEffect;
|
| | | if (StageLoad.Instance.currentStage is LoginStage)
|
| | | {
|
| | | ShowLoginEffect();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= ShowLoginEffect;
|
| | | Resources.UnloadAsset(m_SkeletonGraphic.material);
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | |
|
| | | if (!useStaticBackGround)
|
| | | {
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetEmptyAnimations(0);
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void ShowLoginEffect()
|
| | | private void Start()
|
| | | {
|
| | | if (!useStaticBackGround)
|
| | | {
|
| | | if (loginEffect != null)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetAnimation(0, "animation2", true);
|
| | | }
|
| | | }
|
| | | m_AlphaTween.Play();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | }
|
| | |
|
| | | }
|