From a974a2621a6dcb90b8fe52b23d075814873c0960 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 23 十月 2018 20:53:49 +0800
Subject: [PATCH] Merge branch 'master' into leonard

---
 System/Launch/LaunchBackGroundWin.cs |   42 +++++++++++++++++++++++++++++++++---------
 1 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/System/Launch/LaunchBackGroundWin.cs b/System/Launch/LaunchBackGroundWin.cs
index abad82c..11ee8d3 100644
--- a/System/Launch/LaunchBackGroundWin.cs
+++ b/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);
+                }
             }
-
         }
 
     }

--
Gitblit v1.8.0