From 62188b271cce5e3aec5ca40d58c30f08643e2f60 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 04 九月 2025 23:20:17 +0800
Subject: [PATCH] 117 【武将】武将系统 - 天赋部分,优化自动战斗
---
Main/Component/UI/Decorate/Tweens/ScaleTween.cs | 9
Main/System/Equip/EquipModel.cs | 10
Main/System/HeroUI/HeroLVBreakSuccessWin.cs | 6
Main/System/HeroUI/HeroUIManager.Talent.cs | 110 +++++++++
Main/System/HeroUI/HeroGiftEatWin.cs | 68 +++++
Main/Common/EventName.cs | 4
Main/Component/UI/Core/ButtonEx.cs | 16 +
Main/System/HeroUI/GiftBaseCell.cs | 30 ++
Main/System/HeroUI/HeroGiftLineCell.cs | 9
Main/System/SkillUI/SkillWordCell.cs | 2
Main/System/Battle/BattleField/StoryBattleField.cs | 15
Main/System/Main/AutoFightWin.cs | 1
Main/System/Battle/BattleField/BattleField.cs | 8
Main/System/Hero/HeroInfo.Talent.cs | 49 +++-
Main/Utility/ComponentExtersion.cs | 6
Main/System/SkillUI/SkillBaseCell.cs | 2
Main/System/Battle/BattleObject/BattleObject.cs | 2
Main/Config/PartialConfigs/HeroAwakeConfig.cs | 12
Main/System/HeroUI/HeroShowBaseCell.cs | 37 +-
Main/Config/PartialConfigs/PlayerPropertyConfig.cs | 3
Main/System/HeroUI/HeroTrainWin.cs | 88 ++----
Main/System/Main/AutoFightModel.cs | 26 +
Main/Component/UI/Decorate/Tweens/PositionTween.cs | 68 ++--
Main/System/Battle/BattleManager.cs | 2
Main/System/HeroUI/HeroGiftEatWin.cs.meta | 11
Main/Component/UI/Decorate/Tweens/TweenEx.cs | 12
/dev/null | 31 --
Main/Utility/UIHelper.cs | 26 ++
Main/Component/UI/Decorate/Tweens/RotationTween.cs | 10
Main/System/Battle/Skill/SkillBase.cs | 1
Main/System/Main/MainWin.cs | 8
Main/System/HeroUI/HeroListWin.cs | 2
Main/System/HeroUI/HeroHeadBaseCell.cs | 2
Main/System/HeroUI/HeroUIManager.Talent.cs.meta | 0
34 files changed, 481 insertions(+), 205 deletions(-)
diff --git a/Main/Common/EventName.cs b/Main/Common/EventName.cs
index b7dda2c..15df307 100644
--- a/Main/Common/EventName.cs
+++ b/Main/Common/EventName.cs
@@ -11,6 +11,8 @@
public const string DISPLAY_BATTLE_UI = "DISPLAY_BATTLE_UI";//鏄剧ず鎴樻枟UI
public const string BATTLE_DROP_ITEMS = "BATTLE_DROP_ITEMS";//鎺夎惤鐗╁搧
-
+
public const string BATTLE_CAST_SKILL = "BATTLE_CAST_SKILL";//鏂芥斁鎶�鑳�
+
+ public const string BATTLE_END = "BATTLE_END";//鎴樻枟缁撴潫
}
\ No newline at end of file
diff --git a/Main/Component/UI/Core/ButtonEx.cs b/Main/Component/UI/Core/ButtonEx.cs
index d70c07c..87d4365 100644
--- a/Main/Component/UI/Core/ButtonEx.cs
+++ b/Main/Component/UI/Core/ButtonEx.cs
@@ -14,8 +14,11 @@
public bool customNegativeSound = false;
public int positiveSound = 0;
public int negativeSound = 0;
+ public float pressedScale = 1.1f;
float m_AbleTime = 0f;
+ private Vector3 originalScale;
+
public float ableTime {
get { return m_AbleTime; }
private set {
@@ -44,6 +47,19 @@
protected override void Awake()
{
base.Awake();
+ originalScale = transform.localScale;
+ }
+
+ public override void OnPointerDown(PointerEventData eventData)
+ {
+ base.OnPointerDown(eventData);
+ transform.localScale = originalScale * pressedScale;
+ }
+
+ public override void OnPointerUp(PointerEventData eventData)
+ {
+ base.OnPointerUp(eventData);
+ transform.localScale = originalScale;
}
private void PlayPositiveSound()
diff --git a/Main/Component/UI/Decorate/Tweens/PositionTween.cs b/Main/Component/UI/Decorate/Tweens/PositionTween.cs
index 8ccc0b0..8663e4f 100644
--- a/Main/Component/UI/Decorate/Tweens/PositionTween.cs
+++ b/Main/Component/UI/Decorate/Tweens/PositionTween.cs
@@ -1,45 +1,45 @@
锘縰sing UnityEngine;
using System.Collections;
- public class PositionTween : TweenEx
+public class PositionTween : TweenEx
+{
+
+ public override void SetStartState()
{
+ base.SetStartState();
+ this.rectTransform.anchoredPosition = from;
+ }
- public override void SetStartState()
+ public override void SetEndState()
+ {
+ base.SetEndState();
+ this.rectTransform.anchoredPosition = to;
+ }
+
+ protected override void OnPrepare()
+ {
+ base.OnPrepare();
+ this.rectTransform.anchoredPosition = reversal ? to : from;
+ }
+
+ protected override void OnOnceEnd()
+ {
+ if (wrapMode == WrapMode.PingPongOnce)
{
- base.SetStartState();
- this.rectTransform.anchoredPosition = from;
+ SetStartState();
}
-
- public override void SetEndState()
- {
- base.SetEndState();
- this.rectTransform.anchoredPosition = to;
+ else
+ {
+ this.rectTransform.anchoredPosition = reversal ? from : to;
}
+ base.OnOnceEnd();
- protected override void OnPrepare()
- {
- base.OnPrepare();
- this.rectTransform.anchoredPosition = reversal ? to : from;
- }
+ }
- protected override void OnOnceEnd()
- {
- if (wrapMode == WrapMode.PingPongOnce)
- {
- SetStartState();
- }
- else
- {
- this.rectTransform.anchoredPosition = reversal ? from : to;
- }
+ protected override void UpdateVector3()
+ {
+ base.UpdateVector3();
+ this.rectTransform.anchoredPosition = CalculateVector3();
+ }
- base.OnOnceEnd();
- }
-
- protected override void UpdateVector3()
- {
- base.UpdateVector3();
- this.rectTransform.anchoredPosition = CalculateVector3();
- }
-
- }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Decorate/Tweens/RotationTween.cs b/Main/Component/UI/Decorate/Tweens/RotationTween.cs
index 3360e8d..15435e6 100644
--- a/Main/Component/UI/Decorate/Tweens/RotationTween.cs
+++ b/Main/Component/UI/Decorate/Tweens/RotationTween.cs
@@ -25,8 +25,14 @@
protected override void OnOnceEnd()
{
-
- this.transform.localEulerAngles = reversal ? from : to;
+ if (wrapMode == WrapMode.PingPongOnce)
+ {
+ SetStartState();
+ }
+ else
+ {
+ this.transform.localEulerAngles = reversal ? from : to;
+ }
base.OnOnceEnd();
}
diff --git a/Main/Component/UI/Decorate/Tweens/ScaleTween.cs b/Main/Component/UI/Decorate/Tweens/ScaleTween.cs
index 7b51006..58f2cb0 100644
--- a/Main/Component/UI/Decorate/Tweens/ScaleTween.cs
+++ b/Main/Component/UI/Decorate/Tweens/ScaleTween.cs
@@ -23,7 +23,14 @@
protected override void OnOnceEnd()
{
- this.transform.localScale = reversal ? from : to;
+ if (wrapMode == WrapMode.PingPongOnce)
+ {
+ SetStartState();
+ }
+ else
+ {
+ this.transform.localScale = reversal ? from : to;
+ }
base.OnOnceEnd();
}
diff --git a/Main/Component/UI/Decorate/Tweens/TweenEx.cs b/Main/Component/UI/Decorate/Tweens/TweenEx.cs
index a973999..d31e5c8 100644
--- a/Main/Component/UI/Decorate/Tweens/TweenEx.cs
+++ b/Main/Component/UI/Decorate/Tweens/TweenEx.cs
@@ -99,14 +99,8 @@
switch (wrapMode)
{
case WrapMode.Once:
- if (accumulatedTime > duration)
- {
- OnOnceEnd();
- doTween = false;
- }
- break;
case WrapMode.PingPongOnce:
- if (accumulatedTime > duration*2)
+ if (accumulatedTime > duration)
{
OnOnceEnd();
doTween = false;
@@ -173,9 +167,11 @@
t = Mathf.Repeat((accumulatedTime / duration) * curveLength, 1);
break;
case WrapMode.PingPong:
- case WrapMode.PingPongOnce:
t = Mathf.PingPong((accumulatedTime / duration) * curveLength, 1);
break;
+ case WrapMode.PingPongOnce:
+ t = Mathf.PingPong((accumulatedTime / (duration/2)) * curveLength, 1);
+ break;
}
var value = curve.Evaluate(reversal ? curveLength - t : t);
diff --git a/Main/Config/PartialConfigs/HeroAwakeConfig.cs b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
index 4d2d182..bb89580 100644
--- a/Main/Config/PartialConfigs/HeroAwakeConfig.cs
+++ b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
@@ -63,7 +63,17 @@
{
return item.Key;
}
- }
+ }
return 0;
}
+
+ public static int GetMaxAwakeLV(int heroID)
+ {
+ Dictionary<int, HeroAwakeConfig> tempDic = null;
+ if (!configDics.TryGetValue(heroID, out tempDic))
+ {
+ return 0;
+ }
+ return tempDic.Count;
+ }
}
diff --git a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
index c137e4c..80dbebe 100644
--- a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
+++ b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -30,8 +30,9 @@
public static int[] baseAttrs = new int[] { 6, 7, 8 };
+ // 鏄犲皠瀵瑰簲鐨勭櫨鍒嗘瘮灞炴�э紝鏂逛究浣跨敤锛屽璁$畻灞炴�ч渶瑕佹壘瀵瑰簲鐨勭櫨鍒嗘瘮鍔犳垚
public static Dictionary<int, int> baseAttr2perDict = new Dictionary<int, int>()
- {
+ {
{ 6,16 },
{ 7,17 },
{ 8,18 }
diff --git a/Main/System/Battle/BattleField/BattleField.cs b/Main/System/Battle/BattleField/BattleField.cs
index 0d0be34..21cd1da 100644
--- a/Main/System/Battle/BattleField/BattleField.cs
+++ b/Main/System/Battle/BattleField/BattleField.cs
@@ -439,17 +439,19 @@
{
Debug.LogError("鎴樻枟鑳滃埄");
// 鎴樻枟鑳滃埄
-
- // 濡傛灉鏄嚜鍔ㄦ垬鏂楄浆鑷姩鎴樻枟锛�
}
else
{
// 鎴樻枟澶辫触
Debug.LogError("鎴樻枟澶辫触");
- // HaveRest();
}
IsBattleFinish = true;
+
+
+ //鎻愪緵澶栭儴 鑳滃埄绛夊鍔辨樉绀�
+ EventBroadcast.Instance.Broadcast<string, JsonData>(EventName.BATTLE_END, guid, turnFightStateData);
+
});
recordPlayer.PlayRecord(battleEndAction);
diff --git a/Main/System/Battle/BattleField/StoryBattleField.cs b/Main/System/Battle/BattleField/StoryBattleField.cs
index e69b472..3cb2bfe 100644
--- a/Main/System/Battle/BattleField/StoryBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBattleField.cs
@@ -122,13 +122,6 @@
public override void OnTurnFightState(int turnNum, int State, int FuncLineID, JsonData extendData)
{
base.OnTurnFightState(turnNum, State, FuncLineID, extendData);
-
- // 0-璧峰鐘舵�佹爣璁帮紱1-鍑嗗瀹屾瘯锛�2-鎴樻枟涓紱3-鎴樻枟缁撴潫锛�4-缁撶畻濂栧姳锛�5-缁撴潫鐘舵�佹爣璁� 6-浼戞伅骞剁粨鏉�
- if (State == 4)
- {
- //涓婁竴娉㈠皬鎬浜★紝榛樿甯帺瀹惰姹備竴涓嬪埛鏂版柊鎬紝鐜╁鐐瑰嚮閿ゅ瓙鏃跺�欏氨鍙互鐩存帴鏀诲嚮
- RequestFight();
- }
}
protected void OnTeamChange(TeamType teamType)
@@ -141,6 +134,13 @@
}
}
}
+
+
+ protected override void OnSettlement(JsonData turnFightStateData)
+ {
+ RequestFight();
+ }
+
public override void HaveRest()
{
@@ -157,7 +157,6 @@
// public override void OnBattleEnd(JsonData turnFightStateData)
// {
// base.OnBattleEnd(turnFightStateData);
-
// // HaveRest();
// }
diff --git a/Main/System/Battle/BattleManager.cs b/Main/System/Battle/BattleManager.cs
index 177c95e..bc0fe5f 100644
--- a/Main/System/Battle/BattleManager.cs
+++ b/Main/System/Battle/BattleManager.cs
@@ -407,7 +407,7 @@
// 0-鍋滄鎴樻枟鍥炲煄 - 鐜╁涓诲姩鐐瑰嚮鍥炲煄鏃跺彂閫�
// 1-璁剧疆娑堣�楀�嶅�� - 鐜╁璁剧疆娑堣�楀�嶅�硷紝瀵瑰簲鍒扮帺瀹秛seHarmerCount鐨勫��
// 2-鎸戞垬鍏冲崱灏忔�� - 鐜╁鐐瑰嚮寮�濮嬫垬鏂楁椂鍙戦�侊紝浠呬粠浼戞伅鐘舵�佸埌寮�濮嬫垬鏂楁椂鍙戦�佸嵆鍙�
- // 3-鎸戞垬鍏冲崱boss - 鐜╁璇锋眰鎸戞垬璇ュ叧鍗oss鏃跺彂閫�
+ // 3-閲嶅畾涔夋殏鏈娇鐢�
// 4-缁х画鎴樻枟 - 鐜╁涓荤嚎鎴樻枟涓紙鍖呭惈涓荤嚎灏忔��佷富绾縝oss锛夛紝鍓嶇琛ㄧ幇瀹屽悗绔悓姝ョ殑鎴樻枟鐗囨鍚庯紝鍙啀鍥炲璇ュ�硷紝鍚庣浼氭牴鎹垬鏂楅�昏緫鍙婃祦绋嬭嚜鍔ㄥ洖澶嶄笅涓�娈电殑鎴樻枟鐗囨灏佸寘锛屼竴鐩村惊鐜�
public void MainFightRequest(byte reqType, uint reqValue = 0)
{
diff --git a/Main/System/Battle/BattleObject/BattleObject.cs b/Main/System/Battle/BattleObject/BattleObject.cs
index 060bdb9..110afc0 100644
--- a/Main/System/Battle/BattleObject/BattleObject.cs
+++ b/Main/System/Battle/BattleObject/BattleObject.cs
@@ -353,7 +353,7 @@
public void PerformDrop()
{
- if (null == battleDrops)
+ if (null == battleDrops || battleDrops.dropItemPackIndex.Count == 0)
return;
EventBroadcast.Instance.Broadcast<string, BattleDrops, Action>(
diff --git a/Main/System/Battle/Skill/SkillBase.cs b/Main/System/Battle/Skill/SkillBase.cs
index 247d755..374c71f 100644
--- a/Main/System/Battle/Skill/SkillBase.cs
+++ b/Main/System/Battle/Skill/SkillBase.cs
@@ -4,7 +4,6 @@
using DG.Tweening;
using Spine;
using System.Linq;
-using PlasticGui.WorkspaceWindow.BranchExplorer;
public class SkillBase
diff --git a/Main/System/Equip/EquipModel.cs b/Main/System/Equip/EquipModel.cs
index 7135882..06e3d8c 100644
--- a/Main/System/Equip/EquipModel.cs
+++ b/Main/System/Equip/EquipModel.cs
@@ -87,7 +87,9 @@
{
if (!string.IsNullOrEmpty(guid))
return;
+
lastDropIndexs = drops.dropItemPackIndex;
+ // Debug.Log("-鎺夎惤瑁呭 " + lastDropIndexs.Count + " 涓�" + JsonMapper.ToJson(lastDropIndexs));
NotifyItemDrop(drops.dropItemPackIndex, drops.rectTransform);
action?.Invoke();
}
@@ -118,6 +120,7 @@
if (item == null)
return;
+
//闈炶嚜鍔ㄦā寮忎笅锛岀瓫閫夎澶囨墦寮�瑁呭鎿嶄綔鐣岄潰
if (IsEquip(item))
{
@@ -136,7 +139,8 @@
if (info.MakeValue == 0)
return;
- waitEquipOPPack = false;
+ if (info.MakeValue == 2)
+ waitEquipOPPack = false;
bool isDone = false; // 鎹笂鏂拌澶囦笖鍒嗚В浜嗘棫瑁呭
//閫変腑鐨勫湴鏉胯澶囪繘琛屽鐞嗭紝鏇挎崲杩樻槸鎵句笅涓�浠讹紝妫�鏌nEquipOPResultAction
if (selectFloorEquip != null)
@@ -182,7 +186,7 @@
/// <param name="autoDecompose"></param>
public void SendEquipOP(ushort[] itemIndexList, byte opType, bool autoDecompose = false)
{
- if (waitEquipOPPack) return;
+ if (opType == 2 && waitEquipOPPack) return;
// NoteFloorEquip(itemIndexList, opType);
var pack = new CB415_tagCSMainDropItemOP();
@@ -191,7 +195,7 @@
pack.OPType = opType;
pack.OPValue = (byte)(autoDecompose ? 1 : 0); // 鏇挎崲鍚庢槸鍚﹁嚜鍔ㄥ垎瑙e師瑁呭锛�0鍚�1鏄�
- if (opType > 0)
+ if (opType == 2)
waitEquipOPPack = true;
GameNetSystem.Instance.SendInfo(pack);
}
diff --git a/Main/System/Hero/HeroInfo.Talent.cs b/Main/System/Hero/HeroInfo.Talent.cs
index d493875..7f31b92 100644
--- a/Main/System/Hero/HeroInfo.Talent.cs
+++ b/Main/System/Hero/HeroInfo.Talent.cs
@@ -41,6 +41,17 @@
}
}
+ // 75 # 鑻遍泟澶╄祴娲楃偧閿佸畾绱㈠紩鍒楄〃锛屽搴�71澶╄祴ID绱㈠紩
+ public List<int> talentLockList
+ {
+ get
+ {
+ if (itemHero == null)
+ return null;
+ return itemHero.GetUseData(75);
+ }
+ }
+
Dictionary<int, int> talentAttrDic = new Dictionary<int, int>(); //灞炴�D : 澶╄祴灞炴�у��
@@ -85,23 +96,37 @@
return 0;
}
- public int GetMaxStarCount()
- {
- if (Quality < 4)
- return HeroUIManager.normalGiftMaxCnt * HeroUIManager.Instance.maxGiftLevel;
- return HeroUIManager.giftMaxCnt * HeroUIManager.Instance.maxGiftLevel;
- }
- public int GetTotalStarCount()
- {
- //talentLvList閲岀殑鍏冪礌鍏ㄩ儴鐩稿姞
- return talentLvList.Sum();
- }
-
+ //澶╄祴浼氭洿蹇埌杈炬弧绾э紱瑙夐啋鍙互鎻愬崌鏄熶笂闄�,濡傚垵濮嬫椂40婊℃槦锛岃閱扻绾у悗50婊℃槦
+ //鍒ゆ柇褰撳墠鏄惁婊℃槦
public bool IsFullStar()
+ {
+ if (HeroAwakeConfig.GetHeroAwakeConfig(heroId, 1) == null)
+ {
+ return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper;
+ }
+
+ //鏍规嵁瑙夐啋绱鎻愬崌鏄熶笂闄�
+ int addStarCount = 0;
+ for (int i = 1; i <= awakeLevel; i++)
+ {
+ addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroId, i).AddStarUpper;
+ }
+ return heroStar >= HeroQualityConfig.Get(Quality).InitStarUpper + addStarCount;
+ }
+
+ public bool IsFullGift()
{
//妫�鏌alentLvList 鎵�鏈夊厓绱犻兘澶т簬绛変簬10
return talentLvList.All(x => x >= HeroUIManager.Instance.maxGiftLevel);
}
+
+
+ public int GetTalentLockCount()
+ {
+ //talentLockList閲岀殑鍏冪礌鍏ㄩ儴鐩稿姞 1浠h〃閿佸畾 0浠h〃鏈攣瀹�
+ return talentLockList.Sum();
+ }
+
}
diff --git a/Main/System/HeroUI/GiftBaseCell.cs b/Main/System/HeroUI/GiftBaseCell.cs
index efa2179..8370f3e 100644
--- a/Main/System/HeroUI/GiftBaseCell.cs
+++ b/Main/System/HeroUI/GiftBaseCell.cs
@@ -106,9 +106,8 @@
//showState 0锛氫笉鏄剧ず 1锛氭柊澧� 2锛氭彁鍗�
//giftID 0 :浠h〃鐏拌壊闇�鍗囨槦婵�娲� -1锛氫唬琛ㄦ鑹查渶瑙夐啋婵�娲伙紝鍏朵粬鏍规嵁閰嶈〃锛屾病鏈夊ぉ璧嬬殑澶栧眰鎺у埗鏄鹃殣
- public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0)
+ public void Init(int giftID, int lv, UnityAction onclick = null, int showState = 0, int heroID = 0, int index = 0)
{
- giftBtn.AddListener(onclick);
if (HeroTalentConfig.HasKey(giftID))
{
var config = HeroTalentConfig.Get(giftID);
@@ -129,7 +128,32 @@
lvRect.SetActive(false);
stateImg.SetActive(false);
}
+ giftBtn.AddListener(onclick != null ? onclick : () => { ShowSmallTip(giftID, lv, heroID, index); });
}
+
+ void ShowSmallTip(int giftID, int giftLV, int heroID, int index)
+ {
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ if (giftID > 0)
+ {
+ var giftConfig = HeroTalentConfig.Get(giftID);
+ SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
+ Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+
+ }
+ else if (giftID == 0)
+ {
+ SmallTipWin.showText = Language.Get("HeroGift1");
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ }
+ else if (giftID == -1)
+ {
+ SmallTipWin.showText = Language.Get("HeroGift2", HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(heroID, index));
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ }
+ }
+
Color32 GetColor(int quality)
{
@@ -220,7 +244,7 @@
}
scale = width / rect.sizeDelta.x;
- cellContainer.transform.localScale = new Vector3(scale, scale, scale);
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
}
}
diff --git a/Main/System/HeroUI/HeroGiftEatWin.cs b/Main/System/HeroUI/HeroGiftEatWin.cs
new file mode 100644
index 0000000..1f25fb6
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftEatWin.cs
@@ -0,0 +1,68 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鍚炲櫖鐣岄潰
+/// </summary>
+public class HeroGiftEatWin : UIBase
+{
+ [SerializeField] HeroShowBaseCell heroShow;
+ [SerializeField] GiftBaseCell[] giftCells;
+ [SerializeField] Button addHeroBtn;
+ [SerializeField] GameObject addHeroGo;
+ [SerializeField] HeroShowBaseCell addHeroShow;
+ [SerializeField] GiftBaseCell[] addGiftCells;
+ [SerializeField] GameObject addTip;
+ [SerializeField] GameObject addAttrGo;
+ [SerializeField] Text[] addAttrTexts;
+ [SerializeField] Text addGiftTip;
+
+ [SerializeField] GameObject eatBtn;
+
+
+
+ string addHeroGuid;
+
+ protected override void OnPreOpen()
+ {
+ var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
+ Display(hero);
+ }
+
+ protected override void OnPreClose()
+ {
+ addHeroGuid = "";
+ }
+
+
+ public void Display(HeroInfo hero)
+ {
+ heroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel);
+ HeroUIManager.Instance.RefreshGiftCell(giftCells, hero);
+ if (string.IsNullOrEmpty(addHeroGuid))
+ {
+ addHeroBtn.SetActive(true);
+ addHeroGo.SetActive(false);
+ addTip.SetActive(true);
+ addAttrGo.SetActive(false);
+ }
+ else
+ {
+ addHeroBtn.SetActive(false);
+ addHeroGo.SetActive(true);
+ addTip.SetActive(false);
+ addAttrGo.SetActive(true);
+ var addHero = HeroManager.Instance.GetHero(addHeroGuid);
+ addHeroShow.Init(addHero.heroId, addHero.SkinID, addHero.breakLevel, addHero.heroStar, addHero.awakeLevel, addHero.heroLevel);
+ HeroUIManager.Instance.RefreshGiftCell(addGiftCells, addHero);
+ for (int i = 0; i < addAttrTexts.Length; i++)
+ {
+ int id = PlayerPropertyConfig.baseAttrs[i];
+ addAttrTexts[i].text = PlayerPropertyConfig.GetFullDescription(id, hero.qualityConfig.StarAddPer);
+ }
+ addGiftTip.SetActive(hero.IsFullGift());
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroGiftEatWin.cs.meta b/Main/System/HeroUI/HeroGiftEatWin.cs.meta
new file mode 100644
index 0000000..8b35be1
--- /dev/null
+++ b/Main/System/HeroUI/HeroGiftEatWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 93b6b3386d485e34580130c8aff973bb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroGiftLineCell.cs b/Main/System/HeroUI/HeroGiftLineCell.cs
index b4702fa..d4237d4 100644
--- a/Main/System/HeroUI/HeroGiftLineCell.cs
+++ b/Main/System/HeroUI/HeroGiftLineCell.cs
@@ -14,14 +14,7 @@
var giftID = configList[index];
var giftLV = HeroUIManager.Instance.maxGiftLevel;
cardList[i].SetActive(true);
- cardList[i].Init(giftID, giftLV, () =>
- {
- var giftConfig = HeroTalentConfig.Get(giftID);
- SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
- Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
- SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
- UIManager.Instance.OpenWindow<SmallTipWin>();
- });
+ cardList[i].Init(giftID, giftLV);
}
else
{
diff --git a/Main/System/HeroUI/HeroHeadBaseCell.cs b/Main/System/HeroUI/HeroHeadBaseCell.cs
index 5547b2f..983cbcd 100644
--- a/Main/System/HeroUI/HeroHeadBaseCell.cs
+++ b/Main/System/HeroUI/HeroHeadBaseCell.cs
@@ -232,7 +232,7 @@
}
scale = width / rect.sizeDelta.x;
- cellContainer.transform.localScale = new Vector3(scale, scale, scale);
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
}
}
diff --git a/Main/System/HeroUI/HeroLVBreakSuccessWin.cs b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
index d8b7124..68d26f7 100644
--- a/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
+++ b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
@@ -21,7 +21,6 @@
string guid;
- HeroInfo hero;
protected override void InitComponent()
@@ -35,8 +34,7 @@
guid = HeroUIManager.Instance.waitResponse.guid;
if (string.IsNullOrEmpty(guid))
return;
- hero = HeroManager.Instance.GetHero(guid);
- Refresh();
+ Display(HeroManager.Instance.GetHero(guid));
}
protected override void OnPreClose()
@@ -44,7 +42,7 @@
}
- public override void Refresh()
+ public void Display(HeroInfo hero)
{
breakLVText.text = "+" + (hero.breakLevel - 1);
nextBreakLVText.text = "+" + hero.breakLevel;
diff --git a/Main/System/HeroUI/HeroListWin.cs b/Main/System/HeroUI/HeroListWin.cs
index 7af32c7..18a5c4e 100644
--- a/Main/System/HeroUI/HeroListWin.cs
+++ b/Main/System/HeroUI/HeroListWin.cs
@@ -169,7 +169,7 @@
void RefreshPackCount()
{
int count = singlePack.GetAllItems().Count;
- heroPackText.text = UIHelper.AppendColor(count > singlePack.unlockedGridCount ? TextColType.Red : TextColType.NavyBrown,
+ heroPackText.text = UIHelper.AppendColor(count >= singlePack.unlockedGridCount ? TextColType.Red : TextColType.NavyBrown,
string.Format("{0}/{1}", count, singlePack.unlockedGridCount));
}
diff --git a/Main/System/HeroUI/HeroShowBaseCell.cs b/Main/System/HeroUI/HeroShowBaseCell.cs
index 4206963..716237c 100644
--- a/Main/System/HeroUI/HeroShowBaseCell.cs
+++ b/Main/System/HeroUI/HeroShowBaseCell.cs
@@ -2,11 +2,12 @@
using UnityEngine.UI;
using System.Collections.Generic;
+//姝﹀皢妯″瀷绔欏彴妯″潡
public class HeroShowBaseCell : MonoBehaviour
{
Image m_QualityBG;
- Image qualityBG
+ Image qualityBG //搴曞骇鍙板瓙
{
get
{
@@ -38,7 +39,7 @@
{
if (m_StarRect == null)
{
- m_StarRect = this.transform.Find("Container_HeroShow/stars");
+ m_StarRect = this.transform.Find("Container_HeroShow/layout/stars");
}
return m_StarRect;
}
@@ -54,7 +55,7 @@
m_StarsImg = new List<Image>();
for (int i = 0; i < 5; i++)
{
- var star = this.transform.GetComponent<Image>("Container_HeroShow/stars/star" + i);
+ var star = this.transform.GetComponent<Image>("Container_HeroShow/layout/stars/star" + i);
m_StarsImg.Add(star);
}
}
@@ -97,22 +98,31 @@
{
if (m_LvText == null)
{
- m_LvText = this.transform.GetComponent<Text>("Container_HeroShow/lv");
+ m_LvText = this.transform.GetComponent<Text>("Container_HeroShow/layout/lv");
}
return m_LvText;
}
}
-
- OutlineEx heroNameOutline;
- OutlineEx heroLVOutline;
+ OutlineEx m_LvTextOutline;
+ OutlineEx heroLVOutline
+ {
+ get
+ {
+ if (m_LvTextOutline == null)
+ {
+ m_LvTextOutline = this.transform.GetComponent<OutlineEx>("Container_HeroShow/layout/lv");
+ }
+ return m_LvTextOutline;
+ }
+ }
void Awake()
{
LoadPrefab();
}
- // 姝﹀皢灏忓ご鍍忥紝锛堣亴涓氬拰鍚嶇О涓嶅啀姝ょ鐞嗭紝鍚勪釜鐣岄潰鎺掔増涓嶅悓锛�
- public void Init(int heroID, int skinID = 0, int breakLevel = 0, int star = 0, int awakelv = 0, int lv = 0, bool isShowLock = false)
+ // 姝﹀皢妯″瀷绔欏彴鏄剧ず
+ public void Init(int heroID, int skinID, int breakLevel = 0, int star = 0, int awakelv = 0, int lv = 0, bool isShowLock = false)
{
var heroConfig = HeroConfig.Get(heroID);
qualityBG.SetSprite("herodz" + heroConfig.Quality);
@@ -154,7 +164,6 @@
nameText.text = breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, breakLevel);
nameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality);
- heroNameOutline.colorType = (QualityTextColType)heroConfig.Quality;
lvText.text = string.Format("{0}{1} {2}", Language.Get("L1094"), lv, awakelv == 0 ? Language.Get("herocard13") : Language.Get("herocard12", awakelv));
heroLVOutline.colorType = awakelv == 0 ? QualityTextColType.None : QualityTextColType.red;
@@ -193,15 +202,13 @@
//澶栭儴鎺у埗浜嗗昂瀵歌幏鍙栦负0
GridLayoutGroup grid = GetComponentInParent<GridLayoutGroup>();
if (grid != null)
- {
+ {
width = grid.cellSize.x;
}
-
+
}
scale = width / rect.sizeDelta.x;
- cellContainer.transform.localScale = new Vector3(scale, scale, scale);
- heroNameOutline = nameText.GetComponent<OutlineEx>();
- heroLVOutline = lvText.GetComponent<OutlineEx>();
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
}
}
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
index bcadf4d..ea342e1 100644
--- a/Main/System/HeroUI/HeroTrainWin.cs
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -135,6 +135,7 @@
});
starUPBtn.AddListener(StarUP);
+ washBtn.AddListener(Wash);
}
@@ -584,9 +585,9 @@
void RefreshGift()
{
- RefreshGiftCell();
+ HeroUIManager.Instance.RefreshGiftCell(giftBaseCells, hero);
- if (hero.GetTotalStarCount() >= hero.GetMaxStarCount())
+ if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
{
starUPBtn.interactable = false;
starUPBtn.SetColorful(null, false);
@@ -604,63 +605,22 @@
starUPBtn.SetColorful(null, true);
starUPBtnText.text = Language.Get("HeroGift3");
}
- }
- void RefreshGiftCell()
- {
- //浼犺浠ヤ笅鍙湁4涓�
- int showCount = hero.Quality < 4 ? HeroUIManager.normalGiftMaxCnt : HeroUIManager.giftMaxCnt;
- for (int i = 0; i < giftBaseCells.Length; i++)
+ if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel)
{
- if (i >= showCount)
- {
- giftBaseCells[i].SetActive(false);
- continue;
- }
-
- giftBaseCells[i].SetActive(true);
- if (i < hero.talentIDList.Count)
- {
- int giftID = hero.talentIDList[i];
- int giftLV = hero.talentLvList[i];
- giftBaseCells[i].Init(giftID, giftLV, () =>
- {
- var giftConfig = HeroTalentConfig.Get(giftID);
- SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
- Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
- SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
- UIManager.Instance.OpenWindow<SmallTipWin>();
- });
- }
- else
- {
- if (i < HeroUIManager.normalGiftMaxCnt)
- {
- giftBaseCells[i].Init(0, 0, () =>
- {
- SmallTipWin.showText = Language.Get("HeroGift1");
- SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
- UIManager.Instance.OpenWindow<SmallTipWin>();
- });
- }
- else
- {
- int index = i;
- giftBaseCells[i].Init(-1, 0, () =>
- {
- SmallTipWin.showText = Language.Get("HeroGift2", HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(hero.heroId, index));
- SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
- UIManager.Instance.OpenWindow<SmallTipWin>();
- });
- }
- }
-
+ washBtn.SetColorful(washBtn.GetComponentInChildren<Text>(), false);
+ }
+ else
+ {
+ washBtn.SetColorful(washBtn.GetComponentInChildren<Text>(), true);
}
}
+
+
void StarUP()
- {
- if (hero.GetTotalStarCount() >= hero.GetMaxStarCount())
+ {
+ if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
{
return;
}
@@ -674,7 +634,27 @@
{
starUPBtn.interactable = true;
starUPBtn.SetColorful(null, true);
- starUPBtnText.text = Language.Get("HeroGift3");
+ HeroUIManager.Instance.selectHeroGuidForGiftFunc = hero.itemHero.guid;
+ UIManager.Instance.OpenWindow<HeroGiftEatWin>();
}
}
+
+ void Wash()
+ {
+ if (hero.heroStar < HeroUIManager.Instance.canWashStarLevel)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroGift2", HeroUIManager.Instance.canWashStarLevel);
+ return;
+ }
+ // //鏍规嵁閿佺姸鎬佸垽鏂潗鏂欐槸鍚﹁冻澶�
+ // if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID,
+ // HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2))
+ // {
+ // return;
+ // }
+
+
+ // UIManager.Instance.OpenWindow<HeroGiftWashWin>();
+
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroUIManager.Gift.cs b/Main/System/HeroUI/HeroUIManager.Gift.cs
deleted file mode 100644
index 4771a2d..0000000
--- a/Main/System/HeroUI/HeroUIManager.Gift.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-锘縰sing System;
-using System.Collections;
-using System.Collections.Generic;
-using LitJson;
-
-using UnityEngine;
-
-//澶╄祴
-public partial class HeroUIManager : GameSystemManager<HeroUIManager>
-{
- public const int normalGiftMaxCnt = 4; //浼犺4浠ヤ笅
- public const int giftMaxCnt = 8;
- public int maxGiftLevel; //鍗曞ぉ璧嬫渶楂樼瓑绾э紝鍏朵粬鍔熻兘鍙兘浼氬鍔犺繖涓笂闄�
- public int starLevelCanAwake; //x鏄熷彲浠ヨ閱�
-
- public int washItemID;
- public int[] washByLockUseCounts;
-
- void ParseGiftConfig()
- {
- var config = FuncConfigConfig.Get("HeroStarTalent");
- maxGiftLevel = int.Parse(config.Numerical2);
- starLevelCanAwake = int.Parse(config.Numerical4);
-
- config = FuncConfigConfig.Get("HeroWash");
- washItemID = int.Parse(config.Numerical1);
- washByLockUseCounts = JsonMapper.ToObject<int[]>(config.Numerical2);
- }
-
-}
-
diff --git a/Main/System/HeroUI/HeroUIManager.Talent.cs b/Main/System/HeroUI/HeroUIManager.Talent.cs
new file mode 100644
index 0000000..f9e2057
--- /dev/null
+++ b/Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -0,0 +1,110 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using LitJson;
+
+using UnityEngine;
+
+//澶╄祴
+public partial class HeroUIManager : GameSystemManager<HeroUIManager>
+{
+ public int normalGiftMaxCnt = 4; //鍒濆澶╄祴鏍煎瓙鏁�
+ public const int giftMaxCnt = 8; //鍏宠仈鐣岄潰鎺掔増闂锛屾殏鏃跺啓姝伙紝閫氳繃瑙夐啋鍙互澧炲姞涓婇檺
+ public int maxGiftLevel; //鍗曞ぉ璧嬫渶楂樼瓑绾э紝鍏朵粬鍔熻兘鍙兘浼氬鍔犺繖涓笂闄�
+ public int starLevelCanAwake; //x鏄熷彲浠ヨ閱�
+
+ public int washItemID;
+ public int[] washByLockUseCounts;
+ public int canWashStarLevel; //杈惧埌X鏄熷彲浠ユ礂缁�
+
+ public string selectHeroGuidForGiftFunc;
+
+ void ParseGiftConfig()
+ {
+ var config = FuncConfigConfig.Get("HeroStarTalent");
+ normalGiftMaxCnt = int.Parse(config.Numerical1);
+ maxGiftLevel = int.Parse(config.Numerical2);
+ starLevelCanAwake = int.Parse(config.Numerical4);
+
+ config = FuncConfigConfig.Get("HeroWash");
+ washItemID = int.Parse(config.Numerical1);
+ washByLockUseCounts = JsonMapper.ToObject<int[]>(config.Numerical2);
+ canWashStarLevel = int.Parse(config.Numerical3);
+ }
+
+
+ //鏍规嵁澶╄祴閿佺姸鎬佽幏鍙栨秷鑰楃殑鏉愭枡鏁伴噺
+ public int GetTalentLockUseWashCount(HeroInfo hero)
+ {
+ return washByLockUseCounts[hero.GetTalentLockCount()];
+ }
+
+
+ //澶╄祴鏍煎瓙鎬绘暟涓婇檺
+ public int GetGiftGirdMaxCount(int heroID)
+ {
+ //娌℃湁瑙夐啋閰嶇疆鐨� 涓洪粯璁�4锛屽惁鍒�8
+ if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null)
+ {
+ return Instance.normalGiftMaxCnt;
+ }
+ return giftMaxCnt;
+ }
+
+
+
+ //鏄熶笂闄愮敱鍝佽川 鍜� 瑙夐啋鍐冲畾
+ public int GetMaxStarCount(int heroID, int quality)
+ {
+ if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null)
+ {
+ return HeroQualityConfig.Get(quality).InitStarUpper;
+
+ }
+
+ //鏍规嵁瑙夐啋绱鎻愬崌鏄熶笂闄�
+ int addStarCount = 0;
+ for (int i = 1; i <= HeroAwakeConfig.GetMaxAwakeLV(heroID); i++)
+ {
+ addStarCount += HeroAwakeConfig.GetHeroAwakeConfig(heroID, i).AddStarUpper;
+ }
+ return HeroQualityConfig.Get(quality).InitStarUpper + addStarCount;
+ }
+
+
+ public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero)
+ {
+ int showCount = GetGiftGirdMaxCount(hero.heroId);
+ for (int i = 0; i < giftBaseCells.Length; i++)
+ {
+ if (i >= showCount)
+ {
+ giftBaseCells[i].SetActive(false);
+ continue;
+ }
+
+ giftBaseCells[i].SetActive(true);
+ if (i < hero.talentIDList.Count)
+ {
+ int giftID = hero.talentIDList[i];
+ int giftLV = hero.talentLvList[i];
+ giftBaseCells[i].Init(giftID, giftLV);
+ }
+ else
+ {
+ if (i < normalGiftMaxCnt)
+ {
+ giftBaseCells[i].Init(0, 0);
+ }
+ else
+ {
+ int index = i;
+ giftBaseCells[i].Init(-1, 0, null, hero.heroId, index);
+ }
+ }
+
+ }
+ }
+
+}
+
diff --git a/Main/System/HeroUI/HeroUIManager.Gift.cs.meta b/Main/System/HeroUI/HeroUIManager.Talent.cs.meta
similarity index 100%
rename from Main/System/HeroUI/HeroUIManager.Gift.cs.meta
rename to Main/System/HeroUI/HeroUIManager.Talent.cs.meta
diff --git a/Main/System/Main/AutoFightModel.cs b/Main/System/Main/AutoFightModel.cs
index 1cf1356..c0e1741 100644
--- a/Main/System/Main/AutoFightModel.cs
+++ b/Main/System/Main/AutoFightModel.cs
@@ -36,7 +36,21 @@
}
//鑷姩妯″紡, 鐪熸鐐瑰嚮鎴橀敜娑堣�楀紑鍚紝鍜屼紤鎭紙鎴栨棤鏉愭枡锛夊仠姝�
- public bool isAutoAttack = false;
+ bool m_IsAutoAttack = false;
+ public bool isAutoAttack
+ {
+ get
+ {
+ return m_IsAutoAttack;
+ }
+ set
+ {
+ if (m_IsAutoAttack == value)
+ return;
+ m_IsAutoAttack = value;
+ Debug.Log("isAutoAttack:" + m_IsAutoAttack);
+ }
+ }
//鏄惁寮�鍚嚜鍔ㄦ垬鏂楄缃�
public bool isAutoAttackSet
@@ -173,10 +187,8 @@
return;
}
- if (isAutoAttackSet)
- {
- isAutoAttack = true;
- }
+
+ isAutoAttack = isAutoAttackSet;
//鎵嬪姩浼氫竴鐩磋繘鍏ヨ繖涓�昏緫, 鑷姩瑙﹀彂涓�娆�
storyBattleField.AutoSetBattleMode();
@@ -219,6 +231,10 @@
if (!string.IsNullOrEmpty(guid))
return;
+ //闃茶寖鍥炴敹鎶ラ敊
+ if (teamHero == null)
+ return;
+
//鍙�氱煡鐜╁姝﹀皢鐨勬垬鏂�
if (teamHero.NPCID != 0)
return;
diff --git a/Main/System/Main/AutoFightWin.cs b/Main/System/Main/AutoFightWin.cs
index 6a915e5..ab08e19 100644
--- a/Main/System/Main/AutoFightWin.cs
+++ b/Main/System/Main/AutoFightWin.cs
@@ -232,6 +232,7 @@
if (isOK)
{
AutoFightModel.Instance.isAutoAttackSet = false;
+ AutoFightModel.Instance.isAutoAttack = false;
AutoFightModel.Instance.fightCost = int.Parse(costText.text);
AutoFightModel.Instance.fightSpeed = int.Parse(speedText.text);
AutoFightModel.Instance.isStopFightByBetterEquip = betterEquipToggle.isOn;
diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index a1c1fdd..8cacbdf 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -22,6 +22,7 @@
[SerializeField] Image restImg; //浼戞伅鐘舵��
[SerializeField] GameObject fightGo; //鎴樻枟鐘舵��
[SerializeField] Image fightHeroImg; //鎴樻枟鏄剧ず鑻遍泟
+ [SerializeField] ScaleTween fightHeroScale; //鎴樻枟鏄剧ず鑻遍泟缂╂斁
[SerializeField] UIEffectPlayer fightEffect;
[SerializeField] FillTween cdTween;
@@ -264,17 +265,20 @@
{
fightEffect.Play();
cdTween.SetStartState();
- cdTween.Play(()=>
- {
+ cdTween.Play(() =>
+ {
AutoFightModel.Instance.fightingHeroSkinID = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid).SkinID;
fightHeroImg.SetOrgSprite(HeroSkinConfig.Get(AutoFightModel.Instance.fightingHeroSkinID).SquareIcon, "HeroHead");
});
+ fightHeroScale.SetStartState();
+ fightHeroScale.Play();
}
else
{
fightEffect.Stop();
cdTween.Stop();
cdTween.SetEndState();
+ fightHeroScale.Stop();
}
if (AutoFightModel.Instance.fightingHeroSkinID == 0)
diff --git a/Main/System/SkillUI/SkillBaseCell.cs b/Main/System/SkillUI/SkillBaseCell.cs
index 7101b77..06ccab1 100644
--- a/Main/System/SkillUI/SkillBaseCell.cs
+++ b/Main/System/SkillUI/SkillBaseCell.cs
@@ -121,7 +121,7 @@
}
scale = width / rect.sizeDelta.x;
- cellContainer.transform.localScale = new Vector3(scale, scale, scale);
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
}
}
diff --git a/Main/System/SkillUI/SkillWordCell.cs b/Main/System/SkillUI/SkillWordCell.cs
index 6d436cd..e2dbb4e 100644
--- a/Main/System/SkillUI/SkillWordCell.cs
+++ b/Main/System/SkillUI/SkillWordCell.cs
@@ -114,7 +114,7 @@
}
scale = width / rect.sizeDelta.x;
- cellContainer.transform.localScale = new Vector3(scale, scale, scale);
+ cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
}
}
diff --git a/Main/Utility/ComponentExtersion.cs b/Main/Utility/ComponentExtersion.cs
index 68c49cd..7d6eb58 100644
--- a/Main/Utility/ComponentExtersion.cs
+++ b/Main/Utility/ComponentExtersion.cs
@@ -245,7 +245,11 @@
_btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.Green : TextColType.White);
break;
default:
- _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.NavyBrown : TextColType.White);
+ //false 鐏拌壊锛宼rue 鍘熻壊
+ if (!_colorful)
+ _btnTxt.text = UIHelper.AppendColor(TextColType.NavyGray, _btnTxt.text); //涓嶆敼鍙樼粍浠堕鑹诧紝鍙敼鍙樻樉绀洪鑹�
+ else
+ _btnTxt.text = UIHelper.AppendColor(_btnTxt.color, _btnTxt.text);
break;
}
}
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 6e47226..84dc837 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -761,6 +761,30 @@
return msg;
}
+ public static string AppendColor(Color color, string msg)
+ {
+ return StringUtility.Contact("<color=#", ColorToHexWithHash(color), ">", msg, "</color>");
+ }
+
+
+ public static string ColorToHexWithHash(Color color, bool includeAlpha = false)
+ {
+ int r = Mathf.RoundToInt(color.r * 255);
+ int g = Mathf.RoundToInt(color.g * 255);
+ int b = Mathf.RoundToInt(color.b * 255);
+ if (includeAlpha)
+ {
+ int a = Mathf.RoundToInt(color.a * 255);
+ return string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", r, g, b, a);
+ }
+ else
+ {
+ return string.Format("{0:X2}{1:X2}{2:X2}", r, g, b);
+ }
+ }
+
+
+
//needName 鎸囧畼鑱�0鏄惁闇�瑕佸悕绉�
public static string GetRealmName(int realmLv, bool bright = true, bool needName = false)
{
@@ -825,7 +849,7 @@
/// <param name="itemColor"></param>
/// <param name="msg"></param>
/// <param name="bright"></param>
- /// <param name="colorGroupType"></param>
+ /// <param name="colorGroupType">0 閫氱敤鍔熻兘鍝佽川鍒嗙粍绮捐壇鍒扮璇�</param>
/// <returns></returns>
public static string AppendColor(int itemColor, string msg, bool bright = true, int colorGroupType = 0)
{
--
Gitblit v1.8.0