hch
5 天以前 d22a2cf47f8015dde7227d45b13833300dd2a8e6
0312 更换背景图
4个文件已修改
159 ■■■■ 已修改文件
Main/System/Launch/LaunchBackGroundWin.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Launch/LaunchWin.cs 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Launch/LoadingWin.cs 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Login/GameAgeWarnWin.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Launch/LaunchBackGroundWin.cs
@@ -8,8 +8,8 @@
public class LaunchBackGroundWin : UIBase
{
    // 组件引用
    [SerializeField] RectTransform m_StaticBackGround;
    [SerializeField] Image m_BackGroundImage;
    // [SerializeField] RectTransform m_StaticBackGround;
    // [SerializeField] Image m_BackGroundImage;
    [SerializeField] TextEx info;
    // 生命周期
    protected override void Awake()
@@ -33,10 +33,10 @@
        LoginManager.Instance.loginErrorEvent += OnLoginError;
        var sprite = BuiltInLoader.LoadSprite("LoginBackGround");
        m_BackGroundImage.overrideSprite = sprite;
        // var sprite = BuiltInLoader.LoadSprite("LoginBackGround");
        // m_BackGroundImage.overrideSprite = sprite;
        //m_BackGroundImage.preserveAspect = true;
        m_StaticBackGround.SetActive(true);
        // m_StaticBackGround.SetActive(true);
        this.transform.SetAsFirstSibling();
        info.text = LoginManager.Instance.loginErrorInfo;
Main/System/Launch/LaunchWin.cs
@@ -14,7 +14,7 @@
    public class LaunchWin : UIBase
    {
        // [SerializeField] UIAlphaTween m_AlphaTween;
        [SerializeField] Image m_BackGround;
        // [SerializeField] Image m_BackGround;
        [SerializeField] RectTransform m_AndroidProgressContainer;
        [SerializeField] RectTransform m_NetworkContainer;
        [SerializeField] SmoothSlider m_PartProgressSlider;
@@ -42,25 +42,25 @@
        protected override void InitComponent()
        {
            base.InitComponent();
            m_BackGround.preserveAspect = true;
            if (Application.isEditor)
            {
                var sprite = BuiltInLoader.LoadSprite("Launch_1");
                m_BackGround.overrideSprite = sprite;
            }
            else
            {
                for (var i = 0; i < 3; i++)
                {
                    var sprite = BuiltInLoader.LoadSprite(StringUtility.Contact("Launch_", i + 1));
                    if (sprite != null)
                    {
                        backGrounds.Add(sprite);
                    }
                }
            // m_BackGround.preserveAspect = true;
            // if (Application.isEditor)
            // {
            //     var sprite = BuiltInLoader.LoadSprite("Launch_1");
            //     m_BackGround.overrideSprite = sprite;
            // }
            // else
            // {
            //     for (var i = 0; i < 3; i++)
            //     {
            //         var sprite = BuiltInLoader.LoadSprite(StringUtility.Contact("Launch_", i + 1));
            //         if (sprite != null)
            //         {
            //             backGrounds.Add(sprite);
            //         }
            //     }
                m_BackGround.overrideSprite = backGrounds[0];
            }
            //     m_BackGround.overrideSprite = backGrounds[0];
            // }
        }
@@ -175,15 +175,15 @@
        {
            UpdateProgress();
            backGroundTimer += Time.deltaTime;
            if (backGroundTimer >= 3f)
            {
                backGroundTimer = 0f;
                if (backGrounds.Count > 1)
                {
                    m_BackGround.overrideSprite = backGrounds[(++backGroundIndex) % backGrounds.Count];
                }
            }
            // backGroundTimer += Time.deltaTime;
            // if (backGroundTimer >= 3f)
            // {
            //     backGroundTimer = 0f;
            //     if (backGrounds.Count > 1)
            //     {
            //         m_BackGround.overrideSprite = backGrounds[(++backGroundIndex) % backGrounds.Count];
            //     }
            // }
            if (HttpBehaviour.ConnectAllTimes >= AllTimes && m_NetworkContainer != null)
            {
@@ -283,7 +283,7 @@
            return new LaunchWinData(){
                backGroundTimer = backGroundTimer,
                backGroundIndex = backGroundIndex,
                sprite = m_BackGround.overrideSprite,
                // sprite = m_BackGround.overrideSprite,
                sprites = backGrounds,
            };
        }
Main/System/Launch/LoadingWin.cs
@@ -10,7 +10,7 @@
    protected int targetProgress = 0;
    // [SerializeField] UIAlphaTween m_AlphaTween;
    [SerializeField] Image m_BackGround;
    [SerializeField] RawImage m_BackGround;
    [SerializeField] SmoothSlider m_PartProgressSlider;
    [SerializeField] SmoothSlider m_TotalProgressSlider;
    [SerializeField] Text m_StageDescription;
@@ -26,30 +26,30 @@
    {
        base.InitComponent();
        if (Application.isEditor)
        {
            if (m_BackGround.overrideSprite == null)
            {
                var sprite = BuiltInLoader.LoadSprite("Launch_1");
                m_BackGround.overrideSprite = sprite;
            }
        }
        else
        {
            if (backGrounds.Count <= 0)
            {
                for (var i = 0; i < 3; i++)
                {
                    var sprite = BuiltInLoader.LoadSprite(StringUtility.Contact("Launch_", i + 1));
                    if (sprite != null)
                    {
                        backGrounds.Add(sprite);
                    }
                }
        // if (Application.isEditor)
        // {
        //     if (m_BackGround.overrideSprite == null)
        //     {
        //         var sprite = BuiltInLoader.LoadSprite("Launch_1");
        //         m_BackGround.overrideSprite = sprite;
        //     }
        // }
        // else
        // {
        //     if (backGrounds.Count <= 0)
        //     {
        //         for (var i = 0; i < 3; i++)
        //         {
        //             var sprite = BuiltInLoader.LoadSprite(StringUtility.Contact("Launch_", i + 1));
        //             if (sprite != null)
        //             {
        //                 backGrounds.Add(sprite);
        //             }
        //         }
                m_BackGround.overrideSprite = backGrounds[0];
            }
        }
        //         m_BackGround.overrideSprite = backGrounds[0];
        //     }
        // }
    }
    protected override void OnPreOpen()
@@ -116,30 +116,30 @@
    protected void LateUpdate()
    {
        UpdateProgress();
        CopiedLogic_LateUpdate();
        // CopiedLogic_LateUpdate();
    }
    private void CopiedLogic_LateUpdate()
    {
        backGroundTimer += Time.deltaTime;
        if (backGroundTimer >= 3f)
        {
            backGroundTimer -= 3f;
            if (backGrounds.Count > 1)
            {
                m_BackGround.overrideSprite = backGrounds[(++backGroundIndex) % backGrounds.Count];
            }
        // backGroundTimer += Time.deltaTime;
        // if (backGroundTimer >= 3f)
        // {
        //     backGroundTimer -= 3f;
        //     if (backGrounds.Count > 1)
        //     {
        //         m_BackGround.overrideSprite = backGrounds[(++backGroundIndex) % backGrounds.Count];
        //     }
            //  考虑在这里做这个描述的切换 或者根据图片来做提示词
            // m_StageDescription.text = "";
        }
        //     //  考虑在这里做这个描述的切换 或者根据图片来做提示词
        //     // m_StageDescription.text = "";
        // }
    }
    public void SetData(LaunchWinData _launchWinData)
    {
        backGroundTimer = _launchWinData.backGroundTimer;
        backGroundIndex = _launchWinData.backGroundIndex;
        m_BackGround.overrideSprite = _launchWinData.sprite;
        // m_BackGround.overrideSprite = _launchWinData.sprite;
        backGrounds = _launchWinData.sprites;
        m_StageDescription.text = Language.GetFromLocal(44);//最后Completed一定是这个 考虑要不要塞入LaunchWinData..
    }
Main/System/Login/GameAgeWarnWin.cs
@@ -14,26 +14,19 @@
    [SerializeField] Transform m_Info2;
    [SerializeField] Transform m_Title3;    //年龄
    [SerializeField] Transform m_Info3;
    [SerializeField] Button m_Close;
    public static int data = 1;
    protected override void InitComponent()
    {
        m_Close.AddListener(CloseWindow);
    }
    // UI事件
    protected override void OnOpen()
    {
        m_Title1.SetActive(data == 1);
        m_Info1.SetActive(data == 1);
        m_Title2.SetActive(data == 2);
        m_Info2.SetActive(data == 2);
        m_Title3.SetActive(data == 3);
        m_Title1.SetActive(data == 1);
        m_Info1.SetActive(data == 1);
        m_Title2.SetActive(data == 2);
        m_Info2.SetActive(data == 2);
        m_Title3.SetActive(data == 3);
        m_Info3.SetActive(data == 3);
    }