From 49f616f4c75ccfc2d09828001ca0b5dcb31764cd Mon Sep 17 00:00:00 2001 From: LiRuoChen <571244399@qq.com> Date: Wed, 23 Jul 2025 20:08:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0unity=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E7=B1=BB=EF=BC=8C=E5=85=81=E8=AE=B8=E4=BD=BF=E7=94=A8=E6=B3=9B?= =?UTF-8?q?=E5=9E=8B=E6=8E=A7=E5=88=B6=E7=95=8C=E9=9D=A2=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E3=80=82=20=E7=9B=AE=E5=89=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E6=AC=A1=E6=9C=80=E5=A4=9A=E4=B8=89=E4=B8=AA?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E5=B1=9E=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Core.meta | 3 + Editor/Core/Vessel.meta | 3 + Editor/Core/Vessel/ObjectVessel2Property.cs | 89 +++++ .../Core/Vessel/ObjectVessel2Property.cs.meta | 3 + Editor/Core/Vessel/ObjectVessel3Property.cs | 105 ++++++ .../Core/Vessel/ObjectVessel3Property.cs.meta | 3 + Editor/Core/Vessel/ObjectVesselProperty.cs | 59 ++++ .../Core/Vessel/ObjectVesselProperty.cs.meta | 3 + .../Core/Vessel/ObjectVesselPropertyBase.cs | 54 +++ .../Vessel/ObjectVesselPropertyBase.cs.meta | 3 + .../Lrss3.Xericuiactionvessel.Editor.asmdef | 8 +- Runtime/Core.meta | 3 + Runtime/Core/Base.meta | 3 + Runtime/Core/Base/XericUIBehaciour.cs | 49 +++ Runtime/Core/Base/XericUIBehaciour.cs.meta | 3 + Runtime/Core/Vessel.meta | 3 + Runtime/Core/Vessel/ObjectVessel.cs | 38 ++ Runtime/Core/Vessel/ObjectVessel.cs.meta | 3 + Runtime/Core/Vessel/ObjectVessel2.cs | 39 +++ Runtime/Core/Vessel/ObjectVessel2.cs.meta | 3 + Runtime/Core/Vessel/ObjectVessel3.cs | 47 +++ Runtime/Core/Vessel/ObjectVessel3.cs.meta | 3 + Runtime/Core/Vessel/VesselBase.cs | 7 + Runtime/Core/Vessel/VesselBase.cs.meta | 3 + .../Core/Vessel/XericUIExtendHelper.Text.cs | 43 +++ .../Vessel/XericUIExtendHelper.Text.cs.meta | 3 + Runtime/Core/Vessel/XericUIExtendHelper.cs | 41 +++ .../Core/Vessel/XericUIExtendHelper.cs.meta | 3 + Runtime/FlipPage.meta | 8 + Runtime/FlipPage/FlipPageComponentManager.cs | 151 ++++++++ .../FlipPage/FlipPageComponentManager.cs.meta | 3 + .../FlipPage/XericFlipPageIndexVesselBase.cs | 221 ++++++++++++ .../XericFlipPageIndexVesselBase.cs.meta | 11 + .../InfiniteVessel/XericInfiniteVesselBase.cs | 65 +++- Runtime/Lrss3.Xericuiactionvessel.asmdef | 4 +- Runtime/Material.meta | 8 + Runtime/Material/BasicUI.meta | 8 + .../MELC_HorizontalCenterLinearBar120A0.mat | 48 +++ ...LC_HorizontalCenterLinearBar120A0.mat.meta | 8 + .../MELC_HorizontalCenterLinearBar120A1.mat | 48 +++ ...LC_HorizontalCenterLinearBar120A1.mat.meta | 8 + .../MELC_HorizontalLeftLinearBar120A0.mat | 48 +++ ...MELC_HorizontalLeftLinearBar120A0.mat.meta | 8 + .../MELC_HorizontalRightLinearBar120A0.mat | 48 +++ ...ELC_HorizontalRightLinearBar120A0.mat.meta | 8 + Runtime/Material/BasicUI/Shader.meta | 8 + .../MonotonicallyExcessiveLinearColor.shader | 256 ++++++++++++++ ...otonicallyExcessiveLinearColor.shader.meta | 10 + .../BasicUI/Shader/RoundPolygon.shader | 329 ++++++++++++++++++ .../BasicUI/Shader/RoundPolygon.shader.meta | 10 + .../Material/BasicUI/TextBackgroundSprite.mat | 134 +++++++ .../BasicUI/TextBackgroundSprite.mat.meta | 8 + .../BasicUI/XRoundPureRectR15Full.mat | 48 +++ .../BasicUI/XRoundPureRectR15Full.mat.meta | 8 + .../BasicUI/XRoundPureRectR15HollowArrow.mat | 51 +++ .../XRoundPureRectR15HollowArrow.mat.meta | 8 + Runtime/Sprite.meta | 8 + Runtime/Sprite/CircleFillCenterPoint8.png | Bin 0 -> 154 bytes .../Sprite/CircleFillCenterPoint8.png.meta | 134 +++++++ Runtime/{Vessel.meta => TextVessel.meta} | 0 Runtime/TextVessel/Prefab.meta | 8 + .../Prefab/AutoSizeText-TMP_Text.prefab | 229 ++++++++++++ .../Prefab/AutoSizeText-TMP_Text.prefab.meta | 7 + 63 files changed, 2580 insertions(+), 6 deletions(-) create mode 100644 Editor/Core.meta create mode 100644 Editor/Core/Vessel.meta create mode 100644 Editor/Core/Vessel/ObjectVessel2Property.cs create mode 100644 Editor/Core/Vessel/ObjectVessel2Property.cs.meta create mode 100644 Editor/Core/Vessel/ObjectVessel3Property.cs create mode 100644 Editor/Core/Vessel/ObjectVessel3Property.cs.meta create mode 100644 Editor/Core/Vessel/ObjectVesselProperty.cs create mode 100644 Editor/Core/Vessel/ObjectVesselProperty.cs.meta create mode 100644 Editor/Core/Vessel/ObjectVesselPropertyBase.cs create mode 100644 Editor/Core/Vessel/ObjectVesselPropertyBase.cs.meta create mode 100644 Runtime/Core.meta create mode 100644 Runtime/Core/Base.meta create mode 100644 Runtime/Core/Base/XericUIBehaciour.cs create mode 100644 Runtime/Core/Base/XericUIBehaciour.cs.meta create mode 100644 Runtime/Core/Vessel.meta create mode 100644 Runtime/Core/Vessel/ObjectVessel.cs create mode 100644 Runtime/Core/Vessel/ObjectVessel.cs.meta create mode 100644 Runtime/Core/Vessel/ObjectVessel2.cs create mode 100644 Runtime/Core/Vessel/ObjectVessel2.cs.meta create mode 100644 Runtime/Core/Vessel/ObjectVessel3.cs create mode 100644 Runtime/Core/Vessel/ObjectVessel3.cs.meta create mode 100644 Runtime/Core/Vessel/VesselBase.cs create mode 100644 Runtime/Core/Vessel/VesselBase.cs.meta create mode 100644 Runtime/Core/Vessel/XericUIExtendHelper.Text.cs create mode 100644 Runtime/Core/Vessel/XericUIExtendHelper.Text.cs.meta create mode 100644 Runtime/Core/Vessel/XericUIExtendHelper.cs create mode 100644 Runtime/Core/Vessel/XericUIExtendHelper.cs.meta create mode 100644 Runtime/FlipPage.meta create mode 100644 Runtime/FlipPage/FlipPageComponentManager.cs create mode 100644 Runtime/FlipPage/FlipPageComponentManager.cs.meta create mode 100644 Runtime/FlipPage/XericFlipPageIndexVesselBase.cs create mode 100644 Runtime/FlipPage/XericFlipPageIndexVesselBase.cs.meta create mode 100644 Runtime/Material.meta create mode 100644 Runtime/Material/BasicUI.meta create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalCenterLinearBar120A0.mat create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalCenterLinearBar120A0.mat.meta create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalCenterLinearBar120A1.mat create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalCenterLinearBar120A1.mat.meta create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalLeftLinearBar120A0.mat create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalLeftLinearBar120A0.mat.meta create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalRightLinearBar120A0.mat create mode 100644 Runtime/Material/BasicUI/MELC_HorizontalRightLinearBar120A0.mat.meta create mode 100644 Runtime/Material/BasicUI/Shader.meta create mode 100644 Runtime/Material/BasicUI/Shader/MonotonicallyExcessiveLinearColor.shader create mode 100644 Runtime/Material/BasicUI/Shader/MonotonicallyExcessiveLinearColor.shader.meta create mode 100644 Runtime/Material/BasicUI/Shader/RoundPolygon.shader create mode 100644 Runtime/Material/BasicUI/Shader/RoundPolygon.shader.meta create mode 100644 Runtime/Material/BasicUI/TextBackgroundSprite.mat create mode 100644 Runtime/Material/BasicUI/TextBackgroundSprite.mat.meta create mode 100644 Runtime/Material/BasicUI/XRoundPureRectR15Full.mat create mode 100644 Runtime/Material/BasicUI/XRoundPureRectR15Full.mat.meta create mode 100644 Runtime/Material/BasicUI/XRoundPureRectR15HollowArrow.mat create mode 100644 Runtime/Material/BasicUI/XRoundPureRectR15HollowArrow.mat.meta create mode 100644 Runtime/Sprite.meta create mode 100644 Runtime/Sprite/CircleFillCenterPoint8.png create mode 100644 Runtime/Sprite/CircleFillCenterPoint8.png.meta rename Runtime/{Vessel.meta => TextVessel.meta} (100%) create mode 100644 Runtime/TextVessel/Prefab.meta create mode 100644 Runtime/TextVessel/Prefab/AutoSizeText-TMP_Text.prefab create mode 100644 Runtime/TextVessel/Prefab/AutoSizeText-TMP_Text.prefab.meta diff --git a/Editor/Core.meta b/Editor/Core.meta new file mode 100644 index 0000000..6ebea4a --- /dev/null +++ b/Editor/Core.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 27922b2ba2514fb58c60420c4dee6618 +timeCreated: 1753252613 \ No newline at end of file diff --git a/Editor/Core/Vessel.meta b/Editor/Core/Vessel.meta new file mode 100644 index 0000000..33c4011 --- /dev/null +++ b/Editor/Core/Vessel.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 41e64720c91340eaa285a8d1a227184c +timeCreated: 1753253334 \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVessel2Property.cs b/Editor/Core/Vessel/ObjectVessel2Property.cs new file mode 100644 index 0000000..5051afa --- /dev/null +++ b/Editor/Core/Vessel/ObjectVessel2Property.cs @@ -0,0 +1,89 @@ +using System; +using UnityEditor; +using UnityEngine; +using XericLibrary.Runtime.MacroLibrary; +using XericUI.Core.Vessel; +using Object = UnityEngine.Object; + +namespace XericUIEditor.Core.Vessel +{ + [CustomPropertyDrawer(typeof(ObjectVessel<,>))] + public class ObjectVessel2Property : ObjectVesselPropertyBase + { + private Type property0Type = typeof(Object); + private Type property1Type = typeof(Object); + private string originTooltip = null; + private const float horizontalSpacing = 2f; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + var targetProperty0 = property.FindPropertyRelative("target0"); + var targetProperty1 = property.FindPropertyRelative("target1"); + + if (targetProperty0 == null || targetProperty1 == null) + { + EditorGUI.HelpBox(position, "[PROPERTY ERROR: target0/target1 not found]", MessageType.Error); + EditorGUI.EndProperty(); + return; + } + + Type genericType = GetActualGenericType(fieldInfo.FieldType, typeof(ObjectVessel<,>)); + if (genericType != null && genericType.IsGenericType) + { + Type[] typeArgs = genericType.GetGenericArguments(); + if (typeArgs.Length >= 1) property0Type = typeArgs[0]; + if (typeArgs.Length >= 2) property1Type = typeArgs[1]; + + // 更新Tooltip + if (string.IsNullOrEmpty(originTooltip)) + { + originTooltip = $"<{property0Type?.Name}, {property1Type?.Name}>\n{label.tooltip}"; + label.tooltip = originTooltip; + } + } + + // 布局计算(��原有逻辑��) + float labelWidth = EditorGUIUtility.labelWidth; + float indentOffset = EditorGUI.indentLevel * 15f; + float totalFieldWidth = position.width - labelWidth - indentOffset; + float singleFieldWidth = (totalFieldWidth - horizontalSpacing) / 2; + + Rect leftFieldRect = new Rect( + position.x + labelWidth + indentOffset, + position.y, + singleFieldWidth, + EditorGUIUtility.singleLineHeight + ); + + Rect rightFieldRect = new Rect( + leftFieldRect.x + singleFieldWidth + horizontalSpacing, + position.y, + singleFieldWidth, + EditorGUIUtility.singleLineHeight + ); + + // 绘制标签和属性(��原有逻辑��) + EditorGUI.PrefixLabel( + new Rect(position.x + indentOffset, position.y, labelWidth, position.height), + label + ); + + targetProperty0.objectReferenceValue = EditorGUI.ObjectField( + leftFieldRect, GUIContent.none, targetProperty0.objectReferenceValue, property0Type, true + ); + + targetProperty1.objectReferenceValue = EditorGUI.ObjectField( + rightFieldRect, GUIContent.none, targetProperty1.objectReferenceValue, property1Type, true + ); + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight; + } + } +} \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVessel2Property.cs.meta b/Editor/Core/Vessel/ObjectVessel2Property.cs.meta new file mode 100644 index 0000000..1f2299f --- /dev/null +++ b/Editor/Core/Vessel/ObjectVessel2Property.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4b6688946bd24f47b4ddfe5435d4a06a +timeCreated: 1753260952 \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVessel3Property.cs b/Editor/Core/Vessel/ObjectVessel3Property.cs new file mode 100644 index 0000000..a70525b --- /dev/null +++ b/Editor/Core/Vessel/ObjectVessel3Property.cs @@ -0,0 +1,105 @@ +using System; +using UnityEditor; +using UnityEngine; +using XericLibrary.Runtime.MacroLibrary; +using XericUI.Core.Vessel; +using Object = UnityEngine.Object; + +namespace XericUIEditor.Core.Vessel +{ + [CustomPropertyDrawer(typeof(ObjectVessel<,,>))] + public class ObjectVessel3Property : ObjectVesselPropertyBase + { + private Type property0Type = typeof(Object); + private Type property1Type = typeof(Object); + private Type property2Type = typeof(Object); + private string originTooltip = null; + private const float horizontalSpacing = 2f; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + var targetProperty0 = property.FindPropertyRelative("target0"); + var targetProperty1 = property.FindPropertyRelative("target1"); + var targetProperty2 = property.FindPropertyRelative("target2"); + + if (targetProperty0 == null || targetProperty1 == null || targetProperty2 == null) + { + EditorGUI.HelpBox(position, "[PROPERTY ERROR: target0/target1/target2 not found]", MessageType.Error); + EditorGUI.EndProperty(); + return; + } + + Type genericType = GetActualGenericType(fieldInfo.FieldType, typeof(ObjectVessel<,,>)); + if (genericType != null && genericType.IsGenericType) + { + Type[] typeArgs = genericType.GetGenericArguments(); + if (typeArgs.Length >= 1) property0Type = typeArgs[0]; + if (typeArgs.Length >= 2) property1Type = typeArgs[1]; + if (typeArgs.Length >= 3) property2Type = typeArgs[2]; + + // 更新Tooltip + if (string.IsNullOrEmpty(originTooltip)) + { + originTooltip = + $"<{property0Type.Name}, {property1Type.Name}, {property2Type.Name}>\n{label.tooltip}"; + label.tooltip = originTooltip; + } + } + + // 布局计算(三个属性等分剩余空间) + float labelWidth = EditorGUIUtility.labelWidth; + float indentOffset = EditorGUI.indentLevel * 15f; + float totalFieldWidth = position.width - labelWidth - indentOffset; + float singleFieldWidth = (totalFieldWidth - horizontalSpacing * 2) / 3; // 三个属性,两个间� + + // 计算三个属性框的�置 + Rect fieldRect0 = new Rect( + position.x + labelWidth + indentOffset, + position.y, + singleFieldWidth, + EditorGUIUtility.singleLineHeight + ); + + Rect fieldRect1 = new Rect( + fieldRect0.x + singleFieldWidth + horizontalSpacing, + position.y, + singleFieldWidth, + EditorGUIUtility.singleLineHeight + ); + + Rect fieldRect2 = new Rect( + fieldRect1.x + singleFieldWidth + horizontalSpacing, + position.y, + singleFieldWidth, + EditorGUIUtility.singleLineHeight + ); + + // 绘制标签 + EditorGUI.PrefixLabel( + new Rect(position.x + indentOffset, position.y, labelWidth, position.height), + label + ); + + targetProperty0.objectReferenceValue = EditorGUI.ObjectField( + fieldRect0, GUIContent.none, targetProperty0.objectReferenceValue, property0Type, true + ); + + targetProperty1.objectReferenceValue = EditorGUI.ObjectField( + fieldRect1, GUIContent.none, targetProperty1.objectReferenceValue, property1Type, true + ); + + targetProperty2.objectReferenceValue = EditorGUI.ObjectField( + fieldRect2, GUIContent.none, targetProperty2.objectReferenceValue, property2Type, true + ); + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight; + } + } +} \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVessel3Property.cs.meta b/Editor/Core/Vessel/ObjectVessel3Property.cs.meta new file mode 100644 index 0000000..c9ef13f --- /dev/null +++ b/Editor/Core/Vessel/ObjectVessel3Property.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ad305cdce04a4b80ba0a061a630911da +timeCreated: 1753263774 \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVesselProperty.cs b/Editor/Core/Vessel/ObjectVesselProperty.cs new file mode 100644 index 0000000..428ba4f --- /dev/null +++ b/Editor/Core/Vessel/ObjectVesselProperty.cs @@ -0,0 +1,59 @@ +using System; +using UnityEditor; +using UnityEngine; +using XericUI.Core.Vessel; +using Object = UnityEngine.Object; + +namespace XericUIEditor.Core.Vessel +{ + [CustomPropertyDrawer(typeof(ObjectVessel<>))] + public class ObjectVesselProperty : ObjectVesselPropertyBase + { + private Type property0Type = typeof(Object); + private string originTooltip = null; + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + var targetProperty0 = property.FindPropertyRelative("target"); + + if (targetProperty0 == null) + { + // 如果找�到字段,显示错误信� + EditorGUI.HelpBox(position, "[PROPERTY ERROR]", MessageType.Error); + EditorGUI.EndProperty(); + return; + } + + Type genericType = GetActualGenericType(fieldInfo.FieldType, typeof(ObjectVessel<>)); + if (genericType != null && genericType.IsGenericType) + { + Type[] typeArgs = genericType.GetGenericArguments(); + if (typeArgs.Length >= 1) property0Type = typeArgs[0]; + + // 更新Tooltip + if (string.IsNullOrEmpty(originTooltip)) + { + originTooltip = $"<{property0Type?.Name}>\n{label.tooltip}"; + label.tooltip = originTooltip; + } + } + + targetProperty0.objectReferenceValue = EditorGUI.ObjectField( + position, + label, + targetProperty0.objectReferenceValue, + property0Type, + true + ); + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + return EditorGUIUtility.singleLineHeight; + } + } +} \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVesselProperty.cs.meta b/Editor/Core/Vessel/ObjectVesselProperty.cs.meta new file mode 100644 index 0000000..213da76 --- /dev/null +++ b/Editor/Core/Vessel/ObjectVesselProperty.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2e26331650e84011aab1e2ebc4a39821 +timeCreated: 1753253349 \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVesselPropertyBase.cs b/Editor/Core/Vessel/ObjectVesselPropertyBase.cs new file mode 100644 index 0000000..190dd4e --- /dev/null +++ b/Editor/Core/Vessel/ObjectVesselPropertyBase.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using UnityEditor; +using XericUI.Core.Vessel; + +namespace XericUIEditor.Core.Vessel +{ + public class ObjectVesselPropertyBase : PropertyDrawer + { + /// + /// 递归获�实际的泛型类型(处�嵌套情况) + /// + /// + /// + /// + protected Type GetActualGenericType(Type type, Type currentGenericDefinition) + { + // 如果是泛型类型,检查是�为ObjectVessel<,>或继续递归 + if (type.IsGenericType) + { + // 检查是�为ObjectVessel<,>的实例 + Type genericDefinition = type.GetGenericTypeDefinition(); + if (genericDefinition == currentGenericDefinition) + { + return type; // 找到目标类型 + } + + // 处�嵌套泛型(如List>) + foreach (Type argType in type.GetGenericArguments()) + { + Type nestedType = GetActualGenericType(argType, currentGenericDefinition); + if (nestedType != null) + { + return nestedType; + } + } + } + + // 处�数组或其他�能的容器类型 + if (type.IsArray) + { + return GetActualGenericType(type.GetElementType(), currentGenericDefinition); + } + + // 检查基类 + if (type.BaseType != null && type.BaseType != typeof(object)) + { + return GetActualGenericType(type.BaseType, currentGenericDefinition); + } + + return null; // 未找到 + } + } +} \ No newline at end of file diff --git a/Editor/Core/Vessel/ObjectVesselPropertyBase.cs.meta b/Editor/Core/Vessel/ObjectVesselPropertyBase.cs.meta new file mode 100644 index 0000000..438361b --- /dev/null +++ b/Editor/Core/Vessel/ObjectVesselPropertyBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 89ddf50a12de4506b000fee0b00edd4a +timeCreated: 1753261075 \ No newline at end of file diff --git a/Editor/Lrss3.Xericuiactionvessel.Editor.asmdef b/Editor/Lrss3.Xericuiactionvessel.Editor.asmdef index b43c14c..7f9079f 100644 --- a/Editor/Lrss3.Xericuiactionvessel.Editor.asmdef +++ b/Editor/Lrss3.Xericuiactionvessel.Editor.asmdef @@ -1,9 +1,13 @@ { - "name": "Lrss3.Xericuiactionvessel", + "name": "Lrss3.Xericuiactionvessel.Editor", "rootNamespace": "XericUIEditor", "references": [ "Lrss3.Xericuiactionvessel", - "Lrss3.SesothoLine.Editor" + "Lrss3.SesothoLine.Editor", + "Lrss3.Deconstruction", + "UnityEngine.UI", + "Unity.TextMeshPro", + "Unity.TextMeshPro.Editor" ], "includePlatforms": [ "Editor" diff --git a/Runtime/Core.meta b/Runtime/Core.meta new file mode 100644 index 0000000..42e5d39 --- /dev/null +++ b/Runtime/Core.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8c708a987fab422883d5b2bb7183440b +timeCreated: 1753237323 \ No newline at end of file diff --git a/Runtime/Core/Base.meta b/Runtime/Core/Base.meta new file mode 100644 index 0000000..f07ed65 --- /dev/null +++ b/Runtime/Core/Base.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8214816258e04879be55e0e4bbfc6e71 +timeCreated: 1753256011 \ No newline at end of file diff --git a/Runtime/Core/Base/XericUIBehaciour.cs b/Runtime/Core/Base/XericUIBehaciour.cs new file mode 100644 index 0000000..926fcc7 --- /dev/null +++ b/Runtime/Core/Base/XericUIBehaciour.cs @@ -0,0 +1,49 @@ +using System; +using Sirenix.OdinInspector; +using UnityEngine; +using UnityEngine.EventSystems; + +namespace XericUI.Core.Base +{ + public class XericUIBehaciour : UIBehaviour + { + [InfoBox("脚本属性存在空引用�请检查开放属性��试", InfoMessageType.Error, VisibleIf = "PublicFieldNullReference")] + [HideLabel, DisplayAsString] + string __EMPTYFIELD; + + + protected bool PublicFieldNullReference; + + protected bool AlreadyAwake { get; private set; } + protected bool AlreadyStart { get; private set; } + protected bool AlreadyOnEnable { get; private set; } + protected bool AlreadyOnDisable { get; private set; } + protected bool FirstUpdate { get; private set; } + protected bool FirstFixUpdate { get; private set; } + + protected override void Awake() + { + AlreadyAwake = true; + base.Awake(); + } + + protected override void Start() + { + AlreadyStart = true; + base.Start(); + } + + protected override void OnEnable() + { + AlreadyOnEnable = true; + base.OnEnable(); + } + + protected override void OnDisable() + { + AlreadyOnDisable = true; + base.OnDisable(); + } + + } +} \ No newline at end of file diff --git a/Runtime/Core/Base/XericUIBehaciour.cs.meta b/Runtime/Core/Base/XericUIBehaciour.cs.meta new file mode 100644 index 0000000..ff4659a --- /dev/null +++ b/Runtime/Core/Base/XericUIBehaciour.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c86649055e4243d69a945bf7f6a4d474 +timeCreated: 1753256057 \ No newline at end of file diff --git a/Runtime/Core/Vessel.meta b/Runtime/Core/Vessel.meta new file mode 100644 index 0000000..5d71d8a --- /dev/null +++ b/Runtime/Core/Vessel.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4c397c88f8834566bf6ba98d579f4db1 +timeCreated: 1753253292 \ No newline at end of file diff --git a/Runtime/Core/Vessel/ObjectVessel.cs b/Runtime/Core/Vessel/ObjectVessel.cs new file mode 100644 index 0000000..9c9aa93 --- /dev/null +++ b/Runtime/Core/Vessel/ObjectVessel.cs @@ -0,0 +1,38 @@ +using System; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace XericUI.Core.Vessel +{ + /// + /// 组件界�泛型容器 + /// 详情�阅Xeric Library本体库Wiki中关于组件容器的说明。 + /// + /// + [Serializable] + public class ObjectVessel : VesselBase + where T0 : Object + { + [SerializeField] + private Object target = default(T0); + + /// + /// 获�此包裹器中的 + /// + public T0 Target + { + get => target as T0; + set => target = value; + } + + public ObjectVessel() + { + + } + + public ObjectVessel(Object target) + { + this.target = target; + } + } +} \ No newline at end of file diff --git a/Runtime/Core/Vessel/ObjectVessel.cs.meta b/Runtime/Core/Vessel/ObjectVessel.cs.meta new file mode 100644 index 0000000..e37fc34 --- /dev/null +++ b/Runtime/Core/Vessel/ObjectVessel.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 00f4d38097bf40e99b75ab7d431ec126 +timeCreated: 1753253311 \ No newline at end of file diff --git a/Runtime/Core/Vessel/ObjectVessel2.cs b/Runtime/Core/Vessel/ObjectVessel2.cs new file mode 100644 index 0000000..68844f8 --- /dev/null +++ b/Runtime/Core/Vessel/ObjectVessel2.cs @@ -0,0 +1,39 @@ +using System; +using UnityEngine; +using UnityEngine.Serialization; +using Object = UnityEngine.Object; + +namespace XericUI.Core.Vessel +{ + [Serializable] + public class ObjectVessel : VesselBase + where T0 : Object + where T1 : Object + { + [SerializeField] private Object target0 = default(T0); + [SerializeField] private Object target1 = default(T1); + + public T0 Target0 + { + get => target0 as T0; + set => target0 = value; + } + public T1 Target1 + { + get => target1 as T1; + set => target1 = value; + } + + + public ObjectVessel() + { + + } + + public ObjectVessel(Object target0, Object target1) + { + this.target0 = target0; + this.target1 = target1; + } + } +} \ No newline at end of file diff --git a/Runtime/Core/Vessel/ObjectVessel2.cs.meta b/Runtime/Core/Vessel/ObjectVessel2.cs.meta new file mode 100644 index 0000000..7ed3fd2 --- /dev/null +++ b/Runtime/Core/Vessel/ObjectVessel2.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3f9ea9e74d6c4f8ea55cda5d419fa6f0 +timeCreated: 1753260697 \ No newline at end of file diff --git a/Runtime/Core/Vessel/ObjectVessel3.cs b/Runtime/Core/Vessel/ObjectVessel3.cs new file mode 100644 index 0000000..677eb33 --- /dev/null +++ b/Runtime/Core/Vessel/ObjectVessel3.cs @@ -0,0 +1,47 @@ +using System; +using UnityEngine; +using UnityEngine.Serialization; +using Object = UnityEngine.Object; + +namespace XericUI.Core.Vessel +{ + [Serializable] + public class ObjectVessel : VesselBase + where T0 : Object + where T1 : Object + where T2 : Object + { + [SerializeField] private Object target0 = default(T0); + [SerializeField] private Object target1 = default(T1); + [SerializeField] private Object target2 = default(T2); + + public T0 Target0 + { + get => target0 as T0; + set => target0 = value; + } + public T1 Target1 + { + get => target1 as T1; + set => target1 = value; + } + public T2 Target2 + { + get => target2 as T2; + set => target2 = value; + } + + + public ObjectVessel() + { + + } + + public ObjectVessel(Object target0, Object target1, Object target2) + { + this.target0 = target0; + this.target1 = target1; + this.target2 = target2; + } + } +} \ No newline at end of file diff --git a/Runtime/Core/Vessel/ObjectVessel3.cs.meta b/Runtime/Core/Vessel/ObjectVessel3.cs.meta new file mode 100644 index 0000000..6585e4d --- /dev/null +++ b/Runtime/Core/Vessel/ObjectVessel3.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bd442520699543d4a376fff5bb1c7779 +timeCreated: 1753263701 \ No newline at end of file diff --git a/Runtime/Core/Vessel/VesselBase.cs b/Runtime/Core/Vessel/VesselBase.cs new file mode 100644 index 0000000..b9e6062 --- /dev/null +++ b/Runtime/Core/Vessel/VesselBase.cs @@ -0,0 +1,7 @@ +namespace XericUI.Core.Vessel +{ + public class VesselBase + { + + } +} \ No newline at end of file diff --git a/Runtime/Core/Vessel/VesselBase.cs.meta b/Runtime/Core/Vessel/VesselBase.cs.meta new file mode 100644 index 0000000..8216c71 --- /dev/null +++ b/Runtime/Core/Vessel/VesselBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c1ebb22ea2ec4d32b41608c8c1777ada +timeCreated: 1753254327 \ No newline at end of file diff --git a/Runtime/Core/Vessel/XericUIExtendHelper.Text.cs b/Runtime/Core/Vessel/XericUIExtendHelper.Text.cs new file mode 100644 index 0000000..5849f0e --- /dev/null +++ b/Runtime/Core/Vessel/XericUIExtendHelper.Text.cs @@ -0,0 +1,43 @@ +using System; +using UnityEngine; +using XericUI.Core.Vessel; +#if dUI_TextMeshPro +using TMPro; +#endif + +namespace XericUI.Core.Text +{ + public static partial class XericUIExtendHelper + { + public static string DebugSelfName => ""; + + #region TMP_Text + + /// + /// 获�文本容器中的字符串内容 + /// + /// + /// + public static string GetStringContext(this ObjectVessel obj) + where T : TMP_Text + => obj != null ? obj.Target.text : string.Empty; + + /// + /// 获�文本容器中的字符串内容 + /// + /// + /// + /// + public static void SetStringContext(this ObjectVessel obj, string value) + where T : TMP_Text + { + if (obj != null) + obj.Target.text = value; + else + Debug.LogError($"正在�空{DebugSelfName}对象赋值"); + } + + #endregion + + } +} \ No newline at end of file diff --git a/Runtime/Core/Vessel/XericUIExtendHelper.Text.cs.meta b/Runtime/Core/Vessel/XericUIExtendHelper.Text.cs.meta new file mode 100644 index 0000000..846cd50 --- /dev/null +++ b/Runtime/Core/Vessel/XericUIExtendHelper.Text.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1739fa9e30fc4e0a80b97feea7d930b5 +timeCreated: 1753242867 \ No newline at end of file diff --git a/Runtime/Core/Vessel/XericUIExtendHelper.cs b/Runtime/Core/Vessel/XericUIExtendHelper.cs new file mode 100644 index 0000000..a5528b5 --- /dev/null +++ b/Runtime/Core/Vessel/XericUIExtendHelper.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace XericUI.Core.Vessel +{ + public static partial class XericUIExtendHelper + { + /// + /// 检查容器有效 + /// + /// + /// + /// + public static bool IsValid(this ObjectVessel obj) + where T0 : Object + => obj != null && obj.Target != null; + /// + /// 检查容器有效 + /// + /// + /// + /// + /// + public static bool IsValid(this ObjectVessel obj) + where T0 : Object + where T1 : Object + => obj != null && obj.Target0 != null && obj.Target1 != null; + /// + /// 检查容器有效 + /// + /// + /// + /// + /// + /// + public static bool IsValid(this ObjectVessel obj) + where T0 : Object + where T1 : Object + where T2 : Object + => obj != null && obj.Target0 != null && obj.Target1 != null && obj.Target2 != null; + } +} \ No newline at end of file diff --git a/Runtime/Core/Vessel/XericUIExtendHelper.cs.meta b/Runtime/Core/Vessel/XericUIExtendHelper.cs.meta new file mode 100644 index 0000000..ab37e5d --- /dev/null +++ b/Runtime/Core/Vessel/XericUIExtendHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6ee4993e0572478d8c7b5e62baacf30c +timeCreated: 1753265877 \ No newline at end of file diff --git a/Runtime/FlipPage.meta b/Runtime/FlipPage.meta new file mode 100644 index 0000000..126b776 --- /dev/null +++ b/Runtime/FlipPage.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4dc89cfe2b554a04d8704bc672cc0666 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/FlipPage/FlipPageComponentManager.cs b/Runtime/FlipPage/FlipPageComponentManager.cs new file mode 100644 index 0000000..dfdeade --- /dev/null +++ b/Runtime/FlipPage/FlipPageComponentManager.cs @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using Sirenix.OdinInspector; +using UnityEngine; +using UnityEngine.UI; +using XericUI.Core.Vessel; + +namespace XericUI.FlipPage +{ + /// + /// 翻页组件管�器 + /// + /// 对翻页组件的管� + /// + public class FlipPageComponentManager : XericFlipPageIndexVesselBase + { + #region 界�属性 + + /// + /// 首页按钮 + /// +#if ODIN_INSPECTOR + [LabelText("首页按钮")] [BoxGroup("组件", centerLabel: true)] +#endif + public ObjectVessel