修复插件中错误的注释。
表格添加了边框偏移量。
This commit is contained in:
@@ -7,7 +7,7 @@ namespace XericUIEditor.ReflectionUIGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// 反射界面生成器的 Hierarchy 右键菜单示例
|
||||
/// 在 Hierarchy 中右键 -> Xeric UI -> Create Reflection UI Example 即可快速创建示例场景
|
||||
/// 在 Hierarchy 中右键 -> Xeric UI -> Create Reflection UI Example 即可快速创建示例场景
|
||||
///
|
||||
/// 创建后:
|
||||
/// 1. 将配置好的 XuiavrgPropertyGroupScriptableObject 通过代码传入 Manager
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -28,7 +28,7 @@ namespace XericUI.FlipPage
|
||||
/// | |-ItemComponentInfo 项目组件结构
|
||||
///
|
||||
/// 组件层使用组件容器封装,预设的组件引用可以实现类似下面的样式
|
||||
/// |< < 2,3,4 > >|
|
||||
/// |< < 2,3,4 > >|
|
||||
/// 两侧是固定的按钮,中间是一个横向的排列容器,在指定了按钮对象池后,将会自动生成绑定好的按钮用于翻页。
|
||||
/// 页数按钮需要让button在预制体最外层,它的子集中需要包含一个TMP_Text。
|
||||
/// </code>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -22,11 +22,11 @@ namespace XericUI.Helper
|
||||
///
|
||||
/// [MenuItem("CONTEXT/XXX/ReplaceToXXX", true)]
|
||||
/// private static bool ValidateReplaceWithCustomScrollRect(MenuCommand command)
|
||||
/// => command.context is ScrollRect;
|
||||
/// => command.context is ScrollRect;
|
||||
///
|
||||
/// [MenuItem("CONTEXT/XXX/ReplaceToXXX", false, 10)]
|
||||
/// private static void ReplaceWithCustomScrollRect(MenuCommand command)
|
||||
/// => command.ReplaceCommandContext<SourceXXX, TargetXXX>();
|
||||
/// => command.ReplaceCommandContext<SourceXXX, TargetXXX>();
|
||||
///
|
||||
/// 不过实测unity的json序列化也无法处理引用,还是需要手动将引用类型传过来
|
||||
/// </remarks>
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace XericUI.ReflectionUIGenerator
|
||||
/// 涵盖新版 Entry 体系的所有特性:编组、排序、预制体覆盖、多种字段类型
|
||||
///
|
||||
/// 使用方式:
|
||||
/// 1. 在 Hierarchy 右键 -> Xeric UI -> Create Reflection UI Example 创建示例节点
|
||||
/// 1. 在 Hierarchy 右键 -> Xeric UI -> Create Reflection UI Example 创建示例节点
|
||||
/// 2. 创建 XuiavrgPropertyGroupScriptableObject 并设置 groupName 和 supportedTags
|
||||
/// 3. 将编组对应的预制体拖入
|
||||
/// 4. 调用 manager.BuildEntries(new XuiavrgExampleTestData()) 构建 Entry
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace XericUI.VisualForm
|
||||
private readonly List<WorldAnchor> _pendingRemoves = new List<WorldAnchor>();
|
||||
|
||||
/// <summary>
|
||||
/// 活跃的窗口状态字典:锚点 -> 中间窗口状态类
|
||||
/// 活跃的窗口状态字典:锚点 -> 中间窗口状态类
|
||||
/// </summary>
|
||||
private readonly Dictionary<WorldAnchor, WindowState> _activeStates = new Dictionary<WorldAnchor, WindowState>();
|
||||
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace XericUI.XTable.Core
|
||||
|
||||
/// <summary>
|
||||
/// 获取右侧边框样式命名空间。
|
||||
/// col < 0 时退回到 OuterBorderNs。
|
||||
/// col < 0 时退回到 OuterBorderNs。
|
||||
/// </summary>
|
||||
public string GetBorderRightNs(int row, int col)
|
||||
{
|
||||
@@ -445,7 +445,7 @@ namespace XericUI.XTable.Core
|
||||
|
||||
/// <summary>
|
||||
/// 设置右侧边框样式命名空间。
|
||||
/// col < 0 时写入 OuterBorderNs。
|
||||
/// col < 0 时写入 OuterBorderNs。
|
||||
/// </summary>
|
||||
public void SetBorderRightNs(int row, int col, string ns)
|
||||
{
|
||||
@@ -470,7 +470,7 @@ namespace XericUI.XTable.Core
|
||||
|
||||
/// <summary>
|
||||
/// 获取底部边框样式命名空间。
|
||||
/// row < 0 时退回到 OuterBorderNs。
|
||||
/// row < 0 时退回到 OuterBorderNs。
|
||||
/// </summary>
|
||||
public string GetBorderBottomNs(int row, int col)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ namespace XericUI.XTable.Core
|
||||
|
||||
/// <summary>
|
||||
/// 设置底部边框样式命名空间。
|
||||
/// row < 0 时写入 OuterBorderNs。
|
||||
/// row < 0 时写入 OuterBorderNs。
|
||||
/// </summary>
|
||||
public void SetBorderBottomNs(int row, int col, string ns)
|
||||
{
|
||||
|
||||
@@ -85,6 +85,9 @@ namespace XericUI.XTable.Rendering.Component
|
||||
private float m_TotalWidth;
|
||||
private float m_TotalHeight;
|
||||
|
||||
/// <summary>内容偏移量(边框半宽),避免 viewport 裁切边缘边框</summary>
|
||||
private float m_ContentOffset;
|
||||
|
||||
// ScrollRect 可见范围
|
||||
private Rect m_VisibleRect;
|
||||
|
||||
@@ -213,8 +216,8 @@ namespace XericUI.XTable.Rendering.Component
|
||||
// 跳过被合并覆盖的单元格
|
||||
if (TableData.IsCellMerged(row, col)) continue;
|
||||
|
||||
float cellX = GetColLeftX(col);
|
||||
float cellY = -GetRowTopY(row);
|
||||
float cellX = GetColLeftX(col) + m_ContentOffset;
|
||||
float cellY = -GetRowTopY(row) - m_ContentOffset;
|
||||
float cellW = m_ColWidths[col];
|
||||
float cellH = m_RowHeights[row];
|
||||
|
||||
@@ -297,8 +300,8 @@ namespace XericUI.XTable.Rendering.Component
|
||||
// 跳过被合并覆盖的单元格
|
||||
if (TableData.IsCellMerged(row, col)) continue;
|
||||
|
||||
float cellX = GetColLeftX(col);
|
||||
float cellY = -GetRowTopY(row);
|
||||
float cellX = GetColLeftX(col) + m_ContentOffset;
|
||||
float cellY = -GetRowTopY(row) - m_ContentOffset;
|
||||
float cellW = m_ColWidths[col];
|
||||
float cellH = m_RowHeights[row];
|
||||
|
||||
@@ -869,8 +872,9 @@ namespace XericUI.XTable.Rendering.Component
|
||||
// 更新背景尺寸
|
||||
if (m_BackgroundGo != null)
|
||||
{
|
||||
float pad = m_ContentOffset * 2f;
|
||||
var bgRt = m_BackgroundGo.GetComponent<RectTransform>();
|
||||
bgRt.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight);
|
||||
bgRt.sizeDelta = new Vector2(m_TotalWidth + pad, m_TotalHeight + pad);
|
||||
}
|
||||
|
||||
// 归还预制体前,触发所有活跃实例的释放回调
|
||||
@@ -953,8 +957,9 @@ namespace XericUI.XTable.Rendering.Component
|
||||
bgRt.anchorMin = new Vector2(0, 1);
|
||||
bgRt.anchorMax = new Vector2(0, 1);
|
||||
bgRt.pivot = new Vector2(0, 1);
|
||||
bgRt.anchoredPosition = Vector2.zero;
|
||||
bgRt.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight);
|
||||
float pad = m_ContentOffset * 2f;
|
||||
bgRt.anchoredPosition = new Vector2(m_ContentOffset, -m_ContentOffset);
|
||||
bgRt.sizeDelta = new Vector2(m_TotalWidth + pad, m_TotalHeight + pad);
|
||||
|
||||
var bgImg = m_BackgroundGo.GetComponent<Image>();
|
||||
bgImg.color = GetCellBgColor(m_DefaultStyleNamespace);
|
||||
@@ -1176,8 +1181,8 @@ namespace XericUI.XTable.Rendering.Component
|
||||
// 跳过被合并覆盖的单元格
|
||||
if (TableData.IsCellMerged(r, c)) continue;
|
||||
|
||||
float cellX = GetColLeftX(c);
|
||||
float cellY = -GetRowTopY(r);
|
||||
float cellX = GetColLeftX(c) + m_ContentOffset;
|
||||
float cellY = -GetRowTopY(r) - m_ContentOffset;
|
||||
float cellW = m_ColWidths[c];
|
||||
float cellH = m_RowHeights[r];
|
||||
|
||||
@@ -1265,8 +1270,8 @@ namespace XericUI.XTable.Rendering.Component
|
||||
// 跳过被合并覆盖的单元格
|
||||
if (TableData.IsCellMerged(r, c)) continue;
|
||||
|
||||
float cellX = GetColLeftX(c);
|
||||
float cellY = -GetRowTopY(r);
|
||||
float cellX = GetColLeftX(c) + m_ContentOffset;
|
||||
float cellY = -GetRowTopY(r) - m_ContentOffset;
|
||||
float cellW = m_ColWidths[c];
|
||||
float cellH = m_RowHeights[r];
|
||||
|
||||
@@ -1366,8 +1371,12 @@ namespace XericUI.XTable.Rendering.Component
|
||||
foreach (float h in m_RowHeights)
|
||||
m_TotalHeight += h;
|
||||
|
||||
m_ContentOffset = GetCellBorderWidth(m_DefaultStyleNamespace) * 0.5f;
|
||||
float pad = m_ContentOffset * 2f;
|
||||
|
||||
if (m_ScrollRect != null && m_ScrollRect.content != null)
|
||||
m_ScrollRect.content.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight);
|
||||
m_ScrollRect.content.sizeDelta = new Vector2(
|
||||
m_TotalWidth + pad, m_TotalHeight + pad);
|
||||
}
|
||||
|
||||
private void UpdateVisibleRect()
|
||||
@@ -1574,8 +1583,9 @@ namespace XericUI.XTable.Rendering.Component
|
||||
rt.anchorMin = new Vector2(0, 1);
|
||||
rt.anchorMax = new Vector2(0, 1);
|
||||
rt.pivot = new Vector2(0, 1);
|
||||
rt.anchoredPosition = Vector2.zero;
|
||||
rt.sizeDelta = new Vector2(m_TotalWidth, m_TotalHeight);
|
||||
float pad = m_ContentOffset * 2f;
|
||||
rt.anchoredPosition = new Vector2(m_ContentOffset, -m_ContentOffset);
|
||||
rt.sizeDelta = new Vector2(m_TotalWidth + pad, m_TotalHeight + pad);
|
||||
|
||||
m_BorderRenderer = go.GetComponent<UILineRendererV2>();
|
||||
return m_BorderRenderer;
|
||||
@@ -1829,8 +1839,8 @@ namespace XericUI.XTable.Rendering.Component
|
||||
|
||||
float scrollY = m_ScrollRect != null ? Mathf.Max(0, m_ScrollRect.content.anchoredPosition.y) : 0;
|
||||
float scrollX = m_ScrollRect != null ? Mathf.Max(0, -m_ScrollRect.content.anchoredPosition.x) : 0;
|
||||
tableX += scrollX;
|
||||
tableY += scrollY;
|
||||
tableX += scrollX - m_ContentOffset;
|
||||
tableY += scrollY - m_ContentOffset;
|
||||
|
||||
int col = -1;
|
||||
float ax = 0;
|
||||
|
||||
Reference in New Issue
Block a user