From 1f7675733af28f2cdf393956705de0d399e9be10 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 11 八月 2025 10:53:12 +0800
Subject: [PATCH] 117 【武将】武将系统 - 培养; 特效相加模式下 动态加载材质
---
Main/System/HeroUI/HeroLVBreakSuccessWin.cs | 86 +
Main/Config/Configs/WindowSearchConfig.cs | 53
Main/System/HeroUI/HeroLVBreakSuccessWin.cs.meta | 11
Main/Utility/CommonFunc.cs.meta | 0
Main/Config/Configs/PlayerPropertyConfig.cs | 15
Main/System/HappyXB/HappyXBModel.cs | 6
Main/ResModule/UILoader.cs | 14
Main/System/ItemTip/SmallTipWin.cs | 72 +
Main/System/UIBase/UIJumpManager.cs.meta | 11
Main/System/Message/RichText.cs | 2
Main/Utility/ComponentExtersion.cs | 35
Main/System/SkillUI/SkillBaseCell.cs | 24
Main/System/HeroUI/HeroScenePosCell.cs | 10
Main/Config/PartialConfigs/HeroAwakeConfig.cs | 18
Main/Config/PartialConfigs/PlayerPropertyConfig.cs | 55
Main/System/KnapSack/New/CommonItemBaisc.cs | 3
Main/Config/Configs/HeroConfig.cs | 11
Main/System/HeroUI/HeroPosHeadCell.cs | 2
Main/Core/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0722_tagItemDeadLockRefresh.cs | 10
Main/Config/Configs/EffectConfig.cs | 6
Main/System/ItemTip/ItemTipWayWin.cs | 64 +
Main/System/Tip/ConfirmCancel.cs | 7
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs.meta | 11
Main/System/ItemTip/BoxGetItemModel.cs | 4
Main/Config/PartialConfigs/HeroQualityLVConfig.cs.meta | 11
Main/System/HeroUI/HeroSkillWin.cs.meta | 11
Main/Utility/MathUtility.cs | 214 +++
Main/System/Hero/HeroInfo.cs | 2
Main/System/UIBase/UIBase.cs | 78
Main/System/HeroUI/HeroLVBreakWin.cs.meta | 11
Main/Utility/CommonFunc.cs | 35
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs.meta | 11
Main/Config/Configs/HeroQualityAwakeConfig.cs | 5
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs | 4
Main/System/HeroUI/HeroListWin.cs | 4
Main/Component/UI/Common/LayoutElementSizeClamp.cs | 34
Main/Config/PartialConfigs/HeroQualityLVConfig.cs | 33
Main/System/HeroUI/HeroHeadBaseCell.cs | 2
Main/System/ItemTip/ItemTipWayWin.cs.meta | 11
Main/System/Tip/ItemsConfirmWin.cs | 28
Main/Config/ConfigManager.cs | 9
Main/System/HeroUI/HeroTrainWin.cs.meta | 11
Main/System/ItemTip/SmallTipWin.cs.meta | 11
Main/Component/UI/Effect/UIEffectPlayer.cs | 59
Main/System/HeroUI/HeroCardCell.cs | 20
Main/System/HeroUI/HeroConnectionHeadCell.cs | 23
Main/System/KnapSack/Logic/ItemLogicUtility.cs | 33
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs | 20
Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs | 11
Main/Component/UI/Common/AdaptiveLayout.cs | 434 +++---
Main/System/Hero/HeroManager.cs | 7
Main/System/HeroUI/HeroAllAttrWin.cs | 125 ++
Main/System/UIBase/UIJumpManager.cs | 42
Main/System/KnapSack/Logic/SinglePack.cs | 23
Main/System/HeroUI/HeroFormationCell.cs | 2
Main/Component/UI/Effect/EffectPlayer.cs | 2
Main/System/Message/HrefAnalysis.cs | 2
Main/System/HeroUI/HeroTrainWin.cs | 437 +++++++
Main/Config/Configs/HeroQualityConfig.cs | 5
Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs | 18
Main/System/KnapSack/PackManager.cs | 60
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs | 13
Main/System/HeroUI/HeroAllAttrWin.cs.meta | 11
Main/System/Hero/UIHeroController.cs | 37
Main/System/Message/RichNormalEvent.cs | 46
Main/Config/Configs/WindowSearchConfig.cs.meta | 11
Main/System/PhantasmPavilion/PhantasmPavilionModel.cs | 4
Main/System/ItemTip/ItemTipUtility.cs | 56
Main/Config/Configs/GetItemWaysConfig.cs | 20
Main/System/HeroUI/HeroLVBreakWin.cs | 105 +
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs.meta | 11
/dev/null | 222 ----
Main/Utility/UIHelper.cs | 35
Main/System/HeroUI/HeroConnectionCell.cs | 24
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 2
Main/System/HeroUI/HeroSkillWin.cs | 52
Main/Config/PartialConfigs/HeroQualityBreakConfig.cs | 16
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs | 17
Main/Component/UI/Common/ClickScreenOtherSpace.cs | 4
Main/System/HeroUI/HeroUIManager.cs | 195 +++
81 files changed, 2,454 insertions(+), 816 deletions(-)
diff --git a/Main/Component/UI/Common/AdaptiveLayout.cs b/Main/Component/UI/Common/AdaptiveLayout.cs
index 73ad612..f83b7c0 100644
--- a/Main/Component/UI/Common/AdaptiveLayout.cs
+++ b/Main/Component/UI/Common/AdaptiveLayout.cs
@@ -5,236 +5,236 @@
using System;
using Cysharp.Threading.Tasks;
- [ExecuteAlways]
- public class AdaptiveLayout : MonoBehaviour
+[ExecuteAlways]
+public class AdaptiveLayout : MonoBehaviour
+{
+ [SerializeField] HorizonOrVertical m_HorizonOrVerticle;
+ [SerializeField] CanvasGroup m_CanvasGroup;
+ [SerializeField] List<AdaptiveElement> m_AdapElements;
+ [SerializeField] bool m_AutoIncludeChild=false;
+ [SerializeField] float m_LeastHeight = 0f;
+ [SerializeField] float m_LeastWidth = 0f;
+ [SerializeField] float m_MaxHeight = 0f;
+ [SerializeField] float m_MaxWidth = 0f;
+ [NonSerialized] RectTransform m_Rect;
+ public RectTransform rectTransform
{
- [SerializeField] HorizonOrVertical m_HorizonOrVerticle;
- [SerializeField] CanvasGroup m_CanvasGroup;
- [SerializeField] List<AdaptiveElement> m_AdapElements;
- [SerializeField] bool m_AutoIncludeChild=false;
- [SerializeField] float m_LeastHeight = 0f;
- [SerializeField] float m_LeastWidth = 0f;
- [SerializeField] float m_MaxHeight = 0f;
- [SerializeField] float m_MaxWidth = 0f;
- [NonSerialized] RectTransform m_Rect;
- public RectTransform rectTransform
+ get
+ {
+ if (m_Rect == null)
+ {
+ m_Rect = GetComponent<RectTransform>();
+ }
+ return m_Rect;
+ }
+ }
+ public float Size
+ {
+ get
+ {
+ return m_HorizonOrVerticle == HorizonOrVertical.Horizon ? rectTransform.sizeDelta.x : rectTransform.sizeDelta.y;
+ }
+ }
+
+ public event Action adaptiveUpdateEvent;
+
+ private void OnEnable()
+ {
+ if (m_AdapElements == null)
+ {
+ enabled = false;
+ return;
+ }
+ if (m_CanvasGroup != null)
+ {
+ m_CanvasGroup.alpha = 0;
+ m_CanvasGroup.interactable = true;
+ Co_DelayShow();
+ }
+ }
+
+ private void TrackerRect(RectTransform _rect)
+ {
+ var _pivot = _rect.pivot;
+ var _anchorMax = _rect.anchorMax;
+ var _anchorMin = _rect.anchorMin;
+ if (m_HorizonOrVerticle == HorizonOrVertical.Horizon)
+ {
+ _pivot.x = 0; _pivot.y = 0.5f;
+ _anchorMax.x = 0; _anchorMax.y = 0.5f;
+ _anchorMin.x = 0; _anchorMin.y = 0.5f;
+ }
+ else
+ {
+ _pivot.x = 0.5f; _pivot.y = 1f;
+ _anchorMax.x = 0.5f; _anchorMax.y = 1;
+ _anchorMin.x = 0.5f; _anchorMin.y = 1;
+ }
+ if (_rect.pivot != _pivot || _rect.anchorMax != _anchorMax || _rect.anchorMin != _anchorMin)
+ {
+ _rect.pivot = _pivot;
+ _rect.anchorMax = _anchorMax;
+ _rect.anchorMin = _anchorMin;
+ }
+ }
+
+ private void CalculateLayout()
+ {
+ var _offset = 0.0f;
+ var _horizon = m_HorizonOrVerticle == HorizonOrVertical.Horizon;
+ for (int i = 0; i < m_AdapElements.Count; i++)
+ {
+ if (m_AdapElements[i].rect == null || !m_AdapElements[i].rect.gameObject.activeInHierarchy)
+ {
+ continue;
+ }
+ _offset += _horizon ? m_AdapElements[i].padding.left : m_AdapElements[i].padding.top;
+ var _pos = m_AdapElements[i].rect.localPosition;
+ if (_horizon)
+ {
+ _pos.x = _offset;
+ }
+ else
+ {
+ _pos.y = -_offset;
+ }
+ if (m_AdapElements[i].rect.localPosition != _pos)
+ {
+ m_AdapElements[i].rect.localPosition = _pos;
+ }
+ _offset += _horizon ? m_AdapElements[i].rect.sizeDelta.x : m_AdapElements[i].rect.sizeDelta.y;
+ _offset += _horizon ? m_AdapElements[i].padding.right : m_AdapElements[i].padding.bottom;
+ }
+ var _sizeDelta = rectTransform.sizeDelta;
+ if (_horizon)
+ {
+ if (m_LeastWidth > 1f)
+ {
+ _offset = Mathf.Max(_offset, m_LeastWidth);
+ }
+ if (m_MaxWidth > 1f)
+ {
+ _offset = Mathf.Min(_offset, m_MaxWidth);
+ }
+ _sizeDelta.x = _offset;
+ }
+ else
+ {
+ if (m_LeastHeight > 1f)
+ {
+ _offset = Mathf.Max(_offset, m_LeastHeight);
+ }
+ if (m_MaxHeight > 1f)
+ {
+ _offset = Mathf.Min(_offset, m_MaxHeight);
+ }
+ _sizeDelta.y = _offset;
+ }
+ if (rectTransform.sizeDelta != _sizeDelta)
+ {
+ rectTransform.sizeDelta = _sizeDelta;
+ if (adaptiveUpdateEvent != null)
+ {
+ adaptiveUpdateEvent();
+ }
+ }
+ }
+
+ private void LateUpdate()
+ {
+ if (m_AdapElements == null)
+ {
+ return;
+ }
+ TrackerRect(rectTransform);
+ for (int i = 0; i < m_AdapElements.Count; i++)
+ {
+ if (m_AdapElements[i].rect == null)
+ {
+ continue;
+ }
+ TrackerRect(m_AdapElements[i].rect);
+ }
+ CalculateLayout();
+ }
+
+ private void OnTransformChildrenChanged()
+ {
+ if (m_AutoIncludeChild)
+ {
+ AutoIncludeChild();
+ }
+ }
+
+ private void AutoIncludeChild()
+ {
+ var _index = 0;
+ foreach (Transform _child in transform)
+ {
+ if (m_AdapElements == null)
+ {
+ m_AdapElements = new List<AdaptiveElement>();
+ }
+ var _rect = m_AdapElements.Find((x) =>
+ {
+ return x.rect == _child;
+ });
+ var _rectOffset= _child.GetComponent<AdaptiveRectOffset>();
+ if (_rect == null)
+ {
+ m_AdapElements.Insert(_index, new AdaptiveElement(_child as RectTransform, _rectOffset));
+ }
+ _index++;
+ }
+ if (m_AdapElements != null)
+ {
+ m_AdapElements.RemoveAll((x) =>
+ {
+ return x.rect == null;
+ });
+ }
+ LateUpdate();
+ }
+
+ async UniTask Co_DelayShow()
+ {
+ await UniTask.Delay(100);
+ if (m_CanvasGroup != null)
+ {
+ m_CanvasGroup.alpha = 1;
+ }
+ }
+
+ public enum HorizonOrVertical
+ {
+ Horizon,
+ Vertical,
+ }
+ [Serializable]
+ public class AdaptiveElement
+ {
+ [SerializeField] RectTransform m_Rect;
+ public RectTransform rect
{
get
{
- if (m_Rect == null)
- {
- m_Rect = GetComponent<RectTransform>();
- }
return m_Rect;
}
}
- public float Size
+ [SerializeField] RectOffset m_Padding;
+ public RectOffset padding
{
get
{
- return m_HorizonOrVerticle == HorizonOrVertical.Horizon ? rectTransform.sizeDelta.x : rectTransform.sizeDelta.y;
+ return m_Padding;
}
}
- public event Action adaptiveUpdateEvent;
-
- private void OnEnable()
+ public AdaptiveElement(RectTransform _rect, AdaptiveRectOffset _offset)
{
- if (m_AdapElements == null)
- {
- enabled = false;
- return;
- }
- if (m_CanvasGroup != null)
- {
- m_CanvasGroup.alpha = 0;
- m_CanvasGroup.interactable = true;
- Co_DelayShow();
- }
+ m_Rect = _rect;
+ m_Padding = _offset == null ? new RectOffset() : _offset.rectOffset;
}
+ }
- private void TrackerRect(RectTransform _rect)
- {
- var _pivot = _rect.pivot;
- var _anchorMax = _rect.anchorMax;
- var _anchorMin = _rect.anchorMin;
- if (m_HorizonOrVerticle == HorizonOrVertical.Horizon)
- {
- _pivot.x = 0; _pivot.y = 0.5f;
- _anchorMax.x = 0; _anchorMax.y = 0.5f;
- _anchorMin.x = 0; _anchorMin.y = 0.5f;
- }
- else
- {
- _pivot.x = 0.5f; _pivot.y = 1f;
- _anchorMax.x = 0.5f; _anchorMax.y = 1;
- _anchorMin.x = 0.5f; _anchorMin.y = 1;
- }
- if (_rect.pivot != _pivot || _rect.anchorMax != _anchorMax || _rect.anchorMin != _anchorMin)
- {
- _rect.pivot = _pivot;
- _rect.anchorMax = _anchorMax;
- _rect.anchorMin = _anchorMin;
- }
- }
-
- private void CalculateLayout()
- {
- var _offset = 0.0f;
- var _horizon = m_HorizonOrVerticle == HorizonOrVertical.Horizon;
- for (int i = 0; i < m_AdapElements.Count; i++)
- {
- if (m_AdapElements[i].rect == null || !m_AdapElements[i].rect.gameObject.activeInHierarchy)
- {
- continue;
- }
- _offset += _horizon ? m_AdapElements[i].padding.left : m_AdapElements[i].padding.top;
- var _pos = m_AdapElements[i].rect.localPosition;
- if (_horizon)
- {
- _pos.x = _offset;
- }
- else
- {
- _pos.y = -_offset;
- }
- if (m_AdapElements[i].rect.localPosition != _pos)
- {
- m_AdapElements[i].rect.localPosition = _pos;
- }
- _offset += _horizon ? m_AdapElements[i].rect.sizeDelta.x : m_AdapElements[i].rect.sizeDelta.y;
- _offset += _horizon ? m_AdapElements[i].padding.right : m_AdapElements[i].padding.bottom;
- }
- var _sizeDelta = rectTransform.sizeDelta;
- if (_horizon)
- {
- if (m_LeastWidth > 1f)
- {
- _offset = Mathf.Max(_offset, m_LeastWidth);
- }
- if (m_MaxWidth > 1f)
- {
- _offset = Mathf.Min(_offset, m_MaxWidth);
- }
- _sizeDelta.x = _offset;
- }
- else
- {
- if (m_LeastHeight > 1f)
- {
- _offset = Mathf.Max(_offset, m_LeastHeight);
- }
- if (m_MaxHeight > 1f)
- {
- _offset = Mathf.Min(_offset, m_MaxHeight);
- }
- _sizeDelta.y = _offset;
- }
- if (rectTransform.sizeDelta != _sizeDelta)
- {
- rectTransform.sizeDelta = _sizeDelta;
- if (adaptiveUpdateEvent != null)
- {
- adaptiveUpdateEvent();
- }
- }
- }
-
- private void LateUpdate()
- {
- if (m_AdapElements == null)
- {
- return;
- }
- TrackerRect(rectTransform);
- for (int i = 0; i < m_AdapElements.Count; i++)
- {
- if (m_AdapElements[i].rect == null)
- {
- continue;
- }
- TrackerRect(m_AdapElements[i].rect);
- }
- CalculateLayout();
- }
-
- private void OnTransformChildrenChanged()
- {
- if (m_AutoIncludeChild)
- {
- AutoIncludeChild();
- }
- }
-
- private void AutoIncludeChild()
- {
- var _index = 0;
- foreach (Transform _child in transform)
- {
- if (m_AdapElements == null)
- {
- m_AdapElements = new List<AdaptiveElement>();
- }
- var _rect = m_AdapElements.Find((x) =>
- {
- return x.rect == _child;
- });
- var _rectOffset= _child.GetComponent<AdaptiveRectOffset>();
- if (_rect == null)
- {
- m_AdapElements.Insert(_index, new AdaptiveElement(_child as RectTransform, _rectOffset));
- }
- _index++;
- }
- if (m_AdapElements != null)
- {
- m_AdapElements.RemoveAll((x) =>
- {
- return x.rect == null;
- });
- }
- LateUpdate();
- }
-
- async UniTask Co_DelayShow()
- {
- await UniTask.Delay(100);
- if (m_CanvasGroup != null)
- {
- m_CanvasGroup.alpha = 1;
- }
- }
-
- public enum HorizonOrVertical
- {
- Horizon,
- Vertical,
- }
- [Serializable]
- public class AdaptiveElement
- {
- [SerializeField] RectTransform m_Rect;
- public RectTransform rect
- {
- get
- {
- return m_Rect;
- }
- }
- [SerializeField] RectOffset m_Padding;
- public RectOffset padding
- {
- get
- {
- return m_Padding;
- }
- }
-
- public AdaptiveElement(RectTransform _rect, AdaptiveRectOffset _offset)
- {
- m_Rect = _rect;
- m_Padding = _offset == null ? new RectOffset() : _offset.rectOffset;
- }
- }
-
- }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Common/ClickScreenOtherSpace.cs b/Main/Component/UI/Common/ClickScreenOtherSpace.cs
index a4c33bc..d9e96d1 100644
--- a/Main/Component/UI/Common/ClickScreenOtherSpace.cs
+++ b/Main/Component/UI/Common/ClickScreenOtherSpace.cs
@@ -41,13 +41,13 @@
switch (m_RespondType) {
case RespondType.In:
if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
- m_ClickOtherEvent.Invoke();
+ m_ClickOtherEvent?.Invoke();
this.SetActive(!m_DeActiveSelf);
}
break;
case RespondType.Out:
if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
- m_ClickOtherEvent.Invoke();
+ m_ClickOtherEvent?.Invoke();
this.SetActive(!m_DeActiveSelf);
}
break;
diff --git a/Main/Component/UI/Common/LayoutElementSizeClamp.cs b/Main/Component/UI/Common/LayoutElementSizeClamp.cs
index d41452b..b0b17c3 100644
--- a/Main/Component/UI/Common/LayoutElementSizeClamp.cs
+++ b/Main/Component/UI/Common/LayoutElementSizeClamp.cs
@@ -1,9 +1,8 @@
-锘縰sing System.Collections;
-using System.Collections.Generic;
+锘縰sing Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
-using UnityEngine.EventSystems;
+//鎺у埗鐩爣鐨勬渶澶ф渶灏忓昂瀵�
[ExecuteAlways]
public class LayoutElementSizeClamp : LayoutElement
{
@@ -15,21 +14,34 @@
[SerializeField] RectTransform m_Target;
- Vector2 targetSizeRef = Vector2.zero;
- private void LateUpdate()
+ protected override void OnEnable()
{
+ base.OnEnable();
if (clampEnable && m_Target != null)
{
- if (targetSizeRef != m_Target.sizeDelta)
- {
- preferredHeight = Mathf.Clamp(m_Target.rect.height, m_Clamp.minY, m_Clamp.maxY);
- preferredWidth = Mathf.Clamp(m_Target.rect.width, m_Clamp.minX, m_Clamp.maxX);
- targetSizeRef = new Vector2(preferredWidth, preferredHeight);
- }
+ UpdateRect().Forget();
}
+
}
+ async UniTask UpdateRect()
+ {
+ await UniTask.DelayFrame(1);
+ preferredHeight = -1;
+ preferredWidth = -1;
+ //棰戠箒璋冪敤ForceRebuildLayoutImmediate鐨勫師鍥犳槸
+ // 濡俆ext瑕佽嚜閫傚簲瀹介珮鍙堣闄愬埗瀹介珮, 鍏堣澶勭悊瀹藉害鍒锋柊鍚庢墠鑳借绠楁崲琛�
+ // 寮哄埗閲嶆柊璁$畻甯冨眬
+ LayoutRebuilder.ForceRebuildLayoutImmediate(transform.parent as RectTransform);
+ preferredWidth = Mathf.Clamp(m_Target.rect.width, m_Clamp.minX, m_Clamp.maxX);
+ // 寮哄埗閲嶆柊璁$畻甯冨眬
+ LayoutRebuilder.ForceRebuildLayoutImmediate(transform.parent as RectTransform);
+ preferredHeight = Mathf.Clamp(m_Target.rect.height, m_Clamp.minY, m_Clamp.maxY);
+
+ }
+
+
[System.Serializable]
public struct Clamp
{
diff --git a/Main/Component/UI/Effect/EffectPlayer.cs b/Main/Component/UI/Effect/EffectPlayer.cs
index 16010c2..e90c9f8 100644
--- a/Main/Component/UI/Effect/EffectPlayer.cs
+++ b/Main/Component/UI/Effect/EffectPlayer.cs
@@ -40,7 +40,7 @@
[Header("鎾斁瀹屾瘯绔嬪嵆鍥炴敹")]
- public bool isReleaseImmediately = true; //鐣岄潰鐗规晥涓�鑸笉闇�瑕佽嚜鎴戦攢姣侊紝璺熼殢鐣岄潰鎴栬�呯埗瀵硅薄閿�姣佸氨琛�
+ public bool isReleaseImmediately = false; //鐣岄潰鐗规晥涓�鑸笉闇�瑕佽嚜鎴戦攢姣侊紝璺熼殢鐣岄潰鎴栬�呯埗瀵硅薄閿�姣佸氨琛�
public Action<EffectPlayer> onDestroy;
diff --git a/Main/Component/UI/Effect/UIEffectPlayer.cs b/Main/Component/UI/Effect/UIEffectPlayer.cs
index a8fc647..cfae60e 100644
--- a/Main/Component/UI/Effect/UIEffectPlayer.cs
+++ b/Main/Component/UI/Effect/UIEffectPlayer.cs
@@ -5,23 +5,29 @@
using UnityEngine;
using Spine;
using UnityEngine.UI;
+using Cysharp.Threading.Tasks;
//UI鐗规晥鎾斁鍣紝spine鐗规晥鐩存帴鍔犺浇鏃犻渶鎻愬墠鍋氶鍒朵綋
//UI鐗规晥澶ч儴鍒嗘儏鍐典笉浼氭敼鍙樼壒鏁堬紝鏃犻渶閿�姣�
public class UIEffectPlayer : EffectPlayer
{
-
[Header("鏄惁寰幆鎾斁spine鐗规晥")]
public bool isPlaySpineLoop = false;
[Header("鏄惁鍦ㄦ樉绀烘椂鎾斁")]
public bool isPlayOnEnable = false;
+ [Header("寤惰繜鎾斁(姣)")]
+ public int playDelayTime = 0;
+
+ int playSpineAnimIndex = -1; //鎾斁spine鐗规晥鍔ㄧ敾绱㈠紩,
+
protected override void OnEnable()
{
+ playSpineAnimIndex = -1;
if (isPlayOnEnable)
{
- Play(false);
+ PlayAsync(false).Forget();
}
else if (spineComp != null)
{
@@ -43,6 +49,10 @@
if (!this.gameObject.activeSelf)
{
this.gameObject.SetActive(true);
+ }
+ if (effectConfig.isSpine != 0)
+ {
+ PlayerTheSpineAnim();
}
return;
}
@@ -90,6 +100,18 @@
spineComp.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("UIEffect/" + effectConfig.packageName, effectConfig.fxName);
spineComp.raycastTarget = false;
spineComp.Initialize(true);
+
+ // 妫�鏌ュ姩鐢绘槸鍚︽湁鐩稿姞妯″紡
+ bool hasAdditiveBlend = CheckForAdditiveBlend(spineComp.Skeleton);
+ if (hasAdditiveBlend)
+ {
+ spineComp.material = ResManager.Instance.LoadAsset<Material>("UIEffect/" + effectConfig.packageName, effectConfig.fxName.Split('_')[0] + "_Material-Additive");
+ }
+ else
+ {
+ spineComp.material = null;
+ }
+
spineAnimationState = spineComp.AnimationState;
spineAnimationState.Data.DefaultMix = 0f;
spineAnimationState.Complete -= OnSpineAnimationComplete;
@@ -97,18 +119,42 @@
}
spineComp.enabled = true;
- PlayerFistSpineAnim();
+ PlayerTheSpineAnim();
}
+ private bool CheckForAdditiveBlend(Spine.Skeleton skeleton)
+ {
+ // 閬嶅巻鎵�鏈夋彃妲斤紝妫�鏌ユ槸鍚︽湁鐩稿姞妯″紡
+ foreach (var slot in skeleton.Slots)
+ {
+ if (slot.Data.BlendMode == Spine.BlendMode.Additive)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
- // 鎾斁绗竴涓姩鐢伙紙浣滀负榛樿鍔ㄧ敾锛�
- void PlayerFistSpineAnim()
+ public void Play(int index, bool showLog = true)
+ {
+ playSpineAnimIndex = index;
+ PlayAsync(showLog).Forget();
+ }
+
+ async UniTask PlayAsync(bool showLog = true)
+ {
+ await UniTask.Delay(playDelayTime);
+ Play(showLog);
+ }
+
+ // 鎾斁鎸囧畾鍔ㄧ敾
+ void PlayerTheSpineAnim()
{
spineComp.enabled = true;
var skeletonData = spineComp.Skeleton.Data;
if (skeletonData.Animations.Count > 0)
{
- string defaultAnimationName = skeletonData.Animations.Items[0].Name;
+ string defaultAnimationName = skeletonData.Animations.Items[playSpineAnimIndex == -1 ? effectConfig.animIndex : playSpineAnimIndex].Name;
spineAnimationState.SetAnimation(0, defaultAnimationName, isPlaySpineLoop);
}
else
@@ -137,6 +183,7 @@
}
+
// 鍒涘缓鍚庣殑鐗规晥浼氳嚜鍔ㄩ殣钘� 闇�瑕佹墜鍔ㄨ皟鐢≒lay鎵嶈兘鎾斁
public static UIEffectPlayer CreateEffect(int effectId, Transform parent, bool createNewChild = false)
{
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 6061df9..88d91a4 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -40,6 +40,7 @@
HashSet<Type> configTypes = new HashSet<Type>() {
typeof(ChestsAwardConfig),
typeof(CTGConfig),
+ typeof(DamageNumConfig),
typeof(DirtyWordConfig),
typeof(EquipGSParamConfig),
typeof(FaceConfig),
@@ -52,6 +53,7 @@
typeof(NPCExConfig),
typeof(NPCLineupConfig),
typeof(OrderInfoConfig),
+ typeof(PlayerAttrConfig),
typeof(PlayerFaceConfig),
typeof(StoreConfig),
typeof(SuccessConfig),
@@ -59,6 +61,7 @@
typeof(TitleStarUpConfig),
typeof(TreasureSetConfig),
typeof(TreeLVConfig),
+ typeof(WindowSearchConfig),
typeof(XBGetItemConfig)
};
@@ -213,6 +216,8 @@
ClearConfigDictionary<ChestsAwardConfig>();
// 娓呯┖ CTGConfig 瀛楀吀
ClearConfigDictionary<CTGConfig>();
+ // 娓呯┖ DamageNumConfig 瀛楀吀
+ ClearConfigDictionary<DamageNumConfig>();
// 娓呯┖ DirtyWordConfig 瀛楀吀
ClearConfigDictionary<DirtyWordConfig>();
// 娓呯┖ EquipGSParamConfig 瀛楀吀
@@ -237,6 +242,8 @@
ClearConfigDictionary<NPCLineupConfig>();
// 娓呯┖ OrderInfoConfig 瀛楀吀
ClearConfigDictionary<OrderInfoConfig>();
+ // 娓呯┖ PlayerAttrConfig 瀛楀吀
+ ClearConfigDictionary<PlayerAttrConfig>();
// 娓呯┖ PlayerFaceConfig 瀛楀吀
ClearConfigDictionary<PlayerFaceConfig>();
// 娓呯┖ StoreConfig 瀛楀吀
@@ -251,6 +258,8 @@
ClearConfigDictionary<TreasureSetConfig>();
// 娓呯┖ TreeLVConfig 瀛楀吀
ClearConfigDictionary<TreeLVConfig>();
+ // 娓呯┖ WindowSearchConfig 瀛楀吀
+ ClearConfigDictionary<WindowSearchConfig>();
// 娓呯┖ XBGetItemConfig 瀛楀吀
ClearConfigDictionary<XBGetItemConfig>();
}
diff --git a/Main/Config/Configs/EffectConfig.cs b/Main/Config/Configs/EffectConfig.cs
index fbc0966..633781f 100644
--- a/Main/Config/Configs/EffectConfig.cs
+++ b/Main/Config/Configs/EffectConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: 2025骞�8鏈�7鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -20,7 +20,7 @@
public string packageName;
public int isSpine;
public string fxName;
- public string animName;
+ public int animIndex;
public int audio;
public string nodeName;
public int notShow;
@@ -45,7 +45,7 @@
fxName = tables[3];
- animName = tables[4];
+ int.TryParse(tables[4],out animIndex);
int.TryParse(tables[5],out audio);
diff --git a/Main/Config/Configs/GetItemWaysConfig.cs b/Main/Config/Configs/GetItemWaysConfig.cs
index 5df562d..41cd2d4 100644
--- a/Main/Config/Configs/GetItemWaysConfig.cs
+++ b/Main/Config/Configs/GetItemWaysConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: 2025骞�8鏈�10鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -18,12 +18,8 @@
public int ID;
public string name;
- public string Icon;
public string Text;
- public int OpenpanelId;
- public int FuncOpenId;
- public int ActiveType;
- public int customize;
+ public int WinJumpID;
public override int LoadKey(string _key)
{
@@ -39,17 +35,9 @@
name = tables[1];
- Icon = tables[2];
+ Text = tables[2];
- Text = tables[3];
-
- int.TryParse(tables[4],out OpenpanelId);
-
- int.TryParse(tables[5],out FuncOpenId);
-
- int.TryParse(tables[6],out ActiveType);
-
- int.TryParse(tables[7],out customize);
+ int.TryParse(tables[3],out WinJumpID);
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/HeroConfig.cs b/Main/Config/Configs/HeroConfig.cs
index 31c6bb4..738f35d 100644
--- a/Main/Config/Configs/HeroConfig.cs
+++ b/Main/Config/Configs/HeroConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: Wednesday, August 6, 2025
//--------------------------------------------------------
using System.Collections.Generic;
@@ -20,8 +20,8 @@
public string Name;
public int Country;
public int Quality;
- public int AtkDistType;
public int Class;
+ public int Position;
public int[] SkinIDList;
public int AtkSkillID;
public int AngerSkillID;
@@ -31,6 +31,7 @@
public string BatAttrDict;
public int[] FetterIDList;
public float UIScale;
+ public string Desc;
public override int LoadKey(string _key)
{
@@ -50,9 +51,9 @@
int.TryParse(tables[3],out Quality);
- int.TryParse(tables[4],out AtkDistType);
+ int.TryParse(tables[4],out Class);
- int.TryParse(tables[5],out Class);
+ int.TryParse(tables[5],out Position);
if (tables[6].Contains("["))
{
@@ -95,6 +96,8 @@
}
float.TryParse(tables[14],out UIScale);
+
+ Desc = tables[15];
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/HeroQualityAwakeConfig.cs b/Main/Config/Configs/HeroQualityAwakeConfig.cs
index ea2a4fd..10f27a5 100644
--- a/Main/Config/Configs/HeroQualityAwakeConfig.cs
+++ b/Main/Config/Configs/HeroQualityAwakeConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: 2025骞�8鏈�7鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -20,6 +20,7 @@
public int Quality;
public int AwakeLV;
public int[] UPCostItem;
+ public int RebirthCostMoney;
public override int LoadKey(string _key)
{
@@ -50,6 +51,8 @@
int.TryParse(UPCostItemStringArray[i],out UPCostItem[i]);
}
}
+
+ int.TryParse(tables[4],out RebirthCostMoney);
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/HeroQualityConfig.cs b/Main/Config/Configs/HeroQualityConfig.cs
index 14fb026..f2d715c 100644
--- a/Main/Config/Configs/HeroQualityConfig.cs
+++ b/Main/Config/Configs/HeroQualityConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: 2025骞�8鏈�7鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -27,6 +27,7 @@
public int BookInitAddPer;
public int BookStarAddPer;
public int BookBreakLVAddPer;
+ public int[][] DismissReturnItems;
public override int LoadKey(string _key)
{
@@ -83,6 +84,8 @@
int.TryParse(tables[9],out BookStarAddPer);
int.TryParse(tables[10],out BookBreakLVAddPer);
+
+ DismissReturnItems = JsonMapper.ToObject<int[][]>(tables[11].Replace("(", "[").Replace(")", "]"));
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/PlayerPropertyConfig.cs b/Main/Config/Configs/PlayerPropertyConfig.cs
index 626e8a3..1e9fa88 100644
--- a/Main/Config/Configs/PlayerPropertyConfig.cs
+++ b/Main/Config/Configs/PlayerPropertyConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: Tuesday, August 5, 2025
+// [ Date ]: 2025骞�8鏈�9鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -20,7 +20,6 @@
public string Name;
public string ShowName;
public int ISPercentage;
- public int type;
public int decimalCount;
public int showType;
public int showSequence;
@@ -45,17 +44,15 @@
int.TryParse(tables[3],out ISPercentage);
- int.TryParse(tables[4],out type);
+ int.TryParse(tables[4],out decimalCount);
- int.TryParse(tables[5],out decimalCount);
+ int.TryParse(tables[5],out showType);
- int.TryParse(tables[6],out showType);
+ int.TryParse(tables[6],out showSequence);
- int.TryParse(tables[7],out showSequence);
+ desc = tables[7];
- desc = tables[8];
-
- Parameter = tables[9];
+ Parameter = tables[8];
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/WindowSearchConfig.cs b/Main/Config/Configs/WindowSearchConfig.cs
new file mode 100644
index 0000000..2ee3b13
--- /dev/null
+++ b/Main/Config/Configs/WindowSearchConfig.cs
@@ -0,0 +1,53 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�8鏈�10鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class WindowSearchConfig : ConfigBase<int, WindowSearchConfig>
+{
+ static WindowSearchConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int ID;
+ public string WinName;
+ public int ActiveType;
+ public int FuncID;
+ public int TabIndex;
+ public string Extra;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out ID);
+
+ WinName = tables[1];
+
+ int.TryParse(tables[2],out ActiveType);
+
+ int.TryParse(tables[3],out FuncID);
+
+ int.TryParse(tables[4],out TabIndex);
+
+ Extra = tables[5];
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/WindowSearchConfig.cs.meta b/Main/Config/Configs/WindowSearchConfig.cs.meta
new file mode 100644
index 0000000..da147a0
--- /dev/null
+++ b/Main/Config/Configs/WindowSearchConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3466e463eaa5cc7468dd902fe89f1741
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/PartialConfigs/HeroAwakeConfig.cs b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
index 2398d6d..6673ad4 100644
--- a/Main/Config/PartialConfigs/HeroAwakeConfig.cs
+++ b/Main/Config/PartialConfigs/HeroAwakeConfig.cs
@@ -4,11 +4,7 @@
//--------------------------------------------------------
using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System;
-using UnityEngine;
-using LitJson;
+
public partial class HeroAwakeConfig : ConfigBase<int, HeroAwakeConfig>
{
@@ -30,15 +26,7 @@
configDics.Add(HeroID, tempDic);
}
- if (tempDic.ContainsKey(AwakeLV))
- {
- // 瑕嗙洊锛岄槻姝簩娆″垵濮嬪寲鍑洪敊
- tempDic[AwakeLV] = this;
- }
- else
- {
- tempDic.Add(AwakeLV, this);
- }
+ tempDic[AwakeLV] = this;
}
public static HeroAwakeConfig GetHeroAwakeConfig(int heroID, int awakeLv)
@@ -56,7 +44,7 @@
return config;
}
- public static bool IsReachMax(int heroID, int awakeLv)
+ public static bool CanAwake(int heroID, int awakeLv)
{
return GetHeroAwakeConfig(heroID, awakeLv) == null;
}
diff --git a/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs b/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs
index 39f14cf..7bfedeb 100644
--- a/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs
+++ b/Main/Config/PartialConfigs/HeroQualityAwakeConfig.cs
@@ -24,16 +24,7 @@
}
- if (tempDic.ContainsKey(AwakeLV))
- {
- // 瑕嗙洊 杩欓噷鎬曟湁浠g爜鍐欓敊 浜屾鍒濆鍖栭厤缃� 瀵艰嚧鍑洪棶棰�
- // 褰撴槸闃查敊 鎬ц兘涓婁篃涓嶇畻澶�� 鍥犱负琛ㄥ氨娌″灏戞暟鎹�
- tempDic[AwakeLV] = this;
- }
- else
- {
- tempDic.Add(AwakeLV, this);
- }
+ tempDic[AwakeLV] = this;
}
public static HeroQualityAwakeConfig GetQualityAwakeConfig(int quality, int awakeLv)
diff --git a/Main/Config/PartialConfigs/HeroQualityBreakConfig.cs b/Main/Config/PartialConfigs/HeroQualityBreakConfig.cs
index 3026f37..7f47470 100644
--- a/Main/Config/PartialConfigs/HeroQualityBreakConfig.cs
+++ b/Main/Config/PartialConfigs/HeroQualityBreakConfig.cs
@@ -3,12 +3,8 @@
public partial class HeroQualityBreakConfig : ConfigBase<int, HeroQualityBreakConfig>
{
- // public int Quality;
- // public int BreakLV;
-
- // Quality, Dictionary<BreakLV, HeroQualityBreakConfig>
public static Dictionary<int, Dictionary<int, HeroQualityBreakConfig>> configDics = new Dictionary<int, Dictionary<int, HeroQualityBreakConfig>>();
-
+ public static Dictionary<int, int> maxlvDic = new Dictionary<int, int>();
protected override void OnConfigParseCompleted()
{
base.OnConfigParseCompleted();
@@ -20,14 +16,12 @@
configDics.Add(Quality, tempDic);
}
- if (tempDic.ContainsKey(BreakLV))
+ tempDic[BreakLV] = this;
+ if (!maxlvDic.ContainsKey(LVMax) || LVMax > maxlvDic[Quality])
{
- tempDic[BreakLV] = this;
+ maxlvDic[Quality] = LVMax;
}
- else
- {
- tempDic.Add(BreakLV, this);
- }
+
}
public static HeroQualityBreakConfig GetQualityBreakConfig(int quality, int breakLv)
diff --git a/Main/Config/PartialConfigs/HeroQualityLVConfig.cs b/Main/Config/PartialConfigs/HeroQualityLVConfig.cs
new file mode 100644
index 0000000..fa0f2ea
--- /dev/null
+++ b/Main/Config/PartialConfigs/HeroQualityLVConfig.cs
@@ -0,0 +1,33 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public partial class HeroQualityLVConfig : ConfigBase<int, HeroQualityLVConfig>
+{
+ public static Dictionary<int, Dictionary<int, HeroQualityLVConfig>> configDics = new Dictionary<int, Dictionary<int, HeroQualityLVConfig>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+
+ Dictionary<int, HeroQualityLVConfig> tempDic = null;
+ if (!configDics.TryGetValue(Quality, out tempDic))
+ {
+ tempDic = new Dictionary<int, HeroQualityLVConfig>();
+ configDics.Add(Quality, tempDic);
+ }
+
+ tempDic.Add(HeroLV, this);
+ }
+
+ public static HeroQualityLVConfig GetQualityLVConfig(int quality, int lv)
+ {
+ Dictionary<int, HeroQualityLVConfig> tempDic = null;
+ if (!configDics.TryGetValue(quality, out tempDic))
+ {
+ return null;
+ }
+ HeroQualityLVConfig config = null;
+ tempDic.TryGetValue(lv, out config);
+ return config;
+ }
+
+}
\ No newline at end of file
diff --git a/Main/Config/PartialConfigs/HeroQualityLVConfig.cs.meta b/Main/Config/PartialConfigs/HeroQualityLVConfig.cs.meta
new file mode 100644
index 0000000..7b936c0
--- /dev/null
+++ b/Main/Config/PartialConfigs/HeroQualityLVConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3a3a6fceebbdfe6448e73e82a8cd45c4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
index 4ea7bc6..5c3996c 100644
--- a/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
+++ b/Main/Config/PartialConfigs/PlayerPropertyConfig.cs
@@ -5,29 +5,28 @@
public partial class PlayerPropertyConfig : ConfigBase<int, PlayerPropertyConfig>
{
- private static Dictionary<int, List<PlayerPropertyConfig>> m_PropCfgs = new Dictionary<int, List<PlayerPropertyConfig>>();
- private static Dictionary<int, List<int>> outputDict = new Dictionary<int, List<int>>();
-
- public static int[] baseAttrs = { 6, 7, 8 }; //鏀婚槻琛�
- public static int[] basePerAttrs = { 16, 17, 18 }; //鏀婚槻琛� 鐧惧垎姣�
- protected override void OnConfigParseCompleted()
+ // 鎸夋樉绀虹被鍨嬪垎
+ private static Dictionary<int, List<int>> m_PlayerPropertyDict = new Dictionary<int, List<int>>();
+ public static Dictionary<int, List<int>> playerPropertyDict
{
- List<PlayerPropertyConfig> list = null;
- m_PropCfgs.TryGetValue(type, out list);
- if (list != null)
+ get
{
- list.Add(this);
- }
- else
- {
- list = new List<PlayerPropertyConfig>();
- list.Add(this);
- m_PropCfgs.Add(type, list);
+ if (m_PlayerPropertyDict.IsNullOrEmpty())
+ RefreshShowDict();
+ return m_PlayerPropertyDict;
}
}
- public static Dictionary<int, List<int>> GetShowDict()
+
+ public static int[] inheritAttrs = playerPropertyDict[5].ToArray(); //鏀婚槻琛� 缁ф壙鐨勭櫨鍒嗘瘮
+ public static int[] basePerAttrs = playerPropertyDict[6].ToArray(); //鏀婚槻琛� 鍔犳垚鐧惧垎姣�
+
+ public const int baseType = 1; //鍩虹灞炴��
+ public const int fightType = 2; //鎴樻枟灞炴��
+ public const int fightAntiType = 3; //鎴樻枟鎶楁��
+ public const int specialType = 4; //鐗规畩灞炴��
+ private static Dictionary<int, List<int>> RefreshShowDict()
{
- if (outputDict.IsNullOrEmpty())
+ if (m_PlayerPropertyDict.IsNullOrEmpty())
{
var keys = GetKeys();
for (int i = 0; i < keys.Count; i++)
@@ -36,23 +35,21 @@
int showType = Get(id).showType;
if (showType == 0) //涓�0鏃朵笉鏄剧ず
continue;
- if (!outputDict.ContainsKey(showType))
+ if (!m_PlayerPropertyDict.ContainsKey(showType))
{
- outputDict[showType] = new List<int> { id };
+ m_PlayerPropertyDict[showType] = new List<int> { id };
}
else
{
- outputDict[showType].Add(id);
+ m_PlayerPropertyDict[showType].Add(id);
}
}
- var outputList = outputDict.Keys.ToList();
- for (int i = 0; i < outputList.Count; i++)
+ foreach (var showType in m_PlayerPropertyDict.Keys)
{
- int showType = outputList[i];
- outputDict[showType].Sort(cmp);
+ m_PlayerPropertyDict[showType].Sort(cmp);
}
}
- return outputDict;
+ return m_PlayerPropertyDict;
}
static int cmp(int id1, int id2)
@@ -63,12 +60,6 @@
return config1.showSequence.CompareTo(config2.showSequence);
}
- public static List<PlayerPropertyConfig> GetPropByType(int type)
- {
- List<PlayerPropertyConfig> list = null;
- m_PropCfgs.TryGetValue(type, out list);
- return list;
- }
public static string GetFullDescription(Int2 property)
diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs
new file mode 100644
index 0000000..1e07b1a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+using System.Collections;
+
+// B2 39 姝﹀皢閲嶇敓 #tagCSHeroRebirth
+
+public class CB239_tagCSHeroRebirth : GameNetPackBasic {
+ public ushort ItemIndex; //姝﹀皢鐗╁搧鎵�鍦ㄦ灏嗚儗鍖呬綅缃储寮�
+
+ public CB239_tagCSHeroRebirth () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB239;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (ItemIndex, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs.meta
new file mode 100644
index 0000000..6e8b75f
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB239_tagCSHeroRebirth.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8003dc9310623ad43a8835fe9221d9ce
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs
new file mode 100644
index 0000000..96ba068
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// B2 40 姝﹀皢閬f暎 #tagCSHeroDismiss
+
+public class CB240_tagCSHeroDismiss : GameNetPackBasic {
+ public ushort Count;
+ public ushort[] ItemIndexList; // 姝﹀皢鐗╁搧鎵�鍦ㄦ灏嗚儗鍖呬綅缃储寮曞垪琛�
+
+ public CB240_tagCSHeroDismiss () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB240;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (Count, NetDataType.WORD);
+ WriteBytes (ItemIndexList, NetDataType.WORD, Count);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs.meta
new file mode 100644
index 0000000..cfb538e
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB240_tagCSHeroDismiss.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 53d619f99407d824cb6b4ac819f0caa3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0722_tagItemDeadLockRefresh.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0722_tagItemDeadLockRefresh.cs
index b646c97..45d92cb 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0722_tagItemDeadLockRefresh.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0722_tagItemDeadLockRefresh.cs
@@ -1,11 +1,13 @@
-using UnityEngine;
-using System.Collections;
-
+using UnityEngine;
+using System.Collections;
+
//07 22 鐗╁搧姝婚攣#tagItemDeadLockRefresh
public class DTC0722_tagItemDeadLockRefresh : DtcBasic {
- public override void Done(GameNetPackBasic vNetPack) {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
base.Done(vNetPack);
H0722_tagItemDeadLockRefresh vNetData = vNetPack as H0722_tagItemDeadLockRefresh;
+ PackManager.Instance.UpdateItemLockState(vNetData);
}
}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs
new file mode 100644
index 0000000..d3c7eea
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 25 鐜╁姝﹀皢鍏叡淇℃伅 #tagSCPlayerHeroInfo
+
+public class DTCB125_tagSCPlayerHeroInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HB125_tagSCPlayerHeroInfo vNetData = vNetPack as HB125_tagSCPlayerHeroInfo;
+ HeroUIManager.Instance.UpdateHeroInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs.meta
new file mode 100644
index 0000000..95ba9bf
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB125_tagSCPlayerHeroInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b8aea40fcee94ca4f8ffed1b039c8fd0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index 6ecf68a..a9d471c 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -104,6 +104,8 @@
Register(typeof(HB427_tagSCUseSkill), typeof(DTCB427_tagSCUseSkill));
Register(typeof(HB124_tagSCLineupInfo), typeof(DTCB124_tagSCLineupInfo));
Register(typeof(HA207_tagSCPackBuyInfo), typeof(DTCA207_tagSCPackBuyInfo));
+ Register(typeof(H0722_tagItemDeadLockRefresh), typeof(DTC0722_tagItemDeadLockRefresh));
+ Register(typeof(HB125_tagSCPlayerHeroInfo), typeof(DTCB125_tagSCPlayerHeroInfo));
}
//涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs b/Main/Core/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs
index ba2aea9..05d07d7 100644
--- a/Main/Core/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs
+++ b/Main/Core/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs
@@ -37,6 +37,7 @@
ItemList[i] = new tagMCGiveAwardItem();
TransBytes (out ItemList[i].ItemID, vBytes, NetDataType.DWORD);
TransBytes (out ItemList[i].Count, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemList[i].CountEx, vBytes, NetDataType.DWORD);
TransBytes (out ItemList[i].IsBind, vBytes, NetDataType.BYTE);
}
TransBytes (out DataLen, vBytes, NetDataType.WORD);
@@ -50,7 +51,8 @@
public struct tagMCGiveAwardItem {
public uint ItemID;
- public uint Count;
+ public uint Count; // 姹備綑浜块儴鍒嗭紝涓埆鍔熻兘鍗曟姹囨�诲彲鑳借秴20浜匡紝濡傛壒閲忛仯鏁o紝鍥虹粺涓�瑙勫垯
+ public uint CountEx; // 鏁撮櫎浜块儴鍒�
public byte IsBind;
}
diff --git a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs
new file mode 100644
index 0000000..0f3b03a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 25 鐜╁姝﹀皢鍏叡淇℃伅 #tagSCPlayerHeroInfo
+
+public class HB125_tagSCPlayerHeroInfo : GameNetPackBasic {
+ public byte AwakeRebirthCnt; // 浠婃棩瑙夐啋杩囩殑姝﹀皢宸查噸鐢熸鏁�
+
+ public HB125_tagSCPlayerHeroInfo () {
+ _cmd = (ushort)0xB125;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out AwakeRebirthCnt, vBytes, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs.meta
new file mode 100644
index 0000000..31d2d1a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB125_tagSCPlayerHeroInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ca0dbb77a3bf332449047d97572422f2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/ResModule/UILoader.cs b/Main/ResModule/UILoader.cs
index cb5331c..6f07dbf 100644
--- a/Main/ResModule/UILoader.cs
+++ b/Main/ResModule/UILoader.cs
@@ -38,7 +38,7 @@
public static Sprite LoadSprite(string _folder, string _file)
{
- return ResManager.Instance.LoadAsset<Sprite>(StringUtility.Contact(ResourcesPath.UI_SPRITE_SUFFIX, "/", _folder) , _file);
+ return ResManager.Instance.LoadAsset<Sprite>(StringUtility.Contact(ResourcesPath.UI_SPRITE_SUFFIX, "/", _folder), _file);
}
public static void UnLoadSprite(string _iconKey)
@@ -53,11 +53,21 @@
public static Font LoadFont(string _fontName)
{
- return ResManager.Instance.LoadAsset<Font>(ResourcesPath.UI_FONT_SUFFIX, _fontName);
+ return ResManager.Instance.LoadAsset<Font>(ResourcesPath.UI_FONT_SUFFIX, _fontName);
}
public static void UnLoadFont(string _fontName)
{
ResManager.Instance.UnloadAsset(ResourcesPath.UI_FONT_SUFFIX, _fontName);
}
+
+ public static Texture2D LoadTexture2D(string _iconKey)
+ {
+ var iconConfig = IconConfig.Get(_iconKey);
+ if (iconConfig == null)
+ {
+ return null;
+ }
+ return ResManager.Instance.LoadAsset<Texture2D>(StringUtility.Contact(ResourcesPath.UI_SPRITE_SUFFIX, "/" + iconConfig.folder), iconConfig.sprite);
+ }
}
diff --git a/Main/System/HappyXB/HappyXBModel.cs b/Main/System/HappyXB/HappyXBModel.cs
index 9635842..f46f2f9 100644
--- a/Main/System/HappyXB/HappyXBModel.cs
+++ b/Main/System/HappyXB/HappyXBModel.cs
@@ -747,7 +747,7 @@
XBFuncSet funcSet = GetXBFuncSet(type);
if (funcSet == null) return false;
- int toolCnt = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.costToolIds[0]);
+ int toolCnt = (int)PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.costToolIds[0]);
if (toolCnt >= funcSet.costToolNums[0])
{
return true;
@@ -764,7 +764,7 @@
XBFuncSet funcSet = GetXBFuncSet(type);
if (funcSet == null) return false;
- toolCnt = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
+ toolCnt = (int)PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
needToolCnt = funcSet.costToolNums[1];
if (toolCnt > 0)
{
@@ -783,7 +783,7 @@
XBFuncSet funcSet = GetXBFuncSet(type);
if (funcSet == null) return false;
- toolCnt = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
+ toolCnt = (int)PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.costToolIds[1]);
needToolCnt = funcSet.costToolNums[1];
if (toolCnt > 0)
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index d0cab14..2080d00 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -112,7 +112,7 @@
qualityConfig = HeroQualityConfig.Get(Quality);
// 鍝佽川绐佺牬閰嶇疆
- qualityBreakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(Quality, awakeLevel);
+ qualityBreakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(Quality, breakLevel);
}
diff --git a/Main/System/Hero/HeroManager.cs b/Main/System/Hero/HeroManager.cs
index 416dbc2..01aceb6 100644
--- a/Main/System/Hero/HeroManager.cs
+++ b/Main/System/Hero/HeroManager.cs
@@ -147,9 +147,12 @@
public int GetHeroCount()
- {
+ {
return heroInfoDict.Count;
}
-
+ public bool HasHero(int heroID)
+ {
+ return PackManager.Instance.GetSinglePack(PackType.Hero).HasItem(heroID);
+ }
}
\ No newline at end of file
diff --git a/Main/System/Hero/UIHeroController.cs b/Main/System/Hero/UIHeroController.cs
index 20fd6af..1b11019 100644
--- a/Main/System/Hero/UIHeroController.cs
+++ b/Main/System/Hero/UIHeroController.cs
@@ -2,8 +2,7 @@
using System;
using Spine.Unity;
using UnityEngine;
-using UnityEngine.Events;
-using UnityEngine.EventSystems;
+
public class UIHeroController : MonoBehaviour
{
private GameObjectPoolManager.GameObjectPool pool;
@@ -14,7 +13,7 @@
private GameObject instanceGO;
private Action onComplete;
- public void Create(int _skinID, float scale = 1f, Action _onComplete = null)
+ public void Create(int _skinID, float scale = 1f, Action _onComplete = null, string motionName = "idle", bool isLh = false)
{
if (skinID == _skinID)
{
@@ -44,12 +43,21 @@
skeletonGraphic = instanceGO.GetComponentInChildren<SkeletonGraphic>(true);
var skinConfig = HeroSkinConfig.Get(skinID);
- skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinConfig.SpineRes);
+ if (isLh)
+ {
+ skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinConfig.Tachie);
+ }
+ else
+ {
+ skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinConfig.SpineRes);
+ }
skeletonGraphic.Initialize(true);
this.transform.localScale = Vector3.one * scale;
spineAnimationState = skeletonGraphic.AnimationState;
spineAnimationState.Data.DefaultMix = 0f;
- PlayAnimation(MotionName.idle, true);
+ if (motionName == "")
+ motionName = GetFistSpineAnim();
+ PlayAnimation(motionName, true);
spineAnimationState.Complete -= OnAnimationComplete;
spineAnimationState.Complete += OnAnimationComplete;
}
@@ -70,12 +78,27 @@
}
- public virtual void PlayAnimation(MotionName motionName, bool loop = false)
+ public virtual void PlayAnimation(string motionName, bool loop = false)
{
if (spineAnimationState == null) return;
// 鐩存帴浣跨敤 ToString() 鑰屼笉鏄皟鐢� GetAnimationName
spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
+ }
+
+ // 鎾斁绗竴涓姩鐢伙紙浣滀负榛樿鍔ㄧ敾锛�
+ string GetFistSpineAnim()
+ {
+ var skeletonData = skeletonGraphic.Skeleton.Data;
+ if (skeletonData.Animations.Count > 0)
+ {
+ return skeletonData.Animations.Items[0].Name;
+ }
+ else
+ {
+ Debug.LogError("Spine 鏁版嵁涓病鏈夋壘鍒颁换浣曞姩鐢伙紒姝﹀皢鐨偆锛�" + skinID);
+ }
+ return "";
}
/// <summary>
@@ -84,6 +107,6 @@
protected virtual void OnAnimationComplete(Spine.TrackEntry trackEntry)
{
onComplete?.Invoke();
- }
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroAllAttrWin.cs b/Main/System/HeroUI/HeroAllAttrWin.cs
new file mode 100644
index 0000000..cd582d7
--- /dev/null
+++ b/Main/System/HeroUI/HeroAllAttrWin.cs
@@ -0,0 +1,125 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢灞炴�х晫闈細 functionOrder 鐢ㄦ潵浼犻�掓灏嗚儗鍖呯储寮�
+/// </summary>
+public class HeroAllAttrWin : UIBase
+{
+ [SerializeField] GameObject baseAttrGroup;
+ [SerializeField] GameObject fightAttrGroup;
+ [SerializeField] GameObject fightAntiAttrGroup;
+ [SerializeField] GameObject specialAttrGroup;
+
+
+
+ Dictionary<int, Button> attrBtns = new Dictionary<int, Button>();
+
+ protected override void InitComponent()
+ {
+ //鎵惧嚭鎵�鏈夊瓙缁勪欢鍚嶅瓧涓篴ttr鐨凣ameObject
+ Button[] attrComponents = baseAttrGroup.GetComponentsInChildren<Button>(true)
+ .Where(c => c.gameObject.name == "attr").ToArray();
+
+ var attrIDList = PlayerPropertyConfig.playerPropertyDict[PlayerPropertyConfig.baseType];
+ for (int i = 0; i < attrComponents.Length; i++)
+ {
+ if (i < attrIDList.Count)
+ {
+ attrComponents[i].SetActive(true);
+ attrBtns.Add(attrIDList[i], attrComponents[i]);
+ }
+ else
+ {
+ attrComponents[i].SetActive(false);
+ }
+ }
+
+ attrComponents = fightAttrGroup.GetComponentsInChildren<Button>(true)
+ .Where(c => c.gameObject.name == "attr").ToArray();
+ attrIDList = PlayerPropertyConfig.playerPropertyDict[PlayerPropertyConfig.fightType];
+ for (int i = 0; i < attrComponents.Length; i++)
+ {
+ if (i < attrIDList.Count)
+ {
+ attrComponents[i].SetActive(true);
+ attrBtns.Add(attrIDList[i], attrComponents[i]);
+ }
+ else
+ {
+ attrComponents[i].SetActive(false);
+ }
+ }
+
+ attrComponents = fightAntiAttrGroup.GetComponentsInChildren<Button>(true)
+ .Where(c => c.gameObject.name == "attr").ToArray();
+ attrIDList = PlayerPropertyConfig.playerPropertyDict[PlayerPropertyConfig.fightAntiType];
+ for (int i = 0; i < attrComponents.Length; i++)
+ {
+ if (i < attrIDList.Count)
+ {
+ attrComponents[i].SetActive(true);
+ attrBtns.Add(attrIDList[i], attrComponents[i]);
+ }
+ else
+ {
+ attrComponents[i].SetActive(false);
+ }
+ }
+ attrComponents = specialAttrGroup.GetComponentsInChildren<Button>(true)
+ .Where(c => c.gameObject.name == "attr").ToArray();
+ attrIDList = PlayerPropertyConfig.playerPropertyDict[PlayerPropertyConfig.specialType];
+ for (int i = 0; i < attrComponents.Length; i++)
+ {
+ if (i < attrIDList.Count)
+ {
+ attrComponents[i].SetActive(true);
+ attrBtns.Add(attrIDList[i], attrComponents[i]);
+ }
+ else
+ {
+ attrComponents[i].SetActive(false);
+ }
+ }
+
+ //璁剧疆鍥炶皟
+ foreach (var kv in attrBtns)
+ {
+ int id = kv.Key;
+ kv.Value.AddListener(() =>
+ {
+ SmallTipWin.showText = PlayerPropertyConfig.Get(id).desc;
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ });
+ }
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ var item = PackManager.Instance.GetItemByIndex(PackType.Hero, functionOrder);
+ if (item == null)
+ return;
+ var hero = HeroManager.Instance.GetHero(item.guid);
+ if (hero == null)
+ return;
+
+ foreach (var kv in attrBtns)
+ {
+ //姣忎釜鎸夐挳涓嬫湁涓や釜Text锛歯ame 鍜� value
+ var id = kv.Key;
+ var button = kv.Value;
+ Text nameText = button.transform.Find("name").GetComponent<Text>();
+ Text valueText = button.transform.Find("value").GetComponent<Text>();
+
+ nameText.text = PlayerPropertyConfig.Get(id).ShowName;
+ valueText.text = PlayerPropertyConfig.GetValueDescription(id, 123);
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroAllAttrWin.cs.meta b/Main/System/HeroUI/HeroAllAttrWin.cs.meta
new file mode 100644
index 0000000..0fb073f
--- /dev/null
+++ b/Main/System/HeroUI/HeroAllAttrWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 62b2672487e30c24f97012135a1ffcf8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroCardCell.cs b/Main/System/HeroUI/HeroCardCell.cs
index 7521a1c..0ad1a75 100644
--- a/Main/System/HeroUI/HeroCardCell.cs
+++ b/Main/System/HeroUI/HeroCardCell.cs
@@ -19,15 +19,17 @@
[SerializeField] Text awakeLVText;
[SerializeField] List<Image> starImgList;
+ string guid;
public void Display(int index)
{
- var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.heroSortList[index]);
+ guid = HeroUIManager.Instance.heroSortList[index];
+ var hero = HeroManager.Instance.GetHero(guid);
if (hero == null)
{
this.gameObject.SetActive(false);
return;
}
-
+
this.gameObject.SetActive(true);
heroCardBG.SetSprite("herocardbg" + hero.Quality);
if (glowMaterial != null)
@@ -36,15 +38,15 @@
}
lvText.text = Language.Get("L1094") + hero.heroLevel.ToString();
var heroConfig = hero.heroConfig;
- countryImg.SetSprite("herocountry" + heroConfig.Country);
- jobImg.SetSprite("herojob" + heroConfig.Class);
+ countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
+ jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale);
onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story));
redpoint.redpointId = MainRedDot.HeroCardRedpoint * 1000 + hero.itemHero.gridIndex;
var funcState = hero.funcState;
if (funcState > 0)
- {
+ {
trainStateImg.SetActive(true);
trainStateImg.SetSprite("herofuncstate" + hero.funcState);
}
@@ -67,13 +69,19 @@
else if ((hero.heroStar - 1) % starImgList.Count >= i)
{
starImgList[i].SetActive(true);
- starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1)/starImgList.Count)+1)*starImgList.Count);
+ starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1) / starImgList.Count) + 1) * starImgList.Count);
}
else
{
starImgList[i].SetActive(false);
}
}
+
+ heroCardBtn.AddListener(() =>
+ {
+ HeroUIManager.Instance.selectHeroGuid = guid;
+ UIManager.Instance.OpenWindow<HeroTrainWin>();
+ });
}
}
diff --git a/Main/System/HeroUI/HeroConnectionCell.cs b/Main/System/HeroUI/HeroConnectionCell.cs
index f09ef80..01035cd 100644
--- a/Main/System/HeroUI/HeroConnectionCell.cs
+++ b/Main/System/HeroUI/HeroConnectionCell.cs
@@ -7,15 +7,26 @@
[SerializeField] HeroConnectionHeadCell[] heros;
[SerializeField] Text connAttrText;
- public void Display(int fetterID)
+ /// <summary>
+ /// 缇佺粖鍥剧墖灞曠ず
+ /// </summary>
+ /// <param name="fetterID"></param>
+ /// <param name="showStr">灞炴�ф枃瀛楁帓鐗�</param>
+ /// <param name="showCollect">鏄惁鎸夋敹闆嗘樉绀虹疆鐏扮姸鎬�</param>
+ /// <param name="guid">鍒囨崲鐨偆鐢�</param>
+ public void Display(int fetterID, string showStr = "", bool showCollect = false, string guid = "")
{
HeroFetterConfig heroFetterConfig = HeroFetterConfig.Get(fetterID);
+
+ int fromHeroID = HeroManager.Instance.GetHero(guid).heroId;
+ int _skinID = HeroManager.Instance.GetHero(guid).SkinID;
for (int i = 0; i < heros.Length; i++)
{
if (i < heroFetterConfig.HeroIDList.Length)
{
heros[i].SetActive(true);
- heros[i].Display(heroFetterConfig.HeroIDList[i], i);
+ heros[i].Display(heroFetterConfig.HeroIDList[i], i, showCollect,
+ fromHeroID == heroFetterConfig.HeroIDList[i] ? _skinID : 0);
}
else
{
@@ -27,7 +38,14 @@
{
attrStr += PlayerPropertyConfig.GetFullDescription(heroFetterConfig.AttrIDList[i], heroFetterConfig.AttrValueList[i]) + " ";
}
- connAttrText.text = Language.Get("L1100", heroFetterConfig.FetterName, UIHelper.AppendColor(TextColType.lightYellow, attrStr));
+ if (string.IsNullOrEmpty(showStr))
+ {
+ connAttrText.text = Language.Get("L1100", heroFetterConfig.FetterName, UIHelper.AppendColor(TextColType.lightYellow, attrStr));
+ }
+ else
+ {
+ connAttrText.text = showStr + attrStr;
+ }
}
}
diff --git a/Main/System/HeroUI/HeroConnectionHeadCell.cs b/Main/System/HeroUI/HeroConnectionHeadCell.cs
index 0b13c49..77de465 100644
--- a/Main/System/HeroUI/HeroConnectionHeadCell.cs
+++ b/Main/System/HeroUI/HeroConnectionHeadCell.cs
@@ -5,7 +5,7 @@
public class HeroConnectionHeadCell : MonoBehaviour
{
[SerializeField] Image qualityImg;
- [SerializeField] Image heroIcon;
+ [SerializeField] ImageEx heroIcon;
[SerializeField] Text nameText;
[SerializeField] Image connMarkImg; //閾炬帴鐨勯攣鍥炬爣锛岀涓�涓笉鏄剧ず
@@ -14,20 +14,18 @@
/// </summary>
/// <param name="heroID"></param>
/// <param name="index"> 鍙槸涓轰簡璁╃涓�涓笉鏄剧ず閿佸浘鏍囩敤</param>
- /// <param name="guid">閮ㄥ垎鐣岄潰鏄剧ず涓嶅悓鐨偆鍥炬爣</param>
- public void Display(int heroID, int index, string guid = "")
+ /// <param name="showCollect">鏄惁鎸夋敹闆嗘樉绀虹疆鐏扮姸鎬�</param>
+ /// <param name="_skinID">鎸囧畾鐨偆</param>
+ public void Display(int heroID, int index, bool showCollect = false, int _skinID = 0)
{
int skinID = 0;
- HeroConfig heroConfig;
- if (!string.IsNullOrEmpty(guid))
+ HeroConfig heroConfig = HeroConfig.Get(heroID);
+ if (_skinID != 0)
{
- var hero = HeroManager.Instance.GetHero(guid);
- skinID = hero.SkinID;
- heroConfig = hero.heroConfig;
+ skinID = _skinID;
}
else
{
- heroConfig = HeroConfig.Get(heroID);
skinID = heroConfig.SkinIDList[0]; //榛樿绗竴涓浘閴村睍绀�
}
@@ -45,6 +43,13 @@
heroIcon.overrideSprite = sprite;
}
+ if (showCollect)
+ {
+ //鏈幏寰楁灏嗚缃伆
+ heroIcon.gray = !HeroManager.Instance.HasHero(heroID);
+
+ }
+
connMarkImg.SetActive(index != 0);
}
}
diff --git a/Main/System/HeroUI/HeroFormationCell.cs b/Main/System/HeroUI/HeroFormationCell.cs
index 914eb12..8290d71 100644
--- a/Main/System/HeroUI/HeroFormationCell.cs
+++ b/Main/System/HeroUI/HeroFormationCell.cs
@@ -55,7 +55,7 @@
string lineText = string.Empty;
bool isActive = sameCountry && count <= result.y;
string countStr = isActive ? UIHelper.AppendColor(TextColType.Green, count.ToString()) : count.ToString();
- lineText = (k == 0 ? "" : "</r>") + Language.Get("herocard37", countStr, RichTextMsgReplaceConfig.GetRichReplace("Country", index + 1));
+ lineText = (k == 0 ? "" : "</r>") + Language.Get("herocard37", countStr, HeroUIManager.Instance.GetJobName(index + 1));
var attrConfig = attrDict[count];
for (int i = 0; i < attrConfig.AttrIDList.Length; i++)
{
diff --git a/Main/System/HeroUI/HeroHeadBaseCell.cs b/Main/System/HeroUI/HeroHeadBaseCell.cs
index f4f83d6..bdad82b 100644
--- a/Main/System/HeroUI/HeroHeadBaseCell.cs
+++ b/Main/System/HeroUI/HeroHeadBaseCell.cs
@@ -194,7 +194,7 @@
}
}
- countryImg.SetSprite("herocountry" + heroConfig.Country);
+ countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
lvText.text = lv == 0 ? "": Language.Get("L1094") + lv;
awakeLvRect.SetActive(awakelv > 0);
diff --git a/Main/System/HeroUI/HeroLVBreakSuccessWin.cs b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
new file mode 100644
index 0000000..8625f84
--- /dev/null
+++ b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs
@@ -0,0 +1,86 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢绐佺牬鐣岄潰
+/// </summary>
+public class HeroLVBreakSuccessWin : UIBase
+{
+
+ [SerializeField] Text breakLVText;
+ [SerializeField] Text nextBreakLVText;
+ [SerializeField] Text lvText;
+ [SerializeField] Text nextLVText;
+ [SerializeField] Text[] attrPerTextArr;
+ [SerializeField] Text[] nextAttrPerTextArr;
+ [SerializeField] Text potentialText;
+ [SerializeField] Button okBtn;
+
+
+ string guid;
+ HeroInfo hero;
+
+
+ protected override void InitComponent()
+ {
+ okBtn.AddListener(CloseWindow);
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ guid = HeroUIManager.Instance.waitResponse.guid;
+ if (string.IsNullOrEmpty(guid))
+ return;
+ hero = HeroManager.Instance.GetHero(guid);
+ Refresh();
+ }
+
+ protected override void OnPreClose()
+ {
+ }
+
+
+ public override void Refresh()
+ {
+ breakLVText.text = "+" + (hero.breakLevel - 1);
+ nextBreakLVText.text = "+" + hero.breakLevel;
+ var beforeBreakLVConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel - 1);
+ lvText.text = beforeBreakLVConfig.LVMax.ToString();
+
+ nextLVText.text = hero.qualityBreakConfig.LVMax.ToString();
+
+ for (int i = 0; i < attrPerTextArr.Length; i++)
+ {
+ attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i],
+ hero.qualityConfig.BreakLVAddPer * (hero.breakLevel - 1));
+ }
+ for (int i = 0; i < nextAttrPerTextArr.Length; i++)
+ {
+ nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i],
+ hero.qualityConfig.BreakLVAddPer * hero.breakLevel);
+ }
+
+
+ var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel);
+ if (nextQualityBreakConfig == null)
+ {
+ potentialText.text = "";
+ return;
+ }
+ List<string> attrStrArr = new List<string>();
+ for (int i = 0; i < nextQualityBreakConfig.AttrIDList.Length; i++)
+ {
+ attrStrArr.Add(PlayerPropertyConfig.GetFullDescription(nextQualityBreakConfig.AttrIDList[i], nextQualityBreakConfig.AttrValueList[i]));
+ }
+ if (nextQualityBreakConfig.SkillID != 0)
+ {
+ attrStrArr.Add(SkillConfig.Get(nextQualityBreakConfig.SkillID).Description);
+ }
+ potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join(Language.Get("L1112"), attrStrArr));
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroLVBreakSuccessWin.cs.meta b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs.meta
new file mode 100644
index 0000000..4a9d753
--- /dev/null
+++ b/Main/System/HeroUI/HeroLVBreakSuccessWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6d272e748e1ddd741965ae96a8ede01d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroLVBreakWin.cs b/Main/System/HeroUI/HeroLVBreakWin.cs
new file mode 100644
index 0000000..e2603a3
--- /dev/null
+++ b/Main/System/HeroUI/HeroLVBreakWin.cs
@@ -0,0 +1,105 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢绐佺牬鐣岄潰
+/// </summary>
+public class HeroLVBreakWin : UIBase
+{
+
+ [SerializeField] Text breakLVText;
+ [SerializeField] Text nextBreakLVText;
+ [SerializeField] Text lvText;
+ [SerializeField] Text nextLVText;
+ [SerializeField] Text[] attrPerTextArr;
+ [SerializeField] Text[] nextAttrPerTextArr;
+ [SerializeField] Text potentialText;
+ [SerializeField] Image moneyIcon;
+ [SerializeField] Text moneyText;
+ [SerializeField] Button breakBtn;
+
+
+ string guid;
+ HeroInfo hero;
+
+
+ protected override void InitComponent()
+ {
+ breakBtn.AddListener(BreakLV);
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ guid = HeroUIManager.Instance.selectHeroGuid;
+ hero = HeroManager.Instance.GetHero(guid);
+ Refresh();
+ }
+
+ protected override void OnPreClose()
+ {
+ }
+
+
+ public override void Refresh()
+ {
+ breakLVText.text = "+" + hero.breakLevel;
+ nextBreakLVText.text = "+" + (hero.breakLevel + 1);
+ lvText.text = hero.qualityBreakConfig.LVMax.ToString();
+
+ var nextBreakLVConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel + 1);
+ nextLVText.text = nextBreakLVConfig.LVMax.ToString();
+
+ for (int i = 0; i < attrPerTextArr.Length; i++)
+ {
+ attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i],
+ hero.qualityConfig.BreakLVAddPer * hero.breakLevel);
+ }
+ for (int i = 0; i < nextAttrPerTextArr.Length; i++)
+ {
+ nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i],
+ hero.qualityConfig.BreakLVAddPer * (hero.breakLevel + 1));
+ }
+
+ moneyIcon.SetOrgSprite(ItemConfig.Get(nextBreakLVConfig.UPCostItem[0]).IconKey);
+ moneyText.text = UIHelper.ShowUseItem(PackType.Item, nextBreakLVConfig.UPCostItem[0], (ulong)nextBreakLVConfig.UPCostItem[1]);
+
+ var nextQualityBreakConfig = HeroBreakConfig.GetHeroBreakConfig(hero.heroId, hero.breakLevel + 1);
+ if (nextQualityBreakConfig == null)
+ {
+ potentialText.text = "";
+ return;
+ }
+ List<string> attrStrArr = new List<string>();
+ for (int i = 0; i < nextQualityBreakConfig.AttrIDList.Length; i++)
+ {
+ attrStrArr.Add(PlayerPropertyConfig.GetFullDescription(nextQualityBreakConfig.AttrIDList[i], nextQualityBreakConfig.AttrValueList[i]));
+ }
+ if (nextQualityBreakConfig.SkillID != 0)
+ {
+ attrStrArr.Add(SkillConfig.Get(nextQualityBreakConfig.SkillID).Description);
+ }
+ potentialText.text = Language.Get("L1100", Language.Get("herocard56"), string.Join(Language.Get("L1112"), attrStrArr));
+ }
+
+ void BreakLV()
+ {
+ if (ItemLogicUtility.CheckItemCount(PackType.Item, hero.qualityBreakConfig.UPCostItem[0], (ulong)hero.qualityBreakConfig.UPCostItem[1], 2))
+ {
+ var pack = new CB232_tagCSHeroBreak();
+ pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
+ GameNetSystem.Instance.SendInfo(pack);
+ CloseWindow();
+ //璁剧疆涓瓑寰呭洖澶嶇殑鏍囪瘑 鏄剧ず鎴愬姛鐣岄潰
+ HeroUIManager.Instance.waitResponse = new WaitHeroFuncResponse()
+ {
+ guid = guid,
+ type = HeroFuncType.Break,
+ time = Time.time
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroLVBreakWin.cs.meta b/Main/System/HeroUI/HeroLVBreakWin.cs.meta
new file mode 100644
index 0000000..7c1c46f
--- /dev/null
+++ b/Main/System/HeroUI/HeroLVBreakWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b01967255da52584984f8c394f186c0f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroListWin.cs b/Main/System/HeroUI/HeroListWin.cs
index c3e1a84..24f64af 100644
--- a/Main/System/HeroUI/HeroListWin.cs
+++ b/Main/System/HeroUI/HeroListWin.cs
@@ -33,6 +33,10 @@
HeroUIManager.Instance.selectTeamType = TeamType.Story;
UIManager.Instance.OpenWindow<HeroPosWin>();
});
+ attrOnTipBtn.AddListener(() =>
+ {
+ attrOnTip.SetActive(!attrOnTip.activeSelf);
+ });
}
diff --git a/Main/System/HeroUI/HeroPosHeadCell.cs b/Main/System/HeroUI/HeroPosHeadCell.cs
index 2eb1b0a..faeba92 100644
--- a/Main/System/HeroUI/HeroPosHeadCell.cs
+++ b/Main/System/HeroUI/HeroPosHeadCell.cs
@@ -22,7 +22,7 @@
});
nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel);
- jobImg.SetSprite("herojob" + hero.heroConfig.Class);
+ jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class));
}
void Click(HeroInfo hero, int index)
diff --git a/Main/System/HeroUI/HeroScenePosCell.cs b/Main/System/HeroUI/HeroScenePosCell.cs
index a8351d2..4b5c6a6 100644
--- a/Main/System/HeroUI/HeroScenePosCell.cs
+++ b/Main/System/HeroUI/HeroScenePosCell.cs
@@ -28,19 +28,19 @@
lvText.text = Language.Get("L1099", hero.heroLevel);
var heroConfig = hero.heroConfig;
- countryImg.SetSprite("herocountry" + heroConfig.Country);
+ countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex]);
nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel);
posCircleImg.SetSprite("heroposcircle" + heroConfig.Quality);
//涓嶆槸鎺ㄨ崘浣嶅垯鎻愮ず
- if (heroConfig.AtkDistType == 1 && TeamConst.TeamPos2Array.Contains(index) ||
- heroConfig.AtkDistType == 2 && TeamConst.TeamPos1Array.Contains(index))
+ if (heroConfig.Position == 1 && TeamConst.TeamPos2Array.Contains(index) ||
+ heroConfig.Position == 2 && TeamConst.TeamPos1Array.Contains(index))
{
suggestForm.SetActive(true);
- jobTip.text = RichTextMsgReplaceConfig.GetRichReplace("Class", heroConfig.Class);
- posTip.text = Language.Get("heroAtkDistType" + heroConfig.AtkDistType);
+ jobTip.text = HeroUIManager.Instance.GetJobName(heroConfig.Class);
+ posTip.text = Language.Get("heroAtkDistType" + heroConfig.Position);
}
else
{
diff --git a/Main/System/HeroUI/HeroSkillWin.cs b/Main/System/HeroUI/HeroSkillWin.cs
new file mode 100644
index 0000000..fc83d71
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkillWin.cs
@@ -0,0 +1,52 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鎶�鑳界晫闈�
+/// </summary>
+public class HeroSkillWin : UIBase
+{
+ [SerializeField] SkillBaseCell normalSkillCell;
+ [SerializeField] Text nameText;
+ [SerializeField] Text skillTypeText;
+ [SerializeField] RichText descText;
+
+ [SerializeField] SkillBaseCell angerSkillCell;
+ [SerializeField] Text name2Text;
+ [SerializeField] Text skillType2Text;
+ [SerializeField] RichText desc2Text;
+
+
+ int heroID;
+
+ protected override void OnPreOpen()
+ {
+ heroID = functionOrder;
+ Refresh();
+ }
+
+ protected override void OnPreClose()
+ {
+ }
+
+
+ public override void Refresh()
+ {
+ var heroConfig = HeroConfig.Get(heroID);
+ if (!SkillConfig.HasKey(heroConfig.AtkSkillID))
+ return;
+ normalSkillCell.Init(heroConfig.AtkSkillID);
+ var skillConfig = SkillConfig.Get(heroConfig.AtkSkillID);
+ nameText.text = skillConfig.SkillName;
+ skillTypeText.text = Language.Get("L1100", Language.Get("L1108"), Language.Get(skillConfig.FuncType == 1 ? "HeroSkillType_1" : "HeroSkillType_2"));
+ descText.text = skillConfig.Description;
+
+ angerSkillCell.Init(heroConfig.AngerSkillID);
+ var skillConfig2 = SkillConfig.Get(heroConfig.AngerSkillID);
+ name2Text.text = skillConfig2.SkillName;
+ skillType2Text.text = Language.Get("L1100", Language.Get("L1108"), Language.Get(skillConfig2.FuncType == 1 ? "HeroSkillType_1" : "HeroSkillType_2"));
+ desc2Text.text = skillConfig2.Description;
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroSkillWin.cs.meta b/Main/System/HeroUI/HeroSkillWin.cs.meta
new file mode 100644
index 0000000..0dd009a
--- /dev/null
+++ b/Main/System/HeroUI/HeroSkillWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b1a16fb3ae471984c9b77182c3cb88d7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroTrainWin.cs b/Main/System/HeroUI/HeroTrainWin.cs
new file mode 100644
index 0000000..7daa29c
--- /dev/null
+++ b/Main/System/HeroUI/HeroTrainWin.cs
@@ -0,0 +1,437 @@
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 姝﹀皢鍩瑰吇鐣岄潰
+/// </summary>
+public class HeroTrainWin : UIBase
+{
+ [SerializeField] Button showFuncBtn; //鍙樉绀虹珛缁樻椂鐐瑰嚮锛屾樉绀哄姛鑳�
+ [SerializeField] Transform funcForm;
+ [SerializeField] UIHeroController roleLhModel; //灞曠ず鑻遍泟绔嬬粯
+ [SerializeField] Button rightBtn;
+ [SerializeField] Button leftBtn;
+ [SerializeField] UIHeroController roleXsModel; //鍍忕礌
+ [SerializeField] UIEffectPlayer lvupEffect;
+ [SerializeField] Image jobImg;
+ [SerializeField] Text jobPosNameText;
+ [SerializeField] Text descText;
+ [SerializeField] Text fightPowerText; //鐢卞鎴风鑷繁棰勭畻鐨勬垬鍔�
+ [SerializeField] Button lockBtn;
+ [SerializeField] Image lockImg;
+ [SerializeField] Image unLockImg;
+ [SerializeField] HeroConnectionCell connetionForm; //缇佺粖
+ [SerializeField] Button resetBtn;
+ [SerializeField] Button deleteBtn;
+ [SerializeField] Button seeLhBtn; //鏌ョ湅绔嬬粯
+ [SerializeField] SkillBaseCell normalSkillCell;
+ [SerializeField] SkillBaseCell angerSkillCell;
+ [SerializeField] Button awakeBtn;
+
+ [SerializeField] Button closeBtn; //鍏抽棴鎸夐挳
+
+ [SerializeField] List<Image> starImgList;
+ [SerializeField] Text nameText;
+ [SerializeField] UIEffectPlayer nameEffect;
+ [SerializeField] Image countryImg;
+ [SerializeField] Text awakeLVText;
+
+ [SerializeField] Button attrBtn;
+ [SerializeField] Image unfoldImg; //灞曞紑鏃舵寜閽殑鍥炬爣
+ [SerializeField] Image foldImg; //鏀惰捣鏃舵寜閽殑鍥炬爣
+ bool unfoldState = false;//鏄惁灞曞紑
+ [SerializeField] Transform foldPos;
+ [SerializeField] Transform unfoldPos; //灞曞紑鏃剁殑浣嶇疆
+ [SerializeField] RectTransform attrPanel; //鏄剧ず鐨勫睘鎬ф爮
+ [SerializeField] RectTransform attrScroll;
+ [SerializeField] RichText inheritText; //姝﹀皢缁ф壙鎻忚堪
+ [SerializeField] Text[] inheritAttrText; //姝﹀皢浼氱户鎵跨殑灞炴��
+ [SerializeField] RichText heroAddPerText; //涓诲叕锛堜笂闃碉級鍔犳垚鎻忚堪
+ [SerializeField] Text[] heroAddAttrPerText; //涓诲叕锛堜笂闃碉級鍔犳垚
+ [SerializeField] Text[] addPerText; //澧炲姞鐧惧垎姣旓紙椋樺姩锛�
+ [SerializeField] PositionTween addPerObject;
+ [SerializeField] Image lvupMoneyIcon;
+ [SerializeField] Text lvupMoneyText;
+ [SerializeField] Text lvupBtnText;
+ [SerializeField] LongPressButton lvupBtn;
+ [SerializeField] Button allAttrBtn;
+ string guid;
+ HeroInfo hero;
+ protected override void InitComponent()
+ {
+ showFuncBtn.AddListener(() =>
+ {
+ funcForm.SetActive(true);
+ });
+ seeLhBtn.AddListener(() =>
+ {
+ funcForm.SetActive(false);
+ });
+ closeBtn.AddListener(CloseWindow);
+ rightBtn.AddListener(() =>
+ {
+ ChangeHero(1);
+ });
+ leftBtn.AddListener(() =>
+ {
+ ChangeHero(-1);
+ });
+
+ lockBtn.AddListener(SetLockState);
+ resetBtn.AddListener(ResetBtnClick);
+ deleteBtn.AddListener(DeleteHero);
+ awakeBtn.AddListener(() =>
+ {
+ // UIManager.Instance.OpenWindow<HeroAwakeWin>(hero.heroId);
+ });
+ inheritText.OnClick = () =>
+ {
+ SmallTipWin.showText = Language.Get("herocard47");
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ };
+ heroAddPerText.OnClick = () =>
+ {
+ SmallTipWin.showText = Language.Get("herocard48");
+ SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
+ UIManager.Instance.OpenWindow<SmallTipWin>();
+ };
+ attrBtn.AddListener(() =>
+ {
+ unfoldState = !unfoldState;
+ RefreshFoldState();
+ });
+
+ allAttrBtn.AddListener(() =>
+ {
+ UIManager.Instance.OpenWindow<HeroAllAttrWin>(hero.itemHero.gridIndex);
+ });
+ lvupBtn.AddListener(LVUp);
+ lvupBtn.onPress.AddListener(LVUp);
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ PackManager.Instance.RefreshItemLockEvent += RefreshItemLockEvent;
+ HeroManager.Instance.onHeroChangeEvent += RefreshHeroEvent;
+ guid = HeroUIManager.Instance.selectHeroGuid;
+ hero = HeroManager.Instance.GetHero(guid);
+ unfoldState = false;
+ addPerObject.SetActive(false);
+ Refresh();
+ }
+
+ protected override void OnPreClose()
+ {
+ PackManager.Instance.RefreshItemLockEvent -= RefreshItemLockEvent;
+ HeroManager.Instance.onHeroChangeEvent -= RefreshHeroEvent;
+ }
+
+
+ public override void Refresh()
+ {
+ roleLhModel.Create(hero.SkinID, 0.6f, motionName: "", isLh: true);
+ roleXsModel.Create(hero.SkinID);
+ jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class));
+ jobPosNameText.text = HeroUIManager.Instance.GetJobName(hero.heroConfig.Class);
+ descText.text = hero.heroConfig.Desc;
+ fightPowerText.text = hero.CalculatePower().ToString();
+ lockImg.SetActive(hero.isLock);
+ unLockImg.SetActive(!hero.isLock);
+ nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel);
+
+ RefreshConn();
+ normalSkillCell.Init(hero.heroConfig.AtkSkillID, () =>
+ {
+ UIManager.Instance.OpenWindow<HeroSkillWin>(hero.heroId);
+ }, true);
+ angerSkillCell.Init(hero.heroConfig.AngerSkillID, () =>
+ {
+ UIManager.Instance.OpenWindow<HeroSkillWin>(hero.heroId);
+ }, true);
+
+ awakeBtn.SetActive(HeroAwakeConfig.CanAwake(hero.heroId, 1));
+
+ RefreshName();
+ RefreshFoldState();
+ RefreshAttr();
+ }
+
+ void RefreshItemLockEvent(PackType type, string guid, bool lockState)
+ {
+ if (type != PackType.Hero)
+ return;
+ lockImg.SetActive(hero.isLock);
+ unLockImg.SetActive(!hero.isLock);
+ }
+
+ void RefreshHeroEvent(HeroInfo hero)
+ {
+ Refresh();
+ }
+
+ void RefreshConn()
+ {
+ if (hero.heroConfig.FetterIDList.Length > 0)
+ {
+ connetionForm.SetActive(true);
+ connetionForm.Display(hero.heroConfig.FetterIDList[0], Language.Get("herocard40"), true, guid);
+ }
+ else
+ {
+ connetionForm.SetActive(false);
+ }
+
+ }
+
+ void ChangeHero(int changeValue)
+ {
+ var index = HeroUIManager.Instance.heroSortList.IndexOf(guid);
+ if (index == -1)
+ return;
+ int resultIndex = index + changeValue;
+ //寰幆澶勭悊
+ if (resultIndex < 0)
+ {
+ resultIndex = HeroUIManager.Instance.heroSortList.Count - 1;
+ }
+ else if (resultIndex > HeroUIManager.Instance.heroSortList.Count - 1)
+ {
+ resultIndex = 0;
+ }
+ guid = HeroUIManager.Instance.heroSortList[resultIndex];
+ hero = HeroManager.Instance.GetHero(guid);
+ Refresh();
+ }
+
+ void SetLockState()
+ {
+ var pack = new CB238_tagCSHeroLock();
+ pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
+ pack.IsLock = hero.isLock ? (byte)0 : (byte)1;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ void ResetBtnClick()
+ {
+ //鍗囩骇銆佺獊鐮淬�佽閱�
+ if (hero.heroLevel == 1 && hero.breakLevel == 0 && hero.awakeLevel == 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("HeroCanNotReset");
+ return;
+ }
+
+ List<Item> items = new List<Item>();
+
+
+ var payBack1 = CommonFunc.AddDict(HeroUIManager.Instance.GetHeroLVPayBack(hero.heroId, hero.heroLevel),
+ HeroUIManager.Instance.GetHeroBreakPayBack(hero.heroId, hero.breakLevel));
+
+ //宸茶閱掔殑闇�瑕佹秷鑰楄揣甯�
+ if (hero.awakeLevel == 0)
+ {
+ items = CommonFunc.ChangeToItemList(payBack1);
+ ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ //鍙戝寘
+ SendReborn(hero.itemHero.gridIndex);
+ }
+ });
+ }
+ else
+ {
+ payBack1 = CommonFunc.AddDict(payBack1, HeroUIManager.Instance.GetHeroQualityAwakePayBack(hero.heroId, hero.awakeLevel));
+ items = CommonFunc.ChangeToItemList(payBack1);
+ var info2 = Language.Get("herocard44", HeroUIManager.Instance.awakeRebirthCnt);
+ ConfirmCancel.ShowItemsConfirm(items, Language.Get("herocard42"), Language.Get("herocard43"), (bool isOk) =>
+ {
+ if (isOk)
+ {
+ //鍙戝寘
+ SendReborn(hero.itemHero.gridIndex);
+ }
+ }, info2, "", HeroUIManager.Instance.payBackMoney, HeroUIManager.Instance.payBackMoneyType);
+
+ }
+
+ }
+
+ void SendReborn(int index)
+ {
+ var pack = new CB239_tagCSHeroRebirth();
+ pack.ItemIndex = (ushort)index;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ void DeleteHero()
+ {
+ if (hero.isLock)
+ {
+ SysNotifyMgr.Instance.ShowTip("UnlockHero");
+ return;
+ }
+ }
+
+ void RefreshStars()
+ {
+ for (int i = 0; i < starImgList.Count; i++)
+ {
+ if (hero.heroStar == 0 && i == 0)
+ {
+ // 鏃犳槦绾� 鐗规畩澶勭悊
+ starImgList[i].SetActive(true);
+ starImgList[i].SetSprite("herostar" + hero.heroStar);
+ }
+ else if ((hero.heroStar - 1) % starImgList.Count >= i)
+ {
+ starImgList[i].SetActive(true);
+ starImgList[i].SetSprite("herostar" + (((hero.heroStar - 1) / starImgList.Count) + 1) * starImgList.Count);
+ }
+ else
+ {
+ starImgList[i].SetActive(false);
+ }
+ }
+ }
+
+ void RefreshName()
+ {
+ RefreshStars();
+ nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel);
+ nameText.color = UIHelper.GetUIColorByFunc(hero.Quality);
+
+ if (hero.Quality >= 4)
+ {
+ nameEffect.SetActive(true);
+ nameEffect.Play(hero.Quality == 4 ? 0 : 1);
+ }
+ else
+ {
+ nameEffect.SetActive(false);
+ }
+ countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(hero.heroConfig.Country));
+ if (hero.awakeLevel == 0)
+ {
+ awakeLVText.text = Language.Get("L1094") + hero.heroLevel;
+ awakeLVText.GetComponent<OutlineEx>().colorType = QualityTextColType.itemcucao;
+ }
+ else
+ {
+ awakeLVText.text = Language.Get("L1094") + hero.heroLevel + " " + Language.Get("herocard12", hero.awakeLevel);
+ awakeLVText.GetComponent<OutlineEx>().colorType = QualityTextColType.red;
+ }
+ }
+
+ void RefreshFoldState()
+ {
+ if (!unfoldState)
+ {
+ foldImg.SetActive(true);
+ unfoldImg.SetActive(false);
+ attrPanel.localPosition = foldPos.localPosition;
+ attrScroll.sizeDelta = new Vector2(attrScroll.rect.width, 445);
+ }
+ else
+ {
+ foldImg.SetActive(false);
+ unfoldImg.SetActive(true);
+ attrPanel.localPosition = unfoldPos.localPosition;
+ attrScroll.sizeDelta = new Vector2(attrScroll.rect.width, 933);
+ }
+ }
+
+ void RefreshAttr()
+ {
+ inheritAttrText[0].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[0], hero.heroConfig.AtkInheritPer));
+ inheritAttrText[1].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[1], hero.heroConfig.DefInheritPer));
+ inheritAttrText[2].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.inheritAttrs[2], hero.heroConfig.HPInheritPer));
+
+ //涓婇樀灞炴��
+ int valuePer = hero.GetOnBattleAddPer();
+ for (int i = 0; i < heroAddAttrPerText.Length; i++)
+ {
+ heroAddAttrPerText[i].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.basePerAttrs[i], valuePer));
+ }
+
+
+
+ //鍖哄垎绐佺牬鍜屾渶澶х瓑绾�
+ if (!HeroUIManager.Instance.IsLVMax(hero))
+ {
+ lvupBtnText.text = Language.Get("L1109");
+ lvupBtn.interactable = true;
+ lvupBtn.SetColorful(null, true);
+ lvupMoneyIcon.SetActive(true);
+
+ if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero))
+ {
+ lvupBtnText.text = Language.Get("L1111");
+ var breakConfig = HeroQualityBreakConfig.GetQualityBreakConfig(hero.Quality, hero.breakLevel);
+ lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(breakConfig.UPCostItem[0]).IconKey);
+ lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, breakConfig.UPCostItem[0], (ulong)breakConfig.UPCostItem[1]);
+ }
+ else
+ {
+ lvupBtnText.text = Language.Get("L1109");
+ var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
+ lvupMoneyIcon.SetOrgSprite(ItemConfig.Get(lvupConfig.UPCostItem[0]).IconKey);
+ lvupMoneyText.text = UIHelper.ShowUseItem(PackType.Item, lvupConfig.UPCostItem[0], (ulong)lvupConfig.UPCostItem[1]);
+ }
+
+ }
+ else
+ {
+ lvupBtnText.text = Language.Get("L1110");
+ lvupBtn.interactable = false;
+ lvupBtn.SetColorful(null, false);
+ lvupMoneyIcon.SetActive(false);
+
+ }
+ }
+
+ void LVUp()
+ {
+ int itemID = 0;
+ ulong needCount = 0;
+ if (HeroUIManager.Instance.IsLVMaxByBreakLevel(hero))
+ {
+ //绐佺牬
+ if (!UIManager.Instance.IsOpened<HeroLVBreakWin>())
+ {
+ HeroUIManager.Instance.selectHeroGuid = guid;
+ UIManager.Instance.OpenWindow<HeroLVBreakWin>();
+ }
+ }
+ else
+ {
+ //鍗囩骇
+ var lvupConfig = HeroQualityLVConfig.GetQualityLVConfig(hero.Quality, hero.heroLevel);
+ itemID = lvupConfig.UPCostItem[0];
+ needCount = (ulong)lvupConfig.UPCostItem[1];
+ if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, needCount, 2))
+ {
+ var pack = new CB230_tagCSHeroLVUP();
+ pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
+ GameNetSystem.Instance.SendInfo(pack);
+ //棰勬樉绀�
+ lvupEffect.Play();
+ addPerObject.SetActive(true);
+ for (int i = 0; i < addPerText.Length; i++)
+ {
+ addPerText[i].text = "+" + PlayerPropertyConfig.GetValueDescription(PlayerPropertyConfig.basePerAttrs[i], hero.qualityConfig.BreakLVAddPer);
+ }
+ addPerObject.Play(()=>
+ {
+ addPerObject.SetActive(false);
+ });
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroTrainWin.cs.meta b/Main/System/HeroUI/HeroTrainWin.cs.meta
new file mode 100644
index 0000000..7ef8618
--- /dev/null
+++ b/Main/System/HeroUI/HeroTrainWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b5c5fe2d295e8a1439a4d5b2c223577b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/HeroUI/HeroUIManager.cs b/Main/System/HeroUI/HeroUIManager.cs
index 3af55ee..5b6b3d6 100644
--- a/Main/System/HeroUI/HeroUIManager.cs
+++ b/Main/System/HeroUI/HeroUIManager.cs
@@ -1,9 +1,6 @@
锘縰sing System;
using System.Collections;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using dnlib.DotNet;
using UnityEngine;
@@ -11,33 +8,123 @@
public class HeroUIManager : GameSystemManager<HeroUIManager>
{
#region 姝﹀皢鍒楄〃鐣岄潰
- public List<string> heroSortList { get; private set; } = new List<string>(); //涓婇樀涓轰富绾跨殑鍒楄〃
+ public List<string> heroSortList { get; private set; } = new List<string>(); //涓婇樀涓轰富绾跨殑 GUID鍒楄〃
public int selectHeroListJob = 0; //姝﹀皢鍒楄〃鐣岄潰 绛涢�夎亴涓�
public int selectHeroListCountry = 0; //姝﹀皢鍒楄〃鐣岄潰绛涢�夊浗瀹�
+ public string selectHeroGuid; //閫変腑鐨勬灏唅d
#endregion
+ public WaitHeroFuncResponse waitResponse; //璇锋眰姝﹀皢鍔熻兘
+
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
+ HeroManager.Instance.onHeroChangeEvent += OnHeroChangeEvent;
+ ParseConfig();
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
+ HeroManager.Instance.onHeroChangeEvent -= OnHeroChangeEvent;
+ }
+
+ void ParseConfig()
+ {
+ var config = FuncConfigConfig.Get("HeroRebirth");
+ payBackMoneyType = int.Parse(config.Numerical1);
+ payBackMoney = int.Parse(config.Numerical2);
+ }
public void OnBeforePlayerDataInitialize()
{
heroSortList.Clear();
heroOnTeamSortList.Clear();
+ awakeRebirthCnt = 0;
+ waitResponse = default;
}
- public void OnPlayerLoginOk()
+ private void OnHeroChangeEvent(HeroInfo hero)
{
+ if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
+ return;
+ WaitServerResponse(hero);
}
- public override void Init()
+ private void WaitServerResponse(HeroInfo hero)
{
+ if (waitResponse.Equals(default(WaitHeroFuncResponse)))
+ {
+ return;
+ }
+ // 绛夊緟瓒呰繃5绉� 涓嶅鐞�
+ var nowTime = Time.time;
+ if (waitResponse.time > 0f && waitResponse.time + 5 < nowTime)
+ {
+ waitResponse = default;
+ return;
+ }
+ if (hero.itemHero.guid != waitResponse.guid)
+ {
+ return;
+ }
+
+ if (waitResponse.type == HeroFuncType.Break)
+ {
+ UIManager.Instance.OpenWindow<HeroLVBreakSuccessWin>();
+ }
+
+ waitResponse = default;
+
}
- public override void Release()
+ #region 姝﹀皢UI甯哥敤鎺ュ彛
+ public string GetCountryName(int index)
{
-
+ return RichTextMsgReplaceConfig.GetRichReplace("Country", index);
}
+ public string GetJobName(int index)
+ {
+ return RichTextMsgReplaceConfig.GetRichReplace("Class", index);
+ }
+
+ public string GetCountryIconName(int index)
+ {
+ return StringUtility.Contact("herocountry", index);
+ }
+
+ public string GetJobIconName(int index)
+ {
+ return StringUtility.Contact("herojob", index);
+ }
+
+ public int GetMaxLV(int quality)
+ {
+ return HeroQualityBreakConfig.maxlvDic[quality];
+ }
+
+ //鏄惁杈惧埌鏈�楂樼骇
+ public bool IsLVMax(HeroInfo hero)
+ {
+ return hero.heroLevel >= GetMaxLV(hero.Quality);
+
+ }
+ //绐佺牬闄愬埗鐨勬渶楂樼瓑绾�
+ public int GetMaxLVByBreakLV(int quality, int breakLevel)
+ {
+ return HeroQualityBreakConfig.GetQualityBreakConfig(quality, breakLevel).LVMax;
+ }
+
+ public bool IsLVMaxByBreakLevel(HeroInfo hero)
+ {
+ return hero.heroLevel == GetMaxLVByBreakLV(hero.Quality, hero.breakLevel);
+ }
+
+
+ #endregion
public void QueryUnLockHeroPack()
@@ -58,7 +145,7 @@
{
if (UIHelper.GetMoneyCnt(buyInfo[0]) < (ulong)buyInfo[1])
{
- SysNotifyMgr.Instance.ShowTip("LackMoney",buyInfo[0]);
+ SysNotifyMgr.Instance.ShowTip("LackMoney", buyInfo[0]);
return;
}
PackManager.Instance.BuyPackGird(PackType.Hero);
@@ -119,7 +206,7 @@
private TeamType m_SelectTeamType = TeamType.Story; //褰撳墠閫変腑鐨勬槸鍝釜闃靛, 甯冮樀鐩稿叧閫昏緫浣跨敤
public TeamType selectTeamType
- {
+ {
get { return m_SelectTeamType; }
set
{
@@ -133,7 +220,7 @@
m_SelectTeamType = value;
}
- }
+ }
public int selectTeamPosJob = 0; //甯冮樀鐣岄潰 绛涢�夎亴涓�
public int selectTeamPosCountry = 0; //甯冮樀鐣岄潰 绛涢�夊浗瀹�
@@ -326,4 +413,90 @@
#endregion
+
+ #region 閲嶇敓 閬f暎
+ public int awakeRebirthCnt { get; private set; }
+ public int payBackMoneyType;
+ public int payBackMoney;
+ public Dictionary<int, ulong> GetHeroLVPayBack(int quality, int lv)
+ {
+ //姹囨�昏繑杩樻�绘暟閲�
+ Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>();
+ for (int i = 1; i < lv; i++)
+ {
+ var config = HeroQualityLVConfig.GetQualityLVConfig(quality, lv);
+ var itemID = config.UPCostItem[0];
+ var count = (ulong)config.UPCostItem[1];
+ if (!itemCounDic.ContainsKey(itemID))
+ {
+ itemCounDic[itemID] = count;
+ }
+ itemCounDic[itemID] = itemCounDic[itemID] + count;
+ }
+
+ return itemCounDic;
+ }
+
+
+ public Dictionary<int, ulong> GetHeroBreakPayBack(int quality, int lv)
+ {
+ //姹囨�昏繑杩樻�绘暟閲�
+ Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>();
+ for (int i = 0; i < lv; i++)
+ {
+ var config = HeroQualityBreakConfig.GetQualityBreakConfig(quality, lv);
+ var itemID = config.UPCostItem[0];
+ var count = (ulong)config.UPCostItem[1];
+ if (!itemCounDic.ContainsKey(itemID))
+ {
+ itemCounDic[itemID] = count;
+ }
+ itemCounDic[itemID] = itemCounDic[itemID] + count;
+ }
+
+ return itemCounDic;
+
+
+ }
+
+ public Dictionary<int, ulong> GetHeroQualityAwakePayBack(int quality, int lv)
+ {
+ //姹囨�昏繑杩樻�绘暟閲�
+ Dictionary<int, ulong> itemCounDic = new Dictionary<int, ulong>();
+ for (int i = 0; i < lv; i++)
+ {
+ var config = HeroQualityAwakeConfig.GetQualityAwakeConfig(quality, lv);
+ var itemID = config.UPCostItem[0];
+ var count = (ulong)config.UPCostItem[1];
+ if (!itemCounDic.ContainsKey(itemID))
+ {
+ itemCounDic[itemID] = count;
+ }
+ itemCounDic[itemID] = itemCounDic[itemID] + count;
+ }
+
+ return itemCounDic;
+ }
+
+ public void UpdateHeroInfo(HB125_tagSCPlayerHeroInfo netPack)
+ {
+ awakeRebirthCnt = netPack.AwakeRebirthCnt;
+ }
+
+ #endregion
+}
+
+public struct WaitHeroFuncResponse
+{
+ public HeroFuncType type;
+ public string guid;
+ public float time;
+}
+
+//姝﹀皢鍔熻兘绫诲瀷
+public enum HeroFuncType
+{
+ None = 0, //鏃犲姛鑳�
+ Break = 1, //绐佺牬
+
}
diff --git a/Main/System/ItemTip/BoxGetItemModel.cs b/Main/System/ItemTip/BoxGetItemModel.cs
index 2800b24..2811a19 100644
--- a/Main/System/ItemTip/BoxGetItemModel.cs
+++ b/Main/System/ItemTip/BoxGetItemModel.cs
@@ -103,7 +103,9 @@
{
for (int i = 0; i < netPack.ItemLen; i++)
{
- showItems.Add(new Item((int)netPack.ItemList[i].ItemID, netPack.ItemList[i].Count, netPack.ItemList[i].IsBind));
+ showItems.Add(new Item((int)netPack.ItemList[i].ItemID,
+ netPack.ItemList[i].Count + netPack.ItemList[i].CountEx * Constants.ExpPointValue,
+ netPack.ItemList[i].IsBind));
}
}
diff --git a/Main/System/ItemTip/ItemTipUtility.cs b/Main/System/ItemTip/ItemTipUtility.cs
index 2fab85d..18e63b2 100644
--- a/Main/System/ItemTip/ItemTipUtility.cs
+++ b/Main/System/ItemTip/ItemTipUtility.cs
@@ -223,7 +223,7 @@
public static TipData mainTipData { get; private set; } // 娉ㄦ剰褰撻�掕繘鐐瑰嚮鎵撳紑澶氫釜tip鐣岄潰浼氬彉鏇存暟鎹紝涓嶈兘渚濊禆姝ゅ��
public static TipData secondaryData { get; private set; }
- public static void Show(int itemId)
+ public static void Show(int itemId, bool showGetWay = false)
{
if (!ItemConfig.HasKey(itemId))
{
@@ -234,6 +234,7 @@
Show(new ItemViewInfo()
{
itemId = itemId,
+ unfoldGetWay = showGetWay
});
}
@@ -281,31 +282,38 @@
}
mainTipData.getWay.defaultUnfold = item.unfoldGetWay;
- switch (tipType)
+ if (mainTipData.getWay.defaultUnfold)
{
- case TipType.Equip:
- // WindowCenter.Instance.Open<EquipTipWin>();
- break;
-
- // case TipType.PetMount:
- // WindowCenter.Instance.Open<PetMountTipWin>();
- // break;
-
- case TipType.BoxItem:
- UIManager.Instance.OpenWindow<BoxItemWin>();
- break;
- case TipType.BoxChooseItem:
- UIManager.Instance.OpenWindow<ChooseItemsWin>();
- break;
- case TipType.TreasurePavilion:
- // TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1;
- // TreasurePavilionModel.Instance.showTipFromPiece = config.ID;
- // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
- break;
- default:
- UIManager.Instance.OpenWindow<ItemTipWin>();
- break;
+ UIManager.Instance.OpenWindow<ItemTipWayWin>(itemId);
+ return;
}
+
+
+ switch (tipType)
+ {
+ case TipType.Equip:
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ break;
+
+ // case TipType.PetMount:
+ // WindowCenter.Instance.Open<PetMountTipWin>();
+ // break;
+
+ case TipType.BoxItem:
+ UIManager.Instance.OpenWindow<BoxItemWin>();
+ break;
+ case TipType.BoxChooseItem:
+ UIManager.Instance.OpenWindow<ChooseItemsWin>();
+ break;
+ case TipType.TreasurePavilion:
+ // TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1;
+ // TreasurePavilionModel.Instance.showTipFromPiece = config.ID;
+ // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
+ break;
+ default:
+ UIManager.Instance.OpenWindow<ItemTipWin>();
+ break;
+ }
}
public static void Show(string guid, bool operatable = true)
diff --git a/Main/System/ItemTip/ItemTipWayWin.cs b/Main/System/ItemTip/ItemTipWayWin.cs
new file mode 100644
index 0000000..d4b982e
--- /dev/null
+++ b/Main/System/ItemTip/ItemTipWayWin.cs
@@ -0,0 +1,64 @@
+锘�
+using UnityEngine;
+using UnityEngine.UI;
+
+public class ItemTipWayWin : UIBase
+{
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Text nameText;
+ [SerializeField] Text descText;
+ [SerializeField] ScrollerController scroller;
+
+ int itemID;
+
+
+
+ protected override void OnPreOpen()
+ {
+ scroller.OnRefreshCell += OnRefreshCell;
+ itemID = functionOrder;
+
+ itemCell.Init(new ItemCellModel(itemID, false, 0));
+ var itemConfig = ItemConfig.Get(itemID);
+ nameText.text = itemConfig.ItemName;
+ descText.text = itemConfig.Description;
+
+ CreateScroller();
+ }
+
+ protected override void OnPreClose()
+ {
+ scroller.OnRefreshCell -= OnRefreshCell;
+ }
+
+ void CreateScroller()
+ {
+ var itemConfig = ItemConfig.Get(itemID);
+ scroller.Refresh();
+ for (int i = 0; i < itemConfig.GetWay.Length; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, itemConfig.GetWay[i]);
+ }
+ scroller.Restart();
+ }
+
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var way = GetItemWaysConfig.Get(cell.index);
+ var nameText = cell.FindComponent("Text", "name") as Text;
+ nameText.text = way.name;
+
+ var descText = cell.FindComponent("Text", "way") as Text;
+ descText.text = way.Text;
+
+ cell.GetComponent<Button>().AddListener(()=>
+ {
+ UIJumpManager.Instance.OpenWindow(way.WinJumpID);
+ });
+ }
+
+
+}
+
+
diff --git a/Main/System/ItemTip/ItemTipWayWin.cs.meta b/Main/System/ItemTip/ItemTipWayWin.cs.meta
new file mode 100644
index 0000000..9318f99
--- /dev/null
+++ b/Main/System/ItemTip/ItemTipWayWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 873e79fb0b0d62d4993b62fedc63e337
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ItemTip/SmallTipWin.cs b/Main/System/ItemTip/SmallTipWin.cs
new file mode 100644
index 0000000..cc4bba1
--- /dev/null
+++ b/Main/System/ItemTip/SmallTipWin.cs
@@ -0,0 +1,72 @@
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.UI;
+
+/// <summary>
+/// 鏂囨湰鎻愮ず鐣岄潰
+/// </summary>
+public class SmallTipWin : UIBase
+{
+
+ [SerializeField] RectTransform rectTransform;
+ [SerializeField] RectTransform arrowImage;
+ [SerializeField] Text descText;
+
+ public static Vector3 worldPos; //涓栫晫鍧愭爣绯讳綅缃�
+ public static string showText;
+
+ protected override void OnPreOpen()
+ {
+ descText.text = showText;
+ rectTransform.position = new Vector3(100, 100, 100); //鍒濆鍖栨椂锛屽睆骞曡寖鍥村
+ }
+
+
+ protected override void OnOpen()
+ {
+ UpdatePos().Forget();
+ }
+
+ async UniTask UpdatePos()
+ {
+ await UniTask.DelayFrame(3);
+ // 闄愬埗鍦ㄥ睆骞曡寖鍥村唴
+ Vector3[] corners = new Vector3[4];
+ rectTransform.GetWorldCorners(corners);
+
+ float minY = corners[0].y;
+ float maxY = corners[0].y;
+
+ for (int i = 1; i < corners.Length; i++)
+ {
+ if (corners[i].y < minY) minY = corners[i].y;
+ if (corners[i].y > maxY) maxY = corners[i].y;
+ }
+
+
+ float screenHeight = maxY - minY;
+ Vector2 adjustedPos = new Vector2(worldPos.x, worldPos.y + screenHeight * 0.5f);
+
+ Vector2 screenAdjustedPos = CameraManager.uiCamera.WorldToScreenPoint(adjustedPos);
+ screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectTransform.rect.width * 0.5f, Screen.width - rectTransform.rect.width * 0.5f);
+ screenAdjustedPos.y = Mathf.Clamp(screenAdjustedPos.y, rectTransform.rect.height * 0.5f, Screen.height - rectTransform.rect.height * 0.5f - 15);
+ adjustedPos = CameraManager.uiCamera.ScreenToWorldPoint(screenAdjustedPos);
+ rectTransform.position = adjustedPos;
+ rectTransform.localPosition = new Vector3(rectTransform.localPosition.x, rectTransform.localPosition.y + 15, rectTransform.localPosition.z);
+
+ rectTransform.GetWorldCorners(corners);
+ float minX = corners[0].x;
+ float maxX = corners[0].x;
+
+ for (int i = 1; i < corners.Length; i++)
+ {
+ if (corners[i].x < minX) minX = corners[i].x;
+ if (corners[i].x > maxX) maxX = corners[i].x;
+ }
+ //鏄剧ずarrowImage 鐨剎杞翠笂鐨勪綅缃紝鍜寃orldPos鍚屾锛屼絾涓嶈秴杩噈inX 鍜� maxX鑼冨洿
+ Vector3 arrowImagePosition = arrowImage.position;
+ arrowImagePosition.x = Mathf.Clamp(worldPos.x, minX, maxX);
+ arrowImage.position = arrowImagePosition;
+
+ }
+}
\ No newline at end of file
diff --git a/Main/System/ItemTip/SmallTipWin.cs.meta b/Main/System/ItemTip/SmallTipWin.cs.meta
new file mode 100644
index 0000000..b01322b
--- /dev/null
+++ b/Main/System/ItemTip/SmallTipWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b032869b3ea6c248a6e7c7cbb6c66c2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
index 9051fbe..c8ac004 100644
--- a/Main/System/KnapSack/Logic/ItemLogicUtility.cs
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -354,11 +354,11 @@
int startLockIndex = singlePack.unlockedGridCount - PackManager.Instance.initBagGridCount;
FuncConfigConfig _tagFuncModel = FuncConfigConfig.Get("OpenBagItem");
- int haveCount = packModel.GetItemCountByID(PackType.Item, itemId);
+ var haveCount = packModel.GetItemCountByID(PackType.Item, itemId);
Equation.Instance.Clear();
Equation.Instance.AddKeyValue("index", startLockIndex + 1);
int needTool = Equation.Instance.Eval<int>(_tagFuncModel.Numerical2);
- if (haveCount >= needTool)
+ if (haveCount >= (ulong)needTool)
{
return true;
}
@@ -372,30 +372,28 @@
/// <param name="packType 鑳屽寘绫诲瀷"></param>
/// <param name="itemId 鐗╁搧ID"></param>
/// <param name="needCount 闇�瑕佹暟閲�"></param>
- /// <param name="needTips 鏄惁闇�瑕佹彁绀�"></param>
+ /// <param name="needTips">0 涓嶅搷搴� 1 寮规彁绀� 2 寮硅幏鍙栭�斿緞tips</param>
/// <returns></returns>
- public static bool CheckItemCount(PackType packType, int itemId, int needCount, bool needTips = false)
+ public static bool CheckItemCount(PackType packType, int itemId, ulong needCount, int needTips = 0)
{
if (needCount <= 0)
{
return true;
}
- int haveCount = PackManager.Instance.GetItemCountByID(packType, itemId);
+ var haveCount = PackManager.Instance.GetItemCountByID(packType, itemId);
bool isEnough = haveCount >= needCount;
- if (!isEnough && needTips)
+ if (!isEnough)
{
- var itemConfig = ItemConfig.Get(itemId);
-
- if (null != itemConfig)
+ if (needTips == 1)
{
- // 鏄惁鏈夎幏鍙栭�斿緞
- // 鏄� 寮瑰嚭鑾峰彇閫斿緞
- // 鍚� 鏄剧ず鐗╁搧鏁伴噺涓嶈冻
- // SysNotifyMgr.Instance.ShowTip();
- // YYL TODO
+ SysNotifyMgr.Instance.ShowTip("ItemNotEnough", itemId);
+ }
+ else if (needTips == 2)
+ {
+ ItemTipUtility.Show(itemId, true);
}
}
@@ -415,12 +413,7 @@
if (!isEnough && needTips)
{
- // 鏄惁鏈夎幏鍙栭�斿緞
- // 鏄� 寮瑰嚭鑾峰彇閫斿緞
- // 鍚� 鏄剧ず鐗╁搧鏁伴噺涓嶈冻
- // SysNotifyMgr.Instance.ShowTip();
- // YYL TODO
- Debug.LogError("璐у竵涓嶈冻 " + moneyType);
+ SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
}
return isEnough;
diff --git a/Main/System/KnapSack/Logic/SinglePack.cs b/Main/System/KnapSack/Logic/SinglePack.cs
index ad8f229..325bfb2 100644
--- a/Main/System/KnapSack/Logic/SinglePack.cs
+++ b/Main/System/KnapSack/Logic/SinglePack.cs
@@ -181,21 +181,16 @@
return list;
}
- public int GetCountById(int itemId, bool includeAuction = true)
+ public ulong GetCountById(int itemId, bool includeAuction = true)
{
- var count = 0;
- //foreach (var item in items.Values)
- //{
- // if (!includeAuction && item.isAuction)
- // {
- // continue;
- // }
+ ulong count = 0;
- // if (item.itemId == itemId)
- // {
- // count += item.count;
- // }
- //}
+ //閮ㄥ垎璐у竵鍜岀墿鍝佺粦瀹�
+ if (GeneralDefine.itemMoneyCountDict.ContainsKey(itemId))
+ {
+ //灞曠ず璐у竵鏁伴噺鐨勭墿鍝�
+ count = UIHelper.GetMoneyCnt(GeneralDefine.itemMoneyCountDict[itemId]);
+ }
if (itemIDs.ContainsKey(itemId))
{
@@ -206,7 +201,7 @@
{
continue;
}
- count += item.count;
+ count += (ulong)item.count;
}
}
return count;
diff --git a/Main/System/KnapSack/New/CommonItemBaisc.cs b/Main/System/KnapSack/New/CommonItemBaisc.cs
index c8947a6..ff3afdc 100644
--- a/Main/System/KnapSack/New/CommonItemBaisc.cs
+++ b/Main/System/KnapSack/New/CommonItemBaisc.cs
@@ -216,7 +216,6 @@
itemIcon.SetActive(true);
bgIcon.SetActive(true);
itemIcon.SetOrgSprite(config.IconKey);
- ItemConfig itemConfig = ItemConfig.Get(itemId);
bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic));
if (packModel.gameCashShow.Contains(itemId))
{
@@ -274,7 +273,7 @@
{
var heroConfig = HeroConfig.Get(itemId);
countryIcon.SetActive(true);
- countryIcon.SetSprite("herocountry" + heroConfig.Country);
+ countryIcon.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
}
else
diff --git a/Main/System/KnapSack/PackManager.cs b/Main/System/KnapSack/PackManager.cs
index 33b60d5..568630d 100644
--- a/Main/System/KnapSack/PackManager.cs
+++ b/Main/System/KnapSack/PackManager.cs
@@ -24,6 +24,7 @@
public event Action<int> refreshItemDayUseCountEvent; //鍒锋柊鐗╁搧姣忔棩浣跨敤鏁伴噺
public event Action<int> refreshItemSumUseCountEvent; //鍒锋柊鐗╁搧鎬讳娇鐢ㄦ暟閲�
+ public event Action<PackType, string, bool> RefreshItemLockEvent; //鐗╁搧閿佸畾鍒锋柊 鑳屽寘绫诲瀷锛実uid锛岄攣瀹氱姸鎬�
public bool isPlayBetterEquipEffect { get; set; } //鏁寸悊鑳屽寘鏃舵槸鍚︽挱鏀剧壒鏁�
@@ -57,7 +58,6 @@
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
- DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent += OnAfterPlayerDataInitialize;
DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
ParseConfig();
//SysNotifyMgr.Instance.sysNotifyEvent += RefreshSysInfo;
@@ -89,7 +89,6 @@
public override void Release()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
- DTC0102_tagCDBPlayer.afterPlayerDataInitializeEvent -= OnAfterPlayerDataInitialize;
DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
// SysNotifyMgr.Instance.sysNotifyEvent -= RefreshSysInfo;
@@ -111,13 +110,11 @@
itemDayUseCntDict.Clear();
itemSumUseCntDict.Clear();
itemGUIDDict.Clear();
+ PackGirdServerBuyCountDict.Clear();
isPlayBetterEquipEffect = false;
}
- public void OnAfterPlayerDataInitialize()
- {
- }
public void OnPlayerLoginOk()
{
@@ -257,10 +254,22 @@
}
+ public void UpdateItemLockState(H0722_tagItemDeadLockRefresh netPack)
+ {
+ var singlePack = GetSinglePack((PackType)netPack.PackType);
+ var item = singlePack.GetItemByIndex(netPack.ItemIndex);
+ if (item == null)
+ {
+ return;
+ }
+ item.itemInfo.isLock = netPack.IsLock == 1;
+ RefreshItemLockEvent?.Invoke((PackType)netPack.PackType, item.guid, item.itemInfo.isLock);
+ }
+
public void UpdateBuyPackGirdCount(HA207_tagSCPackBuyInfo netPack)
{
for (int i = 0; i < netPack.BuyInfoList.Length; i++)
- {
+ {
PackGirdServerBuyCountDict[netPack.BuyInfoList[i].PackType] = netPack.BuyInfoList[i].BuyCnt;
}
}
@@ -306,6 +315,8 @@
UpdatePackRedpoint(type);
}
+
+
public void RefreshItemCount(H0707_tagItemCountRefresh refresh)
{
@@ -765,14 +776,14 @@
/// <summary>
- /// 寰楀埌ID鐩稿悓鐨勭墿鍝佹暟閲�
+ /// 寰楀埌ID鐩稿悓鐨勭墿鍝佹暟閲�; 涔熷彲浠ヨ幏寰楅儴鍒嗚揣甯佸拰鐗╁搧缁戝畾鐨勬暟閲�
/// </summary>
/// <param name="type"></param>
/// <param name="id"></param>
/// <returns></returns>
- public int GetItemCountByID(PackType type, int id, bool includeAuction = true)
+ public ulong GetItemCountByID(PackType type, int id, bool includeAuction = true)
{
- int count = 0;
+ ulong count = 0;
var singlePack = GetSinglePack(type);
if (singlePack != null)
{
@@ -913,22 +924,23 @@
public void SetLookIndex(string guid, int singleRowCount = 5)
{
- if (string.IsNullOrEmpty(guid) || guid == "")
- {
- lookLineIndex = -1;
- lookItemGUID = "";
- }
- else
- {
- int index = GetItemByGuid(guid).gridIndex;
- lookLineIndex = index / singleRowCount;
- lookItemGUID = guid;
- }
+ return;
+ // if (string.IsNullOrEmpty(guid) || guid == "")
+ // {
+ // lookLineIndex = -1;
+ // lookItemGUID = "";
+ // }
+ // else
+ // {
+ // int index = GetItemByGuid(guid).gridIndex;
+ // lookLineIndex = index / singleRowCount;
+ // lookItemGUID = guid;
+ // }
- if (lookEquipEvent != null)
- {
- lookEquipEvent();
- }
+ // if (lookEquipEvent != null)
+ // {
+ // lookEquipEvent();
+ // }
}
public event Action RefreshBagEvent;
diff --git a/Main/System/Message/HrefAnalysis.cs b/Main/System/Message/HrefAnalysis.cs
index 5103744..9d57751 100644
--- a/Main/System/Message/HrefAnalysis.cs
+++ b/Main/System/Message/HrefAnalysis.cs
@@ -30,7 +30,7 @@
presentHrefInfo = hrefInfo;
if (RichTextMgr.Inst.presentRichText != null)
{
- presentHrefInfo.unlineColor = UIHelper.GetUIColor(TextColType.Green, RichTextMgr.Inst.presentRichText.colorType == RichText.ColorType.Bright);
+ presentHrefInfo.unlineColor = RichTextMgr.Inst.presentRichText.color;
}
m_StringBuilder.Append(val.Substring(index, match.Groups[1].Index - index));
insertIndex = m_StringBuilder.Length - 3;
diff --git a/Main/System/Message/RichNormalEvent.cs b/Main/System/Message/RichNormalEvent.cs
index 61d2046..077acc6 100644
--- a/Main/System/Message/RichNormalEvent.cs
+++ b/Main/System/Message/RichNormalEvent.cs
@@ -94,29 +94,29 @@
// }
// }
// break;
- // case RichTextEventEnum.OPENUI:
- // {
- // int id = 0;
- // if (int.TryParse(href.mSplits["openui"], out id))
- // {
- // WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)id);
- // }
- // else
- // {
- // var list = href.mSplits["openui"].Split('_');
- // int funcOrder = 0;
- // if (list.Length != 1)
- // {
- // funcOrder = int.Parse(list[1]);
- // }
- // WindowJumpMgr.Instance.WindowJumpToEx(list[0], 1, 0, funcOrder);
- // if (list.Length > 2)
- // {
- // ModelCenter.Instance.GetModel<RoleModel>().openUIMark = int.Parse(list[2]);
- // }
- // }
- // }
- // break;
+ case RichTextEventEnum.OPENUI:
+ {
+ // int id = 0;
+ // if (int.TryParse(href.mSplits["openui"], out id))
+ // {
+ // WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)id);
+ // }
+ // else
+ // {
+ // var list = href.mSplits["openui"].Split('_');
+ // int funcOrder = 0;
+ // if (list.Length != 1)
+ // {
+ // funcOrder = int.Parse(list[1]);
+ // }
+ // WindowJumpMgr.Instance.WindowJumpToEx(list[0], 1, 0, funcOrder);
+ // if (list.Length > 2)
+ // {
+ // ModelCenter.Instance.GetModel<RoleModel>().openUIMark = int.Parse(list[2]);
+ // }
+ // }
+ }
+ break;
// case RichTextEventEnum.OPENURL:
// {
// var url = href.mSplits["openurl"];
diff --git a/Main/System/Message/RichText.cs b/Main/System/Message/RichText.cs
index ef52da4..360a4da 100644
--- a/Main/System/Message/RichText.cs
+++ b/Main/System/Message/RichText.cs
@@ -619,6 +619,7 @@
#region 鎵ц浜嬩欢
public void OnPointerClick(PointerEventData eventData)
{
+ OnClick?.Invoke();
if (HrefClick)
{
Vector2 lp;
@@ -640,7 +641,6 @@
}
}
}
- if (OnClick != null) OnClick();
}
public void OnImgClick()
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs b/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
index 7b8a461..617a7e2 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
@@ -429,8 +429,8 @@
if (itemConfig.UseLV > PlayerDatas.Instance.baseData.LV)
return 0;
//婵�娲荤墿鍝佹暟閲忎笉瓒�
- int hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
- if (hasCnt < count)
+ var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemId);
+ if (hasCnt < (ulong)count)
return 0;
return 1;
}
diff --git a/Main/System/SkillUI/SkillBaseCell.cs b/Main/System/SkillUI/SkillBaseCell.cs
index 1e1b161..77101a2 100644
--- a/Main/System/SkillUI/SkillBaseCell.cs
+++ b/Main/System/SkillUI/SkillBaseCell.cs
@@ -50,15 +50,31 @@
LoadPrefab();
}
- private void Init(int skillID, UnityAction onclick, bool showType = false)
+ public void Init(int skillID, UnityAction onclick = null, bool showType = false)
{
var config = SkillConfig.Get(skillID);
- skillIcon.SetSprite(config.IconName);
- skillBtn.AddListener(onclick);
+ if (config == null)
+ {
+ Debug.LogErrorFormat("鎶�鑳芥湭閰嶇疆 : {0}", skillID);
+ return;
+ }
+ skillIcon.SetOrgSprite(config.IconName, "SkillIcon");
+#if UNITY_EDITOR
+ if (string.IsNullOrEmpty(config.IconName))
+ {
+ //鍐呯綉娴嬭瘯
+ skillIcon.SetOrgSprite("skillicondefault", "SkillIcon");
+ }
+#endif
+
+ skillBtn.AddListener(()=>
+ {
+ onclick?.Invoke();
+ });
if (showType)
{
- skillType.text = Language.Get(config.FuncType == 23 ? "HeroSkillType_1" : "HeroSkillType_2");
+ skillType.text = Language.Get(config.FuncType == 1 ? "HeroSkillType_1" : "HeroSkillType_2");
}
else
{
diff --git a/Main/System/Tip/ConfirmCancel.cs b/Main/System/Tip/ConfirmCancel.cs
index ec15e61..9e73ac6 100644
--- a/Main/System/Tip/ConfirmCancel.cs
+++ b/Main/System/Tip/ConfirmCancel.cs
@@ -259,19 +259,18 @@
public static string generalItemTip;
public static string generalItemTip2;
- public static Action ItemConfirmEvent;
public static List<Item> getItems { get; private set; }
//澶氱墿鍝佺‘璁ゆ
- public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, string info2, string btnText, Action func, int moneyCnt = 0, int type = 0)
+ public static void ShowItemsConfirm(List<Item> items, string tiltle, string info, Action<bool> func,
+ string info2 = "", string btnText = "", int moneyCnt = 0, int type = 0)
{
getItems = items;
generalTitle = tiltle;
generalItemTip = info;
generalItemTip2 = info2;
- ItemConfirmEvent = func;
OKName = btnText;
- ItemConfirmEvent = func;
+ OnPopConfirmClickEvent = func;
moneyType = type;
moneyNeedCount = moneyCnt;
if (!UIManager.Instance.IsOpened<ItemsConfirmWin>())
diff --git a/Main/System/Tip/ItemsConfirmWin.cs b/Main/System/Tip/ItemsConfirmWin.cs
index 9668171..f231781 100644
--- a/Main/System/Tip/ItemsConfirmWin.cs
+++ b/Main/System/Tip/ItemsConfirmWin.cs
@@ -9,6 +9,7 @@
[SerializeField] Text m_Info2; //鐗╁搧鍒楄〃涓嬫柟鎻愮ず
[SerializeField] ScrollerController m_Scroller;
[SerializeField] Button m_ConfirmBtn;
+ [SerializeField] Button m_CancleBtn;
[SerializeField] Text m_BtnText;
[SerializeField] Transform moneyObj;
[SerializeField] Text moneyText;
@@ -21,24 +22,21 @@
protected override void InitComponent()
{
m_ConfirmBtn.AddListener(ConfirmBtn);
+ m_CancleBtn.AddListener( ()=>
+ {
+ ConfirmCancel.OnPopConfirmClickEvent?.Invoke(false);
+ CloseWindow();
+ });
}
protected override void OnPreOpen()
{
m_Title.text = ConfirmCancel.generalTitle;
m_Info.text = ConfirmCancel.generalItemTip;
- if (string.IsNullOrEmpty(ConfirmCancel.generalItemTip2))
- {
- m_Info2.SetActive(false);
- }
- else
- {
- m_Info2.SetActive(true);
- m_Info2.text = ConfirmCancel.generalItemTip2;
- }
+ m_Info2.text = ConfirmCancel.generalItemTip2;
m_Scroller.OnRefreshCell += OnRefreshCell;
CreateScroller();
- m_BtnText.text = ConfirmCancel.OKName;
+ m_BtnText.text = string.IsNullOrEmpty(ConfirmCancel.OKName) ? Language.Get("L1001") : ConfirmCancel.OKName;
if (ConfirmCancel.moneyNeedCount == 0)
{
moneyObj.SetActive(false);
@@ -46,9 +44,7 @@
else
{
moneyObj.SetActive(true);
- moneyText.text = UIHelper.AppendColor((ulong)ConfirmCancel.moneyNeedCount > UIHelper.GetMoneyCnt(ConfirmCancel.moneyType) ? TextColType.Red:TextColType.Green,
- string.Format("{0}/{1}", UIHelper.GetMoneyCnt(ConfirmCancel.moneyType), ConfirmCancel.moneyNeedCount));
-
+ moneyText.text = UIHelper.ShowUseMoney(ConfirmCancel.moneyType, (ulong)ConfirmCancel.moneyNeedCount);
moneyIcon.SetIconWithMoneyType(ConfirmCancel.moneyType);
}
}
@@ -57,16 +53,14 @@
protected override void OnPreClose()
{
m_Scroller.OnRefreshCell -= OnRefreshCell;
+
}
#endregion
private void ConfirmBtn()
{
- if (ConfirmCancel.ItemConfirmEvent != null)
- {
- ConfirmCancel.ItemConfirmEvent();
- }
+ ConfirmCancel.OnPopConfirmClickEvent?.Invoke(true);
}
diff --git a/Main/System/UIBase/UIBase.cs b/Main/System/UIBase/UIBase.cs
index dac454e..5b1901a 100644
--- a/Main/System/UIBase/UIBase.cs
+++ b/Main/System/UIBase/UIBase.cs
@@ -67,8 +67,8 @@
[HideInInspector] public UIBase parentUI;
// 瀛怳I绠$悊
- [HideInInspector] public List<UIBase> childrenUI = new List<UIBase>();
-
+ [HideInInspector] public List<UIBase> childrenUI = new List<UIBase>();
+
[Header("鎵�鏈塙I鎺掔増搴旇鍦ㄦ鑺傜偣鍐呭眰")]
[SerializeField] protected RectTransform _rectTransform; //鐣岄潰榛樿娣诲姞鏍硅妭鐐圭敤浜庤〃鐜扮晫闈㈠紑鍚叧闂姩鐢伙紝鎴栬�呰缃�傞厤鐢�
@@ -126,8 +126,8 @@
originalPosition = _rectTransform.anchoredPosition;;
}
-
- if (screenMask != null)
+
+ if (screenMask != null)
screenMask.transform.SetAsFirstSibling();
InitClickEmptySpaceBtn();
}
@@ -142,33 +142,33 @@
if (clickEmptySpaceClose)
{
//寤惰繜x甯у悗鍙偣鍑�,闃叉鐐瑰嚮杩囧揩绔嬪嵆鍏抽棴浜�
- await UniTask.DelayFrame(5);
- btnClickEmptyClose.interactable = true;
+ await UniTask.Delay(200);
+ btnClickEmptyClose.enabled = true;
}
}
- private void InitClickEmptySpaceBtn()
- {
- if (!clickEmptySpaceClose)
- {
- return;
- }
-
- btnClickEmptyClose = screenMask.GetComponent<Button>();
-
- btnClickEmptyClose.AddListener(() =>
- {
- if (btnClickEmptyCloseEvent != null)
- {
- btnClickEmptyCloseEvent();
- }
- else
- {
- CloseWindow();
- }
- });
-
- btnClickEmptyClose.interactable = false;
+ private void InitClickEmptySpaceBtn()
+ {
+ if (!clickEmptySpaceClose)
+ {
+ return;
+ }
+
+ btnClickEmptyClose = screenMask.GetComponent<Button>();
+
+ btnClickEmptyClose.AddListener(() =>
+ {
+ if (btnClickEmptyCloseEvent != null)
+ {
+ btnClickEmptyCloseEvent();
+ }
+ else
+ {
+ CloseWindow();
+ }
+ });
+
+ btnClickEmptyClose.enabled = false;
}
@@ -260,8 +260,8 @@
return;
}
- if ((clickEmptySpaceClose || openMask) && screenMask == null)
- {
+ if ((clickEmptySpaceClose || openMask) && screenMask == null)
+ {
Debug.LogError($"鐣岄潰: {uiName} 缂哄皯閬僵 ");
return;
}
@@ -298,10 +298,10 @@
public void HandleClose()
{
// 濡傛灉宸茬粡鍦ㄥ叧闂繃绋嬩腑锛岀洿鎺ヨ繑鍥�
- if (isClosing) return;
-
- if (clickEmptySpaceClose)
- btnClickEmptyClose.interactable = false;
+ if (isClosing) return;
+
+ if (clickEmptySpaceClose)
+ btnClickEmptyClose.enabled = false;
OnPreClose();
@@ -413,7 +413,8 @@
// 鎾斁鎵撳紑鍔ㄧ敾
protected virtual void PlayOpenAnimation()
{
-
+ //绂佺敤浜や簰浼氬紩璧风偣閫忛棶棰�, 鍚庣画瑙e喅鍙互鑰冭檻EventSystem
+ canvasGroup.blocksRaycasts = true;
if (openAnimationType == UIAnimationType.None)
{
@@ -432,7 +433,7 @@
if (canvasGroup != null)
{
canvasGroup.alpha = 0f;
- canvasGroup.blocksRaycasts = false;
+ // canvasGroup.blocksRaycasts = false;
}
if (_rectTransform != null)
{
@@ -444,7 +445,7 @@
if (canvasGroup != null)
{
canvasGroup.alpha = 1f;
- canvasGroup.blocksRaycasts = false;
+ // canvasGroup.blocksRaycasts = false;
}
if (_rectTransform != null)
{
@@ -495,7 +496,8 @@
if (canvasGroup != null)
{
canvasGroup.alpha = 1f;
- canvasGroup.blocksRaycasts = false;
+ // 绂佺敤浜や簰浼氬紩璧风偣閫忛棶棰�
+ // canvasGroup.blocksRaycasts = false;
}
if (_rectTransform != null)
{
diff --git a/Main/System/UIBase/UIJumpManager.cs b/Main/System/UIBase/UIJumpManager.cs
new file mode 100644
index 0000000..5581880
--- /dev/null
+++ b/Main/System/UIBase/UIJumpManager.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using System;
+
+/// <summary>
+/// 鍏宠仈鐣岄潰绱㈠紩琛紝鐢ㄤ簬鑾峰彇閫斿緞锛屽瘜鏂囨湰鎵撳紑鐣岄潰绛夋儏鍐�
+/// </summary>
+public class UIJumpManager : GameSystemManager<UIJumpManager>
+{
+
+
+ public override void Init()
+ {
+ }
+
+ public bool CanOpenWin(int winID, bool showTip = false)
+ {
+ var config = WindowSearchConfig.Get(winID);
+ if (config == null)
+ {
+ return false;
+ }
+ if (config.FuncID !=0 && !FuncOpen.Instance.IsFuncOpen(config.FuncID, showTip))
+ {
+ return false;
+ }
+
+ //娲诲姩鍚庣画琛ュ厖
+ return true;
+ }
+
+ public void OpenWindow(int winID, bool showTip = true)
+ {
+ if (!CanOpenWin(winID, showTip))
+ {
+ return;
+ }
+ var config = WindowSearchConfig.Get(winID);
+ UIManager.Instance.OpenWindow(config.WinName, config.TabIndex);
+ }
+}
\ No newline at end of file
diff --git a/Main/System/UIBase/UIJumpManager.cs.meta b/Main/System/UIBase/UIJumpManager.cs.meta
new file mode 100644
index 0000000..23b9602
--- /dev/null
+++ b/Main/System/UIBase/UIJumpManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5d826a564bad188478a9626fa1f2dee7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Utility/CommonFunc.cs b/Main/Utility/CommonFunc.cs
new file mode 100644
index 0000000..4ad96aa
--- /dev/null
+++ b/Main/Utility/CommonFunc.cs
@@ -0,0 +1,35 @@
+锘縰sing UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+
+public class CommonFunc
+{
+ public static Dictionary<int, ulong> AddDict(Dictionary<int, ulong> dic1, Dictionary<int, ulong> dic2)
+ {
+ var resultDic = new Dictionary<int, ulong>(dic1);
+ foreach (var data in dic2)
+ {
+ if (resultDic.ContainsKey(data.Key))
+ {
+ resultDic[data.Key] = resultDic[data.Key] + data.Value;
+ continue;
+ }
+ resultDic[data.Key] = data.Value;
+ }
+ return resultDic;
+ }
+
+
+
+ public static List<Item> ChangeToItemList(Dictionary<int, ulong> dict)
+ {
+ List<Item> itemlist = new List<Item>();
+ if (dict == null)
+ return itemlist;
+ foreach (var data in dict)
+ {
+ itemlist.Add(new Item(data.Key, data.Value));
+ }
+ return itemlist;
+ }
+}
\ No newline at end of file
diff --git a/Main/Utility/MathUtils.cs.meta b/Main/Utility/CommonFunc.cs.meta
similarity index 100%
rename from Main/Utility/MathUtils.cs.meta
rename to Main/Utility/CommonFunc.cs.meta
diff --git a/Main/Utility/ComponentExtersion.cs b/Main/Utility/ComponentExtersion.cs
index db697c9..223e472 100644
--- a/Main/Utility/ComponentExtersion.cs
+++ b/Main/Utility/ComponentExtersion.cs
@@ -80,7 +80,7 @@
return component;
}
-
+
public static void AddListener(this Button _button, UnityAction _action)
{
if (_button == null)
@@ -92,7 +92,7 @@
_button.onClick.AddListener(_action);
}
-
+
public static void RemoveAllListeners(this Button _button)
{
if (_button == null)
@@ -102,7 +102,7 @@
_button.onClick.RemoveAllListeners();
}
-
+
public static void SetListener(this Button button, UnityAction action)
{
if (button == null)
@@ -124,7 +124,7 @@
_toggle.onValueChanged.AddListener(_action);
}
-
+
public static void SetListener(this Toggle toggle, UnityAction<bool> action)
{
if (toggle == null)
@@ -145,7 +145,7 @@
_toggle.onValueChanged.RemoveAllListeners();
}
-
+
public static void AddListener(this Slider _slider, UnityAction<float> _action)
{
if (_slider == null)
@@ -155,7 +155,7 @@
_slider.onValueChanged.AddListener(_action);
}
-
+
public static void SetListener(this Slider slider, UnityAction<float> action)
{
if (slider == null)
@@ -176,7 +176,7 @@
_slider.onValueChanged.RemoveAllListeners();
}
-
+
public static void AddListener(this InputField _inputField, UnityAction<string> _action)
{
if (_inputField == null)
@@ -197,7 +197,7 @@
inputField.onValueChanged.AddListener(action);
}
-
+
public static void RemoveAllListeners(this InputField _inputField)
{
if (_inputField == null)
@@ -223,7 +223,7 @@
// EnableButtonConfig.SetEnable(_btn, _btnTxt, _enable, _type);
// }
-
+
public static void SetColorful(this Button _btn, Text _btnTxt, bool _colorful, int pattern = 0)
{
if (_btn != null)
@@ -251,7 +251,7 @@
}
}
-
+
public static void SetInteractable(this Button _btn, Text _btnText, bool _interactable)
{
if (_btn != null)
@@ -282,7 +282,7 @@
_image.overrideSprite = sprite;
}
-
+
public static void SetSprite(this TextImage _textImage, string _id)
{
if (_textImage == null)
@@ -294,7 +294,7 @@
_textImage.sprite = sprite;
}
- //閫氳繃鍥剧墖鍚嶅姞杞�
+ //閫氳繃鍥剧墖鍚嶅姞杞�, 濡傜墿鍝佽〃 鎶�鑳借〃绛夛紝鑺傜渷鍦↖con琛ㄥ仛澶氫綑閰嶇疆
public static void SetOrgSprite(this Image _image, string iconName, string folderName = "icon")
{
if (_image == null)
@@ -321,4 +321,15 @@
}
}
+
+ public static void SetTexture2D(this RawImage _image, string _id)
+ {
+ if (_image == null)
+ {
+ return;
+ }
+
+ var texture = UILoader.LoadTexture2D(_id);
+ _image.texture = texture;
+ }
}
diff --git a/Main/Utility/MathUtility.cs b/Main/Utility/MathUtility.cs
index 8f1c5d4..a093859 100644
--- a/Main/Utility/MathUtility.cs
+++ b/Main/Utility/MathUtility.cs
@@ -220,5 +220,219 @@
return 0f;
}
+ public static float GetQuatLength(Quaternion q)
+ {
+ return Mathf.Sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w);
+ }
+ public static Quaternion GetQuatConjugate(Quaternion q)
+ {
+ return new Quaternion(-q.x, -q.y, -q.z, q.w);
+ }
+
+ /// <summary>
+ /// Logarithm of a unit quaternion. The result is not necessary a unit quaternion.
+ /// </summary>
+ public static Quaternion GetQuatLog(Quaternion q)
+ {
+ Quaternion res = q;
+ res.w = 0;
+
+ if (Mathf.Abs(q.w) < 1.0f)
+ {
+ float theta = Mathf.Acos(q.w);
+ float sin_theta = Mathf.Sin(theta);
+
+ if (Mathf.Abs(sin_theta) > 0.0001)
+ {
+ float coef = theta / sin_theta;
+ res.x = q.x * coef;
+ res.y = q.y * coef;
+ res.z = q.z * coef;
+ }
+ }
+
+ return res;
+ }
+
+ public static Quaternion GetQuatExp(Quaternion q)
+ {
+ Quaternion res = q;
+
+ float fAngle = Mathf.Sqrt(q.x * q.x + q.y * q.y + q.z * q.z);
+ float fSin = Mathf.Sin(fAngle);
+
+ res.w = Mathf.Cos(fAngle);
+
+ if (Mathf.Abs(fSin) > 0.0001)
+ {
+ float coef = fSin / fAngle;
+ res.x = coef * q.x;
+ res.y = coef * q.y;
+ res.z = coef * q.z;
+ }
+
+ return res;
+ }
+
+ /// <summary>
+ /// SQUAD Spherical Quadrangle interpolation [Shoe87]
+ /// </summary>
+ public static Quaternion GetQuatSquad(float t, Quaternion q0, Quaternion q1, Quaternion a0, Quaternion a1)
+ {
+ float slerpT = 2.0f * t * (1.0f - t);
+
+ Quaternion slerpP = Slerp(q0, q1, t);
+ Quaternion slerpQ = Slerp(a0, a1, t);
+
+ return Slerp(slerpP, slerpQ, slerpT);
+ }
+
+ public static Quaternion GetSquadIntermediate(Quaternion q0, Quaternion q1, Quaternion q2)
+ {
+ Quaternion q1Inv = GetQuatConjugate(q1);
+ Quaternion p0 = GetQuatLog(q1Inv * q0);
+ Quaternion p2 = GetQuatLog(q1Inv * q2);
+ Quaternion sum = new Quaternion(-0.25f * (p0.x + p2.x), -0.25f * (p0.y + p2.y), -0.25f * (p0.z + p2.z), -0.25f * (p0.w + p2.w));
+
+ return q1 * GetQuatExp(sum);
+ }
+
+ /// <summary>
+ /// Smooths the input parameter t.
+ /// If less than k1 ir greater than k2, it uses a sin.
+ /// Between k1 and k2 it uses linear interp.
+ /// </summary>
+ public static float Ease(float t, float k1, float k2)
+ {
+ float f; float s;
+
+ f = k1 * 2 / Mathf.PI + k2 - k1 + (1.0f - k2) * 2 / Mathf.PI;
+
+ if (t < k1)
+ {
+ s = k1 * (2 / Mathf.PI) * (Mathf.Sin((t / k1) * Mathf.PI / 2 - Mathf.PI / 2) + 1);
+ }
+ else
+ if (t < k2)
+ {
+ s = (2 * k1 / Mathf.PI + t - k1);
+ }
+ else
+ {
+ s = 2 * k1 / Mathf.PI + k2 - k1 + ((1 - k2) * (2 / Mathf.PI)) * Mathf.Sin(((t - k2) / (1.0f - k2)) * Mathf.PI / 2);
+ }
+
+ return (s / f);
+ }
+
+ /// <summary>
+ /// We need this because Quaternion.Slerp always uses the shortest arc.
+ /// </summary>
+ public static Quaternion Slerp(Quaternion p, Quaternion q, float t)
+ {
+ Quaternion ret;
+
+ float fCos = Quaternion.Dot(p, q);
+
+ if ((1.0f + fCos) > 0.00001)
+ {
+ float fCoeff0, fCoeff1;
+
+ if ((1.0f - fCos) > 0.00001)
+ {
+ float omega = Mathf.Acos(fCos);
+ float invSin = 1.0f / Mathf.Sin(omega);
+ fCoeff0 = Mathf.Sin((1.0f - t) * omega) * invSin;
+ fCoeff1 = Mathf.Sin(t * omega) * invSin;
+ }
+ else
+ {
+ fCoeff0 = 1.0f - t;
+ fCoeff1 = t;
+ }
+
+ ret.x = fCoeff0 * p.x + fCoeff1 * q.x;
+ ret.y = fCoeff0 * p.y + fCoeff1 * q.y;
+ ret.z = fCoeff0 * p.z + fCoeff1 * q.z;
+ ret.w = fCoeff0 * p.w + fCoeff1 * q.w;
+ }
+ else
+ {
+ float fCoeff0 = Mathf.Sin((1.0f - t) * Mathf.PI * 0.5f);
+ float fCoeff1 = Mathf.Sin(t * Mathf.PI * 0.5f);
+
+ ret.x = fCoeff0 * p.x - fCoeff1 * p.y;
+ ret.y = fCoeff0 * p.y + fCoeff1 * p.x;
+ ret.z = fCoeff0 * p.z - fCoeff1 * p.w;
+ ret.w = p.z;
+ }
+
+ return ret;
+ }
+ #region 杩涘埗杞崲
+ private static char[] symbolsArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '+', '/' };
+ static string symbolStr = new string(symbolsArray, 0, 64);
+ /// <summary>
+ /// 璁插瓧绗︿覆鐢�64杩涘埗杞负10杩涘埗锛屽墠缂�娌$敤鐨勫彲鐢ㄥ瓧绗�-浠f浛
+ /// </summary>
+ /// <param name="val"></param>
+ /// <returns></returns>
+ public static int Convert64To10(string val)
+ {
+ val=val.Trim('-');
+ int result = 0;
+ long longResult = 0;
+ val = val.Trim();
+ if (string.IsNullOrEmpty(val)) {
+ return result;
+ }
+ if (val.Equals("0")) return 0;
+ for (int i = 0; i < val.Length; i++) {
+ if(!symbolStr.Contains(val[i].ToString())) {
+ //DesignDebug.LogError(string.Format("64杩涘埗鏍煎紡閿欒{0}", val));
+ return 0;
+ }
+ else {
+ try {
+ int index = 0;
+ for (int j = 0; j < symbolsArray.Length; j++) {
+ if (symbolsArray[j] == val[val.Length - i - 1]) {
+ index = j;
+ }
+ }
+ longResult += (long)System.Math.Pow(64, i) * index;
+ if(longResult>int.MaxValue) {
+ Debug.LogError("瓒呭嚭Int鏈�澶у�硷紝灏濊瘯杞崲涓簂ong绫诲瀷");
+ return 0;
+ }
+ result = (int)longResult;
+ }
+ catch {
+ Debug.LogError("杩愮畻婧㈠嚭");
+ return 0;
+ }
+ }
+ }
+ return result;
+ }
+ static char[] outSymbol = new char[65];
+ /// <summary>
+ /// 灏�10杩涘埗杞负64杩涘埗鐨勫瓧绗︿覆
+ /// </summary>
+ /// <param name="val"></param>
+ /// <returns></returns>
+ public static string Convert10To64(int val)
+ {
+ if (0 == val) return "0";
+ int index = 0;
+ long longPositive = Mathf.Abs(val);
+ for (index = 0; index <= 64; index++) {
+ if (longPositive == 0) break;
+ outSymbol[outSymbol.Length - index - 1] = symbolsArray[longPositive % 64];
+ longPositive /= 64;
+ }
+ return new string(outSymbol,outSymbol.Length-index,index);
+ }
+ #endregion
}
diff --git a/Main/Utility/MathUtils.cs b/Main/Utility/MathUtils.cs
deleted file mode 100644
index e08855c..0000000
--- a/Main/Utility/MathUtils.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-锘縰sing UnityEngine;
-using System.Collections;
-using System.Collections.Generic;
-
-public class MathUtils
-{
- public static float GetQuatLength(Quaternion q)
- {
- return Mathf.Sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w);
- }
-
- public static Quaternion GetQuatConjugate(Quaternion q)
- {
- return new Quaternion(-q.x, -q.y, -q.z, q.w);
- }
-
- /// <summary>
- /// Logarithm of a unit quaternion. The result is not necessary a unit quaternion.
- /// </summary>
- public static Quaternion GetQuatLog(Quaternion q)
- {
- Quaternion res = q;
- res.w = 0;
-
- if (Mathf.Abs(q.w) < 1.0f)
- {
- float theta = Mathf.Acos(q.w);
- float sin_theta = Mathf.Sin(theta);
-
- if (Mathf.Abs(sin_theta) > 0.0001)
- {
- float coef = theta / sin_theta;
- res.x = q.x * coef;
- res.y = q.y * coef;
- res.z = q.z * coef;
- }
- }
-
- return res;
- }
-
- public static Quaternion GetQuatExp(Quaternion q)
- {
- Quaternion res = q;
-
- float fAngle = Mathf.Sqrt(q.x * q.x + q.y * q.y + q.z * q.z);
- float fSin = Mathf.Sin(fAngle);
-
- res.w = Mathf.Cos(fAngle);
-
- if (Mathf.Abs(fSin) > 0.0001)
- {
- float coef = fSin / fAngle;
- res.x = coef * q.x;
- res.y = coef * q.y;
- res.z = coef * q.z;
- }
-
- return res;
- }
-
- /// <summary>
- /// SQUAD Spherical Quadrangle interpolation [Shoe87]
- /// </summary>
- public static Quaternion GetQuatSquad(float t, Quaternion q0, Quaternion q1, Quaternion a0, Quaternion a1)
- {
- float slerpT = 2.0f * t * (1.0f - t);
-
- Quaternion slerpP = Slerp(q0, q1, t);
- Quaternion slerpQ = Slerp(a0, a1, t);
-
- return Slerp(slerpP, slerpQ, slerpT);
- }
-
- public static Quaternion GetSquadIntermediate(Quaternion q0, Quaternion q1, Quaternion q2)
- {
- Quaternion q1Inv = GetQuatConjugate(q1);
- Quaternion p0 = GetQuatLog(q1Inv * q0);
- Quaternion p2 = GetQuatLog(q1Inv * q2);
- Quaternion sum = new Quaternion(-0.25f * (p0.x + p2.x), -0.25f * (p0.y + p2.y), -0.25f * (p0.z + p2.z), -0.25f * (p0.w + p2.w));
-
- return q1 * GetQuatExp(sum);
- }
-
- /// <summary>
- /// Smooths the input parameter t.
- /// If less than k1 ir greater than k2, it uses a sin.
- /// Between k1 and k2 it uses linear interp.
- /// </summary>
- public static float Ease(float t, float k1, float k2)
- {
- float f; float s;
-
- f = k1 * 2 / Mathf.PI + k2 - k1 + (1.0f - k2) * 2 / Mathf.PI;
-
- if (t < k1)
- {
- s = k1 * (2 / Mathf.PI) * (Mathf.Sin((t / k1) * Mathf.PI / 2 - Mathf.PI / 2) + 1);
- }
- else
- if (t < k2)
- {
- s = (2 * k1 / Mathf.PI + t - k1);
- }
- else
- {
- s = 2 * k1 / Mathf.PI + k2 - k1 + ((1 - k2) * (2 / Mathf.PI)) * Mathf.Sin(((t - k2) / (1.0f - k2)) * Mathf.PI / 2);
- }
-
- return (s / f);
- }
-
- /// <summary>
- /// We need this because Quaternion.Slerp always uses the shortest arc.
- /// </summary>
- public static Quaternion Slerp(Quaternion p, Quaternion q, float t)
- {
- Quaternion ret;
-
- float fCos = Quaternion.Dot(p, q);
-
- if ((1.0f + fCos) > 0.00001)
- {
- float fCoeff0, fCoeff1;
-
- if ((1.0f - fCos) > 0.00001)
- {
- float omega = Mathf.Acos(fCos);
- float invSin = 1.0f / Mathf.Sin(omega);
- fCoeff0 = Mathf.Sin((1.0f - t) * omega) * invSin;
- fCoeff1 = Mathf.Sin(t * omega) * invSin;
- }
- else
- {
- fCoeff0 = 1.0f - t;
- fCoeff1 = t;
- }
-
- ret.x = fCoeff0 * p.x + fCoeff1 * q.x;
- ret.y = fCoeff0 * p.y + fCoeff1 * q.y;
- ret.z = fCoeff0 * p.z + fCoeff1 * q.z;
- ret.w = fCoeff0 * p.w + fCoeff1 * q.w;
- }
- else
- {
- float fCoeff0 = Mathf.Sin((1.0f - t) * Mathf.PI * 0.5f);
- float fCoeff1 = Mathf.Sin(t * Mathf.PI * 0.5f);
-
- ret.x = fCoeff0 * p.x - fCoeff1 * p.y;
- ret.y = fCoeff0 * p.y + fCoeff1 * p.x;
- ret.z = fCoeff0 * p.z - fCoeff1 * p.w;
- ret.w = p.z;
- }
-
- return ret;
- }
- #region 杩涘埗杞崲
- private static char[] symbolsArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '+', '/' };
- static string symbolStr = new string(symbolsArray, 0, 64);
- /// <summary>
- /// 璁插瓧绗︿覆鐢�64杩涘埗杞负10杩涘埗锛屽墠缂�娌$敤鐨勫彲鐢ㄥ瓧绗�-浠f浛
- /// </summary>
- /// <param name="val"></param>
- /// <returns></returns>
- public static int Convert64To10(string val)
- {
- val=val.Trim('-');
- int result = 0;
- long longResult = 0;
- val = val.Trim();
- if (string.IsNullOrEmpty(val)) {
- return result;
- }
- if (val.Equals("0")) return 0;
- for (int i = 0; i < val.Length; i++) {
- if(!symbolStr.Contains(val[i].ToString())) {
- //DesignDebug.LogError(string.Format("64杩涘埗鏍煎紡閿欒{0}", val));
- return 0;
- }
- else {
- try {
- int index = 0;
- for (int j = 0; j < symbolsArray.Length; j++) {
- if (symbolsArray[j] == val[val.Length - i - 1]) {
- index = j;
- }
- }
- longResult += (long)System.Math.Pow(64, i) * index;
- if(longResult>int.MaxValue) {
- Debug.LogError("瓒呭嚭Int鏈�澶у�硷紝灏濊瘯杞崲涓簂ong绫诲瀷");
- return 0;
- }
- result = (int)longResult;
- }
- catch {
- Debug.LogError("杩愮畻婧㈠嚭");
- return 0;
- }
- }
- }
- return result;
- }
- static char[] outSymbol = new char[65];
- /// <summary>
- /// 灏�10杩涘埗杞负64杩涘埗鐨勫瓧绗︿覆
- /// </summary>
- /// <param name="val"></param>
- /// <returns></returns>
- public static string Convert10To64(int val)
- {
- if (0 == val) return "0";
- int index = 0;
- long longPositive = Mathf.Abs(val);
- for (index = 0; index <= 64; index++) {
- if (longPositive == 0) break;
- outSymbol[outSymbol.Length - index - 1] = symbolsArray[longPositive % 64];
- longPositive /= 64;
- }
- return new string(outSymbol,outSymbol.Length-index,index);
- }
- #endregion
-}
\ No newline at end of file
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 518c9e5..83df30c 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -543,7 +543,7 @@
public static readonly Color s_GrayDanLV5 = new Color32(255, 0, 0, 255); //ff0000
public static readonly Color s_GrayDanLV6 = new Color32(240, 0, 255, 255); //f000ff
- // public static Color GetDanLVColor(int danLv, bool bright = false)
+ // public static Color GetDanLVColor(int danLv, bool bright = true)
// {
// var crossDanLVConfig = CrossServerArenaConfig.Get(danLv);
// if (crossDanLVConfig != null)
@@ -569,7 +569,7 @@
// return Color.white;
// }
- // public static string AppendDanLVNameColor(int danLv, bool bright = false)
+ // public static string AppendDanLVNameColor(int danLv, bool bright = true)
// {
// var crossDanLVConfig = CrossServerArenaConfig.Get(danLv);
// if (crossDanLVConfig == null)
@@ -598,14 +598,14 @@
// }
//鐗╁搧 鍚勫姛鑳藉搧璐�
- public static Color GetUIColorByFunc(int itemColor, bool bright = false)
+ public static Color GetUIColorByFunc(int itemColor, bool bright = true)
{
return GetUIColor(itemColor + 1, bright);
}
//瀵瑰簲鍝佽川(鏍�)锛涚墿鍝� 鍚勫姛鑳藉搧璐ㄤ粠2寮�濮� 鐢℅etUIColorByFunc
- public static Color GetUIColor(int itemColor, bool bright = false)
+ public static Color GetUIColor(int itemColor, bool bright = true)
{
switch (itemColor)
{
@@ -641,7 +641,7 @@
return GetUIColor(TextColType.White, bright);
}
- public static Color GetUIColor(TextColType type, bool bright = false)
+ public static Color GetUIColor(TextColType type, bool bright = true)
{
//Bright 鍜� Dark鎸囪儗鏅壊绯绘槸鏄庤繕鏄殫锛屾殫搴曚寒瀛楋紝浜簳鏆楀瓧鐨勮鍒�
switch (type)
@@ -776,7 +776,7 @@
private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline);
- public static string AppendColor(TextColType type, string msg, bool bright = false)
+ public static string AppendColor(TextColType type, string msg, bool bright = true)
{
// if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#")
// && msg.ToLower().EndsWith("</color>"))
@@ -820,7 +820,7 @@
}
//needName 鎸囧畼鑱�0鏄惁闇�瑕佸悕绉�
- public static string GetRealmName(int realmLv, bool bright = false, bool needName = false)
+ public static string GetRealmName(int realmLv, bool bright = true, bool needName = false)
{
if (realmLv <= 0 && !needName)
{
@@ -850,7 +850,7 @@
// return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright);
// }
- public static string GetRealmColorByLv(int realmLv, string msg, bool bright = false)
+ public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true)
{
var config = RealmConfig.Get(realmLv);
if (config == null)
@@ -876,7 +876,7 @@
}
}
- public static string AppendColor(int itemColor, string msg, bool bright = false)
+ public static string AppendColor(int itemColor, string msg, bool bright = true)
{
switch (itemColor)
{
@@ -1252,6 +1252,19 @@
return (int)GetMoneyCnt(98) + (int)GetMoneyCnt(99);
}
+ //鏄剧ず鏁伴噺, 鏍煎紡n/m, 瓒冲缁胯壊涓嶈冻绾㈣壊
+ public static string ShowUseMoney(int moneyType, ulong useCnt, TextColType engoughColor = TextColType.Green)
+ {
+ ulong cnt = GetMoneyCnt(moneyType);
+ return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
+ }
+
+ public static string ShowUseItem(PackType type, int itemId, ulong useCnt, TextColType engoughColor = TextColType.Green)
+ {
+ ulong cnt = PackManager.Instance.GetItemCountByID(type, itemId);
+ return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
+ }
+
#endregion
#region 寰楀埌瑁呭浣嶅搴旂殑閮ㄤ綅鍚嶇О
@@ -1371,7 +1384,7 @@
return count;
}
- // public static string GetEquipSuitName(int itemId, bool bright = false)
+ // public static string GetEquipSuitName(int itemId, bool bright = true)
// {
// if (ItemLogicUtility.Instance.IsSuitEquip(itemId))
// {
@@ -1381,7 +1394,7 @@
// return string.Empty;
// }
- // public static string GetItemName(int itmeId, bool bright = false)
+ // public static string GetItemName(int itmeId, bool bright = true)
// {
// var itemConfig = ItemConfig.Get(itmeId);
// if (itemConfig == null)
--
Gitblit v1.8.0