少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-23 a974a2621a6dcb90b8fe52b23d075814873c0960
System/Launch/LaunchBackGroundWin.cs
@@ -15,10 +15,14 @@
    public class LaunchBackGroundWin : Window
    {
        [SerializeField] RectTransform m_StaticBackGround;
        [SerializeField] Image m_BackGroundImage;
        [SerializeField] RectTransform m_DynamicBackGround;
        [SerializeField] SkeletonGraphic m_SkeletonGraphic;
        GameObject loginEffect;
        bool useStaticBackGround = false;
        #region Built-in
        protected override void BindController()
        {
@@ -31,6 +35,21 @@
        protected override void OnPreOpen()
        {
            var sprite = Resources.Load<Sprite>("UI/Sprites/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);
@@ -54,25 +73,30 @@
        {
            base.OnActived();
            if (m_SkeletonGraphic != null)
            if (!useStaticBackGround)
            {
                m_SkeletonGraphic.AnimationState.SetEmptyAnimations(0);
                if (m_SkeletonGraphic != null)
                {
                    m_SkeletonGraphic.AnimationState.SetEmptyAnimations(0);
                }
            }
        }
        #endregion
        public void ShowLoginEffect()
        {
            if (loginEffect != null)
            if (!useStaticBackGround)
            {
                loginEffect.gameObject.SetActive(true);
            }
                if (loginEffect != null)
                {
                    loginEffect.gameObject.SetActive(true);
                }
            if (m_SkeletonGraphic != null)
            {
                m_SkeletonGraphic.AnimationState.SetAnimation(0, "animation2", true);
                if (m_SkeletonGraphic != null)
                {
                    m_SkeletonGraphic.AnimationState.SetAnimation(0, "animation2", true);
                }
            }
        }
    }