From ea185afc20a915d15eae8adb07d0acd837f3c210 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 01 十二月 2025 11:37:29 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/HeroUI/HeroLVBreakSuccessWin.cs | 2
Main/System/InternalAffairs/AffairBaseWin.cs | 2
Main/System/InternalAffairs/FuncNPCManager.cs | 35 +++++++++++
Main/Core/GameEngine/Launch/InitSettingTask.cs | 1
Main/System/Sound/SoundPlayer.cs | 1
Main/System/Guild/GuildHawkerWin.cs | 10 +++
Main/System/HeroUI/HeroBestWin.cs | 4
Main/System/HeroUI/HeroLVBreakWin.cs | 2
Main/Core/GameEngine/Launch/LaunchInHot.cs | 1
Main/System/Guild/GuildHawkerNoCutCell.cs | 2
Main/System/Main/MainWin.cs | 4 +
Main/System/Guild/GuildBaseWin.cs | 90 +++++++++++++++++++++++++++++
Main/System/HeroUI/HeroTrainWin.cs | 4
13 files changed, 143 insertions(+), 15 deletions(-)
diff --git a/Main/Core/GameEngine/Launch/InitSettingTask.cs b/Main/Core/GameEngine/Launch/InitSettingTask.cs
index 3b2fd94..c4b65ed 100644
--- a/Main/Core/GameEngine/Launch/InitSettingTask.cs
+++ b/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());
diff --git a/Main/Core/GameEngine/Launch/LaunchInHot.cs b/Main/Core/GameEngine/Launch/LaunchInHot.cs
index b1865c5..740a69b 100644
--- a/Main/Core/GameEngine/Launch/LaunchInHot.cs
+++ b/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(); //鍘焥dk鎺ュ彛
if (!AssetSource.isUseAssetBundle)
diff --git a/Main/System/Guild/GuildBaseWin.cs b/Main/System/Guild/GuildBaseWin.cs
index f75ce64..8584a57 100644
--- a/Main/System/Guild/GuildBaseWin.cs
+++ b/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);
}
}
\ No newline at end of file
diff --git a/Main/System/Guild/GuildHawkerNoCutCell.cs b/Main/System/Guild/GuildHawkerNoCutCell.cs
index 882838a..2402086 100644
--- a/Main/System/Guild/GuildHawkerNoCutCell.cs
+++ b/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");
}
diff --git a/Main/System/Guild/GuildHawkerWin.cs b/Main/System/Guild/GuildHawkerWin.cs
index 0beb2df..89230f1 100644
--- a/Main/System/Guild/GuildHawkerWin.cs
+++ b/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;
diff --git a/Main/System/HeroUI/HeroBestWin.cs b/Main/System/HeroUI/HeroBestWin.cs
index 1688850..6659dd0 100644
--- a/Main/System/HeroUI/HeroBestWin.cs
+++ b/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)));
}
}
diff --git a/Main/System/HeroUI/HeroLVBreakSuccessWin.cs b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
index 18db587..2812657 100644
--- a/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
+++ b/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));
}
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroLVBreakWin.cs b/Main/System/HeroUI/HeroLVBreakWin.cs
index fcc9d6d..36c8025 100644
--- a/Main/System/HeroUI/HeroLVBreakWin.cs
+++ b/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()
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index 3072570..9e97cf8 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/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)));
}
}
diff --git a/Main/System/InternalAffairs/AffairBaseWin.cs b/Main/System/InternalAffairs/AffairBaseWin.cs
index e30ea39..70f9f57 100644
--- a/Main/System/InternalAffairs/AffairBaseWin.cs
+++ b/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);
diff --git a/Main/System/InternalAffairs/FuncNPCManager.cs b/Main/System/InternalAffairs/FuncNPCManager.cs
index e2d3b72..6d482f2 100644
--- a/Main/System/InternalAffairs/FuncNPCManager.cs
+++ b/Main/System/InternalAffairs/FuncNPCManager.cs
@@ -1,6 +1,5 @@
锘縰sing 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鎵嶈兘鍙備笌鍠婅瘽锛涚Щ鍔ㄦ垨鑰呮秷澶遍兘涓篺alse
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;
+ }
}
diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index cf8dec2..0ff99d4 100644
--- a/Main/System/Main/MainWin.cs
+++ b/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(() =>
diff --git a/Main/System/Sound/SoundPlayer.cs b/Main/System/Sound/SoundPlayer.cs
index 61ebe21..e91c270 100644
--- a/Main/System/Sound/SoundPlayer.cs
+++ b/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)
--
Gitblit v1.8.0