yyl
2025-12-01 ea185afc20a915d15eae8adb07d0acd837f3c210
Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
13个文件已修改
158 ■■■■■ 已修改文件
Main/Core/GameEngine/Launch/InitSettingTask.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/GameEngine/Launch/LaunchInHot.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Guild/GuildBaseWin.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Guild/GuildHawkerNoCutCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Guild/GuildHawkerWin.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroBestWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroLVBreakSuccessWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroLVBreakWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroTrainWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/InternalAffairs/AffairBaseWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/InternalAffairs/FuncNPCManager.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Main/MainWin.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Sound/SoundPlayer.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/GameEngine/Launch/InitSettingTask.cs
@@ -14,6 +14,7 @@
    {
        ShaderUtility.InitGlobalParams();
        // SoundPlayer.CreateSoundPlayer();
        SoundPlayer.Instance.Init();
        //SoundPlayer.Instance.PlayLoginMusic();
        SystemSetting.Instance.SetSoundVolume(SystemSetting.Instance.GetSoundVolume());
Main/Core/GameEngine/Launch/LaunchInHot.cs
@@ -25,7 +25,6 @@
        System.Net.ServicePointManager.DefaultConnectionLimit = 100;//设置http最大连接数
        Application.backgroundLoadingPriority = ThreadPriority.High;
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        SoundPlayer.Instance.Init();
        SDKUtils.Instance.Init();  //原sdk接口
        if (!AssetSource.isUseAssetBundle)
Main/System/Guild/GuildBaseWin.cs
@@ -1,5 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
@@ -21,6 +23,19 @@
    [SerializeField] Button requestBtn;
    //NPC对话相关
    [Header("行商必须放第一个")]
    [SerializeField] HeroSkinModel[] funcNPCs;
    [SerializeField] Transform[] talkRects;
    [SerializeField] Text[] talkTexts;
    //行商特殊处理
    [SerializeField] Transform hawkerRect;
    [SerializeField] Transform pos1;
    [SerializeField] Transform pos2;
    [SerializeField] UIHeroController hawkerModel;
    protected override void InitComponent()
    {
        guildBtn.AddListener(() =>
@@ -39,6 +54,7 @@
            StoreModel.Instance.selectStoreFuncType = StoreFunc.Guild;
            UIManager.Instance.OpenWindow<StoreBaseWin>();
        });
        InitHawker();
    }
@@ -47,6 +63,7 @@
        if (PlayerDatas.Instance.fairyData.fairy == null)
            return;
        GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
        GlobalTimeEvent.Instance.fiveSecondEvent += OnFiveSecondEvent;
        Display();
    }
@@ -54,6 +71,7 @@
    protected override void OnPreClose()
    {
        GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
        GlobalTimeEvent.Instance.fiveSecondEvent -= OnFiveSecondEvent;
    }
@@ -65,7 +83,7 @@
    void OnSecondEvent()
    {
        ShowHawkerTime();
        ShowHawkerTime(true);
    }
    void ShowGuildInfo()
@@ -86,7 +104,7 @@
        UIManager.Instance.OpenWindow<GuildHawkerWin>();
    }
    void ShowHawkerTime()
    void ShowHawkerTime(bool modelPlay = false)
    {
        var toTenSeconds = TimeUtility.GetToTheHourSeconds();
        if (toTenSeconds > 0)
@@ -95,12 +113,80 @@
            guildHawkerInfo.SetActive(true);
            var addStr = new string('.', (int)Time.time % 4);
            guildHawkerInfo.text = Language.Get("Guild_72") + addStr;
            if (modelPlay)
                HawkerMove(false);
        }
        else
        {
            guildHawkerTimeText.text = TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds);
            guildHawkerInfo.SetActive(false);
            if (modelPlay)
                HawkerMove(true);
        }
    }
    void InitHawker()
    {
        if (FuncNPCManager.Instance.isHawkerStandBy)
        {
            hawkerRect.localPosition = pos1.localPosition;
        }
        else
        {
            hawkerRect.localPosition = pos2.localPosition;
        }
        hawkerModel.PlayAnimation("idle", true);
    }
    //isShow true走出来,false走出去
    void HawkerMove(bool isShow)
    {
        if (isShow == FuncNPCManager.Instance.isHawkerShowNow)
        {
            return;
        }
        FuncNPCManager.Instance.isHawkerShowNow = isShow;
        hawkerModel.PlayAnimation("zoulu", true);
        FuncNPCManager.Instance.isHawkerStandBy = false;
        hawkerModel.transform.localScale = new Vector3(isShow ? hawkerModel.transform.localScale.x : -hawkerModel.transform.localScale.x, hawkerModel.transform.localScale.y, hawkerModel.transform.localScale.z);
        hawkerRect.DOLocalMove(isShow ? pos1.localPosition : pos2.localPosition, 1f).onComplete = () =>
        {
            hawkerModel.PlayAnimation("idle", true);
            FuncNPCManager.Instance.isHawkerStandBy = isShow;
        };
    }
    //NPC对话相关
    void OnFiveSecondEvent()
    {
        var index = FuncNPCManager.Instance.GetRandomGuildNpcTalk();
        if (index == -1)
        {
            return;
        }
        var talk = FuncNPCManager.Instance.GetGuildTalk(funcNPCs[index].heroSkinID);
        if (talk != null)
        {
            talkTexts[index].text = Language.Get(talk);
            talkRects[index].SetActive(true);
        }
        var npc = funcNPCs[index].GetModel();
        npc.PlayAnimation("hanhua", true);
        Talk(index).Forget();
    }
    async UniTask Talk(int index)
    {
        await UniTask.Delay(5000);
        talkRects[index].SetActive(false);
        var npc = funcNPCs[index].GetModel();
        npc.PlayAnimation("idle", true);
    }
}
Main/System/Guild/GuildHawkerNoCutCell.cs
@@ -15,7 +15,7 @@
    {
        var fairyMember = GuildManager.Instance.tmpNoCutMembers[id];
        nameText.text = fairyMember.Name;
        timeText.text = fairyMember.OffTime != 0 ? UIHelper.GetFadeTime((uint)fairyMember.OffTime) + Language.Get("L1026") : string.Empty;
        timeText.text = fairyMember.OffTime != 0 ? UIHelper.GetFadeTime((uint)fairyMember.OffTime) + Language.Get("L1026") : Language.Get("L1025");
    
    }
    
Main/System/Guild/GuildHawkerWin.cs
@@ -17,7 +17,7 @@
    [SerializeField] Button cutBtn;
    [SerializeField] Text cutText;
    [SerializeField] Text timeText;
    [SerializeField] UIHeroController heroController;
@@ -38,6 +38,7 @@
        scroller.OnRefreshCell += OnRefreshCell;
        GuildManager.Instance.UpdateZhenbaogeEvent += OnPlayerZBGEvent;
        GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
        GlobalTimeEvent.Instance.fiveSecondEvent += OnFiveSecondEvent;
        
        Display();
        CreateScroller();
@@ -55,6 +56,7 @@
        scroller.OnRefreshCell -= OnRefreshCell;
        GuildManager.Instance.UpdateZhenbaogeEvent -= OnPlayerZBGEvent;
        GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
        GlobalTimeEvent.Instance.fiveSecondEvent -= OnFiveSecondEvent;
    }
    void OnSecondEvent()
@@ -62,6 +64,12 @@
        timeText.text = Language.Get("Guild_74", TimeUtility.SecondsToShortDHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds));
    }
    int index = 0;
    void OnFiveSecondEvent()
    {
        index++;
        heroController.PlayAnimation(index % 2 == 0 ? "idle" : "hanhua", true);
    }
    void OnRefreshCell(ScrollerDataType type, CellView cell)
    {
        var _cell = cell as GuildHawkerCutCell;
Main/System/HeroUI/HeroBestWin.cs
@@ -367,13 +367,13 @@
            if (i < breakLevel)
            {
                nameText.text = Language.Get("herocard63", i + 1);
                descText.text = string.Join(Language.Get("L1112"), attrStrArr);
                descText.text = string.Join("\n", attrStrArr);
            }
            else
            {
                //置灰
                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join(Language.Get("L1112"), attrStrArr)));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join("\n", attrStrArr)));
            }
        }
Main/System/HeroUI/HeroLVBreakSuccessWin.cs
@@ -84,7 +84,7 @@
            var skill = SkillConfig.Get(nextQualityBreakConfig.SkillID);
            attrStrArr.Add(Language.Get("L1039", skill.SkillName) + skill.Description);
        }
        potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join(Language.Get("L1112"), attrStrArr));
        potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join("\n", attrStrArr));
    }
}
Main/System/HeroUI/HeroLVBreakWin.cs
@@ -96,7 +96,7 @@
                Debug.LogError("未配置技能" + nextQualityBreakConfig.SkillID);
            }
        }
        potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join(Language.Get("L1112"), attrStrArr));
        potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join("\n", attrStrArr));
    }
    void BreakLV()
Main/System/HeroUI/HeroTrainWin.cs
@@ -586,13 +586,13 @@
            if (i < hero.breakLevel)
            {
                nameText.text = Language.Get("herocard63", i + 1);
                descText.text = string.Join(Language.Get("L1112"), attrStrArr);
                descText.text = string.Join("\n", attrStrArr);
            }
            else
            {
                //置灰
                nameText.text = UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join(Language.Get("L1112"), attrStrArr)));
                descText.text = UIHelper.AppendColor(TextColType.NavyGray, UIHelper.RemoveColor(string.Join("\n", attrStrArr)));
            }
        }
Main/System/InternalAffairs/AffairBaseWin.cs
@@ -164,7 +164,7 @@
    async UniTask Talk(int index)
    {
        await UniTask.Delay(4500);
        await UniTask.Delay(5000);
        talkRects[index].SetActive(false);
        var npc = funcNPCs[index].GetModel();
        npc.PlayAnimation("idle", true);
Main/System/InternalAffairs/FuncNPCManager.cs
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Codice.Client.Common;
using LitJson;
using UnityEngine;
@@ -17,6 +16,10 @@
    public List<int> guildTalkIndexList = new List<int>();
    public float lastGuildTalkTime;
    public int lastGuildRandomIndex;
    //行商特殊处理
    public bool isHawkerShowNow = false; //行商状态,true 行商走出来和站岗中,false 行商走出去和外出中
    public bool isHawkerStandBy = false; //行商状态,true 行商站岗中,只有true才能参与喊话;移动或者消失都为false
    public override void Init()
@@ -70,9 +73,28 @@
    public int GetRandomGuildNpcTalk()
    {
        int index = Random.Range(0, guildTalkIndexList.Count);
        //行商特殊处理,行商非站岗中不参与喊话
        int index;
        if (isHawkerStandBy)
        {
            index = Random.Range(0, guildTalkIndexList.Count);
        }
        else
        {
            if (guildTalkIndexList.Count == 1)
            {
                return -1;
            }
            index = Random.Range(1, guildTalkIndexList.Count);
        }
        if (index == lastGuildRandomIndex)
        {
            if (guildTalkIndexList.Count == 1)
            {
                //只有一个的情况
                lastGuildRandomIndex = -1;
                return -1;
            }
            index = (index + 1) % guildTalkIndexList.Count;
        }
        lastGuildRandomIndex = index;
@@ -88,5 +110,14 @@
        }
        return null;
    }
    public string GetGuildTalk(int skinID)
    {
        if (guildNpcTalkDic.ContainsKey(skinID))
        {
            return guildNpcTalkDic[skinID][Random.Range(0, guildNpcTalkDic[skinID].Length)];
        }
        return null;
    }
}
Main/System/Main/MainWin.cs
@@ -195,6 +195,7 @@
        {
            if (currentSubUI != null && currentSubUI.name == "HomeWin")
            {
                fightEffect.Play();
                //手动自动一起处理
                AutoFightModel.Instance.StartFight();
            }
@@ -350,7 +351,8 @@
    {
        if (isfighting)
        {
            fightEffect.Play();
            if (!fightEffect.isPlaying)
                fightEffect.Play();
            nextCantAttackMask.localScale = Vector3.zero;
            cdTween.SetStartState();
            cdTween.Play(() =>
Main/System/Sound/SoundPlayer.cs
@@ -89,6 +89,7 @@
        m_Instance.name = "SoundPlayer";
        m_Instance.SetActive(true);
        DontDestroyOnLoad(gameObject);
        Debug.Log("CreateSoundPlayer");
    }
    public void PlayBackGroundMusic(int _audioId)