Compare commits

...

34 Commits

Author SHA1 Message Date
ALEXTANG
d6dcd8851c 更新文档
更新文档
2023-08-18 17:49:28 +08:00
ALEXTANG
bbea9c4cee Update UIExtension.cs 2023-08-18 17:10:41 +08:00
ALEXTANG
b1ccb1fd53 Update Utility.Http.cs 2023-08-18 16:54:17 +08:00
ALEXTANG
0f2ad3c71d [+] UI循环列表拓展Grid 用法和List一样
[+] UI循环列表拓展Grid 用法和List一样
2023-08-18 16:32:08 +08:00
ALEXTANG
0e6851e691 Remove unused ogg
Remove unused ogg
2023-08-18 15:24:33 +08:00
ALEXTANG
75b9956261 流程初始音效设置开启 2023-08-18 14:33:49 +08:00
ALEXTANG
401c397fc8 流程初始音效设置开启
流程初始音效设置开启
2023-08-18 14:25:10 +08:00
ALEXTANG
94b314e91f TEngine设置面板增加从Hybrid同步AOT与热更程序集的按钮
TEngine设置面板增加从Hybrid同步AOT与热更程序集的按钮
2023-08-18 13:06:08 +08:00
ALEXTANG
a6573d9336 Update ConfigLoader.cs 2023-08-18 13:05:02 +08:00
ALEXTANG
abf5357f49 给不支持WEBGL的增加宏定义
给不支持WEBGL的增加宏定义
2023-08-18 13:04:53 +08:00
ALEXTANG
aab353cca3 Remove Unused Codes.
Remove Unused Codes.
2023-08-17 23:11:11 +08:00
ALEXTANG
e13071c4db 移除调试luban残留的日志
移除调试luban残留的日志
2023-08-17 23:10:14 +08:00
ALEXTANG
e071c20214 拓展自定义鲁班加载配置,支持懒加载 默认使用懒加载,未使用的配置不会载入内存
拓展自定义鲁班加载配置,支持懒加载 默认使用懒加载,未使用的配置不会载入内存
2023-08-17 23:07:07 +08:00
ALEXTANG
bf73ce333b 拓展自定义鲁班加载配置,支持UniTask异步 默认使用同步加载
拓展自定义鲁班加载配置,支持UniTask异步 默认使用同步加载
2023-08-17 22:00:55 +08:00
ALEXTANG
d7a60002d4 ErrorLog使用异步显示UI
ErrorLog使用异步显示UI
2023-08-17 21:41:30 +08:00
ALEXTANG
61f657322d 增加WebGLUpdateDataUrl
增加WebGLUpdateDataUrl
2023-08-17 21:41:07 +08:00
ALEXTANG
33223dc02e 处理DotNet网络层对WebGL导出的兼容 2023-08-17 21:38:21 +08:00
ALEXTANG
0661c59877 处理DotNet网络层对WebGL导出的兼容
处理DotNet网络层对WebGL导出的兼容
2023-08-17 14:06:09 +08:00
ALEXTANG
7c74e10857 提供单独销毁UIWidget的接口。增加UIWidget异步创建接口。
提供单独销毁UIWidget的接口。增加UIWidget异步创建接口。
2023-08-17 10:59:37 +08:00
ALEXTANG
db935bfb5f DotNet 加入热更域,修正GameProto的依赖
DotNet 加入热更域,修正GameProto的依赖
2023-08-16 15:31:16 +08:00
ALEXTANG
dc6b7bb21e 增加使用UniTask的常用资源加载接口
增加使用UniTask的常用资源加载接口
2023-08-15 17:24:02 +08:00
ALEXTANG
d32f3cb768 增加使用UniTask的常用资源加载接口
增加使用UniTask的常用资源加载接口
2023-08-15 17:22:05 +08:00
ALEXTANG
a32ab30444 修改luban模板配置,支持异步加载配置实例,客户端使用UniTask异步加载配置,避免WebGL不支持原生Task
修改luban模板配置,支持异步加载配置实例,客户端使用UniTask异步加载配置,避免WebGL不支持原生Task
2023-08-15 12:54:15 +08:00
ALEXTANG
aa0d40c758 修改luban模板配置,支持异步加载配置实例
修改luban模板配置,支持异步加载配置实例
2023-08-15 12:07:21 +08:00
ALEXTANGXIAO
5239b89326 DotNet 加入热更域
DotNet 加入热更域
2023-08-12 23:39:21 +08:00
ALEXTANG
53f0ecb6c1 [+] UI循环列表拓展与示例
[+] UI循环列表拓展与示例
2023-08-10 23:25:43 +08:00
ALEXTANG
ea9447d0ea Update ClientGm.cs 2023-08-10 10:10:50 +08:00
ALEXTANG
0c6d59f53e Fixed BehaviourSingleton #45
Fixed BehaviourSingleton #45
2023-08-10 10:09:59 +08:00
ALEXTANG
9986e22d18 [-] Remove Old ProtoGenerate
[-] Remove Old Proto Generate
2023-08-09 14:22:39 +08:00
ALEXTANG
7deb049769 更新Entity接口 泛型获取父级、Define增加unit[]类型
更新Entity接口 泛型获取父级、Define增加unit[]类型
2023-08-09 11:09:38 +08:00
ALEXTANG
fce8bd4d60 Update DebuggerModule.SettingsWindow.cs 2023-08-08 19:54:37 +08:00
ALEXTANG
7ec14c670f Luban配置表拓展分组-分组为c和client的为仅客户端字段s和server为仅服务器字段
Luban配置表拓展分组-分组为c和client的为仅客户端字段s和server为仅服务器字段
2023-08-07 15:14:43 +08:00
ALEXTANGXIAO
efe3d2b25b Update README
Update README
2023-08-06 00:36:29 +08:00
ALEXTANGXIAO
2107282368 Update Readme
Update Readme
2023-08-05 00:54:25 +08:00
176 changed files with 10248 additions and 4704 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6a824de3af698c34bb4343dbb911498b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,85 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &99681264163055430
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6931044727624756224}
- component: {fileID: 3459913616456895755}
- component: {fileID: 3314925424923711536}
m_Layer: 5
m_Name: m_textInfo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6931044727624756224
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 99681264163055430}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 205567445133409828}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 91.35828}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3459913616456895755
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 99681264163055430}
m_CullTransparentMesh: 1
--- !u!114 &3314925424923711536
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 99681264163055430}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!1 &200028900962926734
GameObject:
m_ObjectHideFlags: 0
@@ -160,7 +80,7 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u8F93\u5165\u7528\u6237\u540D"
--- !u!1 &867330116831009509
--- !u!1 &228610304149681099
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -168,35 +88,89 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4167822937073975279}
- component: {fileID: 2661482540827288745}
- component: {fileID: 8059956825526392220}
- component: {fileID: 6750364511045006514}
- component: {fileID: 4295640278102793288}
m_Layer: 5
m_Name: Sliding Area
m_Name: Viewport
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4167822937073975279
--- !u!224 &2661482540827288745
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 867330116831009509}
m_GameObject: {fileID: 228610304149681099}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2822172956986517463}
m_Father: {fileID: 6625053874581620453}
- {fileID: 5225285352838474515}
m_Father: {fileID: 2913277243696531993}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: -20}
m_Pivot: {x: 0.5, y: 0.5}
m_SizeDelta: {x: 0, y: -17}
m_Pivot: {x: 0, y: 1}
--- !u!222 &8059956825526392220
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 228610304149681099}
m_CullTransparentMesh: 1
--- !u!114 &6750364511045006514
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 228610304149681099}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &4295640278102793288
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 228610304149681099}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
--- !u!1 &987942439051806727
GameObject:
m_ObjectHideFlags: 0
@@ -277,7 +251,7 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!1 &1128107678303727112
--- !u!1 &1354977820134472711
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -285,125 +259,49 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6625053874581620453}
- component: {fileID: 7920198895917174325}
- component: {fileID: 1252844165034735494}
- component: {fileID: 7751190632459406769}
- component: {fileID: 5910359893906513543}
- component: {fileID: 5407814213624276446}
m_Layer: 5
m_Name: Scrollbar Vertical
m_Name: m_itemTemp
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6625053874581620453
--- !u!224 &5910359893906513543
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1128107678303727112}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_GameObject: {fileID: 1354977820134472711}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4167822937073975279}
m_Father: {fileID: 6950316414753065386}
m_RootOrder: 1
- {fileID: 1620476634722495211}
m_Father: {fileID: 5225285352838474515}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 0.000015259}
m_Pivot: {x: 1, y: 1}
--- !u!222 &7920198895917174325
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1128107678303727112}
m_CullTransparentMesh: 1
--- !u!114 &1252844165034735494
m_SizeDelta: {x: 163, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!114 &5407814213624276446
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1128107678303727112}
m_GameObject: {fileID: 1354977820134472711}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Script: {fileID: 11500000, guid: 29af6e9bda3402e4eba67bb72531e618, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &7751190632459406769
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1128107678303727112}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 1221139505962229183}
m_HandleRect: {fileID: 2822172956986517463}
m_Direction: 2
m_Value: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
Padding: 0
--- !u!1 &1517610079850641450
GameObject:
m_ObjectHideFlags: 0
@@ -564,6 +462,133 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u6CE8\u518C"
--- !u!1 &2294538527106005025
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2913277243696531993}
- component: {fileID: 7710575040041964180}
- component: {fileID: 6581535211515335702}
- component: {fileID: 7476014482463418513}
- component: {fileID: 2372447356726108403}
m_Layer: 5
m_Name: m_scrollRect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2913277243696531993
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2294538527106005025}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2661482540827288745}
m_Father: {fileID: 2683445927021212027}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -185.26123}
m_SizeDelta: {x: 0, y: 370.5225}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7710575040041964180
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2294538527106005025}
m_CullTransparentMesh: 1
--- !u!114 &6581535211515335702
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2294538527106005025}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &7476014482463418513
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2294538527106005025}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Content: {fileID: 5225285352838474515}
m_Horizontal: 1
m_Vertical: 0
m_MovementType: 1
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
m_ScrollSensitivity: 1
m_Viewport: {fileID: 2661482540827288745}
m_HorizontalScrollbar: {fileID: 0}
m_VerticalScrollbar: {fileID: 0}
m_HorizontalScrollbarVisibility: 2
m_VerticalScrollbarVisibility: 2
m_HorizontalScrollbarSpacing: -3
m_VerticalScrollbarSpacing: -3
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!114 &2372447356726108403
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2294538527106005025}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dd536d252034dd74b87b436507ec44f7, type: 3}
m_Name:
m_EditorClassIdentifier:
itemPrefabDataList: []
arrangeType: 2
supportScrollBar: 1
itemSnapEnable: 0
viewPortSnapPivot: {x: 0, y: 0}
itemSnapPivot: {x: 0, y: 0}
--- !u!1 &2683445925571829816
GameObject:
m_ObjectHideFlags: 0
@@ -671,9 +696,9 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6950316414753065386}
- {fileID: 2734507746760885577}
- {fileID: 3818961499522768759}
- {fileID: 2913277243696531993}
m_Father: {fileID: 2683445925571829817}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -1116,7 +1141,7 @@ RectTransform:
m_Children:
- {fileID: 1376866687255549051}
m_Father: {fileID: 2683445927021212027}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@@ -1262,97 +1287,6 @@ MonoBehaviour:
pressedScale: {x: 0.95, y: 0.95, z: 0.95}
duration: 0.1
needRemoveAllTween: 1
--- !u!1 &4316178753519714167
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1891477315646888193}
- component: {fileID: 5879102155965158337}
- component: {fileID: 8203107606952135234}
- component: {fileID: 8213615779585061549}
m_Layer: 5
m_Name: Viewport
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1891477315646888193
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4316178753519714167}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1766356475428725500}
m_Father: {fileID: 6950316414753065386}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &5879102155965158337
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4316178753519714167}
m_CullTransparentMesh: 1
--- !u!114 &8203107606952135234
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4316178753519714167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &8213615779585061549
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4316178753519714167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
--- !u!1 &4436822588635160366
GameObject:
m_ObjectHideFlags: 0
@@ -1572,115 +1506,6 @@ MonoBehaviour:
pressedScale: {x: 0.95, y: 0.95, z: 0.95}
duration: 0.1
needRemoveAllTween: 1
--- !u!1 &5163362076385105452
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6950316414753065386}
- component: {fileID: 693582444088145824}
- component: {fileID: 2430355853573420865}
- component: {fileID: 4282330504859036445}
m_Layer: 5
m_Name: m_goScrollView
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6950316414753065386
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5163362076385105452}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1891477315646888193}
- {fileID: 6625053874581620453}
m_Father: {fileID: 2683445927021212027}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 142.37941, y: -246.96753}
m_SizeDelta: {x: 284.7588, y: 493.9349}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &693582444088145824
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5163362076385105452}
m_CullTransparentMesh: 1
--- !u!114 &2430355853573420865
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5163362076385105452}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &4282330504859036445
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5163362076385105452}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Content: {fileID: 1766356475428725500}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
m_ScrollSensitivity: 1
m_Viewport: {fileID: 1891477315646888193}
m_HorizontalScrollbar: {fileID: 0}
m_VerticalScrollbar: {fileID: 7751190632459406769}
m_HorizontalScrollbarVisibility: 2
m_VerticalScrollbarVisibility: 2
m_HorizontalScrollbarSpacing: -3
m_VerticalScrollbarSpacing: -3
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!1 &5314664002961178086
GameObject:
m_ObjectHideFlags: 0
@@ -1714,89 +1539,13 @@ RectTransform:
- {fileID: 1106430378647148480}
- {fileID: 8401360966016205532}
m_Father: {fileID: 2683445927021212027}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6110186098461980524
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2822172956986517463}
- component: {fileID: 1893953740262017174}
- component: {fileID: 1221139505962229183}
m_Layer: 5
m_Name: Handle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2822172956986517463
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6110186098461980524}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4167822937073975279}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1893953740262017174
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6110186098461980524}
m_CullTransparentMesh: 1
--- !u!114 &1221139505962229183
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6110186098461980524}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7135572807202764412
GameObject:
m_ObjectHideFlags: 0
@@ -1944,7 +1693,7 @@ MonoBehaviour:
m_CaretWidth: 1
m_ReadOnly: 0
m_ShouldActivateOnSelect: 1
--- !u!1 &7277374689422034622
--- !u!1 &8297792320047316563
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -1952,9 +1701,83 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1766356475428725500}
- component: {fileID: 7443401408893521434}
- component: {fileID: 695462780974354670}
- component: {fileID: 1620476634722495211}
- component: {fileID: 3309228999550946613}
- component: {fileID: 581887214916487053}
m_Layer: 5
m_Name: Sp
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1620476634722495211
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8297792320047316563}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5910359893906513543}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3309228999550946613
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8297792320047316563}
m_CullTransparentMesh: 1
--- !u!114 &581887214916487053
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8297792320047316563}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &8523066568731304380
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5225285352838474515}
m_Layer: 5
m_Name: m_tfContent
m_TagString: Untagged
@@ -1962,104 +1785,27 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1766356475428725500
--- !u!224 &5225285352838474515
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7277374689422034622}
m_GameObject: {fileID: 8523066568731304380}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 205567445133409828}
m_Father: {fileID: 1891477315646888193}
- {fileID: 5910359893906513543}
m_Father: {fileID: 2661482540827288745}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 300}
m_Pivot: {x: 0, y: 1}
--- !u!114 &7443401408893521434
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7277374689422034622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 1
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &695462780974354670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7277374689422034622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 2
--- !u!1 &8738425861440261120
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 205567445133409828}
m_Layer: 5
m_Name: m_itemNetLog
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &205567445133409828
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8738425861440261120}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6931044727624756224}
m_Father: {fileID: 1766356475428725500}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8765138137118890297
GameObject:
m_ObjectHideFlags: 0

View File

@@ -80,7 +80,7 @@ public static class Define
{
"", "0", "bool", "byte", "short", "ushort", "int", "uint", "long", "ulong", "float", "string", "AttrConfig",
"IntDictionaryConfig", "StringDictionaryConfig",
"short[]", "int[]", "long[]", "float[]", "string[]"
"short[]", "int[]", "long[]", "float[]", "string[]","uint[]"
};
/// <summary>
/// Excel生成代码模板的位置

View File

@@ -450,6 +450,11 @@ namespace TEngine
#endif
#region GetComponent
public T GetParent<T>() where T : Entity, new()
{
return (T)Parent;
}
public T GetComponent<T>() where T : Entity, new()
{
return GetComponent(typeof(T)) as T;

View File

@@ -4,6 +4,7 @@ namespace TEngine.Core.Network
{
None = 0,
KCP = 1,
TCP = 2
TCP = 2,
WebSocket = 3,
}
}

View File

@@ -2,7 +2,9 @@ using System;
using System.Collections.Generic;
using System.Net;
using System.Net.NetworkInformation;
#if !UNITY_WEBGL
using System.Net.Sockets;
#endif
using System.Runtime.InteropServices;
// ReSharper disable InconsistentNaming
@@ -49,6 +51,7 @@ namespace TEngine.Core
return $"{self.Address}:{self.Port}";
}
#if !UNITY_WEBGL
public static void SetSioUdpConnReset(Socket socket)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
@@ -70,5 +73,6 @@ namespace TEngine.Core
socket.IOControl(SIO_UDP_CONNRESET, new[] {Convert.ToByte(false)}, null);
}
#endif
}
}

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System.Net.Sockets;
namespace TEngine.Core.Network
@@ -48,4 +49,5 @@ namespace TEngine.Core.Network
}
}
}
}
}
#endif

View File

@@ -13,7 +13,8 @@ namespace TEngine.Core.Network
public void Initialize(NetworkProtocolType networkProtocolType, NetworkTarget networkTarget)
{
switch (networkProtocolType)
{
{
#if !UNITY_WEBGL
case NetworkProtocolType.KCP:
{
Network = new KCPClientNetwork(Scene, networkTarget);
@@ -24,6 +25,7 @@ namespace TEngine.Core.Network
Network = new TCPClientNetwork(Scene, networkTarget);
return;
}
#endif
default:
{
throw new NotSupportedException($"Unsupported NetworkProtocolType:{networkProtocolType}");

View File

@@ -13,6 +13,7 @@ namespace TEngine.Core.Network
{
switch (networkProtocolType)
{
#if !UNITY_WEBGL
case NetworkProtocolType.KCP:
{
Network = new KCPServerNetwork(Scene, networkTarget, address);
@@ -25,6 +26,7 @@ namespace TEngine.Core.Network
// Log.Info($"NetworkProtocol:TCP IPEndPoint:{address}");
return;
}
#endif
default:
{
throw new NotSupportedException($"Unsupported NetworkProtocolType:{networkProtocolType}");

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System;
using System.Buffers;
using System.Collections.Generic;
@@ -565,4 +566,5 @@ namespace TEngine.Core.Network
#endregion
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System;
using System.Collections.Generic;
using System.IO;
@@ -459,4 +460,5 @@ namespace TEngine.Core.Network
#endregion
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System;
using System.Buffers;
using System.IO;
@@ -232,4 +233,5 @@ namespace TEngine.Core.Network
#endregion
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System;
using System.Collections.Generic;
using System.IO;
@@ -538,4 +539,5 @@ namespace TEngine.Core.Network
#endregion
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System;
using System.Collections.Generic;
using System.IO;
@@ -235,4 +236,5 @@ namespace TEngine.Core.Network
#endregion
}
}
}
#endif

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using System;
using System.IO;
using System.Net.Sockets;
@@ -346,4 +347,5 @@ namespace TEngine.Core.Network
#endregion
}
}
}
#endif

View File

@@ -3,7 +3,11 @@
using System;
using System.Collections.Generic;
using System.Reflection;
#if UNITY_WEBGL
using Cysharp.Threading.Tasks;
#else
using System.Threading.Tasks;
#endif
using TEngine.DataStructure;
#pragma warning disable CS8601
#pragma warning disable CS8604
@@ -25,10 +29,10 @@ namespace TEngine.Core
private static void Load(int assemblyName)
{
var count = 0;
var task = new List<Task>();
#if !UNITY_WEBGL
var task = new List<Task>();
#endif
UnLoad(assemblyName);
foreach (var singletonType in AssemblyManager.ForEach(assemblyName, typeof(ISingleton)))
{
var instance = (ISingleton) Activator.CreateInstance(singletonType);
@@ -38,7 +42,11 @@ namespace TEngine.Core
if (initializeMethodInfo != null)
{
#if !UNITY_WEBGL
task.Add((Task) initializeMethodInfo.Invoke(instance, null));
#else
initializeMethodInfo.Invoke(instance, null);
#endif
}
registerMethodInfo?.Invoke(instance, new object[] {instance});
@@ -58,7 +66,9 @@ namespace TEngine.Core
Singletons.Enqueue(assemblyName, instance);
}
#if !UNITY_WEBGL
Task.WaitAll(task.ToArray());
#endif
Log.Info($"assembly:{assemblyName} load Singleton count:{count}");
}

View File

@@ -1,12 +1,13 @@
using System;
using System;
using System.Collections.Generic;
namespace TEngine
{
/// <summary>
/// 通过LogicSys来驱动且具备Unity完整生命周期的单例不继承MonoBehaviour
/// <remarks>Update、FixUpdate以及LateUpdate这些敏感帧更新需要加上对应的Attribute以最优化性能。</remarks>
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="T">完整生命周期的类型。</typeparam>
public abstract class BehaviourSingleton<T> : BaseBehaviourSingleton where T : BaseBehaviourSingleton, new()
{
private static T _instance;
@@ -45,11 +46,6 @@ namespace TEngine
{
}
public virtual bool IsHaveLateUpdate()
{
return false;
}
public virtual void Start()
{
}
@@ -159,7 +155,6 @@ namespace TEngine
{
var listStart = _listStart;
var listToUpdate = _listUpdate;
var listToLateUpdate = _listLateUpdate;
if (listStart.Count > 0)
{
for (int i = 0; i < listStart.Count; i++)
@@ -169,12 +164,6 @@ namespace TEngine
inst.IsStart = true;
inst.Start();
listToUpdate.Add(inst);
if (inst.IsHaveLateUpdate())
{
listToLateUpdate.Add(inst);
}
}
listStart.Clear();

View File

@@ -1,3 +1,4 @@
#if !UNITY_WEBGL
using UnityEngine;
using System.Collections.Generic;
using System;
@@ -10,19 +11,18 @@ using System.Linq;
{
aucThread = new Thread(ReceiveMsg);
aucThread.Start();
}
}
//进程调用主线程方法
MainPack pack = (MainPack)MainPack.Descriptor.Parser.ParseFrom(buffer, 0, len);
Loom.QueueOnMainThread((param) =>
{
UdpHandleResponse(pack);
}, null);
*******************************************************************************/
namespace GameBase
{
/// <summary>
/// Loom多线程通信。
/// <remarks></remarks>
@@ -187,4 +187,5 @@ namespace GameBase
}
}
}
}
}
#endif

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: ab10a5a730054c5aaa942164c750abfb
timeCreated: 1689576189

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 94212c40840344b5bd6ba4fc82097d47
timeCreated: 1689576337

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 78e93a657ea64d5d97000e8b6cc83ffc
timeCreated: 1689576342

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 3212280593954784b888cf6e9fa088a8
timeCreated: 1689584199

View File

@@ -1,11 +0,0 @@
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// Actor属性数据管理。
/// </summary>
public class ActorData : EntityLogicComponent
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: a344b822c96449a29d78fb64b02c762d
timeCreated: 1689584206

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: cc314cd9682f4c1d8a870e2b4c6a5c88
timeCreated: 1689584122

View File

@@ -1,86 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 实体类的Buff管理。
/// </summary>
public class BuffComponent:EntityLogicComponent
{
private readonly Dictionary<int, BufferItem> _allBuff = new Dictionary<int, BufferItem>();
private readonly List<BufferItem> _listBuff = new List<BufferItem>();
public override void Dispose()
{
foreach (var bufferItem in _listBuff)
{
BufferItem.Release(bufferItem);
}
_listBuff.Clear();
_allBuff.Clear();
base.Dispose();
}
/// <summary>
/// 增加Buff。
/// </summary>
/// <param name="buffId">BuffId。</param>
/// <param name="caster">施法者。</param>
/// <param name="addStackNum">增加层数。</param>
/// <param name="skillId">技能Id。</param>
/// <returns></returns>
public bool AddBuff(int buffId, EntityLogic caster, int addStackNum = 1, uint skillId = 0)
{
BufferItem bufferItem = BufferItem.Alloc(buffId);
if (bufferItem == null)
{
return false;
}
RefreshBuffAttr();
UpdateBuffState();
_allBuff.Add(buffId, bufferItem);
_listBuff.Add(bufferItem);
return true;
}
/// <summary>
/// 移除Buff。
/// </summary>
/// <param name="buffID">BuffID。</param>
/// <param name="caster">移除施放来源。</param>
public void RmvBuff(int buffID, EntityLogic caster)
{
if (_allBuff.TryGetValue(buffID, out BufferItem buffItem))
{
RemoveBuffFromList(buffItem);
RefreshBuffAttr();
UpdateBuffState();
}
}
private void RemoveBuffFromList(BufferItem buffItem)
{
Log.Info("remove buff: {0}", buffItem.BuffID);
BufferItem.Release(buffItem);
_allBuff.Remove(buffItem.BuffID);
_listBuff.Remove(buffItem);
}
/// <summary>
/// 刷新Buff带来的属性。
/// </summary>
private void RefreshBuffAttr()
{
}
/// <summary>
/// 刷新Buff改变的状态。
/// </summary>
private void UpdateBuffState()
{
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 29088ba5001247628aefb072c6d82705
timeCreated: 1689582372

View File

@@ -1,62 +0,0 @@
using GameConfig.Battle;
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// Buff实例。
/// </summary>
public class BufferItem:IMemory
{
/// <summary>
/// BuffId。
/// </summary>
public int BuffID => BuffConfig?.BuffID ?? 0;
/// <summary>
/// BUff配置表。
/// </summary>
public BuffConfig BuffConfig { private set; get; }
/// <summary>
/// 清理内存。
/// </summary>
public void Clear()
{
BuffConfig = null;
}
/// <summary>
/// 生成Buff实例。
/// </summary>
/// <param name="buffId">buffId。</param>
/// <returns>Buff实例。</returns>
public static BufferItem Alloc(int buffId)
{
Log.Debug($"Alloc buffItem buffId:{buffId}");
BuffConfig buffConfig = ConfigLoader.Instance.Tables.TbBuff.Get(buffId);
if (buffConfig == null)
{
Log.Warning($"Alloc buffItem Failed ! buffId:{buffId}");
return null;
}
BufferItem ret = MemoryPool.Acquire<BufferItem>();
ret.BuffConfig = buffConfig;
return ret;
}
/// <summary>
/// 释放Buff实例。
/// </summary>
/// <param name="bufferItem"></param>
public static void Release(BufferItem bufferItem)
{
if (bufferItem == null)
{
return;
}
MemoryPool.Release(bufferItem);
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8915b9545484419eb2642a69d4056daf
timeCreated: 1689584322

View File

@@ -1,39 +0,0 @@
using TEngine;
using UnityEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 实体创建预数据。
/// </summary>
public class EntityCreateData:IMemory
{
public ActorEntityType actorEntityType;
public bool HasBornPos = false;
public Vector3 BornPos;
public Vector3 BornForward;
/// <summary>
/// 设置出生点。
/// </summary>
/// <param name="bornPos"></param>
/// <param name="forward"></param>
public void SetBornPos(Vector3 bornPos, Vector3 forward)
{
HasBornPos = true;
BornPos = bornPos;
BornForward = forward;
}
public void Clear()
{
actorEntityType = ActorEntityType.None;
HasBornPos = false;
BornPos = Vector3.zero;
BornForward = Vector3.zero;
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 4ba847c6eb944645a4b693f1a432d933
timeCreated: 1689583498

View File

@@ -1,65 +0,0 @@
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 逻辑层实体。
/// </summary>
public abstract class EntityLogic : Entity
{
/// <summary>
/// 逻辑层实体类型。
/// </summary>
/// <returns></returns>
public abstract ActorEntityType GetActorEntityType();
/// <summary>
/// 是否是战斗起始的Actor。
/// <remarks>,比如双方参与战斗的玩家或者技能编辑器里的Caster。</remarks>
/// </summary>
public bool IsStartActor;
public EntityCreateData CreateData { private set; get; }
public virtual string GetActorName()
{
return string.Empty;
}
#region
public ActorData ActorData { protected set; get; }
public BuffComponent BuffComponent { protected set; get; }
public SkillCasterComponent SkillCaster { protected set; get; }
#endregion
#region
internal bool LogicCreate(EntityCreateData entityCreateData)
{
CreateData = entityCreateData;
OnLogicCreate();
return true;
}
protected virtual void OnLogicCreate()
{
}
internal void LogicDestroy()
{
OnLogicDestroy();
if (CreateData != null)
{
MemoryPool.Release(CreateData);
}
}
protected virtual void OnLogicDestroy()
{
}
#endregion
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: e7b01c5b166445d680dc411dfbe5c781
timeCreated: 1689576203

View File

@@ -1,12 +0,0 @@
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 逻辑层组件实体。
/// </summary>
public abstract class EntityLogicComponent: Entity
{
public EntityLogic Owner => (EntityLogic)Parent;
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 92574294d8144f218f323f63f72a8374
timeCreated: 1689585864

View File

@@ -1,143 +0,0 @@
using System;
using System.Collections.Generic;
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 实体类型。
/// </summary>
public enum ActorEntityType
{
None,
Player,
Monster,
Pet,
Npc,
}
/// <summary>
/// 逻辑层实体管理器。
/// </summary>
public class EntityLogicMgr
{
private static readonly Dictionary<long, EntityLogic> EntityLogicPool = new Dictionary<long, EntityLogic>();
private static readonly List<EntityLogic> ListEntityLogics = new List<EntityLogic>();
public static event Action<EntityLogic> OnEntityCreate;
public static event Action<EntityLogic> OnEntityDestroy;
public static List<EntityLogic> GetAllActor(ref List<EntityLogic> temp)
{
if (temp == null)
{
temp = new List<EntityLogic>();
}
temp.AddRange(ListEntityLogics);
return temp;
}
public static List<EntityLogic> GetTypeActor(ref List<EntityLogic> temp,ActorEntityType type)
{
if (temp == null)
{
temp = new List<EntityLogic>();
}
foreach (var actor in ListEntityLogics)
{
if (actor.GetActorEntityType() == type)
{
temp.Add(actor);
}
}
return temp;
}
public static EntityLogic CreateEntityLogic(EntityCreateData entityCreateData, bool isStartActor = false)
{
if (entityCreateData == null)
{
Log.Error("create actor failed, create data is null");
return null;
}
var actor = CreateActorEntityObject(entityCreateData.actorEntityType);
if (actor == null)
{
Log.Error("create actor failed, create data is {0}", entityCreateData);
return null;
}
actor.IsStartActor = isStartActor;
if (!actor.LogicCreate(entityCreateData))
{
DestroyActor(actor);
return null;
}
if (OnEntityCreate != null)
{
OnEntityCreate(actor);
}
Log.Debug("entityLogic created: {0}", actor.GetActorName());
return actor;
}
private static EntityLogic CreateActorEntityObject(ActorEntityType actorType)
{
EntityLogic entityLogic = null;
switch (actorType)
{
case ActorEntityType.Player:
{
entityLogic = Entity.Create<PlayerEntity>(GameApp.Instance.Scene);
break;
}
default:
{
Log.Error("unknown actor type:{0}", actorType);
break;
}
}
if (entityLogic != null)
{
EntityLogicPool.Add(entityLogic.RuntimeId, entityLogic);
ListEntityLogics.Add(entityLogic);
}
return entityLogic;
}
public static bool DestroyActor(long runtimeId)
{
EntityLogicPool.TryGetValue(runtimeId, out EntityLogic entityLogic);
if (entityLogic != null)
{
return DestroyActor(entityLogic);
}
return false;
}
public static bool DestroyActor(EntityLogic entityLogic)
{
Log.Debug("on destroy entityLogic {0}", entityLogic.RuntimeId);
var runtimeId = entityLogic.RuntimeId;
Log.Assert(EntityLogicPool.ContainsKey(runtimeId));
if (OnEntityDestroy != null)
{
OnEntityDestroy(entityLogic);
}
entityLogic.LogicDestroy();
EntityLogicPool.Remove(runtimeId);
ListEntityLogics.Remove(entityLogic);
return true;
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 513b12007c8f408698d12aee22fc44db
timeCreated: 1689579220

View File

@@ -1,18 +0,0 @@
namespace GameLogic.BattleDemo
{
public class PlayerEntity : EntityLogic
{
public override ActorEntityType GetActorEntityType()
{
return ActorEntityType.Player;
}
protected override void OnLogicCreate()
{
base.OnLogicCreate();
ActorData = AddComponent<ActorData>();
BuffComponent = AddComponent<BuffComponent>();
SkillCaster = AddComponent<SkillCasterComponent>();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 9939517fe9f04f0d9c0c544fbdd43564
timeCreated: 1689576650

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8d126355d2da45c8899a7a4fff5d376c
timeCreated: 1689584135

View File

@@ -1,35 +0,0 @@
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 技能释放组件。
/// </summary>
public class SkillCasterComponent:EntityLogicComponent
{
/// <summary>
/// 播放技能。
/// </summary>
/// <param name="skillId">技能Id。</param>
/// <param name="target">目标。</param>
/// <param name="checkCd">是否检测CD。</param>
/// <param name="forceCaster">是否强制释放。</param>
/// <returns>是否播放成功。</returns>
internal void PlaySkill(int skillId, EntityLogic target = null, bool forceCaster = false, bool checkCd = true)
{
Log.Assert(skillId > 0, $"ActorName: {Owner.GetActorName()}");
Log.Debug("Start Play SKill[{0}]", skillId);
var skillBaseConfig = ConfigLoader.Instance.Tables.TbSkill.Get(skillId);
if (skillBaseConfig == null)
{
Log.Error("GetSkillBaseConfig Failed, invalid skillID: {0}", skillId);
return;
}
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 9b445989d175457db064ef74adeb4181
timeCreated: 1689582410

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 0c20684aa6954a80abe88ef8ee599800
timeCreated: 1689585664

View File

@@ -1,14 +0,0 @@
using System;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 技能表现数据。
/// <remarks>表现数据再由SkillElementData组成。</remarks>
/// </summary>
[Serializable]
public class SkillDisplayData
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 7ffa4d74525b4c55ac6013a4372c6d42
timeCreated: 1689586727

View File

@@ -1,232 +0,0 @@
using System.Collections.Generic;
using GameConfig.Battle;
using TEngine;
namespace GameLogic.BattleDemo
{
public enum SkillPlayStatus
{
/// <summary>
/// 初始状态。
/// </summary>
PlayInit,
/// <summary>
/// 技能施法前摇。
/// <remarks>播放动作阶段。</remarks>
/// </summary>
PlayingAim,
/// <summary>
/// 播放技能阶段,该阶段同时只能有一个技能播放。
/// </summary>
PlayingFront,
/// <summary>
/// 后台播放阶段,前台播放完后,可能还有一些元素要继续生效,这个时候转为后台播放阶段。
/// 同时玩家可以释放新的技能。
/// </summary>
PlayingBack,
/// <summary>
/// 播放完毕,等待播放.
/// </summary>
PlayingToFree
}
/// <summary>
/// 技能播放的数据。
/// </summary>
public class SkillPlayData:IMemory
{
/// <summary>
/// 技能内存Id,代表该玩家当前的唯一技能Id。
/// </summary>
public uint skillGid = 0;
/// <summary>
/// 技能的配置Id。
/// </summary>
public uint skillId;
/// <summary>
/// 技能的配置。
/// </summary>
public SkillBaseConfig skillBaseConfig;
/// <summary>
/// 技能表现ID.
/// </summary>
public int skillDisplayId;
/// <summary>
/// 技能表现数据。
/// </summary>
public SkillDisplayData skillDisplayData;
/// <summary>
/// 是否已经创建过visual表现层。
/// </summary>
public bool HasVisualPlayData = false;
/// <summary>
/// 开始时间。
/// </summary>
public float startTime;
/// <summary>
/// 开始技能进入后台的时间。
/// </summary>
public float startBackTime;
private SkillPlayStatus _status = SkillPlayStatus.PlayInit;
/// <summary>
/// 播放状态
/// </summary>
public SkillPlayStatus Status
{
set
{
if (_status != value)
{
_status = value;
if (_status == SkillPlayStatus.PlayingBack)
{
startBackTime = GameTime.time;
}
}
}
get => _status;
}
public bool IsFrontStatus => _status == SkillPlayStatus.PlayingAim || _status == SkillPlayStatus.PlayingFront;
public bool IsRunningStatus => _status == SkillPlayStatus.PlayingFront || _status == SkillPlayStatus.PlayingBack;
private EntityLogic _casterActor = null;
private SkillCasterComponent _skillCaster = null;
/// <summary>
/// 获取技能施法者。
/// </summary>
public EntityLogic CasterActor
{
get => _casterActor;
set
{
_casterActor = value;
_skillCaster = _casterActor.SkillCaster;
}
}
/// <summary>
/// 获取施法者的运行时ID。
/// </summary>
public long CasterId
{
get
{
if (_casterActor != null)
{
return _casterActor.RuntimeId;
}
return 0;
}
}
/// <summary>
/// 目标对象。
/// </summary>
public EntityLogic targetActor;
/// <summary>
/// 获取技能播放模块。
/// </summary>
internal SkillCasterComponent SkillCaster => _skillCaster;
/// <summary>
/// 处理动画元素。
/// </summary>
internal SkillAnimationHandle animHandle;
/// <summary>
/// 技能元素处理列表。
/// </summary>
internal List<SkillElementHandle> handleList = new List<SkillElementHandle>();
public void Clear()
{
skillId = 0;
skillGid = 0;
skillDisplayId = 0;
skillDisplayData = null;
skillBaseConfig = null;
Status = SkillPlayStatus.PlayInit;
startTime = 0;
startBackTime = 0;
CasterActor = null;
targetActor = null;
DestroyAllElement();
}
private void DestroyAllElement()
{
//销毁所有的ElementHandle
foreach (var elemHandle in handleList)
{
elemHandle?.Destroy();
}
handleList.Clear();
animHandle = null;
}
/// <summary>
/// 增加技能元素处理。
/// </summary>
/// <param name="handle">技能元素处理。</param>
/// <returns>是否增加成功。</returns>
internal bool AddElementHandle(SkillElementHandle handle)
{
string errField = null;
string checkResult = handle.CheckElementConfig(ref errField);
if (!string.IsNullOrEmpty(checkResult))
{
Log.Warning("skill Element config[{0}] error: {1}, RandomSkillLibraryId[{2}]", handle.GetType().ToString(), checkResult, skillId);
return false;
}
handleList.Add(handle);
return true;
}
/// <summary>
/// 创建表现层技能对象。
/// </summary>
internal void CreateVisualObject()
{
if (HasVisualPlayData)
{
return;
}
HasVisualPlayData = true;
//发送给visual事件
//TODO
}
/// <summary>
/// 销毁表现层技能对象。
/// </summary>
internal void DestroyVisualObject()
{
if (HasVisualPlayData && _casterActor != null)
{
HasVisualPlayData = false;
//TODO
}
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 05013b249849443eb8c5cb10491233ed
timeCreated: 1689586140

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 29cd06d7bab9405481fc35365616dac3
timeCreated: 1689587459

View File

@@ -1,7 +0,0 @@
namespace GameLogic.BattleDemo
{
public abstract class SkillElementData
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 7d6aefa939104f9d89a18ab78e385d05
timeCreated: 1689587502

View File

@@ -1,23 +0,0 @@
using System;
namespace GameLogic.BattleDemo
{
[Serializable]
public enum SkillTriggerEvent
{
/// <summary>
/// 无触发。
/// </summary>
NoneEvent,
/// <summary>
/// 时间点触发。
/// </summary>
TimeEvent,
/// <summary>
/// 施法结束触发。
/// </summary>
AnimStopEvent,
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 0413bfaea7674c68bde372498c15cc2d
timeCreated: 1689588039

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 503ad5f03b8b4f8aab31436f9c5f44eb
timeCreated: 1689587434

View File

@@ -1,7 +0,0 @@
namespace GameLogic.BattleDemo
{
public class SkillAnimationHandle:SkillElementHandle
{
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: f93a8f3fc1e34bb8a03bdb3c0ba56e27
timeCreated: 1689587524

View File

@@ -1,152 +0,0 @@
using GameConfig.Battle;
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 每个元素的状态。
/// </summary>
public enum SkillElementStatus
{
/// <summary>
/// 元素状态初始化。
/// </summary>
ELEM_STATUS_INIT,
/// <summary>
/// 元素状态运行中。
/// </summary>
ELEM_STATUS_RUN,
/// <summary>
/// 元素状态停止。
/// </summary>
ELEM_STATUS_STOP
}
public abstract class SkillElementHandle
{
private static uint m_nextHandleGID = 1;
public uint m_handleGID;
public EntityLogic CasterActor;
protected uint m_skillId;
protected SkillAttrDamageData[] m_damageAttr;
protected SkillPlayData m_playData;
public SkillElementStatus Status = SkillElementStatus.ELEM_STATUS_INIT;
public void Destroy()
{
if (Status == SkillElementStatus.ELEM_STATUS_RUN)
{
Stop();
}
OnDestroy();
}
/// <summary>
/// 初始化接口
/// </summary>
public void Init(SkillPlayData playData, SkillAttrDamageData[] damageAttr)
{
m_handleGID = m_nextHandleGID++;
CasterActor = playData.CasterActor;
m_skillId = playData.skillId;
m_playData = playData;
m_damageAttr = damageAttr;
Status = SkillElementStatus.ELEM_STATUS_INIT;
OnInit();
}
/// <summary>
/// 触发Element开始。
/// </summary>
/// <param name="playData">技能播放数据。</param>
/// <param name="eventType">技能触发类型。</param>
public void Start(SkillPlayData playData, SkillTriggerEvent eventType)
{
if (Status != SkillElementStatus.ELEM_STATUS_INIT)
{
Log.Error("invalid status skillId[{0}] element Type[{1}]", m_skillId, GetType().Name);
return;
}
Status = SkillElementStatus.ELEM_STATUS_RUN;
//如果是重复触发的机制,则不需要开始就触发。
OnStart(playData, eventType);
}
/// <summary>
/// 触发Element结束。
/// </summary>
public void Stop()
{
if (Status == SkillElementStatus.ELEM_STATUS_STOP)
{
return;
}
if (Status != SkillElementStatus.ELEM_STATUS_RUN)
{
Status = SkillElementStatus.ELEM_STATUS_STOP;
return;
}
Status = SkillElementStatus.ELEM_STATUS_STOP;
OnStop();
}
#region override function
/// <summary>
/// 检查配置是否正常
/// </summary>
/// <returns></returns>
public virtual string CheckElementConfig(ref string errField)
{
return null;
}
/// <summary>
/// 初始化一些数,在加入到技能列表的时候触发
/// </summary>
protected virtual void OnInit()
{
}
/// <summary>
/// 触发销毁。
/// </summary>
protected virtual void OnDestroy()
{
}
/// <summary>
/// 触发开始
/// </summary>
/// <param name="playData">触发开始的消息类型</param>
/// <param name="eventType">触发开始的消息类型</param>
protected virtual void OnStart(SkillPlayData playData, SkillTriggerEvent eventType)
{
}
/// <summary>
/// 触发结束。
/// </summary>
protected virtual void OnStop()
{
}
/// <summary>
/// 调试绘制。
/// </summary>
public virtual void OnDrawGizmos()
{
}
#endregion
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 689c542f2f41447395080f93982a872f
timeCreated: 1689587448

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: fad718b498934a5d8c63aa6d1e115485
timeCreated: 1689576347

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 489220b19d954b69be5e170287e92210
timeCreated: 1689584174

View File

@@ -1,18 +0,0 @@
using TEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 外观显示组件。
/// </summary>
public class DisplayComponent:EntityLogicComponent
{
public DisplayInfo displayInfo;
public override void Dispose()
{
MemoryPool.Release(displayInfo);
base.Dispose();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: e1b7fbc52816477c9fc7de9eabe17667
timeCreated: 1689582273

View File

@@ -1,12 +0,0 @@
using TEngine;
namespace GameLogic.BattleDemo
{
public class DisplayInfo:IMemory
{
public void Clear()
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 7ee020b854aa4c62b684df994d73ad7a
timeCreated: 1689585424

View File

@@ -1,14 +0,0 @@
using UnityEngine;
namespace GameLogic.BattleDemo
{
/// <summary>
/// 表现层实体。
/// </summary>
public abstract class EntityVisual:MonoBehaviour
{
public EntityLogic Entity { protected set; get;}
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 892288dabf264b20b49b03ae91ccf5f8
timeCreated: 1689576255

View File

@@ -7,8 +7,6 @@ public partial class GameApp:Singleton<GameApp>
{
private static List<Assembly> _hotfixAssembly;
public Scene Scene { private set; get; }
/// <summary>
/// 热更域App主入口。
/// </summary>
@@ -35,7 +33,7 @@ public partial class GameApp:Singleton<GameApp>
/// </summary>
private void StartGameLogic()
{
}
/// <summary>

View File

@@ -22,6 +22,11 @@ public partial class GameApp
}
/// <summary>
/// Entity框架根节点。
/// </summary>
public Scene Scene { private set; get; }
/// <summary>
/// 注册所有逻辑系统
/// </summary>
@@ -38,6 +43,7 @@ public partial class GameApp
//带生命周期的单例系统。
AddLogicSys(BehaviourSingleSystem.Instance);
AddLogicSys(DataCenterSys.Instance);
AddLogicSys(ConfigSystem.Instance);
GMBehaviourSystem.Instance.Active();
}

View File

@@ -9,6 +9,7 @@ namespace GameLogic
public delegate void HandleGM(List<string> @params);
[Update]
[LateUpdate]
public class GMBehaviourSystem : BehaviourSingleton<GMBehaviourSystem>
{
public override void Active()
@@ -17,14 +18,22 @@ namespace GameLogic
base.Active();
}
public override void Start()
{
base.Start();
}
public override void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
{
GameModule.UI.ShowUIAsync<GMPanel>();
}
}
;
public override void LateUpdate()
{
base.LateUpdate();
}
}

View File

@@ -1,16 +1,28 @@
using System.Collections.Generic;
using GameLogic;
using UnityEngine;
using UnityEngine.UI;
using TEngine;
class TempData
{
}
class TempItem : UILoopItemWidget, IListDataItem<TempData>
{
public void SetItemData(TempData d)
{
}
}
[Window(UILayer.UI)]
class NetWorkDemoUI : UIWindow
{
protected UILoopListWidget<TempItem, TempData> m_loopList;
#region
private GameObject m_goScrollView;
private Transform m_tfContent;
private GameObject m_itemNetLog;
private GameObject m_goConnect;
private Button m_btnConnect;
private GameObject m_goLogin;
@@ -18,12 +30,11 @@ class NetWorkDemoUI : UIWindow
private InputField m_inputName;
private Button m_btnLogin;
private Button m_btnRegister;
private ScrollRect m_scrollRect;
private Transform m_tfContent;
private GameObject m_itemTemp;
public override void ScriptGenerator()
{
m_goScrollView = FindChild("Panel/m_goScrollView").gameObject;
m_tfContent = FindChild("Panel/m_goScrollView/Viewport/m_tfContent");
m_itemNetLog = FindChild("Panel/m_goScrollView/Viewport/m_tfContent/m_itemNetLog").gameObject;
m_goConnect = FindChild("Panel/m_goConnect").gameObject;
m_btnConnect = FindChildComponent<Button>("Panel/m_goConnect/m_btnConnect");
m_goLogin = FindChild("Panel/m_goLogin").gameObject;
@@ -31,13 +42,28 @@ class NetWorkDemoUI : UIWindow
m_inputName = FindChildComponent<InputField>("Panel/m_goLogin/m_inputName");
m_btnLogin = FindChildComponent<Button>("Panel/m_goLogin/m_btnLogin");
m_btnRegister = FindChildComponent<Button>("Panel/m_goLogin/m_btnRegister");
m_scrollRect = FindChildComponent<ScrollRect>("Panel/m_scrollRect");
m_tfContent = FindChild("Panel/m_scrollRect/Viewport/m_tfContent");
m_itemTemp = FindChild("Panel/m_scrollRect/Viewport/m_tfContent/m_itemTemp").gameObject;
m_btnConnect.onClick.AddListener(OnClickConnectBtn);
m_btnLogin.onClick.AddListener(OnClickLoginBtn);
m_btnRegister.onClick.AddListener(OnClickRegisterBtn);
}
#endregion
public override void OnRefresh()
{
m_loopList = CreateWidget<UILoopListWidget<TempItem, TempData>>(m_scrollRect.gameObject);
m_loopList.itemBase = m_itemTemp;
List<TempData> datas = new List<TempData>();
for (int i = 0; i < 100; i++)
{
datas.Add(new TempData());
}
m_loopList.SetDatas(datas);
base.OnRefresh();
}
#region
private void OnClickConnectBtn()

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 881edafa002b2e44ab8d65769582db3a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f0e67891bd0f0c7449b345c622ed6b0e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0fcee77031f85f84dbc6735c875d64b8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,84 @@
using UnityEngine;
using UnityEngine.EventSystems;
namespace GameLogic
{
public class ClickEventListener : MonoBehaviour, IPointerClickHandler, IPointerDownHandler, IPointerUpHandler
{
public static ClickEventListener Get(GameObject obj)
{
ClickEventListener listener = obj.GetComponent<ClickEventListener>();
if (listener == null)
{
listener = obj.AddComponent<ClickEventListener>();
}
return listener;
}
private System.Action<GameObject> _clickedHandler = null;
private System.Action<GameObject> _doubleClickedHandler = null;
private System.Action<GameObject> _onPointerDownHandler = null;
private System.Action<GameObject> _onPointerUpHandler = null;
bool _isPressed = false;
public bool IsPressed => _isPressed;
public void OnPointerClick(PointerEventData eventData)
{
if (eventData.clickCount == 2)
{
if (_doubleClickedHandler != null)
{
_doubleClickedHandler(gameObject);
}
}
else
{
if (_clickedHandler != null)
{
_clickedHandler(gameObject);
}
}
}
public void SetClickEventHandler(System.Action<GameObject> handler)
{
_clickedHandler = handler;
}
public void SetDoubleClickEventHandler(System.Action<GameObject> handler)
{
_doubleClickedHandler = handler;
}
public void SetPointerDownHandler(System.Action<GameObject> handler)
{
_onPointerDownHandler = handler;
}
public void SetPointerUpHandler(System.Action<GameObject> handler)
{
_onPointerUpHandler = handler;
}
public void OnPointerDown(PointerEventData eventData)
{
_isPressed = true;
if (_onPointerDownHandler != null)
{
_onPointerDownHandler(gameObject);
}
}
public void OnPointerUp(PointerEventData eventData)
{
_isPressed = false;
if (_onPointerUpHandler != null)
{
_onPointerUpHandler(gameObject);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: aa13a2165836fda459a6c28562ac101a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
namespace GameLogic
{
public enum SnapStatus
{
NoTargetSet = 0,
TargetHasSet = 1,
SnapMoving = 2,
SnapMoveFinish = 3
}
public enum ItemCornerEnum
{
LeftBottom = 0,
LeftTop,
RightTop,
RightBottom,
}
public enum ListItemArrangeType
{
TopToBottom = 0,
BottomToTop,
LeftToRight,
RightToLeft,
}
public enum GridItemArrangeType
{
TopLeftToBottomRight = 0,
BottomLeftToTopRight,
TopRightToBottomLeft,
BottomRightToTopLeft,
}
public enum GridFixedType
{
ColumnCountFixed = 0,
RowCountFixed,
}
public struct RowColumnPair
{
public RowColumnPair(int row1, int column1)
{
mRow = row1;
mColumn = column1;
}
public bool Equals(RowColumnPair other)
{
return this.mRow == other.mRow && this.mColumn == other.mColumn;
}
public static bool operator ==(RowColumnPair a, RowColumnPair b)
{
return (a.mRow == b.mRow)&&(a.mColumn == b.mColumn);
}
public static bool operator !=(RowColumnPair a, RowColumnPair b)
{
return (a.mRow != b.mRow) || (a.mColumn != b.mColumn); ;
}
public override int GetHashCode()
{
return 0;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}
return (obj is RowColumnPair) && Equals((RowColumnPair)obj);
}
public int mRow;
public int mColumn;
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 19e4e487f35877f4b9bb864eb43484d6
timeCreated: 1534508353
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,326 @@
using System;
using System.Collections.Generic;
namespace GameLogic
{
public class ItemSizeGroup
{
public float[] ItemSizeArray = null;
public float[] ItemStartPosArray = null;
public int ItemCount = 0;
private int _dirtyBeginIndex = ItemPosMgr.ItemMaxCountPerGroup;
public float GroupSize = 0;
public float GroupStartPos = 0;
public float GroupEndPos = 0;
public int GroupIndex = 0;
public float ItemDefaultSize = 0;
public ItemSizeGroup(int index, float itemDefaultSize)
{
GroupIndex = index;
ItemDefaultSize = itemDefaultSize;
Init();
}
public void Init()
{
ItemSizeArray = new float[ItemPosMgr.ItemMaxCountPerGroup];
if (ItemDefaultSize != 0)
{
for (int i = 0; i < ItemSizeArray.Length; ++i)
{
ItemSizeArray[i] = ItemDefaultSize;
}
}
ItemStartPosArray = new float[ItemPosMgr.ItemMaxCountPerGroup];
ItemStartPosArray[0] = 0;
ItemCount = ItemPosMgr.ItemMaxCountPerGroup;
GroupSize = ItemDefaultSize * ItemSizeArray.Length;
if (ItemDefaultSize != 0)
{
_dirtyBeginIndex = 0;
}
else
{
_dirtyBeginIndex = ItemPosMgr.ItemMaxCountPerGroup;
}
}
public float GetItemStartPos(int index)
{
return GroupStartPos + ItemStartPosArray[index];
}
public bool IsDirty
{
get { return (_dirtyBeginIndex < ItemCount); }
}
public float SetItemSize(int index, float size)
{
float old = ItemSizeArray[index];
if (Math.Abs(old - size) < 0.001f)
{
return 0;
}
ItemSizeArray[index] = size;
if (index < _dirtyBeginIndex)
{
_dirtyBeginIndex = index;
}
float ds = size - old;
GroupSize = GroupSize + ds;
return ds;
}
public void SetItemCount(int count)
{
if (ItemCount == count)
{
return;
}
ItemCount = count;
RecalcGroupSize();
}
public void RecalcGroupSize()
{
GroupSize = 0;
for (int i = 0; i < ItemCount; ++i)
{
GroupSize += ItemSizeArray[i];
}
}
public int GetItemIndexByPos(float pos)
{
if (ItemCount == 0)
{
return -1;
}
int low = 0;
int high = ItemCount - 1;
while (low <= high)
{
int mid = (low + high) / 2;
float startPos = ItemStartPosArray[mid];
float endPos = startPos + ItemSizeArray[mid];
if (startPos <= pos && endPos >= pos)
{
return mid;
}
else if (pos > endPos)
{
low = mid + 1;
}
else
{
high = mid - 1;
}
}
return -1;
}
public void UpdateAllItemStartPos()
{
if (_dirtyBeginIndex >= ItemCount)
{
return;
}
int startIndex = (_dirtyBeginIndex < 1) ? 1 : _dirtyBeginIndex;
for (int i = startIndex; i < ItemCount; ++i)
{
ItemStartPosArray[i] = ItemStartPosArray[i - 1] + ItemSizeArray[i - 1];
}
_dirtyBeginIndex = ItemCount;
}
}
public class ItemPosMgr
{
public const int ItemMaxCountPerGroup = 100;
readonly List<ItemSizeGroup> _itemSizeGroupList = new List<ItemSizeGroup>();
public int _dirtyBeginIndex = int.MaxValue;
public float TotalSize = 0;
public float ItemDefaultSize = 20;
public ItemPosMgr(float itemDefaultSize)
{
ItemDefaultSize = itemDefaultSize;
}
public void SetItemMaxCount(int maxCount)
{
_dirtyBeginIndex = 0;
TotalSize = 0;
int st = maxCount % ItemMaxCountPerGroup;
int lastGroupItemCount = st;
int needMaxGroupCount = maxCount / ItemMaxCountPerGroup;
if (st > 0)
{
needMaxGroupCount++;
}
else
{
lastGroupItemCount = ItemMaxCountPerGroup;
}
int count = _itemSizeGroupList.Count;
if (count > needMaxGroupCount)
{
int d = count - needMaxGroupCount;
_itemSizeGroupList.RemoveRange(needMaxGroupCount, d);
}
else if (count < needMaxGroupCount)
{
int d = needMaxGroupCount - count;
for (int i = 0; i < d; ++i)
{
ItemSizeGroup tGroup = new ItemSizeGroup(count + i, ItemDefaultSize);
_itemSizeGroupList.Add(tGroup);
}
}
count = _itemSizeGroupList.Count;
if (count == 0)
{
return;
}
for (int i = 0; i < count - 1; ++i)
{
_itemSizeGroupList[i].SetItemCount(ItemMaxCountPerGroup);
}
_itemSizeGroupList[count - 1].SetItemCount(lastGroupItemCount);
for (int i = 0; i < count; ++i)
{
TotalSize = TotalSize + _itemSizeGroupList[i].GroupSize;
}
}
public void SetItemSize(int itemIndex, float size)
{
int groupIndex = itemIndex / ItemMaxCountPerGroup;
int indexInGroup = itemIndex % ItemMaxCountPerGroup;
ItemSizeGroup tGroup = _itemSizeGroupList[groupIndex];
float changedSize = tGroup.SetItemSize(indexInGroup, size);
if (changedSize != 0f)
{
if (groupIndex < _dirtyBeginIndex)
{
_dirtyBeginIndex = groupIndex;
}
}
TotalSize += changedSize;
}
public float GetItemPos(int itemIndex)
{
Update(true);
int groupIndex = itemIndex / ItemMaxCountPerGroup;
int indexInGroup = itemIndex % ItemMaxCountPerGroup;
return _itemSizeGroupList[groupIndex].GetItemStartPos(indexInGroup);
}
public void GetItemIndexAndPosAtGivenPos(float pos, ref int index, ref float itemPos)
{
Update(true);
index = 0;
itemPos = 0f;
int count = _itemSizeGroupList.Count;
if (count == 0)
{
return;
}
ItemSizeGroup hitGroup = null;
int low = 0;
int high = count - 1;
while (low <= high)
{
int mid = (low + high) / 2;
ItemSizeGroup tGroup = _itemSizeGroupList[mid];
if (tGroup.GroupStartPos <= pos && tGroup.GroupEndPos >= pos)
{
hitGroup = tGroup;
break;
}
else if (pos > tGroup.GroupEndPos)
{
low = mid + 1;
}
else
{
high = mid - 1;
}
}
int hitIndex = -1;
if (hitGroup != null)
{
hitIndex = hitGroup.GetItemIndexByPos(pos - hitGroup.GroupStartPos);
}
else
{
return;
}
if (hitIndex < 0)
{
return;
}
index = hitIndex + hitGroup.GroupIndex * ItemMaxCountPerGroup;
itemPos = hitGroup.GetItemStartPos(hitIndex);
}
public void Update(bool updateAll)
{
int count = _itemSizeGroupList.Count;
if (count == 0)
{
return;
}
if (_dirtyBeginIndex >= count)
{
return;
}
int loopCount = 0;
for (int i = _dirtyBeginIndex; i < count; ++i)
{
loopCount++;
ItemSizeGroup tGroup = _itemSizeGroupList[i];
_dirtyBeginIndex++;
tGroup.UpdateAllItemStartPos();
if (i == 0)
{
tGroup.GroupStartPos = 0;
tGroup.GroupEndPos = tGroup.GroupSize;
}
else
{
tGroup.GroupStartPos = _itemSizeGroupList[i - 1].GroupEndPos;
tGroup.GroupEndPos = tGroup.GroupStartPos + tGroup.GroupSize;
}
if (!updateAll && loopCount > 1)
{
return;
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 61adb6a884bfbfc4292a5d39261a74f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d7f738dc5a266e94d9e9870fc76009c2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,173 @@
namespace GameLogic
{
//if GridFixedType is GridFixedType.ColumnCountFixed, then the GridItemGroup is one row of the gridview
//if GridFixedType is GridFixedType.RowCountFixed, then the GridItemGroup is one column of the gridview
public class GridItemGroup
{
private int _count = 0;
private int _groupIndex = -1;//the row index or the column index of this group
private LoopGridViewItem _first = null;
private LoopGridViewItem _last = null;
public int Count => _count;
public LoopGridViewItem First => _first;
public LoopGridViewItem Last => _last;
public int GroupIndex
{
get => _groupIndex;
set => _groupIndex = value;
}
public LoopGridViewItem GetItemByColumn(int column)
{
LoopGridViewItem cur = _first;
while(cur != null)
{
if(cur.Column == column)
{
return cur;
}
cur = cur.NextItem;
}
return null;
}
public LoopGridViewItem GetItemByRow(int row)
{
LoopGridViewItem cur = _first;
while (cur != null)
{
if (cur.Row == row)
{
return cur;
}
cur = cur.NextItem;
}
return null;
}
public void ReplaceItem(LoopGridViewItem curItem,LoopGridViewItem newItem)
{
newItem.PrevItem = curItem.PrevItem;
newItem.NextItem = curItem.NextItem;
if(newItem.PrevItem != null)
{
newItem.PrevItem.NextItem = newItem;
}
if(newItem.NextItem != null)
{
newItem.NextItem.PrevItem = newItem;
}
if(_first == curItem)
{
_first = newItem;
}
if(_last == curItem)
{
_last = newItem;
}
}
public void AddFirst(LoopGridViewItem newItem)
{
newItem.PrevItem = null;
newItem.NextItem = null;
if (_first == null)
{
_first = newItem;
_last = newItem;
_first.PrevItem = null;
_first.NextItem = null;
_count++;
}
else
{
_first.PrevItem = newItem;
newItem.PrevItem = null;
newItem.NextItem = _first;
_first = newItem;
_count++;
}
}
public void AddLast(LoopGridViewItem newItem)
{
newItem.PrevItem = null;
newItem.NextItem = null;
if (_first == null)
{
_first = newItem;
_last = newItem;
_first.PrevItem = null;
_first.NextItem = null;
_count++;
}
else
{
_last.NextItem = newItem;
newItem.PrevItem = _last;
newItem.NextItem = null;
_last = newItem;
_count++;
}
}
public LoopGridViewItem RemoveFirst()
{
LoopGridViewItem ret = _first;
if (_first == null)
{
return ret;
}
if(_first == _last)
{
_first = null;
_last = null;
--_count;
return ret;
}
_first = _first.NextItem;
_first.PrevItem = null;
--_count;
return ret;
}
public LoopGridViewItem RemoveLast()
{
LoopGridViewItem ret = _last;
if (_first == null)
{
return ret;
}
if (_first == _last)
{
_first = null;
_last = null;
--_count;
return ret;
}
_last = _last.PrevItem;
_last.NextItem = null;
--_count;
return ret;
}
public void Clear()
{
LoopGridViewItem current = _first;
while (current != null)
{
current.PrevItem = null;
current.NextItem = null;
current = current.NextItem;
}
_first = null;
_last = null;
_count = 0;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f7e7eb25fe1319d4b8773ddfab7a240e
timeCreated: 1554538573
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace GameLogic
{
public class GridItemPool
{
private GameObject _prefabObj;
private string _prefabName;
private int _initCreateCount = 1;
private readonly List<LoopGridViewItem> _tmpPooledItemList = new List<LoopGridViewItem>();
private readonly List<LoopGridViewItem> _pooledItemList = new List<LoopGridViewItem>();
private static int _curItemIdCount = 0;
private RectTransform _itemParent = null;
public GridItemPool()
{
}
public void Init(GameObject prefabObj, int createCount, RectTransform parent)
{
_prefabObj = prefabObj;
_prefabName = _prefabObj.name;
_initCreateCount = createCount;
_itemParent = parent;
_prefabObj.SetActive(false);
for (int i = 0; i < _initCreateCount; ++i)
{
LoopGridViewItem tViewItem = CreateItem();
RecycleItemReal(tViewItem);
}
}
public LoopGridViewItem GetItem()
{
_curItemIdCount++;
LoopGridViewItem tItem = null;
if (_tmpPooledItemList.Count > 0)
{
int count = _tmpPooledItemList.Count;
tItem = _tmpPooledItemList[count - 1];
_tmpPooledItemList.RemoveAt(count - 1);
tItem.gameObject.SetActive(true);
}
else
{
int count = _pooledItemList.Count;
if (count == 0)
{
tItem = CreateItem();
}
else
{
tItem = _pooledItemList[count - 1];
_pooledItemList.RemoveAt(count - 1);
tItem.gameObject.SetActive(true);
}
}
tItem.ItemId = _curItemIdCount;
return tItem;
}
public void DestroyAllItem()
{
ClearTmpRecycledItem();
int count = _pooledItemList.Count;
for (int i = 0; i < count; ++i)
{
GameObject.DestroyImmediate(_pooledItemList[i].gameObject);
}
_pooledItemList.Clear();
}
public LoopGridViewItem CreateItem()
{
GameObject go = GameObject.Instantiate<GameObject>(_prefabObj, Vector3.zero, Quaternion.identity, _itemParent);
go.SetActive(true);
RectTransform rf = go.GetComponent<RectTransform>();
rf.localScale = Vector3.one;
rf.anchoredPosition3D = Vector3.zero;
rf.localEulerAngles = Vector3.zero;
LoopGridViewItem tViewItem = go.GetComponent<LoopGridViewItem>();
tViewItem.ItemPrefabName = _prefabName;
tViewItem.GoId = go.GetHashCode();
return tViewItem;
}
void RecycleItemReal(LoopGridViewItem item)
{
item.gameObject.SetActive(false);
_pooledItemList.Add(item);
}
public void RecycleItem(LoopGridViewItem item)
{
item.PrevItem = null;
item.NextItem = null;
_tmpPooledItemList.Add(item);
}
public void ClearTmpRecycledItem()
{
int count = _tmpPooledItemList.Count;
if (count == 0)
{
return;
}
for (int i = 0; i < count; ++i)
{
RecycleItemReal(_tmpPooledItemList[i]);
}
_tmpPooledItemList.Clear();
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c1eb92a17e8cee642a2245950dfaabea
timeCreated: 1554538573
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 17e9881a7bce8124a8f855b96a8ca11a
timeCreated: 1554538573
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,184 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace GameLogic
{
public class LoopGridViewItem : MonoBehaviour
{
// indicates the items index in the list the mItemIndex can only be from 0 to itemTotalCount -1.
int mItemIndex = -1;
// the row index, the item is in. starting from 0.
int mRow = -1;
// the column index, the item is in. starting from 0.
int mColumn = -1;
//indicates the items id.
//This property is set when the item is created or fetched from pool,
//and will no longer change until the item is recycled back to pool.
int mItemId = -1;
private int _goId = 0;
public int GoId
{
set => _goId = value;
get => _goId;
}
LoopGridView mParentGridView = null;
bool mIsInitHandlerCalled = false;
string mItemPrefabName;
RectTransform mCachedRectTransform;
int mItemCreatedCheckFrameCount = 0;
object mUserObjectData = null;
int mUserIntData1 = 0;
int mUserIntData2 = 0;
string mUserStringData1 = null;
string mUserStringData2 = null;
LoopGridViewItem mPrevItem;
LoopGridViewItem mNextItem;
public object UserObjectData
{
get { return mUserObjectData; }
set { mUserObjectData = value; }
}
public int UserIntData1
{
get { return mUserIntData1; }
set { mUserIntData1 = value; }
}
public int UserIntData2
{
get { return mUserIntData2; }
set { mUserIntData2 = value; }
}
public string UserStringData1
{
get { return mUserStringData1; }
set { mUserStringData1 = value; }
}
public string UserStringData2
{
get { return mUserStringData2; }
set { mUserStringData2 = value; }
}
public int ItemCreatedCheckFrameCount
{
get { return mItemCreatedCheckFrameCount; }
set { mItemCreatedCheckFrameCount = value; }
}
public RectTransform CachedRectTransform
{
get
{
if (mCachedRectTransform == null)
{
mCachedRectTransform = gameObject.GetComponent<RectTransform>();
}
return mCachedRectTransform;
}
}
public string ItemPrefabName
{
get
{
return mItemPrefabName;
}
set
{
mItemPrefabName = value;
}
}
public int Row
{
get
{
return mRow;
}
set
{
mRow = value;
}
}
public int Column
{
get
{
return mColumn;
}
set
{
mColumn = value;
}
}
public int ItemIndex
{
get
{
return mItemIndex;
}
set
{
mItemIndex = value;
}
}
public int ItemId
{
get
{
return mItemId;
}
set
{
mItemId = value;
}
}
public bool IsInitHandlerCalled
{
get
{
return mIsInitHandlerCalled;
}
set
{
mIsInitHandlerCalled = value;
}
}
public LoopGridView ParentGridView
{
get
{
return mParentGridView;
}
set
{
mParentGridView = value;
}
}
public LoopGridViewItem PrevItem
{
get { return mPrevItem; }
set { mPrevItem = value; }
}
public LoopGridViewItem NextItem
{
get { return mNextItem; }
set { mNextItem = value; }
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ec0432517adfcb84bb6163d7a44ab8c1
timeCreated: 1554538573
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e9bbd48a4abc45c46a92b92d0df3ae07
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dd536d252034dd74b87b436507ec44f7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,216 @@
using UnityEngine;
namespace GameLogic
{
public class LoopListViewItem : MonoBehaviour
{
public float Padding;
private int _itemIndex = -1;
private int _itemId = -1;
private LoopListView _parentListView = null;
private bool _isInitHandlerCalled = false;
private string _itemPrefabName;
private RectTransform _cachedRectTransform;
private float _padding;
private float _distanceWithViewPortSnapCenter = 0;
private int _itemCreatedCheckFrameCount = 0;
private float _startPosOffset = 0;
private object _userObjectData = null;
private int _userIntData1 = 0;
private int _userIntData2 = 0;
private string _userStringData1 = null;
private string _userStringData2 = null;
private int _goId = 0;
public int GoId
{
set => _goId = value;
get => _goId;
}
public object UserObjectData
{
get => _userObjectData;
set => _userObjectData = value;
}
public int UserIntData1
{
get => _userIntData1;
set => _userIntData1 = value;
}
public int UserIntData2
{
get => _userIntData2;
set => _userIntData2 = value;
}
public string UserStringData1
{
get => _userStringData1;
set => _userStringData1 = value;
}
public string UserStringData2
{
get => _userStringData2;
set => _userStringData2 = value;
}
public float DistanceWithViewPortSnapCenter
{
get => _distanceWithViewPortSnapCenter;
set => _distanceWithViewPortSnapCenter = value;
}
public float StartPosOffset
{
get => _startPosOffset;
set => _startPosOffset = value;
}
public int ItemCreatedCheckFrameCount
{
get => _itemCreatedCheckFrameCount;
set => _itemCreatedCheckFrameCount = value;
}
public RectTransform CachedRectTransform
{
get
{
if (_cachedRectTransform == null)
{
_cachedRectTransform = gameObject.GetComponent<RectTransform>();
}
return _cachedRectTransform;
}
}
public string ItemPrefabName
{
get => _itemPrefabName;
set => _itemPrefabName = value;
}
public int ItemIndex
{
get => _itemIndex;
set => _itemIndex = value;
}
public int ItemId
{
get => _itemId;
set => _itemId = value;
}
public bool IsInitHandlerCalled
{
get => _isInitHandlerCalled;
set => _isInitHandlerCalled = value;
}
public LoopListView ParentListView
{
get => _parentListView;
set => _parentListView = value;
}
public float TopY
{
get
{
ListItemArrangeType arrageType = ParentListView.ArrangeType;
if (arrageType == ListItemArrangeType.TopToBottom)
{
return CachedRectTransform.localPosition.y;
}
else if (arrageType == ListItemArrangeType.BottomToTop)
{
return CachedRectTransform.localPosition.y + CachedRectTransform.rect.height;
}
return 0;
}
}
public float BottomY
{
get
{
ListItemArrangeType arrageType = ParentListView.ArrangeType;
if (arrageType == ListItemArrangeType.TopToBottom)
{
return CachedRectTransform.localPosition.y - CachedRectTransform.rect.height;
}
else if (arrageType == ListItemArrangeType.BottomToTop)
{
return CachedRectTransform.localPosition.y;
}
return 0;
}
}
public float LeftX
{
get
{
ListItemArrangeType arrageType = ParentListView.ArrangeType;
if (arrageType == ListItemArrangeType.LeftToRight)
{
return CachedRectTransform.localPosition.x;
}
else if (arrageType == ListItemArrangeType.RightToLeft)
{
return CachedRectTransform.localPosition.x - CachedRectTransform.rect.width;
}
return 0;
}
}
public float RightX
{
get
{
ListItemArrangeType arrageType = ParentListView.ArrangeType;
if (arrageType == ListItemArrangeType.LeftToRight)
{
return CachedRectTransform.localPosition.x + CachedRectTransform.rect.width;
}
else if (arrageType == ListItemArrangeType.RightToLeft)
{
return CachedRectTransform.localPosition.x;
}
return 0;
}
}
public float ItemSize
{
get
{
if (ParentListView.IsVertList)
{
return CachedRectTransform.rect.height;
}
else
{
return CachedRectTransform.rect.width;
}
}
}
public float ItemSizeWithPadding => ItemSize + _padding;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 29af6e9bda3402e4eba67bb72531e618
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -5,7 +5,7 @@ using UnityEngine.UI;
namespace GameLogic
{
class UIEventItem<T> : UIWidget where T : UIEventItem<T>
public class UIEventItem<T> : UIWidget where T : UIEventItem<T>
{
private object _eventParam1;
private object _eventParam2;

View File

@@ -112,8 +112,8 @@ public static class UIExtension
return hadMouseDown;
}
public static void SetSprite(this Image image, string spriteName, UIBase uiBase, bool isSetNativeSize = false)
public static void SetSprite(this Image image, string spriteName, bool isSetNativeSize = false,bool isAsync = false)
{
if (image == null)
{
@@ -126,31 +126,30 @@ public static class UIExtension
}
else
{
image.sprite = uiBase.LoadAsset<Sprite>(spriteName);
if (isSetNativeSize)
if (!isAsync)
{
image.SetNativeSize();
image.sprite = GameModule.Resource.LoadAsset<Sprite>(spriteName);
if (isSetNativeSize)
{
image.SetNativeSize();
}
}
}
}
public static void SetSprite(this UIBase uiBase, string spriteName, Image image, bool isSetNativeSize = false)
{
if (image == null)
{
return;
}
if (string.IsNullOrEmpty(spriteName))
{
image.sprite = null;
}
else
{
image.sprite = uiBase.LoadAsset<Sprite>(spriteName);
if (isSetNativeSize)
else
{
image.SetNativeSize();
GameModule.Resource.LoadAssetAsync<Sprite>(spriteName, operation =>
{
if (image == null)
{
goto Dispose;
}
image.sprite = operation.AssetObject as Sprite;
if (isSetNativeSize)
{
image.SetNativeSize();
}
Dispose:
operation.Dispose();
});
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a9c3cf3e98f544a7a1dd6cb8ac023d30
timeCreated: 1691679403

View File

@@ -0,0 +1,337 @@
using System;
using System.Collections.Generic;
using TEngine;
using UnityEngine;
using UnityEngine.UI;
namespace GameLogic
{
/// <summary>
/// UI列表Item
/// </summary>
/// <typeparam name="DataT"></typeparam>
public interface IListDataItem<in DataT>
{
void SetItemData(DataT d);
}
/// <summary>
/// UI列表Item
/// </summary>
public interface IListSelectItem
{
/// <summary>
/// 获取索引。
/// </summary>
/// <returns></returns>
int GetItemIndex();
/// <summary>
/// 设置索引。
/// </summary>
/// <param name="i"></param>
void SetItemIndex(int i);
/// <summary>
/// 是否被选中。
/// </summary>
/// <returns></returns>
bool IsSelected();
/// <summary>
/// 设置是否选中。
/// </summary>
/// <param name="v"></param>
void SetSelected(bool v);
}
public class SelectItemBase : UIEventItem<SelectItemBase>, IListSelectItem
{
/// <summary>
/// 索引。
/// </summary>
protected int m_itemIndex;
public int GetItemIndex()
{
return m_itemIndex;
}
public void SetItemIndex(int i)
{
m_itemIndex = i;
}
/// <summary>
/// 是否被选中。
/// </summary>
protected bool m_isSelected;
public virtual bool IsSelected()
{
return m_isSelected;
}
public virtual void SetSelected(bool v)
{
if (m_isSelected == v) return;
m_isSelected = v;
UpdateSelect();
}
/// <summary>
/// 刷新选中状态。
/// </summary>
public virtual void UpdateSelect()
{
}
public override void RegisterEvent()
{
base.RegisterEvent();
AddSelectEvt();
}
/// <summary>
/// 监听选中事件。
/// </summary>
protected virtual void AddSelectEvt()
{
if (Parent == null || !(Parent is IUISelectList)) return;
var btn = TEngine.DUnityUtil.AddMonoBehaviour<Button>(gameObject);
if (btn != null)
{
btn.onClick.AddListener(OnSelectClick);
}
}
/// <summary>
/// 选中点击
/// </summary>
protected virtual void OnSelectClick()
{
var p = Parent as IUISelectList;
if (p != null)
{
p.OnItemClick(this, GetItemIndex());
}
}
}
interface IUISelectList
{
void OnItemClick(object item, int i);
}
/// <summary>
/// UI列表
/// </summary>
public class UIListBase<ItemT, DataT> : UIWidget, IUISelectList where ItemT : UIWidget, new()
{
/// <summary>
/// item模板
/// </summary>
public GameObject itemBase;
/// <summary>
/// 数据列表
/// </summary>
protected List<DataT> m_datas;
/// <summary>
/// 数据列表
/// </summary>
public List<DataT> datas => m_datas;
/// <summary>
/// 数据数量
/// </summary>
public int DataNum => m_datas?.Count ?? 0;
/// <summary>
/// 数量
/// </summary>
protected int m_num;
/// <summary>
/// 数量
/// </summary>
public int num => m_num;
/// <summary>
/// 设置数据数量
/// </summary>
/// <param name="n"></param>
/// <param name="funcItem"></param>
public void SetDataNum(int n, Action<ItemT, int> funcItem = null)
{
AdjustItemNum(n, null, funcItem);
}
/// <summary>
/// 数据起始索引
/// </summary>
public int dataStartOffset = 0;
/// <summary>
/// 设置数据
/// </summary>
/// <param name="dataList"></param>
/// <param name="n"></param>
public void SetDatas(List<DataT> dataList, int n = -1)
{
AdjustItemNum(Mathf.Max(0, n >= 0 ? n : (dataList == null ? 0 : (dataList.Count - dataStartOffset))),
dataList);
}
/// <summary>
/// 设置显示数据
/// </summary>
/// <param name="n"></param>
/// <param name="datas"></param>
/// <param name="funcItem"></param>
protected virtual void AdjustItemNum(int n, List<DataT> datas = null, Action<ItemT, int> funcItem = null)
{
m_num = n;
m_datas = datas;
if (itemBase != null)
{
itemBase.SetActive(false);
}
}
/// <summary>
/// 刷新列表ITEM
/// </summary>
/// <param name="item"></param>
/// <param name="i"></param>
/// <param name="func"></param>
protected virtual void UpdateListItem(ItemT item, int i, Action<ItemT, int> func)
{
if (item == null) return;
if (func != null)
{
func.Invoke(item, i);
return;
}
var listDataItem = item as IListDataItem<DataT>;
if (listDataItem != null)
{
listDataItem.SetItemData(GetData(i));
}
}
/// <summary>
/// 选中索引
/// </summary>
protected int m_selectIndex = -1;
/// <summary>
/// Item点击
/// </summary>
public Action<int> funcOnItemClick;
/// <summary>
/// 选中变化回调函数
/// </summary>
public Action funcOnSelectChange;
/// <summary>
/// 点击无选中变化回调
/// </summary>
public Action funcNoSelectChange;
/// <summary>
/// 选中索引
/// </summary>
public int selectIndex
{
get => m_selectIndex;
set => SetSelectIndex(value);
}
/// <summary>
/// 设置选中索引
/// </summary>
/// <param name="i"></param>
/// <param name="forceUpdate"></param>
/// <param name="triggerEvt"></param>
public void SetSelectIndex(int i, bool forceUpdate = false, bool triggerEvt = true)
{
if (!forceUpdate && m_selectIndex == i)
{
if (funcNoSelectChange != null)
{
funcNoSelectChange.Invoke();
}
return;
}
var preIndex = selectIndex;
m_selectIndex = i;
var item = GetItem(preIndex) as IListSelectItem;
if (item != null)
{
item.SetSelected(false);
}
item = GetItem(selectIndex) as IListSelectItem;
if (item != null)
{
item.SetSelected(true);
}
if (triggerEvt && funcOnSelectChange != null)
{
funcOnSelectChange.Invoke();
}
}
/// <summary>
/// 获取当前选中的数据
/// </summary>
/// <returns></returns>
public DataT GetSelectData()
{
return GetData(selectIndex);
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
public DataT GetData(int i)
{
i += dataStartOffset;
return m_datas == null || i < 0 || i >= m_datas.Count ? default(DataT) : m_datas[i];
}
/// <summary>
/// 获取item
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
public virtual ItemT GetItem(int i)
{
return null;
}
/// <summary>
/// item被点击
/// </summary>
/// <param name="item"></param>
/// <param name="i"></param>
public void OnItemClick(object item, int i)
{
if (funcOnItemClick != null)
{
funcOnItemClick.Invoke(i);
}
selectIndex = i;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9d3742a744bb4934a4848b54bb6910a2
timeCreated: 1691679426

View File

@@ -0,0 +1,14 @@
namespace GameLogic
{
public class UILoopGridItemWidget: SelectItemBase
{
public LoopGridViewItem LoopItem { set; get; }
public int Index { private set; get; }
public virtual void UpdateItem(int index)
{
Index = index;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 47ee457a0d7549b3a3b5d23f4ac048cd
timeCreated: 1692346002

Some files were not shown because too many files have changed in this diff Show More