Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
1 文件已重命名
56个文件已修改
1个文件已删除
29 文件已复制
31个文件已添加
| | |
| | | private void CheckForValueChangeNotification(float currentSliderValue) |
| | | { |
| | | int currentSegment = GetCurrentSegment(currentSliderValue); |
| | | |
| | | |
| | | // 如果当前的分段索引与上次触发事件时的索引不同,说明已跨越分段边界。 |
| | | if (currentSegment != m_LastNotifiedSegment) |
| | | { |
| | | ValueChangeAction?.Invoke(currentSliderValue, CurrentStage); |
| | | // 更新“上次触发”的索引为当前索引,防止本分段内重复触发。 |
| | | m_LastNotifiedSegment = currentSegment; |
| | | m_LastNotifiedSegment = currentSegment; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 立即设置滑块的状态(值和阶段),而不触发任何事件或平滑动画。 |
| | | /// </summary> |
| | | /// <param name="newValue">要设置的新目标值 (0-1)。</param> |
| | | /// <param name="newStage">要设置的新目标阶段和当前阶段。</param> |
| | | public void SetStateInstantly(float newValue, int newStage) |
| | | { |
| | | this.value = newValue; |
| | | this.stage = newStage; |
| | | this.presentStage = newStage; |
| | | if (m_Slider != null) |
| | | { |
| | | m_Slider.value = this.value; |
| | | } |
| | | refSpeed = 0f; |
| | | isMoving = false; |
| | | // 确保下次 LateUpdate 不会因为索引不匹配而错误触发 ValueChangeAction |
| | | m_LastNotifiedSegment = GetCurrentSegment(this.value); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | /// <summary> |
| | | /// 支持渐变效果的文本组件 |
| | | /// </summary> |
| | | public class GradientText : Text |
| | | { |
| | | [Header("渐变设置")] |
| | | [SerializeField] |
| | | private GradientType m_GradientType = GradientType.Horizontal; |
| | | |
| | | [SerializeField] |
| | | private Color m_TopLeftColor = Color.white; |
| | | |
| | | [SerializeField] |
| | | private Color m_TopRightColor = Color.white; |
| | | |
| | | [SerializeField] |
| | | private Color m_BottomLeftColor = Color.white; |
| | | |
| | | [SerializeField] |
| | | private Color m_BottomRightColor = Color.white; |
| | | |
| | | [SerializeField] |
| | | private bool m_UseGradient = true; |
| | | |
| | | public enum GradientType |
| | | { |
| | | Horizontal, // 水平渐变 |
| | | Vertical, // 垂直渐变 |
| | | Diagonal, // 对角线渐变 |
| | | Radial, // 径向渐变 |
| | | Custom // 自定义四角颜色 |
| | | } |
| | | |
| | | public GradientType gradientType |
| | | { |
| | | get { return m_GradientType; } |
| | | set |
| | | { |
| | | if (m_GradientType != value) |
| | | { |
| | | m_GradientType = value; |
| | | SetVerticesDirty(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Color topLeftColor |
| | | { |
| | | get { return m_TopLeftColor; } |
| | | set |
| | | { |
| | | if (m_TopLeftColor != value) |
| | | { |
| | | m_TopLeftColor = value; |
| | | SetVerticesDirty(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Color topRightColor |
| | | { |
| | | get { return m_TopRightColor; } |
| | | set |
| | | { |
| | | if (m_TopRightColor != value) |
| | | { |
| | | m_TopRightColor = value; |
| | | SetVerticesDirty(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Color bottomLeftColor |
| | | { |
| | | get { return m_BottomLeftColor; } |
| | | set |
| | | { |
| | | if (m_BottomLeftColor != value) |
| | | { |
| | | m_BottomLeftColor = value; |
| | | SetVerticesDirty(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Color bottomRightColor |
| | | { |
| | | get { return m_BottomRightColor; } |
| | | set |
| | | { |
| | | if (m_BottomRightColor != value) |
| | | { |
| | | m_BottomRightColor = value; |
| | | SetVerticesDirty(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public bool useGradient |
| | | { |
| | | get { return m_UseGradient; } |
| | | set |
| | | { |
| | | if (m_UseGradient != value) |
| | | { |
| | | m_UseGradient = value; |
| | | SetVerticesDirty(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置水平渐变颜色 |
| | | /// </summary> |
| | | public void SetHorizontalGradient(Color leftColor, Color rightColor) |
| | | { |
| | | m_GradientType = GradientType.Horizontal; |
| | | m_TopLeftColor = leftColor; |
| | | m_BottomLeftColor = leftColor; |
| | | m_TopRightColor = rightColor; |
| | | m_BottomRightColor = rightColor; |
| | | SetVerticesDirty(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置垂直渐变颜色 |
| | | /// </summary> |
| | | public void SetVerticalGradient(Color topColor, Color bottomColor) |
| | | { |
| | | m_GradientType = GradientType.Vertical; |
| | | m_TopLeftColor = topColor; |
| | | m_TopRightColor = topColor; |
| | | m_BottomLeftColor = bottomColor; |
| | | m_BottomRightColor = bottomColor; |
| | | SetVerticesDirty(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置对角线渐变颜色 |
| | | /// </summary> |
| | | public void SetDiagonalGradient(Color topLeftColor, Color bottomRightColor) |
| | | { |
| | | m_GradientType = GradientType.Diagonal; |
| | | m_TopLeftColor = topLeftColor; |
| | | m_BottomRightColor = bottomRightColor; |
| | | |
| | | // 计算中间颜色 |
| | | m_TopRightColor = Color.Lerp(topLeftColor, bottomRightColor, 0.5f); |
| | | m_BottomLeftColor = Color.Lerp(topLeftColor, bottomRightColor, 0.5f); |
| | | SetVerticesDirty(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置径向渐变颜色 |
| | | /// </summary> |
| | | public void SetRadialGradient(Color centerColor, Color edgeColor) |
| | | { |
| | | m_GradientType = GradientType.Radial; |
| | | m_TopLeftColor = edgeColor; |
| | | m_TopRightColor = edgeColor; |
| | | m_BottomLeftColor = edgeColor; |
| | | m_BottomRightColor = edgeColor; |
| | | // 径向渐变需要在顶点着色器中处理 |
| | | SetVerticesDirty(); |
| | | } |
| | | |
| | | protected override void OnPopulateMesh(VertexHelper vh) |
| | | { |
| | | base.OnPopulateMesh(vh); |
| | | |
| | | if (!m_UseGradient) |
| | | return; |
| | | |
| | | if (!IsActive()) |
| | | return; |
| | | |
| | | // 获取顶点数据 |
| | | var vertexCount = vh.currentVertCount; |
| | | if (vertexCount == 0) |
| | | return; |
| | | |
| | | // 计算文本的边界框 |
| | | var vertices = new List<UIVertex>(); |
| | | vh.GetUIVertexStream(vertices); |
| | | |
| | | var bounds = new Bounds(vertices[0].position, Vector3.zero); |
| | | for (int i = 1; i < vertices.Count; i++) |
| | | { |
| | | bounds.Encapsulate(vertices[i].position); |
| | | } |
| | | |
| | | // 应用渐变颜色 |
| | | for (int i = 0; i < vertices.Count; i++) |
| | | { |
| | | var vertex = vertices[i]; |
| | | var pos = vertex.position; |
| | | |
| | | // 计算相对于边界框的归一化坐标 |
| | | var normalizedX = (pos.x - bounds.min.x) / bounds.size.x; |
| | | var normalizedY = (pos.y - bounds.min.y) / bounds.size.y; |
| | | |
| | | Color color = CalculateGradientColor(normalizedX, normalizedY); |
| | | vertex.color = color; |
| | | |
| | | vertices[i] = vertex; |
| | | } |
| | | |
| | | vh.Clear(); |
| | | vh.AddUIVertexTriangleStream(vertices); |
| | | } |
| | | |
| | | private Color CalculateGradientColor(float x, float y) |
| | | { |
| | | switch (m_GradientType) |
| | | { |
| | | case GradientType.Horizontal: |
| | | return Color.Lerp(m_TopLeftColor, m_TopRightColor, x); |
| | | |
| | | case GradientType.Vertical: |
| | | return Color.Lerp(m_TopLeftColor, m_BottomLeftColor, y); |
| | | |
| | | case GradientType.Diagonal: |
| | | return Color.Lerp(m_TopLeftColor, m_BottomRightColor, (x + y) * 0.5f); |
| | | |
| | | case GradientType.Radial: |
| | | var center = new Vector2(0.5f, 0.5f); |
| | | var distance = Vector2.Distance(new Vector2(x, y), center); |
| | | return Color.Lerp(m_TopLeftColor, m_BottomRightColor, distance * 2f); |
| | | |
| | | case GradientType.Custom: |
| | | // 双线性插值 |
| | | var topColor = Color.Lerp(m_TopLeftColor, m_TopRightColor, x); |
| | | var bottomColor = Color.Lerp(m_BottomLeftColor, m_BottomRightColor, x); |
| | | return Color.Lerp(topColor, bottomColor, y); |
| | | |
| | | default: |
| | | return color; |
| | | } |
| | | } |
| | | |
| | | protected override void Awake() |
| | | { |
| | | base.Awake(); |
| | | |
| | | // 设置默认颜色 |
| | | if (m_TopLeftColor == Color.white && m_TopRightColor == Color.white && |
| | | m_BottomLeftColor == Color.white && m_BottomRightColor == Color.white) |
| | | { |
| | | // 设置默认的渐变颜色 |
| | | m_TopLeftColor = Color.red; |
| | | m_TopRightColor = Color.blue; |
| | | m_BottomLeftColor = Color.green; |
| | | m_BottomRightColor = Color.yellow; |
| | | } |
| | | } |
| | | } |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Component/UI/Core/GradientText.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 9a20b8661160f064e9c0f1c76e41a05e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | /// <summary> |
| | | /// 椭圆形遮罩组件 |
| | | /// 基于模板测试实现椭圆形遮罩效果 |
| | | /// </summary> |
| | | [RequireComponent(typeof(RectTransform))] |
| | | [AddComponentMenu("UI/Effects/Ellipse Mask")] |
| | | [ExecuteInEditMode] |
| | | public class EllipseMask : MonoBehaviour |
| | | { |
| | | [Header("椭圆参数")] |
| | | [SerializeField] private Vector2 m_EllipseCenter = new Vector2(0.5f, 0.5f); |
| | | [SerializeField] private Vector2 m_EllipseRadius = new Vector2(0.5f, 0.5f); |
| | | [SerializeField] [Range(0, 0.5f)] private float m_Softness = 0f; //暂无效果 |
| | | [SerializeField] private int m_StencilID = 1; //多个遮罩时 |
| | | [SerializeField] private bool m_ShowMaskGraphic = false; |
| | | |
| | | private Material m_MaskMaterial; |
| | | private Image m_MaskImage; |
| | | private RectTransform m_RectTransform; |
| | | private List<Graphic> m_MaskedChildren = new List<Graphic>(); |
| | | |
| | | public Vector2 EllipseCenter |
| | | { |
| | | get => m_EllipseCenter; |
| | | set |
| | | { |
| | | if (m_EllipseCenter != value) |
| | | { |
| | | m_EllipseCenter = value; |
| | | UpdateMask(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Vector2 EllipseRadius |
| | | { |
| | | get => m_EllipseRadius; |
| | | set |
| | | { |
| | | if (m_EllipseRadius != value) |
| | | { |
| | | m_EllipseRadius = value; |
| | | UpdateMask(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public float Softness |
| | | { |
| | | get => m_Softness; |
| | | set |
| | | { |
| | | if (m_Softness != value) |
| | | { |
| | | m_Softness = Mathf.Clamp(value, 0, 0.5f); |
| | | UpdateMask(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public int StencilID |
| | | { |
| | | get => m_StencilID; |
| | | set |
| | | { |
| | | if (m_StencilID != value) |
| | | { |
| | | m_StencilID = value; |
| | | UpdateMask(); |
| | | UpdateChildrenStencil(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public bool ShowMaskGraphic |
| | | { |
| | | get => m_ShowMaskGraphic; |
| | | set |
| | | { |
| | | if (m_ShowMaskGraphic != value) |
| | | { |
| | | m_ShowMaskGraphic = value; |
| | | UpdateMaskVisibility(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | protected virtual void Awake() |
| | | { |
| | | m_RectTransform = GetComponent<RectTransform>(); |
| | | |
| | | // 创建遮罩图像 |
| | | CreateMaskImage(); |
| | | |
| | | // 创建遮罩材质 |
| | | CreateMaskMaterial(); |
| | | |
| | | UpdateMask(); |
| | | } |
| | | |
| | | protected virtual void OnEnable() |
| | | { |
| | | CreateMaskMaterial(); |
| | | UpdateMask(); |
| | | |
| | | // 为所有子对象添加模板测试 |
| | | UpdateChildrenStencil(); |
| | | } |
| | | |
| | | protected virtual void OnDisable() |
| | | { |
| | | if (m_MaskMaterial != null) |
| | | { |
| | | DestroyImmediate(m_MaskMaterial); |
| | | m_MaskMaterial = null; |
| | | } |
| | | |
| | | // 移除子对象的模板测试 |
| | | RemoveChildrenStencil(); |
| | | } |
| | | |
| | | protected virtual void OnDestroy() |
| | | { |
| | | if (m_MaskMaterial != null) |
| | | { |
| | | DestroyImmediate(m_MaskMaterial); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建遮罩图像 |
| | | /// </summary> |
| | | private void CreateMaskImage() |
| | | { |
| | | if (m_MaskImage == null) |
| | | { |
| | | m_MaskImage = GetComponent<Image>(); |
| | | if (m_MaskImage == null) |
| | | { |
| | | m_MaskImage = gameObject.AddComponent<Image>(); |
| | | m_MaskImage.color = Color.white; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建遮罩材质 |
| | | /// </summary> |
| | | private void CreateMaskMaterial() |
| | | { |
| | | if (m_MaskMaterial == null) |
| | | { |
| | | Shader ellipseShader = Shader.Find("GUI/EllipseMask"); |
| | | if (ellipseShader != null) |
| | | { |
| | | m_MaskMaterial = new Material(ellipseShader); |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("EllipseMask shader not found!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新遮罩 |
| | | /// </summary> |
| | | private void UpdateMask() |
| | | { |
| | | if (m_MaskMaterial != null && m_MaskImage != null) |
| | | { |
| | | UpdateMaterialProperties(); |
| | | |
| | | // 设置材质到Image |
| | | m_MaskImage.material = m_MaskMaterial; |
| | | |
| | | // 强制重绘 |
| | | m_MaskImage.SetMaterialDirty(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新材质属性 |
| | | /// </summary> |
| | | private void UpdateMaterialProperties() |
| | | { |
| | | if (m_MaskMaterial != null) |
| | | { |
| | | m_MaskMaterial.SetVector("_EllipseCenter", new Vector4(m_EllipseCenter.x, m_EllipseCenter.y, 0, 0)); |
| | | m_MaskMaterial.SetVector("_EllipseRadius", new Vector4(m_EllipseRadius.x, m_EllipseRadius.y, 0, 0)); |
| | | m_MaskMaterial.SetFloat("_Softness", m_Softness); |
| | | m_MaskMaterial.SetInt("_Stencil", m_StencilID); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新遮罩可见性 |
| | | /// </summary> |
| | | private void UpdateMaskVisibility() |
| | | { |
| | | if (m_MaskImage != null) |
| | | { |
| | | m_MaskImage.enabled = m_ShowMaskGraphic; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 为子对象添加模板测试 |
| | | /// </summary> |
| | | private void UpdateChildrenStencil() |
| | | { |
| | | // 清除之前的列表 |
| | | m_MaskedChildren.Clear(); |
| | | |
| | | // 获取所有子对象的Graphic组件 |
| | | Graphic[] childrenGraphics = GetComponentsInChildren<Graphic>(); |
| | | foreach (var graphic in childrenGraphics) |
| | | { |
| | | // 跳过遮罩本身 |
| | | if (graphic.gameObject == this.gameObject) |
| | | continue; |
| | | |
| | | // 为子对象创建遮罩材质 |
| | | CreateChildMaskMaterial(graphic); |
| | | m_MaskedChildren.Add(graphic); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 为子对象创建遮罩材质 |
| | | /// </summary> |
| | | private void CreateChildMaskMaterial(Graphic graphic) |
| | | { |
| | | if (graphic.material == null || !graphic.material.shader.name.Contains("EllipseMaskedContent")) |
| | | { |
| | | Shader maskedShader = Shader.Find("GUI/EllipseMaskedContent"); |
| | | if (maskedShader != null) |
| | | { |
| | | Material maskedMaterial = new Material(maskedShader); |
| | | maskedMaterial.SetInt("_Stencil", m_StencilID); |
| | | maskedMaterial.SetInt("_StencilComp", 3); // Equal |
| | | graphic.material = maskedMaterial; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 更新现有材质的模板ID |
| | | graphic.material.SetInt("_Stencil", m_StencilID); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移除子对象的模板测试 |
| | | /// </summary> |
| | | private void RemoveChildrenStencil() |
| | | { |
| | | foreach (var graphic in m_MaskedChildren) |
| | | { |
| | | if (graphic != null && graphic.material != null) |
| | | { |
| | | // 重置材质 |
| | | graphic.material = null; |
| | | } |
| | | } |
| | | m_MaskedChildren.Clear(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置椭圆参数 |
| | | /// </summary> |
| | | /// <param name="center">椭圆中心(归一化坐标)</param> |
| | | /// <param name="radius">椭圆半径(归一化坐标)</param> |
| | | /// <param name="softness">边缘柔化程度</param> |
| | | public void SetEllipseParameters(Vector2 center, Vector2 radius, float softness = 0.1f) |
| | | { |
| | | m_EllipseCenter = center; |
| | | m_EllipseRadius = radius; |
| | | m_Softness = Mathf.Clamp(softness, 0, 0.5f); |
| | | UpdateMask(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置圆形参数(特殊情况的椭圆) |
| | | /// </summary> |
| | | /// <param name="center">圆心(归一化坐标)</param> |
| | | /// <param name="radius">半径(归一化坐标)</param> |
| | | /// <param name="softness">边缘柔化程度</param> |
| | | public void SetCircleParameters(Vector2 center, float radius, float softness = 0.1f) |
| | | { |
| | | SetEllipseParameters(center, new Vector2(radius, radius), softness); |
| | | } |
| | | |
| | | #if UNITY_EDITOR |
| | | protected virtual void OnValidate() |
| | | { |
| | | if (m_MaskMaterial != null) |
| | | { |
| | | UpdateMaterialProperties(); |
| | | UpdateChildrenStencil(); |
| | | } |
| | | } |
| | | #endif |
| | | } |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Component/UI/Effect/EllipseMask.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: d7b138cff435daf4e97efe03e10a756b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | typeof(InvestConfig),
|
| | | typeof(ItemCompoundConfig),
|
| | | typeof(ItemConfig),
|
| | | typeof(LLMJConfig),
|
| | | typeof(MainChapterConfig),
|
| | | typeof(MainLevelConfig),
|
| | | typeof(NPCConfig),
|
| | |
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PriorBundleConfig),
|
| | | typeof(SignInConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | |
| | | ClearConfigDictionary<ItemCompoundConfig>();
|
| | | // 清空 ItemConfig 字典
|
| | | ClearConfigDictionary<ItemConfig>();
|
| | | // 清空 LLMJConfig 字典
|
| | | ClearConfigDictionary<LLMJConfig>();
|
| | | // 清空 MainChapterConfig 字典
|
| | | ClearConfigDictionary<MainChapterConfig>();
|
| | | // 清空 MainLevelConfig 字典
|
| | |
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PriorBundleConfig 字典
|
| | | ClearConfigDictionary<PriorBundleConfig>();
|
| | | // 清空 SignInConfig 字典
|
| | | ClearConfigDictionary<SignInConfig>();
|
| | | // 清空 StoreConfig 字典
|
| | | ClearConfigDictionary<StoreConfig>();
|
| | | // 清空 SuccessConfig 字典
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年11月9日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int GainGold;
|
| | | public int GainGoldPaper;
|
| | | public int FirstGoldPaperPrize;
|
| | | public string GainItemList;
|
| | | public int[][] GainItemList;
|
| | | public int[][] SelectItemInfo;
|
| | | public string Icon;
|
| | | public int PayType;
|
| | |
| | |
|
| | | int.TryParse(tables[10],out FirstGoldPaperPrize);
|
| | |
|
| | | GainItemList = tables[11];
|
| | | GainItemList = JsonMapper.ToObject<int[][]>(tables[11].Replace("(", "[").Replace(")", "]")); |
| | |
|
| | | SelectItemInfo = JsonMapper.ToObject<int[][]>(tables[12].Replace("(", "[").Replace(")", "]"));
|
| | |
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月3日
|
| | | // [ Date ]: Friday, November 7, 2025
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int TaskType;
|
| | | public int[] TaskConds;
|
| | | public int NeedValue;
|
| | | public int AwardLiveness;
|
| | | public int[][] AwardItemList;
|
| | | public string Title;
|
| | | public int GuideID;
|
| | |
|
| | |
| | |
|
| | | int.TryParse(tables[3],out NeedValue);
|
| | |
|
| | | int.TryParse(tables[4],out AwardLiveness); |
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); |
| | |
|
| | | Title = tables[5];
|
| | |
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月9日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class LLMJConfig : ConfigBase<int, LLMJConfig>
|
| | | {
|
| | | static LLMJConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int MJLV;
|
| | | public int CostWarhammer;
|
| | | public int ExpAddPer;
|
| | | public int ExpExUpper;
|
| | | public int DecomposeAddPer;
|
| | | public int DecomposeExUpper;
|
| | |
|
| | | 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 MJLV); |
| | |
|
| | | int.TryParse(tables[1],out CostWarhammer); |
| | |
|
| | | int.TryParse(tables[2],out ExpAddPer); |
| | |
|
| | | int.TryParse(tables[3],out ExpExUpper); |
| | |
|
| | | int.TryParse(tables[4],out DecomposeAddPer); |
| | |
|
| | | int.TryParse(tables[5],out DecomposeExUpper); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Config/Configs/LLMJConfig.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: dbdce8bad9eb8fc46bde37554698bb0f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月10日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class SignInConfig : ConfigBase<int, SignInConfig>
|
| | | {
|
| | | static SignInConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int SignDay;
|
| | | public int[][] AwardItemList;
|
| | |
|
| | | 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 SignDay); |
| | |
|
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[1].Replace("(", "[").Replace(")", "]")); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| File was renamed from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: d6304eddfd727124e9bfb7266018e81d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年11月6日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | |
|
| | | public int ID;
|
| | | public int Type;
|
| | | public int Group;
|
| | | public int NeedCnt;
|
| | | public int[] Condition;
|
| | | public string Condition2;
|
| | | public int Condition3;
|
| | | public string AwardItemList;
|
| | | public string AwardItemList2;
|
| | | public string Money;
|
| | | public int Exp;
|
| | | public int[] AwardAttribute;
|
| | | public int RedPacketID;
|
| | | public int MagicWeaponID;
|
| | | public string MagicWeaponExp;
|
| | | public string Describe;
|
| | | public int NeedGoto;
|
| | | public int Jump;
|
| | | public int ReOrder;
|
| | | public int RealmPracticeID;
|
| | | public int[][] AwardItemList;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | |
|
| | | int.TryParse(tables[1],out Type);
|
| | |
|
| | | int.TryParse(tables[2],out Group); |
| | | int.TryParse(tables[2],out NeedCnt); |
| | |
|
| | | int.TryParse(tables[3],out NeedCnt); |
| | |
|
| | | if (tables[4].Contains("[")) |
| | | if (tables[3].Contains("[")) |
| | | { |
| | | Condition = JsonMapper.ToObject<int[]>(tables[4]); |
| | | Condition = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] ConditionStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] ConditionStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | Condition = new int[ConditionStringArray.Length]; |
| | | for (int i=0;i<ConditionStringArray.Length;i++) |
| | | { |
| | |
| | | } |
| | | }
|
| | |
|
| | | Condition2 = tables[5];
|
| | |
|
| | | int.TryParse(tables[6],out Condition3); |
| | |
|
| | | AwardItemList = tables[7];
|
| | |
|
| | | AwardItemList2 = tables[8];
|
| | |
|
| | | Money = tables[9];
|
| | |
|
| | | int.TryParse(tables[10],out Exp); |
| | |
|
| | | if (tables[11].Contains("[")) |
| | | { |
| | | AwardAttribute = JsonMapper.ToObject<int[]>(tables[11]); |
| | | } |
| | | else |
| | | { |
| | | string[] AwardAttributeStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AwardAttribute = new int[AwardAttributeStringArray.Length]; |
| | | for (int i=0;i<AwardAttributeStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AwardAttributeStringArray[i],out AwardAttribute[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[12],out RedPacketID); |
| | |
|
| | | int.TryParse(tables[13],out MagicWeaponID); |
| | |
|
| | | MagicWeaponExp = tables[14];
|
| | |
|
| | | Describe = tables[15];
|
| | |
|
| | | int.TryParse(tables[16],out NeedGoto); |
| | |
|
| | | int.TryParse(tables[17],out Jump); |
| | |
|
| | | int.TryParse(tables[18],out ReOrder); |
| | |
|
| | | int.TryParse(tables[19],out RealmPracticeID); |
| | | AwardItemList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | return waveLineupLists.Count(list => list.Length > 0); |
| | | } |
| | | |
| | | // 获取目标关卡的索引 |
| | | public static int GetToTargetLevelIndex(int targetLevel) |
| | | { |
| | | var levels = GetKeys(); |
| | | levels.Sort(); |
| | | return levels.IndexOf(targetLevel); |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class SuccessConfig : ConfigBase<int, SuccessConfig> |
| | | { |
| | | public static Dictionary<int, List<int>> typeToIDsDict = new Dictionary<int, List<int>>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!typeToIDsDict.ContainsKey(Type)) |
| | | { |
| | | typeToIDsDict[Type] = new List<int>(); |
| | | } |
| | | typeToIDsDict[Type].Add(ID); |
| | | } |
| | | |
| | | public static List<int> GetTypeToIDDict(int type) |
| | | { |
| | | if (typeToIDsDict.ContainsKey(type)) |
| | | { |
| | | return typeToIDsDict[type]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //获得成就条件,默认一个类型只有一种条件 |
| | | public static string GetConditionString(int type) |
| | | { |
| | | if (typeToIDsDict.ContainsKey(type)) |
| | | { |
| | | var conds = Get(typeToIDsDict[type][0]).Condition; |
| | | return conds.IsNullOrEmpty() ? "" : string.Join("|", conds); |
| | | } |
| | | return ""; |
| | | } |
| | | } |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Config/PartialConfigs/SuccessConfig.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 5c9f079829a75b84587ebbbd29a56119 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A5 09 玩家签到领奖 #tagCSDaySign
|
| | |
|
| | | public class CA509_tagCSDaySign : GameNetPackBasic {
|
| | | public byte Day; // 第x天,从1开始
|
| | |
|
| | | public CA509_tagCSDaySign () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA509;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Day, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA5_Function/CA509_tagCSDaySign.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: c10a6d62687b4004ca4b36bfbde99e67 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A3 0D 玩家签到信息记录 # tagSCDaySignInfo
|
| | |
|
| | | public class DTCA30D_tagSCDaySignInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA30D_tagSCDaySignInfo vNetData = vNetPack as HA30D_tagSCDaySignInfo;
|
| | | SignManager.Instance.UpdateSignInfo(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA30D_tagSCDaySignInfo.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 37443778b58334c48bbd3ebe5696ceb9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 40 成就信息列表 #tagSCSuccessInfoList
|
| | |
|
| | | public class DTCA340_tagSCSuccessInfoList : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA340_tagSCSuccessInfoList vNetData = vNetPack as HA340_tagSCSuccessInfoList;
|
| | | AchievementManager.Instance.UpdateAchievement(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA340_tagSCSuccessInfoList.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 2349866a7124b0c488485ddc575a80b9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 42 成就领奖记录列表 #tagSCSuccessAwardRecordList
|
| | |
|
| | | public class DTCA342_tagSCSuccessAwardRecordList : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA342_tagSCSuccessAwardRecordList vNetData = vNetPack as HA342_tagSCSuccessAwardRecordList;
|
| | | AchievementManager.Instance.UpdateAchievementAward(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA342_tagSCSuccessAwardRecordList.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: b0b463773ed6e62448f3b7158f1ab2a5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 28 历练秘笈信息 #tagSCLLMJInfo
|
| | |
|
| | | public class DTCB128_tagSCLLMJInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB128_tagSCLLMJInfo vNetData = vNetPack as HB128_tagSCLLMJInfo;
|
| | | ExpSecretCollectionManager.Instance.OnExpSecretCollection(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB128_tagSCLLMJInfo.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: b287dd194d9fd404f85bcccdaac9833f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | Register(typeof(HA923_tagSCArenaPlayerInfo), typeof(DTCA923_tagSCArenaPlayerInfo)); |
| | | Register(typeof(HB109_tagSCDailyTaskInfo), typeof(DTCB109_tagSCDailyTaskInfo)); |
| | | Register(typeof(HB201_tagSCTianziKYInfo), typeof(DTCB201_tagSCTianziKYInfo)); |
| | | Register(typeof(HA340_tagSCSuccessInfoList), typeof(DTCA340_tagSCSuccessInfoList)); |
| | | Register(typeof(HA342_tagSCSuccessAwardRecordList), typeof(DTCA342_tagSCSuccessAwardRecordList)); |
| | | Register(typeof(HB128_tagSCLLMJInfo), typeof(DTCB128_tagSCLLMJInfo)); |
| | | Register(typeof(HA30D_tagSCDaySignInfo), typeof(DTCA30D_tagSCDaySignInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A3 0D 玩家签到信息记录 # tagSCDaySignInfo
|
| | |
|
| | | public class HA30D_tagSCDaySignInfo : GameNetPackBasic {
|
| | | public byte Count;
|
| | | public byte[] SignStateList; //每日签到状态记录列表 [第1天状态, ...] 状态:0-不可签到;1-已签到;2-可补签;3-已领取
|
| | |
|
| | | public HA30D_tagSCDaySignInfo () {
|
| | | _cmd = (ushort)0xA30D;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out SignStateList, vBytes, NetDataType.BYTE, Count);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA3_Function/HA30D_tagSCDaySignInfo.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 5aa3f24d1c3aa3b428eff1b075952478 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 40 成就信息列表 #tagSCSuccessInfoList
|
| | |
|
| | | public class HA340_tagSCSuccessInfoList : GameNetPackBasic {
|
| | | public ushort Count; //信息个数
|
| | | public tagSCSuccessInfo[] SuccessInfoList;
|
| | |
|
| | | public HA340_tagSCSuccessInfoList () {
|
| | | _cmd = (ushort)0xA340;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.WORD);
|
| | | SuccessInfoList = new tagSCSuccessInfo[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | SuccessInfoList[i] = new tagSCSuccessInfo();
|
| | | TransBytes (out SuccessInfoList[i].SuccType, vBytes, NetDataType.WORD);
|
| | | TransBytes (out SuccessInfoList[i].CLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out SuccessInfoList[i].Conds, vBytes, NetDataType.DWORD, SuccessInfoList[i].CLen);
|
| | | TransBytes (out SuccessInfoList[i].CurValue, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public class tagSCSuccessInfo {
|
| | | public ushort SuccType; //成就类型
|
| | | public byte CLen;
|
| | | public uint[] Conds; // 条件列表
|
| | | public uint CurValue; // 进度值,相同任务类型条件的进度值共享
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA3_Function/HA340_tagSCSuccessInfoList.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 0da6e6a7f64979d4e9d2e102f68fef21 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 42 成就领奖记录列表 #tagSCSuccessAwardRecordList
|
| | |
|
| | | public class HA342_tagSCSuccessAwardRecordList : GameNetPackBasic {
|
| | | public ushort RecordCnt; //记录个数
|
| | | public tagSCSuccessAwardRecord[] RecordList; //记录列表
|
| | |
|
| | | public HA342_tagSCSuccessAwardRecordList () {
|
| | | _cmd = (ushort)0xA342;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out RecordCnt, vBytes, NetDataType.WORD);
|
| | | RecordList = new tagSCSuccessAwardRecord[RecordCnt];
|
| | | for (int i = 0; i < RecordCnt; i ++) {
|
| | | RecordList[i] = new tagSCSuccessAwardRecord();
|
| | | TransBytes (out RecordList[i].RecordIndex, vBytes, NetDataType.WORD);
|
| | | TransBytes (out RecordList[i].Record, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public class tagSCSuccessAwardRecord {
|
| | | public ushort RecordIndex; //第几个记录值 每个key存31个succid 0-30为0, 31-61为1..
|
| | | public uint Record; //根据成就ID位判断是否已领取
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA3_Function/HA342_tagSCSuccessAwardRecordList.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: be0a52fd85a2e37429a2ed249d0fa74f |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 28 历练秘笈信息 #tagSCLLMJInfo
|
| | |
|
| | | public class HB128_tagSCLLMJInfo : GameNetPackBasic {
|
| | | public byte MJLV; // 秘笈等级,激活后从1开始
|
| | | public uint Zhanchui; // 秘笈累计消耗战锤
|
| | | public uint ExpEx; // 秘笈今日已额外获得经验
|
| | | public uint DecomposeEx; // 秘笈今日已额外获得分解货币
|
| | |
|
| | | public HB128_tagSCLLMJInfo () {
|
| | | _cmd = (ushort)0xB128;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out MJLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Zhanchui, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ExpEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out DecomposeEx, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB128_tagSCLLMJInfo.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 382098446555f5c4c95c809e78e01aa6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | managers.Add(DayMissionManager.Instance);
|
| | | managers.Add(BattlePassManager.Instance);
|
| | | managers.Add(TianziBillboradManager.Instance);
|
| | | managers.Add(ExpSecretCollectionManager.Instance);
|
| | | managers.Add(SignManager.Instance);
|
| | | foreach (var manager in managers)
|
| | | {
|
| | | manager.Init();
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3793503c7ba33204da1ca91f1bb6aacd |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using System.Linq; |
| | | |
| | | |
| | | public partial class AchievementManager : GameSystemManager<AchievementManager> |
| | | { |
| | | //成就类型:条件(可以是空):进度 |
| | | Dictionary<int, Dictionary<string, int>> achivementDict = new Dictionary<int, Dictionary<string, int>>(); |
| | | public event Action<int> OnAchievementUpdateEvent; |
| | | //key:第几个记录值 每个key存31个succid 0-30为0, 31-61为1..; value: 根据成就ID位判断是否已领取 |
| | | Dictionary<int, int> achivementAwardDict = new Dictionary<int, int>(); |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | void OnBeforePlayerDataInitialize() |
| | | { |
| | | } |
| | | |
| | | public void UpdateAchievement(HA340_tagSCSuccessInfoList netPack) |
| | | { |
| | | List<int> types = new List<int>(); |
| | | for (int i = 0; i < netPack.Count; i++) |
| | | { |
| | | var info = netPack.SuccessInfoList[i]; |
| | | if (!achivementDict.ContainsKey(info.SuccType)) |
| | | { |
| | | achivementDict[info.SuccType] = new Dictionary<string, int>(); |
| | | } |
| | | |
| | | string key = info.CLen > 0 ? string.Join("|", info.Conds) : ""; |
| | | achivementDict[info.SuccType][key] = (int)info.CurValue; |
| | | |
| | | OnAchievementUpdateEvent?.Invoke(info.SuccType); |
| | | if (!types.Contains(info.SuccType)) |
| | | { |
| | | types.Add(info.SuccType); |
| | | } |
| | | } |
| | | UpdateRedpoint(types); |
| | | } |
| | | |
| | | public int GetAchievementProgress(int type) |
| | | { |
| | | if (achivementDict.ContainsKey(type)) |
| | | { |
| | | var condKey = SuccessConfig.GetConditionString(type); |
| | | if (achivementDict[type].ContainsKey(condKey)) |
| | | { |
| | | return achivementDict[type][condKey]; |
| | | } |
| | | } |
| | | return 0; |
| | | |
| | | } |
| | | |
| | | public void UpdateAchievementAward(HA342_tagSCSuccessAwardRecordList netPack) |
| | | { |
| | | List<int> types = new List<int>(); |
| | | for (int i = 0; i < netPack.RecordCnt; i++) |
| | | { |
| | | var record = netPack.RecordList[i]; |
| | | achivementAwardDict[record.RecordIndex] = (int)record.Record; |
| | | var startID = record.RecordIndex * 31; |
| | | var endID = startID + 30; |
| | | for (int j = startID; j <= endID; j++) |
| | | { |
| | | if (SuccessConfig.HasKey(j)) |
| | | { |
| | | var type = SuccessConfig.Get(j).Type; |
| | | if (!types.Contains(type)) |
| | | { |
| | | types.Add(type); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | OnAchievementUpdateEvent?.Invoke(-1); |
| | | UpdateRedpoint(types); |
| | | } |
| | | |
| | | //成就是否已领取 |
| | | //每个key存31个succid 0-30为0, 31-61为1..; 根据成就ID位判断是否已领取 |
| | | public bool IsAchievementAwarded(int id) |
| | | { |
| | | var index = id / 31; |
| | | var bit = id % 31; |
| | | if (achivementAwardDict.ContainsKey(index)) |
| | | { |
| | | return (achivementAwardDict[index] & (1 << bit)) != 0; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //获取成就状态 0: 未领取 1: 未达成 2: 已领取 |
| | | public int GetAchievementState(int id) |
| | | { |
| | | var config = SuccessConfig.Get(id); |
| | | var process = GetAchievementProgress(config.Type); |
| | | if (process < config.NeedCnt) |
| | | { |
| | | return 1; |
| | | } |
| | | if (IsAchievementAwarded(id)) |
| | | { |
| | | return 2; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | //主线章节 |
| | | Redpoint mainLevelRedpoint = new Redpoint(MainRedDot.RedPoint_DailyKey, MainRedDot.RedPoint_MainMissionKey); |
| | | //类型:红点id |
| | | Dictionary<int, int> redpointDict = new Dictionary<int, int>() |
| | | { |
| | | {1, MainRedDot.RedPoint_MainMissionKey} |
| | | }; |
| | | |
| | | void UpdateRedpoint(List<int> _types) |
| | | { |
| | | if (_types.IsNullOrEmpty()) |
| | | { |
| | | _types = redpointDict.Keys.ToList(); |
| | | } |
| | | |
| | | foreach (var type in _types) |
| | | { |
| | | var redpoint = RedpointCenter.Instance.GetRedpoint(redpointDict[type]); |
| | | redpoint.state = RedPointState.None; |
| | | //根据ID判断是否有可领取的 |
| | | var allAchivement = SuccessConfig.GetTypeToIDDict(type); |
| | | var process = GetAchievementProgress(type); |
| | | foreach (var id in allAchivement) |
| | | { |
| | | var config = SuccessConfig.Get(id); |
| | | if (config.NeedCnt <= process) |
| | | { |
| | | if (!IsAchievementAwarded(id)) |
| | | { |
| | | redpoint.state = RedPointState.Simple; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | //根据类型获取所有成就ID, 且是排序后的 未领取>未达成>已领取 |
| | | public List<int> GetAchievementIDs(int type) |
| | | { |
| | | var ids = SuccessConfig.GetTypeToIDDict(type); |
| | | ids.Sort(CmpIds); |
| | | return ids; |
| | | } |
| | | |
| | | int CmpIds(int a, int b) |
| | | { |
| | | var stateA = GetAchievementState(a); |
| | | var stateB = GetAchievementState(b); |
| | | |
| | | if (stateA != stateB) |
| | | { |
| | | return stateA - stateB; |
| | | } |
| | | |
| | | return a - b; |
| | | } |
| | | |
| | | public void SendGetAward(int id) |
| | | { |
| | | var config = SuccessConfig.Get(id); |
| | | //简单判断背包 |
| | | if (PackManager.Instance.GetEmptyGridCount(PackType.Item) < config.AwardItemList.Length) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_202580"); |
| | | return; |
| | | } |
| | | |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 59; |
| | | pack.DataEx = (uint)id; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | } |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/Achievement/AchievementManager.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: cf5275bc4183a394c83cbfa9707c3f13 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | } |
| | | Display(); |
| | | CreateScroller(); |
| | | FirstChargeManager.Instance.TryPopWin("ArenaBattleFailWin"); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | |
| | | |
| | | ulong myNowHp = GetNowHP(myTeam); |
| | | ulong enemyNowHp = GetNowHP(enemyTeam); |
| | | txtMyHp.text = Language.Get("BoneField09", UIHelper.ReplaceLargeArtNum(myNowHp), UIHelper.ReplaceLargeArtNum(myMaxHp)); |
| | | txtEnemyHp.text = Language.Get("BoneField09", UIHelper.ReplaceLargeArtNum(enemyNowHp), UIHelper.ReplaceLargeArtNum(enemyMaxHp)); |
| | | txtMyHp.text = Language.Get("BoneField09", UIHelper.ReplaceLargeNum(myNowHp), UIHelper.ReplaceLargeNum(myMaxHp)); |
| | | txtEnemyHp.text = Language.Get("BoneField09", UIHelper.ReplaceLargeNum(enemyNowHp), UIHelper.ReplaceLargeNum(enemyMaxHp)); |
| | | imgMyHp.fillAmount = Mathf.Clamp01((myMaxHp > 0) ? (float)myNowHp / myMaxHp : 0f); |
| | | imgEnemyHp.fillAmount = Mathf.Clamp01((enemyMaxHp > 0) ? (float)enemyNowHp / enemyMaxHp : 0f); |
| | | |
| | |
| | | { |
| | | base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList, turnMax); |
| | | |
| | | TianziBillboradManager.Instance.battleLineID = TianziBillboradManager.Instance.todayLineID; |
| | | int level = FuncLineID;// 关卡 |
| | | extendData = _extendData; |
| | | levelConfig = MainLevelConfig.Get(level); |
| | |
| | | case 3://战斗结束 |
| | | break; |
| | | case 4://结算奖励 |
| | | if (extendData != null && extendData.ContainsKey("totalHurt")) |
| | | { |
| | | ulong totalHurt = ulong.Parse(extendData["totalHurt"].ToString()); |
| | | TianziBillboradBattleWin.TianziDamageBarEndDataAction?.Invoke(totalHurt); |
| | | } |
| | | break; |
| | | case 5://结束状态标记 |
| | | break; |
| | |
| | | { |
| | | AutoFightModel.Instance.isPause = false; |
| | | Destroy(); |
| | | |
| | | TianziBillboradManager.Instance.ClearBar(); |
| | | if (UIManager.Instance.IsOpened<TianziBillboradBattleWin>()) |
| | | { |
| | | UIManager.Instance.CloseWindow<TianziBillboradBattleWin>(); |
| | |
| | | public int fightGuideID; |
| | | public int fightGuideMainLevelLimit; |
| | | public int fightGuideNoClickSeconds; |
| | | public int[] challengeBossGuides; |
| | | |
| | | public Action<string, BattleField> onBattleFieldCreate; |
| | | |
| | |
| | | fightGuideID = int.Parse(config.Numerical1); |
| | | fightGuideMainLevelLimit = int.Parse(config.Numerical2); |
| | | fightGuideNoClickSeconds = int.Parse(config.Numerical3); |
| | | challengeBossGuides = JsonMapper.ToObject<int[]>(config.Numerical4); |
| | | |
| | | config = FuncConfigConfig.Get("BattleButton"); |
| | | passRound= int.Parse(config.Numerical1); |
| | |
| | | |
| | | public void OnObjInfoRefresh(H0418_tagObjInfoRefresh _refreshInfo) |
| | | { |
| | | // 天子的挑战拦截血条逻辑 |
| | | // 天子的挑战拦截血条,不拦截怒气 |
| | | BattleObject boss = battleField.FindBoss(); |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == _refreshInfo.ObjID) |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == _refreshInfo.ObjID && _refreshInfo.RefreshType != (ushort)PlayerDataType.XP) |
| | | return; |
| | | switch ((PlayerDataType)_refreshInfo.RefreshType) |
| | | { |
| | |
| | | |
| | | public void ObjPropertyRefreshView(HB418_tagSCObjPropertyRefreshView vNetData) |
| | | { |
| | | // 天子的挑战拦截血条逻辑 |
| | | // 天子的挑战拦截血条,不拦截怒气 |
| | | BattleObject boss = battleField.FindBoss(); |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == vNetData.ObjID) |
| | | if (boss != null && battleField.MapID == 30020 && boss.ObjID == vNetData.ObjID && vNetData.RefreshType != (ushort)PlayerDataType.XP) |
| | | return; |
| | | switch ((PlayerDataType)vNetData.RefreshType) |
| | | { |
| | |
| | | |
| | | public void PerformDrop() |
| | | { |
| | | if (null == m_battleDrops || m_battleDrops.dropItemPackIndex.Count == 0) |
| | | if (null == m_battleDrops) |
| | | return; |
| | | |
| | | EventBroadcast.Instance.Broadcast<string, BattleDrops, Action>( |
| | |
| | | [SerializeField] public Text txtBossName; |
| | | private BattleObject bossBattleObject = null; |
| | | [SerializeField] public List<BattleBuffCell> buffCells; |
| | | [SerializeField] HeroCountryComponent myCountry; |
| | | [SerializeField] HeroCountryComponent enemyCountry; |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | |
| | | |
| | | OnRoundChange(battleField.round, battleField.turnMax); // 确保回合显示被调用 |
| | | OnBuffChanged(); |
| | | |
| | | // 获取我方(红方)队伍数据 |
| | | List<BattleObject> myTeam = battleField.battleObjMgr.GetBattleObjList(BattleCamp.Red); |
| | | // 获取敌方(蓝方)队伍数据 |
| | | List<BattleObject> enemyTeam = battleField.battleObjMgr.GetBattleObjList(BattleCamp.Blue); |
| | | |
| | | myCountry.RefreshOnTeamCountry(GetTeamHeroList(myTeam), true); |
| | | enemyCountry.RefreshOnTeamCountry(GetTeamHeroList(enemyTeam), true); |
| | | } |
| | | |
| | | private void OnBuffChanged() |
| | |
| | | { |
| | | return FuncOpen.Instance.IsFuncOpen(ArenaManager.Instance.BattleChangeTabFuncId); |
| | | } |
| | | |
| | | List<TeamHero> GetTeamHeroList(List<BattleObject> teams) |
| | | { |
| | | List<TeamHero> teamHeroes = new List<TeamHero>(); |
| | | if (teams.IsNullOrEmpty()) |
| | | return teamHeroes; |
| | | foreach (var item in teams) |
| | | { |
| | | teamHeroes.Add(item.teamHero); |
| | | } |
| | | return teamHeroes; |
| | | |
| | | } |
| | | } |
| | |
| | | private BattleObject bossBattleObject = null; |
| | | |
| | | [SerializeField] public List<BattleBuffCell> buffCells; |
| | | [SerializeField] HeroCountryComponent myCountry; |
| | | [SerializeField] HeroCountryComponent enemyCountry; |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | |
| | | |
| | | OnRoundChange(battleField.round, battleField.turnMax); // 确保回合显示被调用 |
| | | OnBuffChanged(); |
| | | |
| | | // 获取我方(红方)队伍数据 |
| | | List<BattleObject> myTeam = battleField.battleObjMgr.GetBattleObjList(BattleCamp.Red); |
| | | // 获取敌方(蓝方)队伍数据 |
| | | List<BattleObject> enemyTeam = battleField.battleObjMgr.GetBattleObjList(BattleCamp.Blue); |
| | | |
| | | myCountry.RefreshOnTeamCountry(GetTeamHeroList(myTeam), true); |
| | | enemyCountry.RefreshOnTeamCountry(GetTeamHeroList(enemyTeam), true); |
| | | } |
| | | |
| | | private void OnBuffChanged() |
| | |
| | | } |
| | | } |
| | | } |
| | | List<TeamHero> GetTeamHeroList(List<BattleObject> teams) |
| | | { |
| | | List<TeamHero> teamHeroes = new List<TeamHero>(); |
| | | if (teams.IsNullOrEmpty()) |
| | | return teamHeroes; |
| | | foreach (var item in teams) |
| | | { |
| | | teamHeroes.Add(item.teamHero); |
| | | } |
| | | return teamHeroes; |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | |
| | | [SerializeField] RectTransform rectBoxEnd; |
| | | [SerializeField] UIEffectPlayer uiEffectPlayer; |
| | | |
| | | public static Action<ulong> TianziDamageBarEndDataAction; |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | |
| | | tianziDamageBar.StageUp += OnStageUp; |
| | | tianziDamageBar.ValueChangeAction += OnValueChangeAction; |
| | | tianziDamageBar.ChangeEndAction += OnChangeEndAction; |
| | | //tianziDamageBar.IsLastHitUnLockEvent += OnIsLastHitUnLockEvent; |
| | | TianziDamageBarEndDataAction += OnTianziDamageBarEndData; |
| | | TianziBillboradManager.Instance.OnUpdateBarInfoEvent += OnUpdateBarInfoEvent; |
| | | TianziBillboradManager.Instance.PlayUiEffectAction += OnPlayUiEffectAction; |
| | | MainWin.TabChangeEvent += OnTabChangeEvent; |
| | | EventBroadcast.Instance.AddListener<string, JsonData>(EventName.BATTLE_END, OnSettlement); |
| | | EventBroadcast.Instance.AddListener<HB419_tagSCObjHPRefresh>(EventName.BATTLE_TIANZI_REFRESH_HP, OnUpdateHpNum); |
| | | bool isOpenBattleChangeTab = IsOpenBattleChangeTab(); |
| | | transButtons.localPosition = new Vector3(0, isOpenBattleChangeTab ? 130 : 0, 0); |
| | | if (isOpenBattleChangeTab) |
| | |
| | | } |
| | | } |
| | | |
| | | private void OnPlayUiEffectAction() |
| | | { |
| | | uiEffectPlayer.Play(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | tianziDamageBar.StageUp -= OnStageUp; |
| | | tianziDamageBar.ValueChangeAction -= OnValueChangeAction; |
| | | tianziDamageBar.ChangeEndAction += OnChangeEndAction; |
| | | //tianziDamageBar.IsLastHitUnLockEvent += OnIsLastHitUnLockEvent; |
| | | TianziDamageBarEndDataAction -= OnTianziDamageBarEndData; |
| | | tianziDamageBar.ChangeEndAction -= OnChangeEndAction; |
| | | TianziBillboradManager.Instance.OnUpdateBarInfoEvent -= OnUpdateBarInfoEvent; |
| | | TianziBillboradManager.Instance.PlayUiEffectAction -= OnPlayUiEffectAction; |
| | | MainWin.TabChangeEvent -= OnTabChangeEvent; |
| | | EventBroadcast.Instance.RemoveListener<string, JsonData>(EventName.BATTLE_END, OnSettlement); |
| | | EventBroadcast.Instance.RemoveListener<HB419_tagSCObjHPRefresh>(EventName.BATTLE_TIANZI_REFRESH_HP, OnUpdateHpNum); |
| | | bool isOpenBattleChangeTab = IsOpenBattleChangeTab(); |
| | | if (isOpenBattleChangeTab) |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnTianziDamageBarEndData(ulong obj) |
| | | private void OnUpdateBarInfoEvent(ulong loaclNowHunt, ulong loaclMaxHp, int loaclHpNum) |
| | | { |
| | | tianziDamageBar.Show(obj); |
| | | tianziDamageBar.Show(loaclNowHunt, loaclMaxHp, loaclHpNum); |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnStageUp(int stage) |
| | | { |
| | | GameObject hero = bossBattleObject.heroGo; |
| | | if (hero == null || stage <= 1) |
| | | return; |
| | | uiEffectPlayer.Play(); |
| | | |
| | | |
| | | GameObject prefab = UIUtility.CreateWidget("TianziBillboradBox", "TianziBillboradBox"); |
| | | prefab.transform.SetParentEx(hero.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | |
| | | |
| | | DisplaySkillWordsList(lineupConfig); |
| | | |
| | | hpB419 = 0; |
| | | maxHpB419 = 0; |
| | | |
| | | tianziDamageBar.Init(); |
| | | |
| | | if (null != bossBattleObject) |
| | |
| | | RefreshBuff(buffList); |
| | | } |
| | | |
| | | private void OnSettlement(string _guid, JsonData data) |
| | | { |
| | | if (string.Empty == _guid) |
| | | return; |
| | | var battle = BattleManager.Instance.GetBattleField(_guid); |
| | | if (battle == null) |
| | | return; |
| | | var battleName = battle.ToString(); |
| | | if (battleName != "TianziBillboradBattleField") |
| | | return; |
| | | |
| | | if (data != null && data.ContainsKey("totalHurt")) |
| | | { |
| | | ulong totalHurt = ulong.Parse(data["totalHurt"].ToString()); |
| | | tianziDamageBar.Show(totalHurt); |
| | | } |
| | | } |
| | | |
| | | private void OnIsLastHitUnLockEvent() |
| | | { |
| | | if (bossBattleObject == null) |
| | | return; |
| | | |
| | | bossBattleObject.teamHero.curHp = (long)hpB419; |
| | | bossBattleObject.teamHero.maxHp = (long)maxHpB419; |
| | | Debug.Log($"TianziDamageBar OnIsLastHitUnLockEvent hpB419 {hpB419} maxHpB419 {maxHpB419}"); |
| | | } |
| | | |
| | | ulong hpB419; |
| | | ulong maxHpB419; |
| | | private void OnUpdateHpNum(HB419_tagSCObjHPRefresh info) |
| | | { |
| | | if (bossBattleObject == null || info.ObjID != bossBattleObject.ObjID) |
| | | return; |
| | | ulong curHp = (ulong)GeneralDefine.GetFactValue(info.HP, info.HPEx); |
| | | ulong maxHp = (ulong)GeneralDefine.GetFactValue(info.MaxHP, info.MaxHPEx); |
| | | hpB419 = curHp; |
| | | maxHpB419 = maxHp; |
| | | //tianziDamageBar.ShowByB419(curHp, maxHp); |
| | | } |
| | | |
| | | protected override void OnDamageTaken(BattleDmgInfo info) |
| | | { |
| | | base.OnDamageTaken(info); |
| | | |
| | | if (battleField == null || info.battleFieldGuid != battleField.guid) |
| | | return; |
| | | |
| | | if (bossBattleObject != null && info.hurtObj.ObjID == bossBattleObject.ObjID) |
| | | { |
| | | |
| | | TeamHero teamHero = bossBattleObject.teamHero; |
| | | tianziDamageBar.Show(info); |
| | | //tianziDamageBar.Show((ulong)teamHero.curHp, (ulong)teamHero.maxHp, info); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void OnValueChangeAction(float nowValue, int CurrentStage) |
| | | { |
| New file |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class BattlePassBaseCell : CellView |
| | | { |
| | | [SerializeField] Image bg; |
| | | [SerializeField] Image word; |
| | | [SerializeField] RedpointBehaviour redPoint; |
| | | [SerializeField] Button btn; |
| | | |
| | | |
| | | |
| | | public void Display(int type) |
| | | { |
| | | bg.SetSprite("BattlePassBG" + type); |
| | | word.SetSprite("BattlePassWord" + type); |
| | | redPoint.redpointId = MainRedDot.RedPoint_FundKey * 100 + type; |
| | | btn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<BattlePassCommonWin>(type); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/BattlePass/BattlePassBaseCell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 2e63901b40440a649acfb3f7757bbd02 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | //基金入口
|
| | | public class BattlePassBaseWin : UIBase
|
| | | {
|
| | | [SerializeField] ScrollerController scroller;
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | CreateScroller();
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | void CreateScroller()
|
| | | {
|
| | | scroller.Refresh();
|
| | | foreach(var type in BattlePassManager.Instance.battlePassTypeSortList)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(BattlePassManager.Instance.typeToFuncIDDict[type]))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | scroller.AddCell(ScrollerDataType.Header, type);
|
| | | }
|
| | | scroller.Restart();
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as BattlePassBaseCell;
|
| | | _cell.Display(cell.index);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/BattlePass/BattlePassBaseWin.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 99d1228c0c974fc488759c06716cb89c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class BattlePassCommonCell : CellView |
| | | { |
| | | [SerializeField] ItemCell baseAward; |
| | | [SerializeField] Transform baseGotRect; |
| | | [SerializeField] Transform baseCanGetAwardRect; |
| | | [SerializeField] Transform upProcssBGRect; |
| | | [SerializeField] Transform upProcessRect; |
| | | [SerializeField] Transform downProcssBGRect; |
| | | [SerializeField] Transform downProcessRect; |
| | | [SerializeField] Text valueText; |
| | | [SerializeField] ItemCell[] betterAwards; |
| | | [SerializeField] Transform[] betterGotRects; |
| | | [SerializeField] Transform[] betterCanGetAwardRects; |
| | | [SerializeField] Transform[] betterLockRects; |
| | | |
| | | [SerializeField] Transform mask; |
| | | |
| | | int bpID; |
| | | public void Display(int id, BattlePassData battlePassData) |
| | | { |
| | | bpID = id; |
| | | var config = ZhanlingConfig.Get(id); |
| | | int freeItemID = config.FreeRewardItemList[0][0]; |
| | | baseAward.Init(new ItemCellModel(freeItemID, false, config.FreeRewardItemList[0][1])); |
| | | var totalValue = BattlePassManager.Instance.GetTotalValue(config.ZhanlingType); |
| | | var baseAwardState = BattlePassManager.Instance.GetBPCellAwardState(battlePassData, totalValue, config.NeedValue, 0); |
| | | baseAward.button.AddListener(() => |
| | | { |
| | | GetAward(battlePassData, baseAwardState, freeItemID); |
| | | }); |
| | | |
| | | |
| | | baseGotRect.SetActive(baseAwardState == 2); |
| | | baseCanGetAwardRect.SetActive(baseAwardState == 1); |
| | | mask.SetActive(baseAwardState == 0); |
| | | |
| | | var ids = ZhanlingConfig.GetTypeToIDDict(config.ZhanlingType).Values.ToList(); |
| | | ids.Sort(); |
| | | upProcssBGRect.SetActive(ids[0] != id); |
| | | upProcessRect.SetActive(baseAwardState != 0); |
| | | |
| | | downProcssBGRect.SetActive(ids[ids.Count - 1] != id); |
| | | var nextConfig = ZhanlingConfig.Get(id + 1); |
| | | if (nextConfig != null) |
| | | { |
| | | downProcessRect.SetActive(totalValue >= nextConfig.NeedValue); |
| | | } |
| | | else |
| | | { |
| | | downProcessRect.SetActive(false); |
| | | } |
| | | |
| | | if (config.ZhanlingType == (int)BattlePassType.MainLine) |
| | | { |
| | | |
| | | valueText.text = config.NeedValue/100 + "-" + config.NeedValue%100; |
| | | } |
| | | else |
| | | { |
| | | valueText.text = config.NeedValue.ToString(); |
| | | } |
| | | |
| | | var betterAwardState = BattlePassManager.Instance.GetBPCellAwardState(battlePassData, totalValue, config.NeedValue, 1); |
| | | for (int i = 0; i < betterAwards.Length; i++) |
| | | { |
| | | int itemID = config.ZLRewardItemList[i][0]; |
| | | betterAwards[i].Init(new ItemCellModel(itemID, false, config.ZLRewardItemList[i][1])); |
| | | betterAwards[i].button.AddListener(() => |
| | | { |
| | | GetAward(battlePassData, betterAwardState, itemID); |
| | | }); |
| | | betterGotRects[i].SetActive(betterAwardState == 2); |
| | | betterCanGetAwardRects[i].SetActive(betterAwardState == 1); |
| | | betterLockRects[i].SetActive(battlePassData.isActivite == 0); |
| | | } |
| | | } |
| | | |
| | | void GetAward(BattlePassData battlePassData, int awardState, int itemID) |
| | | { |
| | | if (awardState != 1) |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | return; |
| | | } |
| | | var config = ZhanlingConfig.Get(bpID); |
| | | var totalValue = BattlePassManager.Instance.GetTotalValue(config.ZhanlingType); |
| | | BattlePassManager.Instance.GetAllAward(battlePassData, config.ZhanlingType, totalValue); |
| | | } |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/BattlePass/BattlePassCommonCell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: e29202cc898b4164e962fff7c1737ee7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | //通用战令
|
| | | public class BattlePassCommonWin : UIBase
|
| | | {
|
| | | [SerializeField] Text titleText;
|
| | | [SerializeField] Text welfarePerText; //福利百分比 |
| | | [SerializeField] Text itemNameText; //额外奖励
|
| | | [SerializeField] Text totalActivityText;
|
| | | [SerializeField] Text tabNameText;
|
| | | [SerializeField] Transform lockRect;
|
| | | [SerializeField] ScrollerController scroller;
|
| | | [SerializeField] Transform rechargeRect;
|
| | | [SerializeField] ItemCell itemCell;
|
| | | [SerializeField] Button buyBtn;
|
| | | [SerializeField] Text buyText;
|
| | |
|
| | | BattlePassData battlePassData;
|
| | |
|
| | | int battlePasstype;
|
| | |
|
| | | protected override void InitComponent()
|
| | | {
|
| | | buyBtn.AddListener(() =>
|
| | | {
|
| | | RechargeManager.Instance.CTG(BattlePassManager.Instance.GetCTGIDByType(battlePasstype));
|
| | | });
|
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | battlePasstype = functionOrder;
|
| | | battlePassData = BattlePassManager.Instance.GetBattlePassData(battlePasstype);
|
| | | if (battlePassData == null) return;
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | BattlePassManager.Instance.BattlePassDataUpdateEvent += BattlePassDataUpdateEvent;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefresh;
|
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += OnBlessLVUpdateEvent;
|
| | | CreateScroller();
|
| | | ShowStaticUI();
|
| | | Display();
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | BattlePassManager.Instance.BattlePassDataUpdateEvent -= BattlePassDataUpdateEvent;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefresh;
|
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= OnBlessLVUpdateEvent;
|
| | |
|
| | | }
|
| | |
|
| | | void OnPlayerDataRefresh(PlayerDataType type)
|
| | | {
|
| | | if (type == PlayerDataType.LV || type == PlayerDataType.ExAttr1)
|
| | | {
|
| | | Display();
|
| | | }
|
| | | }
|
| | |
|
| | | void OnBlessLVUpdateEvent()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | |
|
| | | void BattlePassDataUpdateEvent(int type)
|
| | | {
|
| | | if (type == battlePasstype)
|
| | | {
|
| | | Display();
|
| | | }
|
| | | }
|
| | |
|
| | | void ShowStaticUI()
|
| | | {
|
| | | var ctgID = BattlePassManager.Instance.GetCTGIDByType(battlePasstype);
|
| | | var config = CTGConfig.Get(ctgID);
|
| | | welfarePerText.text = config.Percentage + "%";
|
| | | if (!config.GainItemList.IsNullOrEmpty() && config.GainItemList.Length >= 2)
|
| | | {
|
| | | //约定第二个物品
|
| | | itemNameText.text = Language.Get("BattlePass8", config.GainItemList[1][1], ItemConfig.Get(config.GainItemList[1][0]).ItemName);
|
| | | }
|
| | |
|
| | | tabNameText.text = Language.Get("BattlePassTab" + battlePasstype);
|
| | | titleText.text = Language.Get("BattlePassTitle" + battlePasstype);
|
| | | }
|
| | |
|
| | |
|
| | | void Display()
|
| | | {
|
| | | ShowTotalValueStr();
|
| | |
|
| | | lockRect.SetActive(battlePassData.isActivite == 0);
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | |
|
| | | if (battlePassData.isActivite == 0)
|
| | | {
|
| | | rechargeRect.SetActive(true);
|
| | | var ctgID = BattlePassManager.Instance.GetCTGIDByType(battlePasstype);
|
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig);
|
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale);
|
| | |
|
| | | var config = CTGConfig.Get(ctgID);
|
| | | //约定第一个武将物品
|
| | | int itemID = config.GainItemList[0][0];
|
| | | itemCell.Init(new ItemCellModel(itemID, false, config.GainItemList[0][1]));
|
| | | itemCell.button.AddListener(() =>
|
| | | {
|
| | | ItemTipUtility.Show(itemID);
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | rechargeRect.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | void ShowTotalValueStr()
|
| | | {
|
| | | var totalValue = BattlePassManager.Instance.GetTotalValue(battlePasstype);
|
| | | switch ((BattlePassType)battlePasstype)
|
| | | {
|
| | | case BattlePassType.LV:
|
| | | case BattlePassType.BlessLV:
|
| | | case BattlePassType.GuBao:
|
| | | case BattlePassType.Arena:
|
| | | {
|
| | | totalActivityText.text = Language.Get("BattlePassValue" + battlePasstype, totalValue);
|
| | | break;
|
| | | }
|
| | | case BattlePassType.MainLine:
|
| | | {
|
| | | totalActivityText.text = Language.Get("BattlePassValue3", totalValue / 100, totalValue % 100);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | void CreateScroller()
|
| | | {
|
| | | scroller.Refresh();
|
| | | var values = ZhanlingConfig.GetTypeToIDDict(battlePasstype).Values.ToList();
|
| | | values.Sort();
|
| | | for (int i = 0; i < values.Count; i++)
|
| | | {
|
| | | scroller.AddCell(ScrollerDataType.Header, values[i]);
|
| | | }
|
| | | scroller.Restart();
|
| | |
|
| | | var totalValue = BattlePassManager.Instance.GetTotalValue(battlePasstype);
|
| | | scroller.JumpIndex(BattlePassManager.Instance.JumpIndex(battlePassData, battlePasstype, totalValue));
|
| | | }
|
| | |
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as BattlePassCommonCell;
|
| | | _cell.Display(cell.index, battlePassData);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/BattlePass/BattlePassCommonWin.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 9ccc81dd25c7a8c4e9fe71b015a3e955 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | using System.Linq; |
| | | |
| | | //通用基金界面战令 |
| | | public partial class BattlePassManager : GameSystemManager<BattlePassManager> |
| | | { |
| | | |
| | | //战令类型:红点 通用基金界面 |
| | | Dictionary<int, Redpoint> redpointCommonDict = new Dictionary<int, Redpoint>(); |
| | | |
| | | //通用战令对应的功能id |
| | | public Dictionary<int, int> typeToFuncIDDict = new Dictionary<int, int>() |
| | | { |
| | | {1, 40}, |
| | | {2, 40}, |
| | | {3, 40}, |
| | | {4, 28}, |
| | | {5, 27}, |
| | | }; |
| | | |
| | | public int[] battlePassTypeSortList; |
| | | |
| | | |
| | | //1-主公等级;2-祝福等级;3-主线关卡;4-古宝数量;5-演武场次数; |
| | | void UpdateCommonBPRedpoint(int _type) |
| | | { |
| | | if (!redpointCommonDict.ContainsKey(_type)) |
| | | { |
| | | return; |
| | | } |
| | | if (!FuncOpen.Instance.IsFuncOpen(typeToFuncIDDict[_type])) |
| | | { |
| | | return; |
| | | } |
| | | redpointCommonDict[_type].state = RedPointState.None; |
| | | battlePassDataDict.TryGetValue(_type, out BattlePassData battlePassData); |
| | | if (battlePassData == null) return; |
| | | int totalValue = 0; |
| | | switch ((BattlePassType)_type) |
| | | { |
| | | case BattlePassType.LV: |
| | | { |
| | | totalValue = PlayerDatas.Instance.baseData.LV; |
| | | break; |
| | | } |
| | | case BattlePassType.BlessLV: |
| | | { |
| | | totalValue = BlessLVManager.Instance.m_TreeLV; |
| | | break; |
| | | } |
| | | case BattlePassType.MainLine: |
| | | { |
| | | totalValue = PlayerDatas.Instance.baseData.ExAttr1 / 100; |
| | | break; |
| | | } |
| | | case BattlePassType.GuBao: |
| | | { |
| | | totalValue = (int)battlePassData.value1; |
| | | break; |
| | | } |
| | | case BattlePassType.Arena: |
| | | { |
| | | totalValue = (int)battlePassData.value1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (HasAnyAward(_type, totalValue)) |
| | | { |
| | | redpointCommonDict[_type].state = RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/BattlePass/BattlePassManager.Common.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: b1c1b8cb5fd4f9d42b87cdadae0dcce5 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | //周战令 |
| | | public partial class BattlePassManager : GameSystemManager<BattlePassManager> |
| | | { |
| | | public const int WeekBattlePassType = 6; |
| | | |
| | | Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_DailyKey, MainRedDot.RedPoint_WeekBPFuncKey); |
| | | void UpdateWeekRedPoint() |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DayMission)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | redpoint.state = RedPointState.None; |
| | | //购买,活跃 |
| | | battlePassDataDict.TryGetValue(WeekBattlePassType, out BattlePassData battlePassData); |
| | | battlePassDataDict.TryGetValue((int)BattlePassType.Week, out BattlePassData battlePassData); |
| | | if (battlePassData == null) return; |
| | | |
| | | |
| | | if (HasAnyAward(WeekBattlePassType, (int)battlePassData.value1)) |
| | | if (HasAnyAward((int)BattlePassType.Week, (int)battlePassData.value1)) |
| | | { |
| | | redpoint.state = RedPointState.Simple; |
| | | } |
| | |
| | | using UnityEngine; |
| | | using System; |
| | | using System.Linq; |
| | | using LitJson; |
| | | |
| | | |
| | | public partial class BattlePassManager : GameSystemManager<BattlePassManager> |
| | |
| | | Dictionary<int, BattlePassData> battlePassDataDict = new Dictionary<int, BattlePassData>(); |
| | | public event Action<int> BattlePassDataUpdateEvent; |
| | | |
| | | |
| | | Dictionary<int, int[]> buyZhanlingTypeDict = new Dictionary<int, int[]>(); |
| | | |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefresh; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += OnBlessLVUpdateEvent; |
| | | ParseConfig(); |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefresh; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= OnBlessLVUpdateEvent; |
| | | } |
| | | |
| | | void OnBeforePlayerDataInitialize() |
| | |
| | | { |
| | | var config = FuncConfigConfig.Get("Zhanling"); |
| | | buyZhanlingTypeDict = ConfigParse.ParseIntArrayDict(config.Numerical1); |
| | | battlePassTypeSortList = JsonMapper.ToObject<int[]>(config.Numerical5); |
| | | |
| | | foreach (var type in battlePassTypeSortList) |
| | | { |
| | | redpointCommonDict[type] = new Redpoint(MainRedDot.RedPoint_FundKey, MainRedDot.RedPoint_FundKey * 100 + type); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | HB120_tagMCZhanlingInfo.tagMCZhanling reward = netPack.RewardList[i]; |
| | | if (!battlePassData.battlePassCellDict.ContainsKey((int)reward.NeedValue)) |
| | | { |
| | | battlePassData.battlePassCellDict[(int)reward.NeedValue] = new BattlePassCell(); |
| | | battlePassData.battlePassCellDict[(int)reward.NeedValue] = new BattlePassAwardState(); |
| | | } |
| | | |
| | | BattlePassCell battlePassCell = battlePassData.battlePassCellDict[(int)reward.NeedValue]; |
| | | BattlePassAwardState battlePassCell = battlePassData.battlePassCellDict[(int)reward.NeedValue]; |
| | | battlePassCell.freeRewardState = reward.FreeRewardState; |
| | | battlePassCell.zlRewardState = reward.ZLRewardState; |
| | | battlePassCell.zlRewardStateH = reward.ZLRewardStateH; |
| | |
| | | BattlePassDataUpdateEvent?.Invoke(netPack.ZhanlingType); |
| | | } |
| | | |
| | | #region 红点 |
| | | |
| | | void UpdateRedpoint(int type) |
| | | void OnBlessLVUpdateEvent() |
| | | { |
| | | UpdateCommonBPRedpoint(2); |
| | | } |
| | | |
| | | void OnPlayerDataRefresh(PlayerDataType type) |
| | | { |
| | | switch (type) |
| | | { |
| | | case WeekBattlePassType: |
| | | case PlayerDataType.LV: |
| | | case PlayerDataType.ExAttr1: |
| | | { |
| | | UpdateCommonBPRedpoint(1); |
| | | UpdateCommonBPRedpoint(3); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void OnPlayerLoginOk() |
| | | { |
| | | foreach (var type in battlePassTypeSortList) |
| | | { |
| | | UpdateCommonBPRedpoint(type); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | void UpdateRedpoint(int type) |
| | | { |
| | | switch ((BattlePassType)type) |
| | | { |
| | | case BattlePassType.LV: |
| | | case BattlePassType.BlessLV: |
| | | case BattlePassType.MainLine: |
| | | case BattlePassType.GuBao: |
| | | case BattlePassType.Arena: |
| | | { |
| | | UpdateCommonBPRedpoint(type); |
| | | break; |
| | | } |
| | | case BattlePassType.Week: |
| | | { |
| | | UpdateWeekRedPoint(); |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | //是否有任何奖励可以领取 |
| | | public bool HasAnyAward(int type, int totalValue) |
| | | { |
| | |
| | | |
| | | public int JumpIndex(BattlePassData battlePassData, int zhanLingType, int totalValue) |
| | | { |
| | | |
| | | |
| | | var ids = ZhanlingConfig.GetTypeToIDDict(zhanLingType).Values.ToList(); |
| | | ids.Sort(); |
| | | int index = -1; |
| | |
| | | } |
| | | return index; |
| | | } |
| | | |
| | | //是否全部完成(奖励全领取) |
| | | public bool IsAllFinish(int type) |
| | | { |
| | | battlePassDataDict.TryGetValue(type, out BattlePassData battlePassData); |
| | | if (battlePassData == null) |
| | | return false; |
| | | if (battlePassData.allFinishTime != 0) |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | public int GetTotalValue(int _type) |
| | | { |
| | | battlePassDataDict.TryGetValue(_type, out BattlePassData battlePassData); |
| | | switch ((BattlePassType)_type) |
| | | { |
| | | case BattlePassType.LV: |
| | | { |
| | | return PlayerDatas.Instance.baseData.LV; |
| | | } |
| | | case BattlePassType.BlessLV: |
| | | { |
| | | return BlessLVManager.Instance.m_TreeLV; |
| | | } |
| | | case BattlePassType.MainLine: |
| | | { |
| | | return PlayerDatas.Instance.baseData.ExAttr1 / 100; |
| | | } |
| | | case BattlePassType.GuBao: |
| | | { |
| | | return (int)battlePassData.value1; |
| | | } |
| | | case BattlePassType.Arena: |
| | | { |
| | | return (int)battlePassData.value1; |
| | | } |
| | | case BattlePassType.Week: |
| | | { |
| | | return (int)battlePassData.value1; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | public class BattlePassCell |
| | | public class BattlePassAwardState |
| | | { |
| | | public byte freeRewardState; // 免费战令奖励是否已领取 |
| | | public byte zlRewardState; // 普通战令奖励是否已领取 |
| | |
| | | public uint allFinishTime; // 全部奖励领取完毕的时间戳,未完毕时该值为0,后端会在0点过天时检查可否重置,前端自行做倒计时表现即可 |
| | | public uint value1; // 战令对应的自定义值,可选,如登录战令代表开始计算日期时间戳 |
| | | |
| | | public Dictionary<int, BattlePassCell> battlePassCellDict = new Dictionary<int, BattlePassCell>(); |
| | | public Dictionary<int, BattlePassAwardState> battlePassCellDict = new Dictionary<int, BattlePassAwardState>(); |
| | | } |
| | | |
| | | public enum BattlePassType |
| | | { |
| | | LV = 1, //等级 |
| | | BlessLV = 2, //祝福等级 |
| | | MainLine = 3, //主线关卡 |
| | | GuBao = 4, //古宝 |
| | | Arena = 5, //演武场 |
| | | Week = 6, //周战令 |
| | | } |
| | |
| | | PlayerDatas.Instance.baseData.face,
|
| | | PlayerDatas.Instance.baseData.facePic));
|
| | | rankText.text = Language.Get("L1045");
|
| | | rankValueText.text = "0";//Language.Get("L1125");
|
| | | rankValueText.text = "1-1";//Language.Get("L1125");
|
| | | nameText.text = PlayerDatas.Instance.baseData.PlayerName;
|
| | | officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID);
|
| | | return;
|
| | |
| | | officialTitleCell.SetActive(false);
|
| | | avatarCell.SetActive(false);
|
| | | nameText.text = Language.Get("L1124");
|
| | | rankValueText.text = "0";//Language.Get("L1125");
|
| | | rankValueText.text = "1-1";//Language.Get("L1125");
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | avatarCell.SetActive(true);
|
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4));
|
| | | nameText.text = rankData.name1;
|
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue));
|
| | | rankValueText.text = RankModel.Instance.GetStoryInfo(rankData.cmpValue); ;
|
| | | }
|
| | |
|
| | | rankText.text = rank.ToString();
|
| | |
| | | |
| | | public override void Refresh() |
| | | { |
| | | cmpStrText.text = Language.Get("RankTypeName_" + rankType); |
| | | cmpStrText.text = Language.Get("RankTypeName_1"); |
| | | ShowTop3(); |
| | | CreateScroller(); |
| | | ShowMyRank(); |
| | |
| | | var rankData = RankModel.Instance.GetRankDataByRank(rankType, rank);
|
| | | if (rankData == null)
|
| | | {
|
| | | rankValueText.text = "0";//Language.Get("L1125");
|
| | | rankValueText.text = "1-1";//Language.Get("L1125");
|
| | | nameText.text = Language.Get("L1124");
|
| | | officialTitleCell.SetActive(false);
|
| | | return;
|
| | | }
|
| | | officialTitleCell.SetActive(true);
|
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue));
|
| | | //rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue));
|
| | | rankValueText.text = RankModel.Instance.GetStoryInfo(rankData.cmpValue);
|
| | | nameText.text = rankData.name1;
|
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2);
|
| | | model.Create((int)rankData.value5, 1);
|
| | |
| | | {
|
| | | public event Action<int> onRankRefresh;
|
| | | //public event Action<int> onMyRankRefresh;
|
| | | |
| | |
|
| | | //排行榜滚动显示的最大数量 类型
|
| | | Dictionary<int, int> ranksShowMaxCnt = new Dictionary<int, int>();
|
| | |
|
| | | //分页查询
|
| | | Dictionary<int, int> queryRankCD = new Dictionary<int, int>(); //首次查询CD,不影响后续的分页查询
|
| | | //分页查询 排名索引按字段存储 1代表第一名
|
| | | Dictionary<int, Dictionary<int, RankData>> m_RankPageDatas = new Dictionary<int, Dictionary<int, RankData>>(); |
| | | Dictionary<int, Dictionary<int, RankData>> m_RankPageDatas = new Dictionary<int, Dictionary<int, RankData>>();
|
| | | //类型:ID -排名索引,通过ID进行排重删除 不同名次 同ID的数据
|
| | | Dictionary<int, Dictionary<int, int>> m_RankIDToIndex = new Dictionary<int, Dictionary<int, int>>();
|
| | |
|
| | |
| | | if (queryPageTimes.ContainsKey(page) && Time.realtimeSinceStartup - queryPageTimes[page] < queryPageCD)
|
| | | return;
|
| | | if (ranksServerMaxCnt.ContainsKey(type))
|
| | | { |
| | | if(index >= ranksServerMaxCnt[type])
|
| | | {
|
| | | if (index >= ranksServerMaxCnt[type])
|
| | | {
|
| | | //超过服务器已上榜的总数量,比如总榜单是100名,当前只有8名玩家上榜,往下滚动就不再查询
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | if (!ranksServerMaxCnt.ContainsKey(rankType))
|
| | | { |
| | | {
|
| | | ranksServerMaxCnt.Add(rankType, package.DataTotal);
|
| | | }
|
| | | ranksServerMaxCnt[rankType] = package.DataTotal;
|
| | |
| | | return null;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public string GetStoryInfo(uint cmpValue)
|
| | | {
|
| | | int value = (int)cmpValue;
|
| | | if (!MainLevelConfig.HasKey(value))
|
| | | return string.Empty;
|
| | | MainLevelConfig config = MainLevelConfig.Get(value);
|
| | | return Language.Get("Arena15", config.ChapterID, config.LevelNum);
|
| | | }
|
| | | }
|
| | |
|
| | | // 默认情况,各个榜可能有所变化
|
| | |
| | | [SerializeField] TextEx txtChallengeYes; |
| | | [SerializeField] TextEx txtChallengeNo; |
| | | [SerializeField] ImageEx imgChallengeLVYes; |
| | | [SerializeField] ImageEx imgChallengeLVNo; |
| | | [SerializeField] ImageEx imgChallengeIcon; |
| | | [SerializeField] ImageEx imgChallengeRed; |
| | | bool isLvOk; |
| | |
| | | txtChallengeYes.SetActive(isLvOk && isHasNextLineID); |
| | | txtChallengeNo.SetActive(!isLvOk || !isHasNextLineID); |
| | | imgChallengeLVYes.SetActive(isLvOk && isHasNextLineID); |
| | | imgChallengeLVNo.SetActive(!isLvOk || !isHasNextLineID); |
| | | imgChallengeLVYes.gray = !isLvOk || !isHasNextLineID; |
| | | imgChallengeIcon.SetActive(isLvOk && isHasNextLineID); |
| | | } |
| | | private void OnClickChallenge() |
| | |
| | | [SerializeField] BoneFieldChallengeButton btnChallenge1; |
| | | [SerializeField] BoneFieldChallengeButton btnChallenge2; |
| | | [SerializeField] ButtonEx btnSweep; |
| | | [SerializeField] ImageEx imgSweepNo; |
| | | [SerializeField] ImageEx imgSweep; |
| | | [SerializeField] ButtonEx btnAds; |
| | | [SerializeField] ImageEx imgSweepRed; |
| | | [SerializeField] UIHeroController bossModel; |
| | |
| | | if (!BoneFieldManager.Instance.TryGetShowSweepCount(out showSweepMaxCount, out showrealRemainSweepCount)) |
| | | return; |
| | | bool isSweepCountOk = showrealRemainSweepCount > 0; |
| | | imgSweepNo.SetActive(!isSweepCountOk); |
| | | btnSweep.interactable = isSweepCountOk; |
| | | imgSweep.gray = !isSweepCountOk; |
| | | long myFightPower = PlayerDatas.Instance.baseData.FightPower; |
| | | imgSweepRed.SetActive(isSweepCountOk && myFightPower < dungeonConfig.FightPower); |
| | | txtFirstFree.SetActive(showSweepMaxCount == showrealRemainSweepCount); |
| | |
| | | break;
|
| | | case 2:
|
| | | //主线任务(英雄之路)
|
| | | currentSubUI = UIManager.Instance.OpenWindow<DayMissionWin>();
|
| | | currentSubUI = UIManager.Instance.OpenWindow<MissionHeroRoadWin>();
|
| | | titleText.text = Language.Get("DayMission4");
|
| | | break;
|
| | | default:
|
| | |
| | | |
| | | public class DayMissionCell : CellView |
| | | { |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Transform[] gotRects; |
| | | [SerializeField] Text titleText; |
| | | [SerializeField] Text valueText; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Button getBtn; |
| | |
| | | int id = DayMissionManager.Instance.dailyIDList[index]; |
| | | var config = DailyTaskConfig.Get(id); |
| | | titleText.text = string.Format(config.Title, config.NeedValue); |
| | | valueText.text = config.AwardLiveness.ToString(); |
| | | var process = DayMissionManager.Instance.GetDailyTaskProcess(id); |
| | | processImg.fillAmount = (float)process / config.NeedValue; |
| | | processText.text = Math.Min(process, config.NeedValue) + "/" + config.NeedValue; |
| | |
| | | getBtn.SetActive(false); |
| | | gotoBtn.SetActive(true); |
| | | gotRect.SetActive(false); |
| | | mask.SetActive(true); |
| | | gotoBtn.AddListener(()=> |
| | | mask.SetActive(false); |
| | | gotoBtn.AddListener(() => |
| | | { |
| | | RightFuncInHome.RemoveListenWindow(); |
| | | UIManager.Instance.CloseWindow<DayMissionBaseWin>(); |
| | | NewBieCenter.Instance.StartNewBieGuide(config.GuideID); |
| | | }); |
| | |
| | | gotoBtn.SetActive(false); |
| | | gotRect.SetActive(false); |
| | | mask.SetActive(false); |
| | | getBtn.AddListener(()=> |
| | | getBtn.AddListener(() => |
| | | { |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 1; |
| | |
| | | gotRect.SetActive(true); |
| | | mask.SetActive(true); |
| | | } |
| | | |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int itemID = config.AwardItemList[i][0]; |
| | | itemCells[i].Init(new ItemCellModel(config.AwardItemList[i][0], false, config.AwardItemList[i][1])); |
| | | itemCells[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | gotRects[i].SetActive(state == 2); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | [SerializeField] Text[] targetActivityText;
|
| | | [SerializeField] ScrollerController scroller;
|
| | |
|
| | | int beforeActivity; //用于显示活跃奖励
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | beforeActivity = DayMissionManager.Instance.activityTotal;
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | DayMissionManager.Instance.OnDayMissionEvent += OnDayMissionEvent;
|
| | |
|
| | |
| | | DayMissionManager.Instance.SortDailyTask();
|
| | | Display();
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | if (DayMissionManager.Instance.activityTotal != beforeActivity)
|
| | | {
|
| | | List<Item> showItems = new List<Item>();
|
| | | Item tempItem = new Item(GeneralDefine.activityItemID, DayMissionManager.Instance.activityTotal - beforeActivity);
|
| | | showItems.Add(tempItem);
|
| | | ItemLogicUtility.Instance.ShowGetItem(showItems);
|
| | |
|
| | | beforeActivity = DayMissionManager.Instance.activityTotal;
|
| | | }
|
| | | }
|
| | |
|
| | | void ShowAward(int id)
|
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class MissionHeroRoadCell : CellView |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Transform[] gotRects; |
| | | |
| | | [SerializeField] Button getBtn; |
| | | [SerializeField] Button gotoBtn; |
| | | [SerializeField] Transform gotRect; |
| | | [SerializeField] Transform mask; |
| | | |
| | | |
| | | public void Display(int id) |
| | | { |
| | | var config = SuccessConfig.Get(id); |
| | | nameText.text = Language.Get("Achievement1", config.NeedCnt / 100, config.NeedCnt % 100); |
| | | |
| | | var targetLevel = MainLevelConfig.GetToTargetLevelIndex(config.NeedCnt) + 1; |
| | | var curLevel = MainLevelConfig.GetToTargetLevelIndex(AchievementManager.Instance.GetAchievementProgress(config.Type)) + 1; |
| | | |
| | | processImg.fillAmount = (float)curLevel / targetLevel; |
| | | processText.text = Math.Min(targetLevel, curLevel) + "/" + targetLevel; |
| | | |
| | | var state = AchievementManager.Instance.GetAchievementState(id); |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int itemID = config.AwardItemList[i][0]; |
| | | itemCells[i].Init(new ItemCellModel(itemID, false, config.AwardItemList[i][1])); |
| | | itemCells[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | gotRects[i].SetActive(state == 2); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | getBtn.SetActive(state == 0); |
| | | gotoBtn.SetActive(state == 1); |
| | | gotRect.SetActive(state == 2); |
| | | mask.SetActive(state == 2); |
| | | |
| | | |
| | | getBtn.AddListener(() => |
| | | { |
| | | AchievementManager.Instance.SendGetAward(id); |
| | | }); |
| | | |
| | | gotoBtn.AddListener(() => |
| | | { |
| | | RightFuncInHome.RemoveListenWindow(); |
| | | UIManager.Instance.CloseWindow<DayMissionBaseWin>(); |
| | | NewBieCenter.Instance.StartNewBieGuide(BattleManager.Instance.challengeBossGuides[0]); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/DayMission/MissionHeroRoadCell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: e5424536ae280184192560cd8373d771 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | //主线任务:英雄之路
|
| | | public class MissionHeroRoadWin : UIBase
|
| | | {
|
| | | [SerializeField] ScrollerController scroller;
|
| | |
|
| | |
|
| | | List<int> ids = new List<int>();
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | AchievementManager.Instance.OnAchievementUpdateEvent += OnAchievementUpdateEvent;
|
| | | CreateScroller();
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | scroller.OnRefreshCell -= OnRefreshCell;
|
| | | AchievementManager.Instance.OnAchievementUpdateEvent -= OnAchievementUpdateEvent;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | void OnAchievementUpdateEvent(int type)
|
| | | {
|
| | | if (type == 1 || type == -1)
|
| | | {
|
| | | ids = AchievementManager.Instance.GetAchievementIDs(1);
|
| | | scroller.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | | }
|
| | |
|
| | | void CreateScroller()
|
| | | {
|
| | | ids = AchievementManager.Instance.GetAchievementIDs(1);
|
| | | var count = ids.Count;
|
| | | scroller.Refresh();
|
| | | for (int i = 0; i < count; i++)
|
| | | {
|
| | | scroller.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | scroller.Restart();
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as MissionHeroRoadCell;
|
| | | _cell.Display(ids[cell.index]);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/DayMission/MissionHeroRoadWin.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 803a78750ea407f49b5ddf73889160d9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class SignCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Image bgImg; |
| | | [SerializeField] Text dayText; |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Transform[] gotRects; |
| | | [SerializeField] Transform nowSelectRect; |
| | | [SerializeField] Transform repairRect; |
| | | [SerializeField] Button signBtn; |
| | | |
| | | |
| | | |
| | | public void Display(int index) |
| | | { |
| | | var day = index + 1; |
| | | var config = SignInConfig.Get(day); |
| | | //状态:0-不可签到;1-已签到;2-可补签;3-已领取 |
| | | var state = SignManager.Instance.GetSignDayState(day); |
| | | |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int itemID = config.AwardItemList[i][0]; |
| | | itemCells[i].Init(new ItemCellModel(itemID, false, config.AwardItemList[i][1])); |
| | | itemCells[i].button.AddListener(()=> |
| | | { |
| | | if (state == 1 || state == 2) |
| | | { |
| | | Sign(day); |
| | | return; |
| | | } |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | if (state == 1) |
| | | { |
| | | //可领取 |
| | | bgImg.SetOrgSprite("Sign_img_54", "Sign"); |
| | | nowSelectRect.SetActive(true); |
| | | for (int i = 0; i < gotRects.Length; i++) |
| | | { |
| | | gotRects[i].SetActive(false); |
| | | } |
| | | repairRect.SetActive(false); |
| | | } |
| | | else if (state == 2) |
| | | { |
| | | //补签 |
| | | bgImg.SetOrgSprite("Sign_img_58", "Sign"); |
| | | nowSelectRect.SetActive(false); |
| | | for (int i = 0; i < gotRects.Length; i++) |
| | | { |
| | | gotRects[i].SetActive(false); |
| | | } |
| | | repairRect.SetActive(true); |
| | | } |
| | | else if (state == 3) |
| | | { |
| | | //已领取 |
| | | bgImg.SetOrgSprite("Sign_img_57", "Sign"); |
| | | nowSelectRect.SetActive(false); |
| | | for (int i = 0; i < gotRects.Length; i++) |
| | | { |
| | | gotRects[i].SetActive(true); |
| | | } |
| | | repairRect.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | //不可签到 |
| | | bgImg.SetOrgSprite("Sign_img_58", "Sign"); |
| | | nowSelectRect.SetActive(false); |
| | | for (int i = 0; i < gotRects.Length; i++) |
| | | { |
| | | gotRects[i].SetActive(false); |
| | | } |
| | | repairRect.SetActive(false); |
| | | } |
| | | |
| | | dayText.text = state == 3 ? Language.Get("Sign2") : Language.Get("SignDay" + day); |
| | | |
| | | signBtn.AddListener(() => |
| | | { |
| | | if (state == 1 || state == 2) |
| | | { |
| | | Sign(day); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | void Sign(int day) |
| | | { |
| | | var state = SignManager.Instance.GetSignDayState(day); |
| | | if (state == 2) |
| | | { |
| | | ConfirmCancel.MoneyIconConfirm(SignManager.Instance.repairSignMoney, SignManager.Instance.repairSignMoneyType, |
| | | Language.Get("Sign3", UIHelper.GetIconNameWithMoneyType(SignManager.Instance.repairSignMoneyType), |
| | | SignManager.Instance.repairSignMoney), (bool isOk, bool isToggle) => |
| | | { |
| | | if (isOk) |
| | | { |
| | | var pack = new CA509_tagCSDaySign(); |
| | | pack.Day = (byte)day; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | var pack = new CA509_tagCSDaySign(); |
| | | pack.Day = (byte)day; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | } |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/DayMission/SignCell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 9e571a902b764294b8f222eeeb60ff3b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | |
| | | public class SignManager : GameSystemManager<SignManager> |
| | | { |
| | | public int repairSignMoneyType; |
| | | public int repairSignMoney; |
| | | public byte[] signStateList = new byte[7]; |
| | | public event Action OnSignEvent; |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | |
| | | ParseConfig(); |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | void OnBeforePlayerDataInitialize() |
| | | { |
| | | signStateList = new byte[7]; |
| | | } |
| | | |
| | | |
| | | void ParseConfig() |
| | | { |
| | | var config = FuncConfigConfig.Get("SignInSet"); |
| | | var arr = ConfigParse.GetMultipleStr<int>(config.Numerical1); |
| | | repairSignMoneyType = arr[0]; |
| | | repairSignMoney = arr[1]; |
| | | } |
| | | |
| | | public void UpdateSignInfo(HA30D_tagSCDaySignInfo netPack) |
| | | { |
| | | signStateList = netPack.SignStateList; |
| | | OnSignEvent?.Invoke(); |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | //状态:0-不可签到;1-已签到;2-可补签;3-已领取 |
| | | public int GetSignDayState(int day) |
| | | { |
| | | return signStateList[day - 1]; |
| | | } |
| | | |
| | | public Redpoint redPointSign = new Redpoint(MainRedDot.RightFuncRedpoint, MainRedDot.RedPoint_SignKey); |
| | | void UpdateRedpoint() |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DaySign)) |
| | | { |
| | | return; |
| | | } |
| | | foreach (var item in signStateList) |
| | | { |
| | | if (item == 1) |
| | | { |
| | | redPointSign.state = RedPointState.Simple; |
| | | return; |
| | | } |
| | | } |
| | | redPointSign.state = RedPointState.None; |
| | | } |
| | | |
| | | } |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/DayMission/SignManager.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 216787bcde983c14fafc47d400400eed |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | //日常任务
|
| | | public class SignWin : UIBase
|
| | | {
|
| | | [SerializeField] SignCell[] signCells;
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | SignManager.Instance.OnSignEvent += Display;
|
| | | Display();
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | SignManager.Instance.OnSignEvent -= Display;
|
| | | }
|
| | |
|
| | |
|
| | | void Display()
|
| | | {
|
| | | for (int i = 0; i < signCells.Length; i++)
|
| | | {
|
| | | signCells[i].Display(i);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/DayMission/SignWin.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 49080bb35cc18c747b6c174d3e69918b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | baseCanGetAwardRect.SetActive(baseAwardState == 1); |
| | | mask.SetActive(baseAwardState == 0); |
| | | |
| | | var ids = ZhanlingConfig.GetTypeToIDDict(BattlePassManager.WeekBattlePassType).Values.ToList(); |
| | | var ids = ZhanlingConfig.GetTypeToIDDict((int)BattlePassType.Week).Values.ToList(); |
| | | ids.Sort(); |
| | | upProcssBGRect.SetActive(ids[0] != id); |
| | | upProcessRect.SetActive(baseAwardState != 0); |
| | |
| | | return; |
| | | } |
| | | |
| | | BattlePassManager.Instance.GetAllAward(battlePassData, BattlePassManager.WeekBattlePassType, (int)battlePassData.value1); |
| | | BattlePassManager.Instance.GetAllAward(battlePassData, (int)BattlePassType.Week, (int)battlePassData.value1); |
| | | } |
| | | } |
| | | |
| | |
| | | {
|
| | | buyBtn.AddListener(() =>
|
| | | {
|
| | | RechargeManager.Instance.CTG(BattlePassManager.Instance.GetCTGIDByType(BattlePassManager.WeekBattlePassType));
|
| | | RechargeManager.Instance.CTG(BattlePassManager.Instance.GetCTGIDByType((int)BattlePassType.Week));
|
| | | });
|
| | | }
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | battlePassData = BattlePassManager.Instance.GetBattlePassData(BattlePassManager.WeekBattlePassType);
|
| | | battlePassData = BattlePassManager.Instance.GetBattlePassData((int)BattlePassType.Week);
|
| | | if (battlePassData == null) return;
|
| | | scroller.OnRefreshCell += OnRefreshCell;
|
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
|
| | |
| | |
|
| | | void BattlePassDataUpdateEvent(int type)
|
| | | {
|
| | | if (type == BattlePassManager.WeekBattlePassType)
|
| | | if (type == (int)BattlePassType.Week)
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
| | |
|
| | | if (battlePassData.isActivite == 0)
|
| | | {
|
| | | var ctgID = BattlePassManager.Instance.GetCTGIDByType(BattlePassManager.WeekBattlePassType);
|
| | | var ctgID = BattlePassManager.Instance.GetCTGIDByType((int)BattlePassType.Week);
|
| | | RechargeManager.Instance.TryGetOrderInfo(ctgID, out var orderInfoConfig);
|
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale);
|
| | | buyBtn.SetInteractable(true);
|
| | |
| | | void CreateScroller()
|
| | | {
|
| | | scroller.Refresh();
|
| | | var values = ZhanlingConfig.GetTypeToIDDict(BattlePassManager.WeekBattlePassType).Values.ToList();
|
| | | var values = ZhanlingConfig.GetTypeToIDDict((int)BattlePassType.Week).Values.ToList();
|
| | | values.Sort();
|
| | | for (int i = 0; i < values.Count; i++)
|
| | | {
|
| | |
| | | }
|
| | | scroller.Restart();
|
| | |
|
| | | scroller.JumpIndex(BattlePassManager.Instance.JumpIndex(battlePassData, BattlePassManager.WeekBattlePassType, (int)battlePassData.value1));
|
| | | scroller.JumpIndex(BattlePassManager.Instance.JumpIndex(battlePassData, (int)BattlePassType.Week, (int)battlePassData.value1));
|
| | | }
|
| | |
|
| | |
|
| | |
| | | { |
| | | equipedText.SetActive(false); |
| | | fightPowerGO.SetActive(true); |
| | | decomposeObject.SetActive(true); |
| | | btnsGO.SetActive(true); |
| | | decomposeCheck.isOn = isToggle; |
| | | |
| | | if (oldEquip == null) |
| | | { |
| | | decomposeObject.SetActive(false); |
| | | exchangeButton.SetActive(false); |
| | | putonButton.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | decomposeObject.SetActive(true); |
| | | exchangeButton.SetActive(true); |
| | | putonButton.SetActive(false); |
| | | } |
| | | |
| | | |
| | | long showFightPower = FightPowerManager.Instance.GetFightPowerChange(EquipModel.Instance.selectFloorEquip); |
| | | |
| | | if (showFightPower < 0) |
| | |
| | | public const int TotleEquip = 12; //装备栏大小 |
| | | public bool waitEquipOPPack = false; // 穿戴装备的操作 不含分解 |
| | | public event Action<bool, int> OnEquipOPResultAction; //是否换上了新装备且分解了 装备索引 |
| | | public event Action<List<int>, RectTransform> OnItemDropEvent; |
| | | public event Action<BattleDrops> OnItemDropEvent; |
| | | |
| | | //用于飘动逻辑 |
| | | // public Dictionary<int, EquipOnFloorInfo> equipFloorInfo = new Dictionary<int, EquipOnFloorInfo>(); //真实背包的索引,对应地板装备的信息 |
| | |
| | | if (!string.IsNullOrEmpty(guid)) |
| | | return; |
| | | |
| | | lastDropIndexs = drops.dropItemPackIndex; |
| | | // lastDropIndexs = drops.dropItemPackIndex; |
| | | // Debug.Log("-掉落装备 " + lastDropIndexs.Count + " 个" + JsonMapper.ToJson(lastDropIndexs)); |
| | | NotifyItemDrop(drops.dropItemPackIndex, drops.rectTransform); |
| | | NotifyItemDrop(drops); |
| | | action?.Invoke(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //掉落通知 |
| | | public void NotifyItemDrop(List<int> indexs, RectTransform rect) |
| | | public void NotifyItemDrop(BattleDrops drops)//(List<int> indexs, RectTransform rect) |
| | | { |
| | | // 界面不显示则立即处理 |
| | | // if (!UIManager.Instance.IsOpened<HomeWin>()) |
| | |
| | | // { |
| | | // OnItemDropEvent?.Invoke(indexs, rect); |
| | | // } |
| | | OnItemDropEvent?.Invoke(indexs, rect); |
| | | OnItemDropEvent?.Invoke(drops); |
| | | } |
| | | |
| | | public void CalcFloorEquip(int itemIndex) |
| | |
| | | [SerializeField] FloorItemCell floorItemCell; //非装备显示组件
|
| | | [SerializeField] MoneyMoveByPath moneyMoveByPathCell; //掉落物金钱
|
| | | [SerializeField] RectTransform defaultDropRect; //默认掉落位置
|
| | |
|
| | | [SerializeField] Text[] expTexts;
|
| | | FloorItemCell[] floorItemCells = new FloorItemCell[20]; //包含非装备的战利品掉落
|
| | | MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[20]; //掉落货币,金钱,经验等
|
| | |
|
| | |
| | | Display(true, EquipModel.Instance.lastDropIndexs);
|
| | | EquipModel.Instance.OnItemDropEvent += NotifyPlayItemDrop;
|
| | | PackManager.Instance.DeleteItemEvent += DeleteDropItem;
|
| | | for (int i = 0; i < expTexts.Length; i++)
|
| | | {
|
| | | expTexts[i].text = "";
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | void NotifyPlayItemDrop(List<int> itemIndexs, RectTransform rect)
|
| | | void NotifyPlayItemDrop(BattleDrops drops)
|
| | | {
|
| | | Display(true, itemIndexs, rect);
|
| | | if (drops.dropItemPackIndex.Count > 0)
|
| | | {
|
| | | Display(true, drops.dropItemPackIndex, drops.rectTransform);
|
| | | }
|
| | | DisplayExp(drops);
|
| | | }
|
| | |
|
| | | int expIndex = 0;
|
| | | void DisplayExp(BattleDrops drops)
|
| | | {
|
| | | // startPos = new Vector2(transform.localPosition.x + UnityEngine.Random.Range(-30, 30), transform.localPosition.y + UnityEngine.Random.Range(50, 100));
|
| | |
|
| | | if (drops.expDrops.Count > 0)
|
| | | {
|
| | | var nowIndex = expIndex;
|
| | | expTexts[nowIndex].text = "E+" + (drops.expDrops[0].Exp + drops.expDrops[0].ExpPoint * Constants.ExpPointValue);
|
| | | expTexts[nowIndex].transform.position = drops.rectTransform.position;
|
| | | expTexts[nowIndex].transform.DOLocalMove(expTexts[nowIndex].transform.localPosition + new Vector3(0, 20, 0), 1f).SetEase(Ease.InOutSine).onComplete = () =>
|
| | | {
|
| | | expTexts[nowIndex].text = "";
|
| | | };
|
| | | |
| | | expIndex = (expIndex + 1) % 6;
|
| | | }
|
| | | }
|
| | |
|
| | | void DeleteDropItem(PackType packType, string guid, int itemID, int index, int clearType)
|
| | | {
|
| | |
| | | return firstChargeInfoDict.TryGetValue(firstId, out firstChargeData); |
| | | } |
| | | |
| | | //所有的战斗死亡弹首充,置顶在战斗失败界面上即可,若首充充完则无须响应,不会死亡的不需要 |
| | | public void TryPopWin(string battleName) |
| | | { |
| | | if (battleName == null || battleName == string.Empty) |
| | | return; |
| | | if (battleName == "TianziBillboradBattleField") |
| | | return; |
| | | if (!TryGetUnBuyFirstId(out int firstId)) |
| | | return; |
| | | if (!UIManager.Instance.IsOpened<FirstChargeWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<FirstChargeWin>(); |
| | | } |
| | | } |
| | | |
| | | public bool TryGetUnBuyFirstId(out int firstId) |
| | | { |
| | | firstId = 0; |
| | |
| | | |
| | | [Header("购买和领取")] |
| | | [SerializeField] ImageEx imgHave; |
| | | [SerializeField] ImageEx imgNoHave; |
| | | [SerializeField] ImageEx imgRed; |
| | | [SerializeField] TextEx txtHave; |
| | | [SerializeField] ButtonEx btnHave; |
| | |
| | | int awardState = firstChargeData.GetHaveState(day); |
| | | bool isAllHave = firstChargeData.IsAllHave(); |
| | | btnHave.interactable = awardState == 2; |
| | | imgNoHave.SetActive(awardState != 2); |
| | | imgHave.SetActive(awardState == 2); |
| | | imgHave.gray = awardState != 2; |
| | | imgRed.SetActive(awardState == 2); |
| | | if (awardState == 2) |
| | | { |
| | |
| | | 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, HeroUIManager.Instance.GetJobName(index + 1)); |
| | | lineText = (k == 0 ? "" : "</r>") + Language.Get("herocard37", countStr, HeroUIManager.Instance.GetCountryName(index + 1)); |
| | | var attrConfig = attrDict[count]; |
| | | for (int i = 0; i < attrConfig.AttrIDList.Length; i++) |
| | | { |
| | |
| | | return selectHeroList; |
| | | } |
| | | |
| | | //!!!新排序规则 |
| | | //若在新手引导(引导ID)中,如果5号位为空,则优先放置5号位 |
| | | //按战力排序 |
| | | int CmpHeroRecommend(string guidA, string guidB) |
| | | { |
| | | HeroInfo heroA = HeroManager.Instance.GetHero(guidA); |
| | |
| | | } |
| | | |
| | | // // 排序规则:武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID |
| | | // if (heroA.heroLevel != heroB.heroLevel) |
| | | // { |
| | | // return heroA.heroLevel > heroB.heroLevel ? -1 : 1; |
| | | // } |
| | | // if (heroA.breakLevel != heroB.breakLevel) |
| | | // { |
| | | // return heroA.breakLevel > heroB.breakLevel ? -1 : 1; |
| | | // } |
| | | // if (heroA.awakeLevel != heroB.awakeLevel) |
| | | // { |
| | | // return heroA.awakeLevel > heroB.awakeLevel ? -1 : 1; |
| | | // } |
| | | // if (heroA.Quality != heroB.Quality) |
| | | // { |
| | | // return heroA.Quality > heroB.Quality ? -1 : 1; |
| | | // } |
| | | // if (heroA.heroStar != heroB.heroStar) |
| | | // { |
| | | // return heroA.heroStar > heroB.heroStar ? -1 : 1; |
| | | // } |
| | | if (heroA.heroLevel != heroB.heroLevel) |
| | | { |
| | | return heroA.heroLevel > heroB.heroLevel ? -1 : 1; |
| | | } |
| | | if (heroA.breakLevel != heroB.breakLevel) |
| | | { |
| | | return heroA.breakLevel > heroB.breakLevel ? -1 : 1; |
| | | } |
| | | if (heroA.awakeLevel != heroB.awakeLevel) |
| | | { |
| | | return heroA.awakeLevel > heroB.awakeLevel ? -1 : 1; |
| | | } |
| | | if (heroA.Quality != heroB.Quality) |
| | | { |
| | | return heroA.Quality > heroB.Quality ? -1 : 1; |
| | | } |
| | | if (heroA.heroStar != heroB.heroStar) |
| | | { |
| | | return heroA.heroStar > heroB.heroStar ? -1 : 1; |
| | | } |
| | | |
| | | return heroA.heroId.CompareTo(heroB.heroId); |
| | | |
| | | |
| | | return heroB.CalculateFightPower(false).CompareTo(heroA.CalculateFightPower(false)); |
| | | } |
| | | |
| | | int CmpByJob(string guidA, string guidB) |
| | |
| | | [SerializeField] Text playerLevelText; |
| | | [SerializeField] SmoothSlider expSlider; |
| | | [SerializeField] Button officialUpBtn; |
| | | [SerializeField] Transform officialTip; |
| | | |
| | | //任务区 |
| | | [SerializeField] Button taskButton; //引导或者领取任务奖励 |
| | |
| | | DisplayRestState(); |
| | | |
| | | funcColBtn.SetActive(FuncOpen.Instance.IsFuncOpen(GeneralDefine.mainRightFuncOpenFuncID)); |
| | | officialTip.SetActive(OfficialRankManager.Instance.CanOfficialLVUP()); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | FirstChargeManager.Instance.OnUpdateFirstChargeInfo += OnUpdateFirstChargeInfo; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | HeroUIManager.Instance.OnUnLockHeroCountEvent += OnUnLockHeroCountEvent; |
| | | OfficialRankManager.Instance.OnOfficialCanLVUpEvent += OnOfficialCanLVUpEvent; |
| | | Display(); |
| | | DisplayFirstChargeBtn(); |
| | | |
| | |
| | | FirstChargeManager.Instance.OnUpdateFirstChargeInfo -= OnUpdateFirstChargeInfo; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | HeroUIManager.Instance.OnUnLockHeroCountEvent -= OnUnLockHeroCountEvent; |
| | | OfficialRankManager.Instance.OnOfficialCanLVUpEvent -= OnOfficialCanLVUpEvent; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | | } |
| | | |
| | | void OnOfficialCanLVUpEvent() |
| | | { |
| | | officialTip.SetActive(OfficialRankManager.Instance.CanOfficialLVUP()); |
| | | } |
| | | |
| | | private void OnClickEnterBoss() |
| | |
| | | case PlayerDataType.ExAttr1: |
| | | case PlayerDataType.ExAttr2: |
| | | DisplayLevel(); |
| | | break; |
| | | |
| | | case PlayerDataType.RealmLevel: |
| | | OnOfficialCanLVUpEvent(); |
| | | break; |
| | | } |
| | | |
| | |
| | | { |
| | | taskButton.SetActive(true); |
| | | var taskConfig = TaskConfig.Get(task.TaskID); |
| | | if (taskConfig == null) |
| | | { |
| | | Debug.LogError("找不到任务 " + task.TaskID); |
| | | return; |
| | | } |
| | | taskText.text = taskConfig.TaskDescribe; |
| | | taskNumText.text = string.Format("({0}/{1})", task.CurValue, taskConfig.NeedValue); |
| | | taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red); |
| | |
| | | [SerializeField] Button storeBtn; |
| | | [SerializeField] Button monthCardBtn; |
| | | [SerializeField] Button dayMissionBtn; |
| | | [SerializeField] Button battlePassBtn; |
| | | [SerializeField] Button llmjBtn; //历练秘笈 |
| | | [SerializeField] Button signBtn; |
| | | |
| | | string listenWindowName = ""; //监听关闭时再显示 |
| | | static string listenWindowName = ""; //监听关闭时再显示 |
| | | |
| | | bool isShow = false; |
| | | void Awake() |
| | |
| | | ListenWindow("DayMissionBaseWin"); |
| | | UIManager.Instance.OpenWindow<DayMissionBaseWin>(); |
| | | }); |
| | | |
| | | battlePassBtn.AddListener(() => |
| | | { |
| | | //用于监听界面,打开时缩进右边功能栏,关闭时显示 |
| | | ListenWindow("BattlePassBaseWin"); |
| | | UIManager.Instance.OpenWindow<BattlePassBaseWin>(); |
| | | }); |
| | | |
| | | llmjBtn.AddListener(() => |
| | | { |
| | | //用于监听界面,打开时缩进右边功能栏,关闭时显示 |
| | | ListenWindow("ExpSecretCollectionWin"); |
| | | UIManager.Instance.OpenWindow<ExpSecretCollectionWin>(); |
| | | }); |
| | | |
| | | signBtn.AddListener(() => |
| | | { |
| | | //用于监听界面,打开时缩进右边功能栏,关闭时显示 |
| | | ListenWindow("SignWin"); |
| | | UIManager.Instance.OpenWindow<SignWin>(); |
| | | }); |
| | | } |
| | | |
| | | void ShowBtns() |
| | | { |
| | | storeBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)); |
| | | dayMissionBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DayMission)); |
| | | battlePassBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.BattlePass)); |
| | | llmjBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.LLMJ)); |
| | | signBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DaySign)); |
| | | // monthCardBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.MonthCard)); |
| | | } |
| | | |
| | | |
| | |
| | | listenWindowName = _listenWindowName; |
| | | } |
| | | |
| | | public static void RemoveListenWindow() |
| | | { |
| | | listenWindowName = ""; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | // } |
| | | } |
| | | break; |
| | | case "success": |
| | | { |
| | | var _id = 0; |
| | | if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id)) |
| | | { |
| | | var _cfg = SuccessConfig.Get(_id); |
| | | if (_cfg != null) |
| | | { |
| | | return _cfg.Describe; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | // case "success": |
| | | // { |
| | | // var _id = 0; |
| | | // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id)) |
| | | // { |
| | | // var _cfg = SuccessConfig.Get(_id); |
| | | // if (_cfg != null) |
| | | // { |
| | | // return _cfg.Describe; |
| | | // } |
| | | // } |
| | | // } |
| | | // break; |
| | | |
| | | case "treasureprivilege": |
| | | { |
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
|
| | | UIManager.Instance.OnOpenWindow += OnOpenWindow;
|
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow;
|
| | | OfficialRankManager.Instance.OnOfficialCanLVUpEvent += OnOfficialCanLVUpEvent;
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
|
| | | UIManager.Instance.OnOpenWindow -= OnOpenWindow;
|
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow;
|
| | | OfficialRankManager.Instance.OnOfficialCanLVUpEvent -= OnOfficialCanLVUpEvent;
|
| | | }
|
| | |
|
| | | void OnOfficialCanLVUpEvent()
|
| | | {
|
| | | var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.Realm);
|
| | | if (guides != null)
|
| | | {
|
| | | TryStartNewBieGuides(guides, true);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnOpenWindow(UIBase _ui)
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | if (currentGuide != 0)
|
| | | if (currentGuide != 0 && GuideConfig.Get(currentGuide).NoRecord == 0)
|
| | | {
|
| | | // 可重复触发的引导属于低优先级 会被新引导替换
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | Debug.LogError("请检查引导id = 0 的情况");
|
| | | return false;
|
| | | }
|
| | |
|
| | | _id = ReplaceGuideID(_id);
|
| | |
|
| | | var config = GuideConfig.Get(_id);
|
| | | if (config == null)
|
| | |
| | | return FuncOpen.Instance.IsFuncOpen(config.Condition);
|
| | | case GuideTriggerType.Level:
|
| | | return PlayerDatas.Instance.baseData.LV >= config.Condition;
|
| | | case GuideTriggerType.Realm:
|
| | | return PlayerDatas.Instance.baseData.realmLevel >= config.Condition && OfficialRankManager.Instance.CanOfficialLVUP();
|
| | | case GuideTriggerType.OpenWindow:
|
| | | return UIManager.Instance.IsOpened(config.WinName);
|
| | | case GuideTriggerType.MainLineQuestCanDo:
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | //动态变化引导
|
| | | public int ReplaceGuideID(int id)
|
| | | {
|
| | | if (id == BattleManager.Instance.challengeBossGuides[0] && MainLevelManager.Instance.CanChallengeBoss())
|
| | | {
|
| | | return BattleManager.Instance.challengeBossGuides[1];
|
| | | }
|
| | |
|
| | | return id;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | MissionClick = 4, //点击任务按任务类型引导
|
| | | OpenWindow = 5, //打开界面的时机 如装备替换界面
|
| | | Level = 6, //等级满足条件
|
| | | Realm = 7, //官职所有任务完成时触发引导,如6升7,6的任务全部完成,配置6
|
| | |
|
| | | } |
| | |
| | | int taskAwardState;
|
| | | Dictionary<int, int> taskValues = new Dictionary<int, int>();
|
| | | public event Action RealmMissionRefreshEvent;
|
| | | public event Action OnOfficialCanLVUpEvent; //检测到可以升官职
|
| | |
|
| | | public Dictionary<int, int> mainLevelDict = new Dictionary<int, int>(); //id:索引 用于判断还需多少关
|
| | |
|
| | | public Dictionary<int, int> guideDict = new Dictionary<int, int>();
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
|
| | |
| | | var levelList = MainLevelConfig.GetKeys().ToList();
|
| | | levelList.Sort();
|
| | | for (int i = 0; i < levelList.Count; i++)
|
| | | { |
| | | {
|
| | | mainLevelDict[levelList[i]] = i;
|
| | | }
|
| | |
|
| | | ParseConfig();
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | |
| | | {
|
| | | taskValues.Clear();
|
| | | taskAwardState = 0;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var config = FuncConfigConfig.Get("Official");
|
| | | guideDict = ConfigParse.ParseIntDict(config.Numerical1);
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | return PlayerDatas.Instance.baseData.ExAttr1 / 100 > config.NeedValueList[0] ? 1 : 0;
|
| | | case 3:
|
| | | return taskValues.ContainsKey(missionID) && taskValues[missionID] >= config.NeedValueList[0] ? 1 : 0;
|
| | | |
| | | case 4:
|
| | | return BlessLVManager.Instance.m_TreeLV >= config.NeedValueList[0] ? 1 : 0;
|
| | |
|
| | | default:
|
| | | return 0;
|
| | | }
|
| | |
| | | finish = false;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (finish)
|
| | | redpoint.state = RedPointState.Simple;
|
| | |
|
| | | CanOfficialLVUP(true);
|
| | | }
|
| | |
|
| | |
|
| | | public bool CanOfficialLVUP(bool notifyEvent = false)
|
| | | {
|
| | | //只要任务完成即可
|
| | | var ids = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
|
| | | foreach (var id in ids)
|
| | | {
|
| | | if (GetMissionState(PlayerDatas.Instance.baseData.realmLevel, id) == 0)
|
| | | return false;
|
| | | }
|
| | | |
| | | if (notifyEvent)
|
| | | OnOfficialCanLVUpEvent?.Invoke();
|
| | | return true;
|
| | | }
|
| | |
|
| | |
|
| | | public Color GetOfficialRankColor(int quality)
|
| | |
| | | getAwardImg.SetActive(state == 1); |
| | | getAwardEffect.SetActive(state == 1); |
| | | bgImg.SetSprite(state == 0 ? "OfficialMissionBG0" : "OfficialMissionBG1"); |
| | | switch (config.TaskType) |
| | | var type = config.TaskType; |
| | | switch (type) |
| | | { |
| | | case 1: |
| | | case 3: |
| | | case 4: |
| | | taskName.text = Language.Get("OfficialMission" + config.TaskType, config.NeedValueList[0]); |
| | | taskName.text = Language.Get("OfficialMission" + type, config.NeedValueList[0]); |
| | | break; |
| | | case 2: |
| | | var mainLVConfig = MainLevelConfig.Get(config.NeedValueList[0]); |
| | |
| | | taskReward.Init(new ItemCellModel(itemID, false, config.AwardItemList[0][1])); |
| | | taskReward.button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | if (state == 0) |
| | | { |
| | | UIManager.Instance.CloseWindow<OfficialUpWin>(); |
| | | NewBieCenter.Instance.StartNewBieGuide(OfficialRankManager.Instance.guideDict[type]); |
| | | return; |
| | | } |
| | | else if (state == 2) |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | return; |
| | | } |
| | | |
| | | OfficialRankManager.Instance.RequestAllAwards(id); |
| | | |
| | | }); |
| | | |
| | | getBtn.AddListener(() => |
| | | { |
| | | if (state != 1) |
| | | if (state == 0) |
| | | { |
| | | UIManager.Instance.CloseWindow<OfficialUpWin>(); |
| | | NewBieCenter.Instance.StartNewBieGuide(OfficialRankManager.Instance.guideDict[type]); |
| | | return; |
| | | } |
| | | else if (state == 2) |
| | | { |
| | | return; |
| | | } |
| | | OfficialRankManager.Instance.RequestAllAwards(id); |
| | | }); |
| | | |
| | |
| | | [SerializeField] Image officialIcon; |
| | | [SerializeField] Image officialNextIcon; |
| | | [SerializeField] Button closeBtn; |
| | | [SerializeField] Text addLVText; |
| | | [SerializeField] PositionTween[] paopaoArr; |
| | | [SerializeField] Text[] paopaoTextArrName; |
| | | [SerializeField] Text[] paopaoTextArrValue; |
| | |
| | | for (int i = 0; i < paopaoArr.Length; i++) |
| | | { |
| | | paopaoArr[i].Play(); |
| | | paopaoTextArrName[i].text = PlayerPropertyConfig.Get(nextConfig.AddAttrType[i]).Name; |
| | | paopaoTextArrValue[i].text = "+" + PlayerPropertyConfig.GetValueDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]); |
| | | if (i < nextConfig.AddAttrType.Length) |
| | | { |
| | | paopaoTextArrName[i].text = PlayerPropertyConfig.Get(nextConfig.AddAttrType[i]).Name; |
| | | paopaoTextArrValue[i].text = "+" + PlayerPropertyConfig.GetValueDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]); |
| | | } |
| | | } |
| | | |
| | | addLVText.text = "+" + (nextConfig.LVMax - config.LVMax); |
| | | |
| | | RefreshBtn(); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //所有泡泡飞向按钮 |
| | | for (int i = 0; i < paopaoArr.Length; i++) |
| | | { |
| | | paopaoArr[i].Stop(); |
| | | paopaoArr[i].transform.DOLocalMove(lvUpBtn.transform.localPosition, 0.4f); |
| | | } |
| | | effectPlayer.Play(); |
| | | |
| | | upEffect.onComplete = () => |
| | | { |
| | | CA523_tagCMRealmLVUp pak = new CA523_tagCMRealmLVUp(); |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | }; |
| | | upEffect.Play(); |
| | | |
| | | effectPlayer.onComplete = () => |
| | | { |
| | | upEffect.Play(); |
| | | }; |
| | | |
| | | //所有泡泡飞向按钮 |
| | | for (int i = 0; i < paopaoArr.Length; i++) |
| | | { |
| | | int index = i; |
| | | paopaoArr[i].Stop(); |
| | | paopaoArr[i].transform.DOLocalMove(lvUpBtn.transform.localPosition, 0.3f).onComplete = () => |
| | | { |
| | | if (index == 0) |
| | | { |
| | | effectPlayer.Play(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | {
|
| | | if (m_AvatarImage == null)
|
| | | {
|
| | | m_AvatarImage = this.GetComponent<ImageEx>("AvatarCell/Img_Avatar");
|
| | | m_AvatarImage = this.GetComponent<ImageEx>("AvatarCell/Img_BG/Img_AvatarFrame/GameObject/Img_Avatar");
|
| | | }
|
| | | return m_AvatarImage;
|
| | | }
|
| | |
| | | {
|
| | | if (m_AvatarFrameImage == null)
|
| | | {
|
| | | m_AvatarFrameImage = this.GetComponent<ImageEx>("AvatarCell/Img_AvatarFrame");
|
| | | m_AvatarFrameImage = this.GetComponent<ImageEx>("AvatarCell/Img_BG/Img_AvatarFrame");
|
| | | }
|
| | | return m_AvatarFrameImage;
|
| | | }
|
| | |
| | | {
|
| | | if (m_button == null)
|
| | | {
|
| | | m_button = this.GetComponent<ButtonEx>("AvatarCell/Img_AvatarFrame");
|
| | | m_button = this.GetComponent<ButtonEx>("AvatarCell/Img_BG");
|
| | | }
|
| | | return m_button;
|
| | | }
|
| | |
| | | {
|
| | | if (m_AvatarUIFrame == null)
|
| | | {
|
| | | m_AvatarUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_Avatar");
|
| | | m_AvatarUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_BG/Img_AvatarFrame/GameObject/Img_Avatar");
|
| | | }
|
| | | return m_AvatarUIFrame;
|
| | | }
|
| | |
| | | {
|
| | | if (m_AvatarFrameUIFrame == null)
|
| | | {
|
| | | m_AvatarFrameUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_AvatarFrame");
|
| | | m_AvatarFrameUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_BG/Img_AvatarFrame");
|
| | | }
|
| | | return m_AvatarFrameUIFrame;
|
| | | }
|
| | |
| | | {
|
| | | if (m_AvatarUIEffect == null)
|
| | | {
|
| | | m_AvatarUIEffect = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_Avatar");
|
| | | m_AvatarUIEffect = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_BG/Img_AvatarFrame/GameObject/Img_Avatar");
|
| | | }
|
| | | return m_AvatarUIEffect;
|
| | | }
|
| | |
| | | {
|
| | | if (m_AvatarFrameUIEffect == null)
|
| | | {
|
| | | m_AvatarFrameUIEffect = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_AvatarFrame");
|
| | | m_AvatarFrameUIEffect = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_BG/Img_AvatarFrame");
|
| | | }
|
| | | return m_AvatarFrameUIEffect;
|
| | | }
|
| | |
| | | using LitJson;
|
| | | using System;
|
| | |
|
| | |
|
| | | //每日特惠
|
| | | public class DailySpecialsModel : GameSystemManager<DailySpecialsModel>
|
| | | {
|
| | | public uint PackBuyTime; // 打包购买的时间戳,如果有该值,代表已经一次性打包购买了,可根据次时间戳算出当前是第几天
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class ExpSecretCollectionCell : CellView |
| | | { |
| | | |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Image targetBGImg; |
| | | [SerializeField] Transform upProcessBG; |
| | | [SerializeField] Transform upProcessImg; |
| | | [SerializeField] Transform downProcessBG; |
| | | [SerializeField] Transform downProcessImg; |
| | | [SerializeField] Transform unlockRect1; |
| | | [SerializeField] Transform unlockRect2; |
| | | [SerializeField] Text unlockValueText; |
| | | [SerializeField] Text addExpPerText; |
| | | [SerializeField] Text addMoneyPerText; |
| | | [SerializeField] Transform mask; |
| | | [SerializeField] Transform canActiveRect; |
| | | [SerializeField] Transform activeRect; |
| | | [SerializeField] Button avtiveBtn; |
| | | |
| | | |
| | | |
| | | public void Display(int id) |
| | | { |
| | | var config = LLMJConfig.Get(id); |
| | | var lv = config.MJLV; |
| | | lvText.text = Language.Get("Arena22", lv); |
| | | targetBGImg.SetOrgSprite(lv <= ExpSecretCollectionManager.Instance.m_MJLV ? "ExpSecret_img_43" : "ExpSecret_img_41", "LLMJ"); |
| | | |
| | | var ids = LLMJConfig.GetKeys(); |
| | | ids.Sort(); |
| | | upProcessBG.SetActive(ids[0] != id); |
| | | upProcessImg.SetActive(ExpSecretCollectionManager.Instance.m_MJLV >= lv); |
| | | |
| | | downProcessBG.SetActive(ids[ids.Count - 1] != id); |
| | | downProcessImg.SetActive(ExpSecretCollectionManager.Instance.m_MJLV > lv); |
| | | |
| | | unlockRect1.SetActive(lv == 1); |
| | | unlockRect2.SetActive(lv != 1); |
| | | |
| | | unlockValueText.text = config.CostWarhammer.ToString(); |
| | | addExpPerText.text = Language.Get("LLMJ6", config.ExpAddPer); |
| | | addMoneyPerText.text = Language.Get("LLMJ7", config.DecomposeAddPer); |
| | | mask.SetActive(ExpSecretCollectionManager.Instance.m_MJLV < lv); |
| | | activeRect.SetActive(ExpSecretCollectionManager.Instance.m_MJLV == lv); |
| | | canActiveRect.SetActive(ExpSecretCollectionManager.Instance.m_MJLV != 0 && |
| | | ExpSecretCollectionManager.Instance.m_MJLV + 1 == lv && ExpSecretCollectionManager.Instance.m_Zhanchui >= config.CostWarhammer); |
| | | |
| | | avtiveBtn.AddListener(() => |
| | | { |
| | | if (ExpSecretCollectionManager.Instance.m_MJLV != 0 && |
| | | ExpSecretCollectionManager.Instance.m_MJLV + 1 == lv && ExpSecretCollectionManager.Instance.m_Zhanchui >= config.CostWarhammer) |
| | | { |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 2; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | SysNotifyMgr.Instance.ShowTip("Success"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/Recharge/ExpSecretCollectionCell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 01c0ae104c52aa9498987271cc2d2e7b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine.UI;
|
| | | using System.Linq;
|
| | | using LitJson;
|
| | | using System;
|
| | |
|
| | | // 历练秘笈
|
| | | public class ExpSecretCollectionManager : GameSystemManager<ExpSecretCollectionManager>
|
| | | {
|
| | | public int ctgID;
|
| | |
|
| | | public byte m_MJLV; // 秘笈等级,激活后从1开始
|
| | | public uint m_Zhanchui; // 秘笈累计消耗战锤
|
| | | public uint m_ExpEx; // 秘笈今日已额外获得经验
|
| | | public uint m_DecomposeEx; // 秘笈今日已额外获得分解货币
|
| | |
|
| | | public event Action UpdateExpSecretCollectionEvent;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | var config = FuncConfigConfig.Get("LLMJ");
|
| | | ctgID = int.Parse(config.Numerical1);
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | }
|
| | |
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | m_MJLV = 0;
|
| | | m_Zhanchui = 0;
|
| | | m_ExpEx = 0;
|
| | | m_DecomposeEx = 0;
|
| | | }
|
| | |
|
| | | public void OnExpSecretCollection(HB128_tagSCLLMJInfo netPack)
|
| | | {
|
| | | m_MJLV = netPack.MJLV;
|
| | | m_Zhanchui = netPack.Zhanchui;
|
| | | m_ExpEx = netPack.ExpEx;
|
| | | m_DecomposeEx = netPack.DecomposeEx;
|
| | | UpdateExpSecretCollectionEvent?.Invoke();
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | public Redpoint redPointLLMJ = new Redpoint(MainRedDot.RightFuncRedpoint, MainRedDot.RedPoint_LLMJKey);
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | if (m_MJLV == 0) return;
|
| | | var nextConfig = LLMJConfig.Get(m_MJLV + 1);
|
| | | if (nextConfig == null) return;
|
| | | if (m_Zhanchui >= nextConfig.CostWarhammer)
|
| | | {
|
| | | redPointLLMJ.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | redPointLLMJ.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/Recharge/ExpSecretCollectionManager.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 37633ce5681dc8540baa735cdc7b4c2d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | //历练秘笈 |
| | | public class ExpSecretCollectionWin : UIBase |
| | | { |
| | | [SerializeField] Text costzcText; |
| | | [SerializeField] Text addExpText; |
| | | [SerializeField] Text addMoneyText; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] Button buyBtn; |
| | | [SerializeField] Text buyText; |
| | | [SerializeField] Transform buyYetRect; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | buyBtn.AddListener(() => |
| | | { |
| | | RechargeManager.Instance.CTG(ExpSecretCollectionManager.Instance.ctgID); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | ExpSecretCollectionManager.Instance.UpdateExpSecretCollectionEvent += OnExpSecretCollectionEvent; |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | CreateScroller(); |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | ExpSecretCollectionManager.Instance.UpdateExpSecretCollectionEvent -= OnExpSecretCollectionEvent; |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | |
| | | void CreateScroller() |
| | | { |
| | | scroller.Refresh(); |
| | | var keys = LLMJConfig.GetKeys(); |
| | | keys.Sort(); |
| | | foreach (var key in keys) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, key); |
| | | } |
| | | scroller.Restart(); |
| | | scroller.JumpIndex(ExpSecretCollectionManager.Instance.m_MJLV - 1); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell as ExpSecretCollectionCell; |
| | | _cell.Display(cell.index); |
| | | } |
| | | |
| | | void OnExpSecretCollectionEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | costzcText.text = ExpSecretCollectionManager.Instance.m_Zhanchui >= 1000000 ? |
| | | UIHelper.ReplaceLargeNum(ExpSecretCollectionManager.Instance.m_Zhanchui) : |
| | | ExpSecretCollectionManager.Instance.m_Zhanchui.ToString(); |
| | | |
| | | var config = LLMJConfig.Get(ExpSecretCollectionManager.Instance.m_MJLV); |
| | | |
| | | if (ExpSecretCollectionManager.Instance.m_MJLV == 0) |
| | | { |
| | | addExpText.text = "0"; |
| | | addMoneyText.text = "0"; |
| | | } |
| | | else |
| | | { |
| | | addExpText.text = ExpSecretCollectionManager.Instance.m_ExpEx + "/" + config.ExpExUpper; |
| | | addMoneyText.text = ExpSecretCollectionManager.Instance.m_DecomposeEx + "/" + config.DecomposeExUpper; |
| | | } |
| | | |
| | | buyBtn.SetActive(ExpSecretCollectionManager.Instance.m_MJLV == 0); |
| | | RechargeManager.Instance.TryGetOrderInfo(ExpSecretCollectionManager.Instance.ctgID, out var orderInfoConfig); |
| | | buyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | buyYetRect.SetActive(ExpSecretCollectionManager.Instance.m_MJLV != 0); |
| | | |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/Recharge/ExpSecretCollectionWin.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 9b8d1a65440f5424daa7a543d9213479 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | {
|
| | | #endif
|
| | | var ctg = CTGConfig.Get(configs[i].CTGID);
|
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(ctg.GainItemList);
|
| | | var _itemArray = ctg.GainItemList;
|
| | | if (_itemArray != null && _itemArray.Length > 0)
|
| | | {
|
| | | var _itemList = new List<Item>();
|
| | |
| | | public const int RedPoint_WeekBPFuncKey = 1042; //周奖励(战令)
|
| | | public const int RedPoint_MainMissionKey = 1043; //主线任务奖励(成就)
|
| | |
|
| | | //基金(战令)
|
| | | public const int RedPoint_FundKey = 105;
|
| | | public Redpoint redPointFund = new Redpoint(RightFuncRedpoint, RedPoint_FundKey);
|
| | |
|
| | | //历练秘笈
|
| | | public const int RedPoint_LLMJKey = 106;
|
| | | |
| | | //签到
|
| | | public const int RedPoint_SignKey = 107;
|
| | | |
| | |
|
| | | |
| | | //武将卡
|
| | | public const int HeroCardRedpoint = 200;
|
| | | public Redpoint HeroListRedpoint = new Redpoint(MainHerosRedpoint, HeroCardRedpoint);
|
| | |
| | | { |
| | | TestParentValue(_redpoint.parent); |
| | | } |
| | | |
| | | |
| | | if (_redpoint.otherParent > 0) |
| | | { |
| | | TestParentValue(_redpoint.otherParent); |
| | |
| | | } |
| | | } |
| | | |
| | | public Redpoint GetRedpoint(int _id) |
| | | { |
| | | Redpoint redpoint = null; |
| | | if (this.redpoints.TryGetValue(_id, out redpoint)) |
| | | { |
| | | return redpoint; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | FirstChargeManager.Instance.TryPopWin("BattleFailWin"); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | int funcId = BoneFieldManager.Instance.funcId; |
| | | txtFuncName.text = FuncOpenLVConfig.HasKey(funcId) ? FuncOpenLVConfig.Get(funcId).Name : string.Empty; |
| | | FirstChargeManager.Instance.TryPopWin("BoneBattleFailWin"); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | [SerializeField] |
| | | [Tooltip("抛射的弧形最高点,相对于起点的高度(像素单位)。")] |
| | | float throwArcHeight = 150f; |
| | | float throwArcHeight = 150f; |
| | | |
| | | [SerializeField] |
| | | [Tooltip("抛射落地的最小垂直距离(像素单位),即比起点低多少。")] |
| | | float minThrowVerticalDrop = 120f; |
| | | float minThrowVerticalDrop = 120f; |
| | | |
| | | [SerializeField] |
| | | [Tooltip("抛射落地的最大垂直距离(像素单位),即比起点低多少。")] |
| | | float maxThrowVerticalDrop = 180f; |
| | | float maxThrowVerticalDrop = 180f; |
| | | |
| | | |
| | | [Header("2. 弹跳阶段")] |
| | |
| | | { |
| | | if (this != null && gameObject != null) |
| | | { |
| | | TianziBillboradManager.Instance.PlayUiEffectAction?.Invoke(); |
| | | Destroy(gameObject); |
| | | } |
| | | }); |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | public class TianziBillboradManager : GameSystemManager<TianziBillboradManager> |
| | | { |
| | | public readonly int rankType = 2; // 榜单类型 |
| | |
| | | public ulong todayHurt; //本考验今日最大伤害 |
| | | public bool isSkipSweepTip = false; |
| | | public event Action UpdateTianziKYInfoExent; |
| | | public Action PlayUiEffectAction; |
| | | public Dictionary<int, int[][]> rankAwards;// 每日排行奖励 {"名次":[[物品ID, 个数,是否拍品], ...], ...} 配置的名次key,自动按小于等于对应名次给奖励 |
| | | public Redpoint parentRedpoint = new Redpoint(MainRedDot.MainChallengeRedpoint, MainRedDot.TianziBillboradRepoint); |
| | | public override void Init() |
| | | { |
| | | EventBroadcast.Instance.AddListener<BattleDmgInfo>(EventName.BATTLE_DAMAGE_TAKEN, OnDamageTaken); |
| | | EventBroadcast.Instance.AddListener<string, JsonData>(EventName.BATTLE_END, OnSettlement); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent; |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent += OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent; |
| | |
| | | |
| | | public override void Release() |
| | | { |
| | | EventBroadcast.Instance.RemoveListener<BattleDmgInfo>(EventName.BATTLE_DAMAGE_TAKEN, OnDamageTaken); |
| | | EventBroadcast.Instance.RemoveListener<string, JsonData>(EventName.BATTLE_END, OnSettlement); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent; |
| | | DungeonManager.Instance.UpdateFBInfoChangeEvent -= OnUpdateFBInfoChangeEvent; |
| | | AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent; |
| | |
| | | todayLineID = 0; |
| | | historyHurt = 0; |
| | | todayHurt = 0; |
| | | |
| | | ClearBar(); |
| | | isSkipSweepTip = false; |
| | | } |
| | | |
| | | public int battleLineID; //正在战斗中的LineID |
| | | public ulong loaclNowHunt = 0; |
| | | public ulong loaclAllHunt = 0; |
| | | public ulong loaclMaxHp = 0; |
| | | public int loaclHpNum = 0; |
| | | public event Action<ulong, ulong, int> OnUpdateBarInfoEvent; |
| | | |
| | | private void OnDamageTaken(BattleDmgInfo info) |
| | | { |
| | | BattleField battleField = BattleManager.Instance.GetBattleFieldByMapID(DataMapID); |
| | | if (info == null || battleField == null || battleField.guid != info.battleFieldGuid) |
| | | return; |
| | | BattleObject boss = battleField.FindBoss(); |
| | | if (boss == null || boss.ObjID != info.hurtObj.ObjID) |
| | | return; |
| | | ShowBar(info); |
| | | } |
| | | |
| | | public void ShowBar(BattleDmgInfo info) |
| | | { |
| | | if (info == null) |
| | | return; |
| | | //闪避和回血类不算伤害 |
| | | if (info.IsType(DamageType.Dodge) || info.IsType(DamageType.Recovery)) |
| | | return; |
| | | var damages = info.damageList; |
| | | for (int i = 0; i < damages.Count; i++) |
| | | { |
| | | ulong hunt = (ulong)damages[i]; |
| | | loaclAllHunt += hunt; |
| | | if (!TryGetBossConfig(DataMapID, battleLineID, out DungeonConfig dungeonConfig, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig)) |
| | | return; |
| | | int bossId = npcConfig.NPCID; |
| | | if (!TianziConfig.TryGetTianziConfigByBossIDAndDamage(bossId, loaclAllHunt, out TianziConfig tianziConfig)) |
| | | return; |
| | | loaclMaxHp = (ulong)tianziConfig.MaxHP; |
| | | loaclHpNum = tianziConfig.HPNum; |
| | | loaclNowHunt = TianziConfig.GetCurrentHPDamage(bossId, loaclAllHunt); |
| | | OnUpdateBarInfoEvent?.Invoke(loaclNowHunt, loaclMaxHp, loaclHpNum); |
| | | //Debug.Log($"TianziDamageBar hunt {hunt} loaclAllHunt {loaclNowHunt} loaclMaxHp {loaclMaxHp} loaclHpNum {loaclHpNum} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | } |
| | | } |
| | | |
| | | public void ClearBar() |
| | | { |
| | | battleLineID = 0; |
| | | loaclNowHunt = 0; |
| | | loaclAllHunt = 0; |
| | | loaclMaxHp = 0; |
| | | loaclHpNum = 0; |
| | | } |
| | | private void OnSettlement(string _guid, JsonData data) |
| | | { |
| | | if (string.Empty == _guid) |
| | | return; |
| | | var battle = BattleManager.Instance.GetBattleField(_guid); |
| | | if (battle == null) |
| | | return; |
| | | var battleName = battle.ToString(); |
| | | if (battleName != "TianziBillboradBattleField") |
| | | return; |
| | | if (data == null || !data.ContainsKey("totalHurt")) |
| | | return; |
| | | ulong totalHurt = ulong.Parse(data["totalHurt"].ToString()); |
| | | if (!TryGetBossConfig(DataMapID, battleLineID, out DungeonConfig dungeonConfig, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig)) |
| | | return; |
| | | int bossId = npcConfig.NPCID; |
| | | if (!TianziConfig.TryGetTianziConfigByBossIDAndDamage(bossId, totalHurt, out TianziConfig tianziConfig)) |
| | | return; |
| | | ulong endNowHunt = TianziConfig.GetCurrentHPDamage(bossId, totalHurt); |
| | | ulong endMaxHp = (ulong)tianziConfig.MaxHP; |
| | | int endHpNum = tianziConfig.HPNum; |
| | | OnUpdateBarInfoEvent?.Invoke(endNowHunt, endMaxHp, endHpNum); |
| | | //Debug.Log($"TianziDamageBar end nowHpNum {endHpNum} nowHunt {endNowHunt} nowHpMax{endMaxHp} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | } |
| | | |
| | | |
| | | private void OnUpdateTianziKYInfoExent() |
| | | { |
| | |
| | | if (vNetData.Msg == null) |
| | | return; |
| | | JsonData jsonData = JsonMapper.ToObject(vNetData.Msg); |
| | | int isSweep = int.Parse(jsonData["isSweep"].ToString()); |
| | | int dataMapID = int.Parse(jsonData["dataMapID"].ToString()); |
| | | if (dataMapID != DataMapID) |
| | | return; |
| | | int isSweep = int.Parse(jsonData["isSweep"].ToString()); |
| | | totalHurtSweep = ulong.Parse(jsonData["totalHurt"].ToString()); |
| | | int lineID = int.Parse(jsonData["lineID"].ToString()); |
| | | todayHurtTotalSweep = ulong.Parse(jsonData["todayHurtTotal"].ToString()); |
| | | int isPass = int.Parse(jsonData["isPass"].ToString()); |
| | | |
| | | if (dataMapID != DataMapID) |
| | | return; |
| | | |
| | | isSweepVictory = true; |
| | | |
| | | itemInfos.Clear(); |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 玩个游戏 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //玩家通用排名 |
| | | public class TianziBillboradPlayerRankCell : MonoBehaviour |
| | | { |
| | | [SerializeField] AvatarCell avatarCell; |
| | | [SerializeField] Text rankText; |
| | | [SerializeField] Text rankValueText; //排名比较内容 |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] OfficialTitleCell officialTitleCell; |
| | | [SerializeField] Button queryPlayerBtn; //后续添加点击查看玩家详情 |
| | | |
| | | |
| | | // rank 为0 代表玩家自己 |
| | | public void Display(int rankType, int rank, string valueFormat) |
| | | { |
| | | RankData rankData = null; |
| | | if (rank != 0) |
| | | { |
| | | rankData = RankModel.Instance.GetRankDataByRank(rankType, rank); |
| | | } |
| | | else |
| | | { |
| | | rankData = RankModel.Instance.GetMyRank(rankType); |
| | | if (rankData == null) |
| | | { |
| | | //取玩家自己的数据 |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID, |
| | | PlayerDatas.Instance.baseData.face, |
| | | PlayerDatas.Instance.baseData.facePic)); |
| | | rankText.text = Language.Get("L1045"); |
| | | rankValueText.text = "0";//Language.Get("L1125"); |
| | | nameText.text = PlayerDatas.Instance.baseData.PlayerName; |
| | | officialTitleCell.InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); |
| | | return; |
| | | } |
| | | rank = rankData.rank; |
| | | } |
| | | if (rankData == null) |
| | | { |
| | | officialTitleCell.SetActive(false); |
| | | avatarCell.SetActive(false); |
| | | nameText.text = Language.Get("L1124"); |
| | | rankValueText.text = "0";//Language.Get("L1125"); |
| | | } |
| | | else |
| | | { |
| | | officialTitleCell.SetActive(true); |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2); |
| | | avatarCell.SetActive(true); |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4)); |
| | | nameText.text = rankData.name1; |
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue)); |
| | | } |
| | | |
| | | rankText.text = rank.ToString(); |
| | | if (queryPlayerBtn != null) |
| | | { |
| | | queryPlayerBtn.AddListener(() => |
| | | { |
| | | |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/TianziBillborad/TianziBillboradPlayerRankCell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 74766b21066229640a700f4283986c9e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 玩个游戏 |
| | | // [ Date ]: Wednesday, September 26, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | //玩家通用的前3排名 |
| | | public class TianziBillboradPlayerTop3Cell : MonoBehaviour |
| | | { |
| | | //[SerializeField] Model 显示NPC 武将模型 |
| | | [SerializeField] Text rankValueText; //排名比较内容 |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] OfficialTitleCell officialTitleCell; |
| | | [SerializeField] Button queryPlayerBtn; //后续添加点击查看玩家详情 |
| | | [SerializeField] UIHeroController model; |
| | | |
| | | public void Display(int rankType, int rank, string valueFormat = "{0}") |
| | | { |
| | | var rankData = RankModel.Instance.GetRankDataByRank(rankType, rank); |
| | | if (rankData == null) |
| | | { |
| | | rankValueText.text = "0";//Language.Get("L1125"); |
| | | nameText.text = Language.Get("L1124"); |
| | | officialTitleCell.SetActive(false); |
| | | return; |
| | | } |
| | | officialTitleCell.SetActive(true); |
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue2 + rankData.cmpValue * Constants.ExpPointValue)); |
| | | nameText.text = rankData.name1; |
| | | officialTitleCell.InitUI((int)rankData.value1, (int)rankData.value2); |
| | | model.Create((int)rankData.value5, 1); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from Main/Component/UI/Core/OutlineColor.cs.meta
copy to Main/System/TianziBillborad/TianziBillboradPlayerTop3Cell.cs.meta
| File was copied from Main/Component/UI/Core/OutlineColor.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 73475911b65888b44a39a57cca0bcac3 |
| | | guid: 7c586be984f58be4d8d46e703f21a7c9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | [SerializeField] Transform transAward; |
| | | [SerializeField] ButtonEx btnClose; |
| | | [SerializeField] TextEx txtTitle; |
| | | [SerializeField] PlayerRankCell myRankCell; |
| | | [SerializeField] TianziBillboradPlayerRankCell myRankCell; |
| | | [HideInInspector] public string valueFormat = "{0}"; |
| | | |
| | | [Header("奖励")] |
| | | [SerializeField] TextEx txtCountdown; |
| | | [SerializeField] ScrollerController scrAward; |
| | | [Header("排行")] |
| | | [SerializeField] List<PlayerTop3Cell> playerTop3Cells; |
| | | [SerializeField] List<TianziBillboradPlayerTop3Cell> playerTop3Cells; |
| | | [SerializeField] ScrollerController scrollerController; |
| | | [HideInInspector] public int groupValue1 = 0; //一般用于跨服 |
| | | [HideInInspector] public int groupValue2 = 0; //一般用于跨服 |
| | |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PlayerRankCell>(); |
| | | var _cell = cell.GetComponent<TianziBillboradPlayerRankCell>(); |
| | | _cell.Display(model.rankType, cell.index + 1, valueFormat); |
| | | RankModel.Instance.ListenRankPage(model.rankType, cell.index, groupValue1, groupValue2); |
| | | } |
| | |
| | | |
| | | public void Init() |
| | | { |
| | | int dataMapID = TianziBillboradManager.Instance.DataMapID; |
| | | int lineID = TianziBillboradManager.Instance.todayLineID; |
| | | if (!TianziBillboradManager.Instance.TryGetBossConfig(dataMapID, lineID, out DungeonConfig dungeonConfig, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig)) |
| | | return; |
| | | bossId = npcConfig.NPCID; |
| | | nowHpNum = 1; // 默认从第1条血开始 |
| | | if (!TianziConfig.TryGetTianziConfigByBossIDAndHPNum(bossId, nowHpNum, out TianziConfig tianziConfig)) |
| | | return; |
| | | m_IntensifySlider.stage = 0; |
| | | m_IntensifySlider.ResetStage(); |
| | | nowHunt = 0; // 初始血量为0 |
| | | nowHpMax = (ulong)tianziConfig.MaxHP; |
| | | m_BoxCount.text = Language.Get("TianziBillborad07", 0); |
| | | // 除零保护 |
| | | float percentage = 0f; |
| | | if (nowHpMax > 0) |
| | | if (TianziBillboradManager.Instance.loaclMaxHp > 0) |
| | | { |
| | | percentage = Mathf.Clamp(nowHunt, 0, nowHpMax) / (float)nowHpMax; |
| | | nowHunt = TianziBillboradManager.Instance.loaclNowHunt; |
| | | nowHpMax = TianziBillboradManager.Instance.loaclMaxHp; |
| | | nowHpNum = TianziBillboradManager.Instance.loaclHpNum; |
| | | Show(nowHunt, nowHpMax, nowHpNum); |
| | | } |
| | | |
| | | m_IntensifySlider.value = percentage; |
| | | m_IntensifySlider.stage = nowHpNum; // 设置当前阶段 |
| | | m_HurtInfo.text = Language.Get("BoneField09", nowHunt, UIHelper.ReplaceLargeNum(nowHpMax)); |
| | | } |
| | | |
| | | |
| | | // public event Action IsLastHitUnLockEvent; |
| | | // public void Show(ulong hp, ulong maxHp, BattleDmgInfo info) // 显示伤害条 |
| | | // { |
| | | // if (!TianziConfig.TryGetTianziConfigByBossIDAndMaxHP(bossId, (long)maxHp, out TianziConfig tianziConfig)) |
| | | // return; |
| | | // if (info.isLastHit && isLock) |
| | | // { |
| | | // isLock = false; |
| | | // IsLastHitUnLockEvent?.Invoke(); |
| | | // } |
| | | |
| | | // int hpNum = tianziConfig.HPNum; |
| | | // ulong hunt = maxHp - hp; |
| | | |
| | | // if (maxHp < nowHpMax) |
| | | // { |
| | | // Debug.LogWarning($"TianziDamageBar SkillID {info.skillConfig.SkillID} hp {hp} maxHp {maxHp} hunt {hunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax {nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | // return; |
| | | // } |
| | | |
| | | // if (!isLock) |
| | | // { |
| | | // // 根据maxHp获得当前是第几条血 |
| | | // nowHpNum = hpNum; |
| | | // nowHunt = hunt; |
| | | // nowHpMax = maxHp; |
| | | // // 除零保护 |
| | | // float percentage = 0f; |
| | | // if (nowHpMax > 0) |
| | | // { |
| | | // percentage = Mathf.Clamp(nowHunt, 0, nowHpMax) / (float)nowHpMax; |
| | | // } |
| | | // m_IntensifySlider.value = percentage; |
| | | // m_IntensifySlider.stage = nowHpNum; // 设置当前阶段 |
| | | // Debug.Log($"TianziDamageBar SkillID {info.skillConfig.SkillID} hp {hp} maxHp {maxHp} hunt {hunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax {nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | // } |
| | | // } |
| | | |
| | | // bool isLock = false; |
| | | // public void ShowByB419(ulong hp, ulong maxHp) |
| | | // { |
| | | // if (!TianziConfig.TryGetTianziConfigByBossIDAndMaxHP(bossId, (long)maxHp, out TianziConfig tianziConfig)) |
| | | // return; |
| | | |
| | | // isLock = true; |
| | | |
| | | // int hpNum = tianziConfig.HPNum; |
| | | // ulong hunt = maxHp - hp; |
| | | |
| | | // if (maxHp < nowHpMax) |
| | | // { |
| | | // Debug.LogWarning($"TianziDamageBar B419 hp {hp} maxHp {maxHp} hunt {hunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax {nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | // return; |
| | | // } |
| | | // nowHpNum = hpNum; |
| | | // nowHunt = hunt; |
| | | // nowHpMax = maxHp; |
| | | // // 除零保护 |
| | | // float percentage = 0f; |
| | | // if (nowHpMax > 0) |
| | | // { |
| | | // percentage = Mathf.Clamp(nowHunt, 0, nowHpMax) / (float)nowHpMax; |
| | | // } |
| | | // m_IntensifySlider.value = percentage; |
| | | // m_IntensifySlider.stage = nowHpNum; // 设置当前阶段 |
| | | // Debug.Log($"TianziDamageBar B419 hp {hp} maxHp {maxHp} hunt {hunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax{nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | // } |
| | | |
| | | |
| | | public void Show(ulong totalHP) // 显示伤害条 |
| | | { |
| | | if (!TianziConfig.TryGetTianziConfigByBossIDAndDamage(bossId, totalHP, out TianziConfig tianziConfig)) |
| | | return; |
| | | ulong endMaxHp = (ulong)tianziConfig.MaxHP; |
| | | int endHpNum = tianziConfig.HPNum; |
| | | ulong endNowHunt = TianziConfig.GetCurrentHPDamage(bossId, totalHP); |
| | | |
| | | nowHpNum = endHpNum; |
| | | nowHunt = endNowHunt; |
| | | nowHpMax = endMaxHp; |
| | | |
| | | // 除零保护 |
| | | float percentage = 0f; |
| | | if (nowHpMax > 0) |
| | | else |
| | | { |
| | | percentage = Mathf.Clamp(nowHunt, 0, nowHpMax) / (float)nowHpMax; |
| | | } |
| | | m_IntensifySlider.value = percentage; |
| | | m_IntensifySlider.stage = nowHpNum; // 设置当前阶段 |
| | | //Debug.Log($"TianziDamageBar end nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax{nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | } |
| | | |
| | | ulong loaclNowHunt = 0; |
| | | ulong loaclAllHunt = 0; |
| | | ulong loaclMaxHp = 0; |
| | | int loaclHpNum = 0; |
| | | public void Show(BattleDmgInfo _damageInfo) |
| | | { |
| | | //闪避和回血类不算伤害 |
| | | if (_damageInfo.IsType(DamageType.Dodge) || _damageInfo.IsType(DamageType.Recovery)) |
| | | return; |
| | | var damages = _damageInfo.damageList; |
| | | for (int i = 0; i < damages.Count; i++) |
| | | { |
| | | ulong hunt = (ulong)damages[i]; |
| | | loaclAllHunt += hunt; |
| | | if (!TianziConfig.TryGetTianziConfigByBossIDAndDamage(bossId, loaclAllHunt, out TianziConfig tianziConfig)) |
| | | int dataMapID = TianziBillboradManager.Instance.DataMapID; |
| | | int lineID = TianziBillboradManager.Instance.todayLineID; |
| | | if (!TianziBillboradManager.Instance.TryGetBossConfig(dataMapID, lineID, out DungeonConfig dungeonConfig, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig)) |
| | | return; |
| | | loaclMaxHp = (ulong)tianziConfig.MaxHP; |
| | | loaclHpNum = tianziConfig.HPNum; |
| | | loaclNowHunt = TianziConfig.GetCurrentHPDamage(bossId, loaclAllHunt); |
| | | |
| | | // if (loaclMaxHp < nowHpMax || loaclHpNum < nowHpNum) |
| | | // { |
| | | // Debug.LogWarning($"TianziDamageBar hunt {hunt} loaclAllHunt {loaclAllHunt} loaclHpNum {loaclHpNum} loaclNowHunt {loaclNowHunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax{nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | // return; |
| | | // } |
| | | |
| | | // if (loaclNowHunt < nowHunt) |
| | | // { |
| | | // Debug.LogWarning($"TianziDamageBar hunt {hunt} loaclAllHunt {loaclAllHunt} loaclHpNum {loaclHpNum} loaclNowHunt {loaclNowHunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax{nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | // return; |
| | | // } |
| | | nowHunt = loaclNowHunt; |
| | | nowHpMax = loaclMaxHp; |
| | | nowHpNum = loaclHpNum; |
| | | // 除零保护 |
| | | float percentage = 0f; |
| | | if (nowHpMax > 0) |
| | | { |
| | | percentage = Mathf.Clamp(nowHunt, 0, nowHpMax) / (float)nowHpMax; |
| | | } |
| | | m_IntensifySlider.value = percentage; |
| | | m_IntensifySlider.stage = nowHpNum; |
| | | //Debug.Log($"TianziDamageBar hunt {hunt} loaclAllHunt {loaclAllHunt} loaclHpNum {loaclHpNum} loaclNowHunt {loaclNowHunt} nowHpNum {nowHpNum} nowHunt {nowHunt} nowHpMax{nowHpMax} 时间: {DateTime.Now:HH:mm:ss}"); |
| | | bossId = npcConfig.NPCID; |
| | | nowHpNum = 1; // 默认从第1条血开始 |
| | | if (!TianziConfig.TryGetTianziConfigByBossIDAndHPNum(bossId, nowHpNum, out TianziConfig tianziConfig)) |
| | | return; |
| | | m_IntensifySlider.stage = 0; |
| | | m_IntensifySlider.ResetStage(); |
| | | nowHunt = 0; // 初始血量为0 |
| | | nowHpMax = (ulong)tianziConfig.MaxHP; |
| | | m_BoxCount.text = Language.Get("TianziBillborad07", 0); |
| | | Show(nowHunt, nowHpMax, nowHpNum); |
| | | } |
| | | } |
| | | |
| | | public void Show(ulong hunt, ulong maxHp, int hpNum) |
| | | { |
| | | nowHunt = hunt; |
| | | nowHpMax = maxHp; |
| | | nowHpNum = hpNum; |
| | | // 除零保护 |
| | | float percentage = 0f; |
| | | if (nowHpMax > 0) |
| | | { |
| | | percentage = Mathf.Clamp(nowHunt, 0, nowHpMax) / (float)nowHpMax; |
| | | } |
| | | m_IntensifySlider.value = percentage; |
| | | m_IntensifySlider.stage = nowHpNum; |
| | | m_HurtInfo.text = Language.Get("BoneField09", nowHunt, UIHelper.ReplaceLargeNum(nowHpMax)); |
| | | } |
| | | } |
| | |
| | | public static void MoneyIconConfirm(int moneyCnt, int _moneyType, string content, Action<bool, bool> func) |
| | | { |
| | | generalContent = content; |
| | | toggleContent = ""; |
| | | OnToggleConfirmEvent = func; |
| | | moneyType = _moneyType; |
| | | moneyNeedCount = moneyCnt; |
| | |
| | | Chat = 19,//聊天 |
| | | AutoFight = 20,//自动战斗 |
| | | Recharge = 22,//充值 |
| | | BattlePass = 40, //基金(战令) |
| | | LLMJ = 41, //历练秘笈 |
| | | |
| | | } |
| | | |