mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Compare commits
327 Commits
demo
...
TEngine4.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ff613e4130 | ||
![]() |
fea1ae2278 | ||
![]() |
866c440479 | ||
![]() |
48ff839d64 | ||
![]() |
69be3cfa23 | ||
![]() |
5f2c27ecf0 | ||
![]() |
ef17cd851b | ||
![]() |
f186d6b058 | ||
![]() |
4385123976 | ||
![]() |
1334dc30f9 | ||
![]() |
af822add2c | ||
![]() |
ffb1f214ad | ||
![]() |
213aaed426 | ||
![]() |
623d301e41 | ||
![]() |
2870383afe | ||
![]() |
1ad435958a | ||
![]() |
386787c6ec | ||
![]() |
cd65dde4c3 | ||
![]() |
8321e77421 | ||
![]() |
1b6f80952e | ||
![]() |
b52e655c30 | ||
![]() |
8c0df95626 | ||
![]() |
0d1e308f1c | ||
![]() |
f8797538fd | ||
![]() |
fe4e168041 | ||
![]() |
8e9047d3a3 | ||
![]() |
04bfaeccc8 | ||
![]() |
d66c823c15 | ||
![]() |
0ec1424f0a | ||
![]() |
01f8eb9d57 | ||
![]() |
f5021a9688 | ||
![]() |
a632f7a5ad | ||
![]() |
5f968f4154 | ||
![]() |
c9fe83c2bd | ||
![]() |
2c00d103cb | ||
![]() |
1d56437d9f | ||
![]() |
69db1ff977 | ||
![]() |
48887b1aee | ||
![]() |
381ea8bb8d | ||
![]() |
7401edac15 | ||
![]() |
b1c7f30be9 | ||
![]() |
cfaf82a623 | ||
![]() |
6992d12c6c | ||
![]() |
119d9683ad | ||
![]() |
9478868513 | ||
![]() |
6ed32082e1 | ||
![]() |
6ee515e8c5 | ||
![]() |
b839afa76a | ||
![]() |
d9605b348a | ||
![]() |
dfef83919c | ||
![]() |
f5f983f220 | ||
![]() |
d61b1206ee | ||
![]() |
3650ba1a8b | ||
![]() |
8f14a4d2cb | ||
![]() |
dc22e595c9 | ||
![]() |
0e70f7d446 | ||
![]() |
039569b2d4 | ||
![]() |
ea38004ba2 | ||
![]() |
cc97c0583a | ||
![]() |
887094a4b1 | ||
![]() |
0d09a7e73b | ||
![]() |
d8f8514f9d | ||
![]() |
f2f6b2422f | ||
![]() |
3a9cad9397 | ||
![]() |
5e70e7972e | ||
![]() |
8d2b4200d6 | ||
![]() |
b983e85416 | ||
![]() |
99d2afdbd7 | ||
![]() |
57ce836b3c | ||
![]() |
8dce78d6fb | ||
![]() |
6d41adffd9 | ||
![]() |
cb9129261b | ||
![]() |
89dd6214d4 | ||
![]() |
1aec76d64c | ||
![]() |
859f654f6d | ||
![]() |
391d690f9d | ||
![]() |
bb0b4104f9 | ||
![]() |
20d0ecd8da | ||
![]() |
8c3d6308b9 | ||
![]() |
4c8c37ffd8 | ||
![]() |
5f694c2bed | ||
![]() |
7ff74bb747 | ||
![]() |
a5de63397a | ||
![]() |
13cc62f3f1 | ||
![]() |
95dfac5294 | ||
![]() |
14e95107c9 | ||
![]() |
caf5b2b54e | ||
![]() |
285483034e | ||
![]() |
1cdd8b63b4 | ||
![]() |
4c748df7ac | ||
![]() |
e1229b5a4b | ||
![]() |
b937fb1a37 | ||
![]() |
87ab99b363 | ||
![]() |
e3a47393f4 | ||
![]() |
75725314ad | ||
![]() |
d3ed2b21b9 | ||
![]() |
ec34dfbb16 | ||
![]() |
bd76e3a651 | ||
![]() |
278c8f23be | ||
![]() |
42568db2ab | ||
![]() |
b033c59b00 | ||
![]() |
04a43a3f11 | ||
![]() |
54214cdd0b | ||
![]() |
fa870b6228 | ||
![]() |
8a49d3437b | ||
![]() |
f19b889deb | ||
![]() |
d55f6e29d9 | ||
![]() |
8e4af31f26 | ||
![]() |
58a4b3e043 | ||
![]() |
576bf3bb48 | ||
![]() |
d282b81546 | ||
![]() |
d6dcd8851c | ||
![]() |
bbea9c4cee | ||
![]() |
b1ccb1fd53 | ||
![]() |
0f2ad3c71d | ||
![]() |
0e6851e691 | ||
![]() |
75b9956261 | ||
![]() |
401c397fc8 | ||
![]() |
94b314e91f | ||
![]() |
a6573d9336 | ||
![]() |
abf5357f49 | ||
![]() |
aab353cca3 | ||
![]() |
e13071c4db | ||
![]() |
e071c20214 | ||
![]() |
bf73ce333b | ||
![]() |
d7a60002d4 | ||
![]() |
61f657322d | ||
![]() |
33223dc02e | ||
![]() |
0661c59877 | ||
![]() |
7c74e10857 | ||
![]() |
db935bfb5f | ||
![]() |
dc6b7bb21e | ||
![]() |
d32f3cb768 | ||
![]() |
a32ab30444 | ||
![]() |
aa0d40c758 | ||
![]() |
5239b89326 | ||
![]() |
53f0ecb6c1 | ||
![]() |
ea9447d0ea | ||
![]() |
0c6d59f53e | ||
![]() |
9986e22d18 | ||
![]() |
7deb049769 | ||
![]() |
fce8bd4d60 | ||
![]() |
7ec14c670f | ||
![]() |
efe3d2b25b | ||
![]() |
2107282368 | ||
![]() |
fb26ea2297 | ||
![]() |
9ac150425f | ||
![]() |
36d2c146b0 | ||
![]() |
774b73bbbf | ||
![]() |
32366eb127 | ||
![]() |
a843617e5f | ||
![]() |
46b139f7cf | ||
![]() |
e6ff1dec3f | ||
![]() |
4429732010 | ||
![]() |
60a5caebae | ||
![]() |
f7c95d8216 | ||
![]() |
98dcb80942 | ||
![]() |
30192d52cf | ||
![]() |
b7b2262d53 | ||
![]() |
d1c93f15d6 | ||
![]() |
1ac1ff7d56 | ||
![]() |
863788f303 | ||
![]() |
74790c7486 | ||
![]() |
1c223c8ad0 | ||
![]() |
e75b3a4e66 | ||
![]() |
91b0995911 | ||
![]() |
14c886ea8f | ||
![]() |
9babc0ba85 | ||
![]() |
f8056aef32 | ||
![]() |
846dc4d4bc | ||
![]() |
03ab7fb353 | ||
![]() |
3c11980e7c | ||
![]() |
c23aa0bd71 | ||
![]() |
df76d0b77a | ||
![]() |
35d2012546 | ||
![]() |
c96d20a89a | ||
![]() |
5787d0f9dc | ||
![]() |
8b35c8ca07 | ||
![]() |
e5456da482 | ||
![]() |
144ba9f222 | ||
![]() |
889fbdc8e1 | ||
![]() |
0d177e6868 | ||
![]() |
29135228be | ||
![]() |
c1a1de73cd | ||
![]() |
612e9b7eba | ||
![]() |
5ed6b8c378 | ||
![]() |
06dad5a68a | ||
![]() |
9e0462043c | ||
![]() |
c1178e284b | ||
![]() |
8e3dd138a6 | ||
![]() |
405253c507 | ||
![]() |
66ef50a9e0 | ||
![]() |
413f4dcda7 | ||
![]() |
75fdb4d7de | ||
![]() |
1ada1e4e33 | ||
![]() |
3848b6aaaa | ||
![]() |
2b33b405c0 | ||
![]() |
6766b930d7 | ||
![]() |
526baf45fa | ||
![]() |
a473971cfb | ||
![]() |
51effd2c97 | ||
![]() |
4205220b64 | ||
![]() |
e95c18ca67 | ||
![]() |
f5571716a2 | ||
![]() |
d61a8dfa4b | ||
![]() |
068ec709d0 | ||
![]() |
8b26b790ee | ||
![]() |
da35b4306b | ||
![]() |
ee2147e3d9 | ||
![]() |
a273e9d5f8 | ||
![]() |
31d4d6c0b8 | ||
![]() |
6a6f0591f1 | ||
![]() |
9cd0bac81e | ||
![]() |
4abe10eecf | ||
![]() |
bd10297dfa | ||
![]() |
7ce72b8aa8 | ||
![]() |
c6ecb48944 | ||
![]() |
c178f8bb75 | ||
![]() |
d4f160d284 | ||
![]() |
d87653a9fb | ||
![]() |
04a5a0e048 | ||
![]() |
c825f4d920 | ||
![]() |
b3e59b92d6 | ||
![]() |
37af620d71 | ||
![]() |
493172a925 | ||
![]() |
1382db8c61 | ||
![]() |
72b7149aa1 | ||
![]() |
0c51ae7bdd | ||
![]() |
79dc302f14 | ||
![]() |
95e4dd93a8 | ||
![]() |
2b310c00f2 | ||
![]() |
fbb26ea9ea | ||
![]() |
bff8f20af3 | ||
![]() |
0c7ce5f28c | ||
![]() |
31fc9abdf9 | ||
![]() |
a087f40e8a | ||
![]() |
7b2fc7ce9f | ||
![]() |
dc4bb8cc9c | ||
![]() |
0c8f3a5f92 | ||
![]() |
a69f53592e | ||
![]() |
8757e1f550 | ||
![]() |
336d4b2eb9 | ||
![]() |
e0be062006 | ||
![]() |
5e69129667 | ||
![]() |
4c39ab79ca | ||
![]() |
a710d1cb76 | ||
![]() |
8472839394 | ||
![]() |
4988c99d31 | ||
![]() |
4fa62b2d79 | ||
![]() |
f549514d7c | ||
![]() |
f588038848 | ||
![]() |
9e0e3ebd50 | ||
![]() |
b07ef836a9 | ||
![]() |
7a1d593195 | ||
![]() |
bc113c5c6e | ||
![]() |
753bbdfb82 | ||
![]() |
6a6d33c536 | ||
![]() |
57a014a83a | ||
![]() |
9d1a8e8c9d | ||
![]() |
86c26cd21b | ||
![]() |
b60b9fff42 | ||
![]() |
990e17a6cc | ||
![]() |
be531bfad0 | ||
![]() |
6c46f3e5fd | ||
![]() |
e4b48e3c58 | ||
![]() |
68e5b1d482 | ||
![]() |
abd152b072 | ||
![]() |
470e62d9c4 | ||
![]() |
481b5911ab | ||
![]() |
05d3aff05e | ||
![]() |
86bb6353dc | ||
![]() |
334698b6e6 | ||
![]() |
2684bd29f5 | ||
![]() |
c568c62404 | ||
![]() |
699ccb3b09 | ||
![]() |
f92bf5c602 | ||
![]() |
cd87c71281 | ||
![]() |
94c137b3c6 | ||
![]() |
120a86b396 | ||
![]() |
383dc50fe3 | ||
![]() |
2369e8723c | ||
![]() |
344f3293ad | ||
![]() |
5d361dd188 | ||
![]() |
a2f7fe907a | ||
![]() |
5b3f64689f | ||
![]() |
2258c13892 | ||
![]() |
a70d2e7d17 | ||
![]() |
b15f51631a | ||
![]() |
da12bd7cab | ||
![]() |
98bcaef6b7 | ||
![]() |
71d1286144 | ||
![]() |
9359a81a96 | ||
![]() |
a9542646c1 | ||
![]() |
0890ca9bdb | ||
![]() |
ec409c7e15 | ||
![]() |
4bc63fafc8 | ||
![]() |
fe0f9afd6d | ||
![]() |
4632a0c099 | ||
![]() |
60e57bb80b | ||
![]() |
b7c79d0438 | ||
![]() |
62b7c9e4d6 | ||
![]() |
75a6977afb | ||
![]() |
659da836ac | ||
![]() |
07c459051f | ||
![]() |
4253a81e78 | ||
![]() |
e498abacd1 | ||
![]() |
f16759483f | ||
![]() |
899472a5db | ||
![]() |
e65245371a | ||
![]() |
b04fff4ec9 | ||
![]() |
d8f8fd01d9 | ||
![]() |
9b1c5e6f0a | ||
![]() |
b2b5c9274c | ||
![]() |
b814d689d8 | ||
![]() |
ca6de42d67 | ||
![]() |
c3e9b76fd6 | ||
![]() |
dca7b71457 | ||
![]() |
7106454dfb | ||
![]() |
b97e24aa6d | ||
![]() |
bec4cba501 | ||
![]() |
0568d5f8b2 | ||
![]() |
49db48e7fc | ||
![]() |
92fc5e0bcd | ||
![]() |
11391e597e | ||
![]() |
6b64f3b261 | ||
![]() |
dff6ba4e6d | ||
![]() |
036c89a6d1 |
121
.gitignore
vendored
121
.gitignore
vendored
@@ -1,118 +1,15 @@
|
||||
# This .gitignore file should be placed at the root of your Unity project directory
|
||||
#
|
||||
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
|
||||
#
|
||||
/[Ll]ibrary/
|
||||
/[Tt]emp/
|
||||
/[Oo]bj/
|
||||
/[Bb]uild/
|
||||
/[Bb]uilds/
|
||||
/[Ll]ogs/
|
||||
/[Mm]emoryCaptures/
|
||||
/EditorBuild/
|
||||
# /[Aa]ssets/TResources/DLL/
|
||||
/[Aa]ssets/StreamingAssets
|
||||
/BuildBundleInfo/
|
||||
[Aa]ssets/AATest/
|
||||
[Aa]ssets/AATest.meta
|
||||
|
||||
# Asset meta data should only be ignored when the corresponding asset is also ignored
|
||||
!/[Aa]ssets/**/*.meta
|
||||
|
||||
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||
# /[Aa]ssets/AssetStoreTools*
|
||||
|
||||
# Autogenerated Jetbrains Rider plugin
|
||||
[Aa]ssets/Plugins/Editor/JetBrains*
|
||||
|
||||
# Visual Studio cache directory
|
||||
.vs/
|
||||
|
||||
# Gradle cache directory
|
||||
.gradle/
|
||||
|
||||
# Autogenerated VS/MD/Consulo solution and project files
|
||||
ExportedObj/
|
||||
.consulo/
|
||||
*.csproj
|
||||
*.unityproj
|
||||
*.sln
|
||||
*.suo
|
||||
*.tmp
|
||||
*.user
|
||||
*.userprefs
|
||||
*.pidb
|
||||
*.booproj
|
||||
*.svd
|
||||
*.pdb
|
||||
*.mdb
|
||||
*.opendb
|
||||
*.VC.db
|
||||
|
||||
# Unity3D generated meta files
|
||||
*.pidb.meta
|
||||
*.pdb.meta
|
||||
*.mdb.meta
|
||||
|
||||
# Unity3D generated file on crash reports
|
||||
sysinfo.txt
|
||||
|
||||
# Builds
|
||||
*.apk
|
||||
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
|
||||
# TEnginePersistentDataPath
|
||||
TEnginePersistentDataPath/
|
||||
|
||||
# Hotfix
|
||||
TEngineHotUpdate/bin
|
||||
TEngineHotUpdate/obj
|
||||
|
||||
#HybirdCLR(HuaTuo)
|
||||
/HybirdCLRData/
|
||||
[Hh]ybridCLRData/
|
||||
|
||||
|
||||
#AATemp
|
||||
[Aa]ssets/AATemp/
|
||||
[Aa]ssets/AATemp.meta
|
||||
|
||||
#Rider
|
||||
/.idea/
|
||||
|
||||
# ABConfig
|
||||
[Aa]ssets/BuildConfig/
|
||||
[Aa]ssets/BuildConfig.meta
|
||||
|
||||
[Aa]ssets/StreamingAssets/
|
||||
[Aa]ssets/StreamingAssets.meta
|
||||
Assets/HybridCLRBuildCache/AssetBundleOutput.meta
|
||||
Assets/HybridCLRBuildCache/AssetBundleOutput/StandaloneWindows.meta
|
||||
Assets/HybridCLRBuildCache.meta
|
||||
Assets/HybridCLRBuildCache/AssetBundleSourceData.meta
|
||||
Assets/HybridCLRBuildCache/AssetBundleSourceData/StandaloneWindows.meta
|
||||
|
||||
#Bundles
|
||||
Bundles/
|
||||
|
||||
#Sandbox
|
||||
Sandbox/
|
||||
UnityProject/UserSettings/Layouts/default-2021.dwlt
|
||||
UnityProject/UserSettings/Search.settings
|
||||
|
||||
#Luban
|
||||
Luban/.cache.meta
|
||||
Tools/Luban/
|
||||
Tools/Luban.ClientServer/
|
||||
Configs/.cache.meta
|
||||
GenerateDatas/
|
||||
|
||||
#HybridCLR
|
||||
Assets/HybridCLRData.meta
|
||||
UserSettings/Search.settings
|
||||
|
||||
#Unity UserSettings
|
||||
UserSettings/Search.index
|
||||
UserSettings/Layouts/default-2021.dwlt
|
||||
|
||||
#UnityOnlineServiceData
|
||||
Assets/UnityOnlineServiceData.meta
|
||||
Assets/UnityOnlineServiceData
|
||||
#FileServer
|
||||
Tools/FileServer/AssetRoot
|
||||
|
||||
UnityProject/ProjectSettings/CommonBurstAotSettings.json
|
||||
UnityProject/ProjectSettings/BurstAotSettings_StandaloneWindows.json
|
||||
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a8431d2a64361c4d821790ed88aeb3d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 4343727234628468602
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 890abd3a957e406ab422fc468ba6c169
|
||||
timeCreated: 1682353243
|
@@ -1,6 +0,0 @@
|
||||
namespace BattleCore.Runtime
|
||||
{
|
||||
public static class EntityExtension
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Unity.Mathematics;
|
||||
|
||||
namespace BattleCore.Runtime
|
||||
{
|
||||
public static class MathematicsExt
|
||||
{
|
||||
public static int2 ToInt2(this Vector2Int vec) => new int2(vec.x, vec.y);
|
||||
public static int3 ToInt3(this Vector3Int vec) => new int3(vec.x, vec.y, vec.z);
|
||||
public static float2 ToFloat2(this Vector2 vec) => new float2(vec.x, vec.y);
|
||||
public static float3 ToFloat3(this Vector3 vec) => new float3(vec.x, vec.y, vec.z);
|
||||
|
||||
public static bool IsEquals(this int2 a, int2 b) => math.all(a == b);
|
||||
public static bool IsEquals(this int3 a, int3 b) => math.all(a == b);
|
||||
|
||||
|
||||
public static Vector2Int ToVec2(this int2 vec) => new Vector2Int(vec.x, vec.y);
|
||||
public static Vector3Int ToVec3(this int2 vec) => new Vector3Int(vec.x, vec.y, 0);
|
||||
public static Vector3Int ToVec3(this int3 vec) => new Vector3Int(vec.x, vec.y, vec.z);
|
||||
public static Vector2 ToVec2(this float2 vec) => new Vector2(vec.x, vec.y);
|
||||
public static Vector3 ToVec3(this float3 vec) => new Vector3(vec.x, vec.y, vec.z);
|
||||
public static int ManhattanDist(this int2 vec) => vec.x + vec.y;
|
||||
public static int ManhattanDist(this int3 vec) => vec.x + vec.y + vec.z;
|
||||
public static float ManhattanDist(this float2 vec) => vec.x + vec.y;
|
||||
public static float ManhattanDist(this float3 vec) => vec.x + vec.y + vec.z;
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b0e288b918a41698571ec3d36059851
|
||||
timeCreated: 1682353251
|
@@ -1,21 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BattleCore.Runtime
|
||||
{
|
||||
public class Empty : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
namespace GameBase
|
||||
{
|
||||
public class BaseClsTemplate<T>
|
||||
{
|
||||
protected static T Imp;
|
||||
|
||||
/// <summary>
|
||||
/// Unity工程,注册处理函数。
|
||||
/// </summary>
|
||||
/// <param name="imp">实现类。</param>
|
||||
public static void RegisterImp(T imp)
|
||||
{
|
||||
Imp = imp;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b062b3e32edd4536a4308a3d180842e0
|
||||
timeCreated: 1681989133
|
@@ -1,190 +0,0 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Linq;
|
||||
|
||||
/*******************************************************************************
|
||||
//开启一个Loom进程
|
||||
Loom.RunAsync(() =>
|
||||
{
|
||||
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>
|
||||
/// </summary>
|
||||
public class Loom : MonoBehaviour
|
||||
{
|
||||
public Dictionary<string, CancellationTokenSource> TokenSourcesDictionary = new Dictionary<string, CancellationTokenSource>();
|
||||
private static readonly int MaxThreads = 8;
|
||||
private static int _numThreads;
|
||||
private static Loom _current;
|
||||
|
||||
public static Loom Current
|
||||
{
|
||||
get
|
||||
{
|
||||
Initialize();
|
||||
return _current;
|
||||
}
|
||||
}
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
_current = this;
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
protected void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
private static bool _initialized;
|
||||
|
||||
private static void Initialize()
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_initialized = true;
|
||||
|
||||
var obj = new GameObject("[Loom]");
|
||||
|
||||
_current = obj.AddComponent<Loom>();
|
||||
|
||||
DontDestroyOnLoad(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public struct NoDelayedQueueItem
|
||||
{
|
||||
public Action<object> Action;
|
||||
public object Param;
|
||||
}
|
||||
|
||||
private readonly List<NoDelayedQueueItem> _actions = new List<NoDelayedQueueItem>();
|
||||
|
||||
public struct DelayedQueueItem
|
||||
{
|
||||
public float Time;
|
||||
public Action<object> Action;
|
||||
public object Param;
|
||||
}
|
||||
|
||||
private readonly List<DelayedQueueItem> _delayed = new List<DelayedQueueItem>();
|
||||
|
||||
private readonly List<DelayedQueueItem> _currentDelayed = new List<DelayedQueueItem>();
|
||||
|
||||
public static void QueueOnMainThread(Action<object> taction, object param, float time = 0f)
|
||||
{
|
||||
if (time != 0f)
|
||||
{
|
||||
lock (Current._delayed)
|
||||
{
|
||||
Current._delayed.Add(new DelayedQueueItem { Time = Time.time + time, Action = taction, Param = param });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lock (Current._actions)
|
||||
{
|
||||
Current._actions.Add(new NoDelayedQueueItem { Action = taction, Param = param });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Thread RunAsync(Action action)
|
||||
{
|
||||
Initialize();
|
||||
while (_numThreads >= MaxThreads)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
Interlocked.Increment(ref _numThreads);
|
||||
ThreadPool.QueueUserWorkItem(RunAction, action);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void RunAction(object action)
|
||||
{
|
||||
try
|
||||
{
|
||||
((Action)action)();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
finally
|
||||
{
|
||||
Interlocked.Decrement(ref _numThreads);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (_current == this)
|
||||
{
|
||||
_current = null;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<NoDelayedQueueItem> _currentActions = new List<NoDelayedQueueItem>();
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_actions.Count > 0)
|
||||
{
|
||||
lock (_actions)
|
||||
{
|
||||
_currentActions.Clear();
|
||||
_currentActions.AddRange(_actions);
|
||||
_actions.Clear();
|
||||
}
|
||||
|
||||
for (int i = 0; i < _currentActions.Count; i++)
|
||||
{
|
||||
_currentActions[i].Action(_currentActions[i].Param);
|
||||
}
|
||||
}
|
||||
|
||||
if (_delayed.Count > 0)
|
||||
{
|
||||
lock (_delayed)
|
||||
{
|
||||
_currentDelayed.Clear();
|
||||
_currentDelayed.AddRange(_delayed.Where(d => d.Time <= Time.time));
|
||||
for (int i = 0; i < _currentDelayed.Count; i++)
|
||||
{
|
||||
_delayed.Remove(_currentDelayed[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _currentDelayed.Count; i++)
|
||||
{
|
||||
_currentDelayed[i].Action(_currentDelayed[i].Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00565f0d362f4c36836804455e19c3df
|
||||
timeCreated: 1681990210
|
@@ -1,214 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 单例接口。
|
||||
/// </summary>
|
||||
public interface ISingleton
|
||||
{
|
||||
void Active();
|
||||
|
||||
void Release();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单例管理器(统一化持久和释放)。
|
||||
/// </summary>
|
||||
public static class SingletonMgr
|
||||
{
|
||||
private static List<ISingleton> _singletonList;
|
||||
private static Dictionary<string, GameObject> _gameObjects;
|
||||
private static GameObject _root;
|
||||
|
||||
public static GameObject Root
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_root == null)
|
||||
{
|
||||
_root = GameObject.Find("[SingletonMgr]");
|
||||
|
||||
if (_root == null)
|
||||
{
|
||||
_root = new GameObject("[SingletonMgr]")
|
||||
{
|
||||
transform =
|
||||
{
|
||||
position = Vector3.zero
|
||||
}
|
||||
};
|
||||
}
|
||||
UnityEngine.Object.DontDestroyOnLoad(_root);
|
||||
}
|
||||
return _root;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Retain(ISingleton go)
|
||||
{
|
||||
if (_singletonList == null)
|
||||
{
|
||||
_singletonList = new List<ISingleton>();
|
||||
}
|
||||
|
||||
_singletonList.Add(go);
|
||||
}
|
||||
|
||||
public static void Retain(GameObject go)
|
||||
{
|
||||
if (_gameObjects == null)
|
||||
{
|
||||
_gameObjects = new Dictionary<string, GameObject>();
|
||||
}
|
||||
|
||||
if (!_gameObjects.ContainsKey(go.name))
|
||||
{
|
||||
_gameObjects.Add(go.name, go);
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
UnityEngine.Object.DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(GameObject go)
|
||||
{
|
||||
if (_gameObjects != null && _gameObjects.ContainsKey(go.name))
|
||||
{
|
||||
_gameObjects.Remove(go.name);
|
||||
UnityEngine.Object.Destroy(go);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(ISingleton go)
|
||||
{
|
||||
if (_singletonList != null && _singletonList.Contains(go))
|
||||
{
|
||||
_singletonList.Remove(go);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release()
|
||||
{
|
||||
if (_gameObjects != null)
|
||||
{
|
||||
foreach (var item in _gameObjects)
|
||||
{
|
||||
UnityEngine.Object.Destroy(item.Value);
|
||||
}
|
||||
|
||||
_gameObjects.Clear();
|
||||
}
|
||||
|
||||
if (_singletonList != null)
|
||||
{
|
||||
for (int i = 0; i < _singletonList.Count; ++i)
|
||||
{
|
||||
_singletonList[i].Release();
|
||||
}
|
||||
|
||||
_singletonList.Clear();
|
||||
}
|
||||
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
|
||||
public static GameObject GetGameObject(string name)
|
||||
{
|
||||
GameObject go = null;
|
||||
if (_gameObjects != null)
|
||||
{
|
||||
_gameObjects.TryGetValue(name, out go);
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
|
||||
internal static bool ContainsKey(string name)
|
||||
{
|
||||
if (_gameObjects != null)
|
||||
{
|
||||
return _gameObjects.ContainsKey(name);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static ISingleton GetSingleton(string name)
|
||||
{
|
||||
for (int i = 0; i < _singletonList.Count; ++i)
|
||||
{
|
||||
if (_singletonList[i].ToString() == name)
|
||||
{
|
||||
return _singletonList[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 释放所有单例。
|
||||
/// </summary>
|
||||
public static void ReStart()
|
||||
{
|
||||
Release();
|
||||
|
||||
SceneManager.LoadScene(0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全局单例对象(非线程安全)。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">泛型T。</typeparam>
|
||||
public abstract class TSingleton<T> : ISingleton where T : TSingleton<T>, new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
_instance.Init();
|
||||
#if UNITY_EDITOR
|
||||
Log.Info($"TSingleton Instance:{typeof(T).Name}");
|
||||
#endif
|
||||
SingletonMgr.Retain(_instance);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsValid => _instance != null;
|
||||
|
||||
protected TSingleton()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void Init()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Active()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Release()
|
||||
{
|
||||
if (_instance != null)
|
||||
{
|
||||
SingletonMgr.Release(_instance);
|
||||
_instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa2cb5bb622045d7a6f2a4c4faea3ca6
|
||||
timeCreated: 1681989590
|
@@ -1,111 +0,0 @@
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 具备Unity完整生命周期的单例。
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public abstract class UnitySingleton<T> : MonoBehaviour where T : MonoBehaviour
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
var ins = UnityEngine.Object.FindObjectOfType<T>();
|
||||
if (ins != null)
|
||||
{
|
||||
var obj = ins.gameObject;
|
||||
obj.name = typeof(T).Name;
|
||||
_instance = ins;
|
||||
SingletonMgr.Retain(obj);
|
||||
return Instance;
|
||||
}
|
||||
|
||||
System.Type thisType = typeof(T);
|
||||
string instName = thisType.Name;
|
||||
GameObject go = SingletonMgr.GetGameObject(instName);
|
||||
if (go == null)
|
||||
{
|
||||
go = GameObject.Find($"{instName}");
|
||||
if (go == null)
|
||||
{
|
||||
go = new GameObject(instName);
|
||||
go.transform.position = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
_instance = go.GetComponent<T>();
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = go.AddComponent<T>();
|
||||
}
|
||||
|
||||
if (_instance == null)
|
||||
{
|
||||
Log.Error($"Can't create UnitySingleton<{typeof(T)}>");
|
||||
}
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static T Active()
|
||||
{
|
||||
return Instance;
|
||||
}
|
||||
|
||||
public static bool IsValid => _instance != null;
|
||||
|
||||
private bool CheckInstance()
|
||||
{
|
||||
if (this == Instance)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
GameObject.Destroy(gameObject);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual void OnLoad()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Awake()
|
||||
{
|
||||
if (CheckInstance())
|
||||
{
|
||||
OnLoad();
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
Log.Debug($"UnitySingleton Instance:{typeof(T).Name}");
|
||||
#endif
|
||||
GameObject tEngine = SingletonMgr.Root;
|
||||
if (tEngine != null)
|
||||
{
|
||||
this.gameObject.transform.SetParent(tEngine.transform);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
Release();
|
||||
}
|
||||
|
||||
public static void Release()
|
||||
{
|
||||
if (_instance != null)
|
||||
{
|
||||
SingletonMgr.Release(_instance.gameObject);
|
||||
_instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25c99243aa534df5870e36fdf9d36afd
|
||||
timeCreated: 1681990223
|
@@ -1,24 +0,0 @@
|
||||
using TEngine;
|
||||
using UnityEngine;
|
||||
#if ENABLE_URP
|
||||
using UnityEngine.Rendering.Universal;
|
||||
#endif
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class CameraUtils
|
||||
{
|
||||
public static void AddCameraStack(Camera camera,Camera mainCamera)
|
||||
{
|
||||
#if ENABLE_URP
|
||||
if (mainCamera != null)
|
||||
{
|
||||
// 通过脚本的方式,只要能找到 camera 不轮是否跨 base 相机的场景,都可以 Add 进 Stack
|
||||
mainCamera.GetComponent<UniversalAdditionalCameraData>().cameraStack.Add(GameModule.UI.UICamera);
|
||||
}
|
||||
#else
|
||||
Log.Fatal("Could not add camera stack because had no URP-Render-Pip");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6375b5490bbdcc145a24706a6c4e9cb7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4703541a565f5ec4bb35edd81c28958c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 145b951be40d41dea06e76bd967a5d15
|
||||
timeCreated: 1682045847
|
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
[Serializable, ProtoContract(Name = @"HeartBeat")]
|
||||
public class HeartBeat : PacketBase
|
||||
{
|
||||
public HeartBeat()
|
||||
{
|
||||
}
|
||||
|
||||
public override int Id => 1;
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8b9b60d2abf409ca9dd2ce00506ac79
|
||||
timeCreated: 1682046644
|
@@ -1,254 +0,0 @@
|
||||
using ProtoBuf;
|
||||
using ProtoBuf.Meta;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public class NetworkChannelHelper : INetworkChannelHelper, IMemory
|
||||
{
|
||||
private readonly Dictionary<int, Type> _serverToClientPacketTypes = new Dictionary<int, Type>();
|
||||
private readonly MemoryStream _cachedStream = new MemoryStream(1024 * 8);
|
||||
private INetworkChannel _networkChannel = null;
|
||||
|
||||
/// <summary>
|
||||
/// 获取消息包头长度。
|
||||
/// <remarks>4。</remarks>
|
||||
/// </summary>
|
||||
public int PacketHeaderLength => sizeof(int);
|
||||
|
||||
/// <summary>
|
||||
/// 初始化网络频道辅助器。
|
||||
/// </summary>
|
||||
/// <param name="networkChannel">网络频道。</param>
|
||||
public void Initialize(INetworkChannel networkChannel)
|
||||
{
|
||||
_networkChannel = networkChannel;
|
||||
|
||||
// 反射注册包和包处理函数。
|
||||
Type packetBaseType = typeof(ProtoPacket);
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
Type[] types = assembly.GetTypes();
|
||||
for (int i = 0; i < types.Length; i++)
|
||||
{
|
||||
if (!types[i].IsClass || types[i].IsAbstract)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (types[i].BaseType == packetBaseType)
|
||||
{
|
||||
PacketBase packetBase = (PacketBase)Activator.CreateInstance(types[i]);
|
||||
Type packetType = GetServerToClientPacketType(packetBase.Id);
|
||||
if (packetType != null)
|
||||
{
|
||||
Log.Warning("Already exist packet type '{0}', check '{1}' or '{2}'?.", packetBase.Id.ToString(), packetType.Name, packetBase.GetType().Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
_serverToClientPacketTypes.Add(packetBase.Id, types[i]);
|
||||
}
|
||||
}
|
||||
|
||||
GameEvent.AddEventListener<INetworkChannel, object>(NetworkEvent.NetworkConnectedEvent, OnNetworkConnected);
|
||||
GameEvent.AddEventListener<INetworkChannel>(NetworkEvent.NetworkClosedEvent, OnNetworkClosed);
|
||||
GameEvent.AddEventListener<INetworkChannel, int>(NetworkEvent.NetworkMissHeartBeatEvent, OnNetworkMissHeartBeat);
|
||||
GameEvent.AddEventListener<INetworkChannel, NetworkErrorCode, SocketError, string>(NetworkEvent.NetworkErrorEvent, OnNetworkError);
|
||||
GameEvent.AddEventListener<INetworkChannel, object>(NetworkEvent.NetworkCustomErrorEvent, OnNetworkCustomError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭并清理网络频道辅助器。
|
||||
/// </summary>
|
||||
public void Shutdown()
|
||||
{
|
||||
GameEvent.RemoveEventListener<INetworkChannel, object>(NetworkEvent.NetworkConnectedEvent, OnNetworkConnected);
|
||||
GameEvent.RemoveEventListener<INetworkChannel>(NetworkEvent.NetworkClosedEvent, OnNetworkClosed);
|
||||
GameEvent.RemoveEventListener<INetworkChannel, int>(NetworkEvent.NetworkMissHeartBeatEvent, OnNetworkMissHeartBeat);
|
||||
GameEvent.RemoveEventListener<INetworkChannel, NetworkErrorCode, SocketError, string>(NetworkEvent.NetworkErrorEvent, OnNetworkError);
|
||||
GameEvent.RemoveEventListener<INetworkChannel, object>(NetworkEvent.NetworkCustomErrorEvent, OnNetworkCustomError);
|
||||
|
||||
_networkChannel = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 准备进行连接。
|
||||
/// </summary>
|
||||
public void PrepareForConnecting()
|
||||
{
|
||||
_networkChannel.Socket.ReceiveBufferSize = 1024 * 64;
|
||||
_networkChannel.Socket.SendBufferSize = 1024 * 64;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送心跳消息包。
|
||||
/// </summary>
|
||||
/// <returns>是否发送心跳消息包成功。</returns>
|
||||
public bool SendHeartBeat()
|
||||
{
|
||||
_networkChannel.Send(MemoryPool.Acquire<HeartBeat>());
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列化消息包。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">消息包类型。</typeparam>
|
||||
/// <param name="packet">要序列化的消息包。</param>
|
||||
/// <param name="destination">要序列化的目标流。</param>
|
||||
/// <returns>是否序列化成功。</returns>
|
||||
public bool Serialize<T>(T packet, Stream destination) where T : Packet
|
||||
{
|
||||
PacketBase packetImpl = packet as PacketBase;
|
||||
if (packetImpl == null)
|
||||
{
|
||||
Log.Warning("Packet is invalid.");
|
||||
return false;
|
||||
}
|
||||
|
||||
_cachedStream.SetLength(_cachedStream.Capacity); // 此行防止 Array.Copy 的数据无法写入
|
||||
_cachedStream.Position = 0L;
|
||||
|
||||
PacketHeader packetHeader = MemoryPool.Acquire<PacketHeader>();
|
||||
Serializer.Serialize(_cachedStream, packetHeader);
|
||||
MemoryPool.Release(packetHeader);
|
||||
|
||||
Serializer.SerializeWithLengthPrefix(_cachedStream, packet, PrefixStyle.Fixed32);
|
||||
MemoryPool.Release((IMemory)packet);
|
||||
|
||||
_cachedStream.WriteTo(destination);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化消息包头。
|
||||
/// </summary>
|
||||
/// <param name="source">要反序列化的来源流。</param>
|
||||
/// <param name="customErrorData">用户自定义错误数据。</param>
|
||||
/// <returns>反序列化后的消息包头。</returns>
|
||||
public IPacketHeader DeserializePacketHeader(Stream source, out object customErrorData)
|
||||
{
|
||||
// 注意:此函数并不在主线程调用!
|
||||
customErrorData = null;
|
||||
return (IPacketHeader)RuntimeTypeModel.Default.Deserialize(source, MemoryPool.Acquire<PacketHeader>(), typeof(PacketHeader));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化消息包。
|
||||
/// </summary>
|
||||
/// <param name="packetHeader">消息包头。</param>
|
||||
/// <param name="source">要反序列化的来源流。</param>
|
||||
/// <param name="customErrorData">用户自定义错误数据。</param>
|
||||
/// <returns>反序列化后的消息包。</returns>
|
||||
public Packet DeserializePacket(IPacketHeader packetHeader, Stream source, out object customErrorData)
|
||||
{
|
||||
// 注意:此函数并不在主线程调用!
|
||||
customErrorData = null;
|
||||
|
||||
PacketHeader scPacketHeader = packetHeader as PacketHeader;
|
||||
if (scPacketHeader == null)
|
||||
{
|
||||
Log.Warning("Packet header is invalid.");
|
||||
return null;
|
||||
}
|
||||
|
||||
Packet packet = null;
|
||||
if (scPacketHeader.IsValid)
|
||||
{
|
||||
Type packetType = GetServerToClientPacketType(scPacketHeader.Id);
|
||||
if (packetType != null)
|
||||
{
|
||||
packet = (Packet)RuntimeTypeModel.Default.DeserializeWithLengthPrefix(source, MemoryPool.Acquire(packetType), packetType, PrefixStyle.Fixed32, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning("Can not deserialize packet for packet id '{0}'.", scPacketHeader.Id.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning("Packet header is invalid.");
|
||||
}
|
||||
|
||||
MemoryPool.Release(scPacketHeader);
|
||||
return packet;
|
||||
}
|
||||
|
||||
private Type GetServerToClientPacketType(int id)
|
||||
{
|
||||
if (_serverToClientPacketTypes.TryGetValue(id, out var type))
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnNetworkConnected(INetworkChannel channel, object userdata)
|
||||
{
|
||||
if (channel != _networkChannel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Info("Network channel '{0}' connected, local address '{1}', remote address '{2}'.",
|
||||
channel.Name, channel.Socket.LocalEndPoint.ToString(),
|
||||
channel.Socket.RemoteEndPoint.ToString());
|
||||
}
|
||||
|
||||
private void OnNetworkClosed(INetworkChannel channel)
|
||||
{
|
||||
if (channel != _networkChannel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Info("Network channel '{0}' closed.", channel.Name);
|
||||
}
|
||||
|
||||
private void OnNetworkMissHeartBeat(INetworkChannel channel, int missCount)
|
||||
{
|
||||
if (channel != _networkChannel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Fatal("Network channel '{0}' miss heart beat '{1}' times.", channel.Name, missCount.ToString());
|
||||
|
||||
if (missCount < 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
channel.Close();
|
||||
}
|
||||
|
||||
private void OnNetworkError(INetworkChannel channel, NetworkErrorCode networkErrorCode, SocketError socketError, string errorMessage)
|
||||
{
|
||||
if (channel != _networkChannel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Fatal("Network channel '{0}' error, error code is '{1}', error message is '{2}'.", channel.Name, networkErrorCode.ToString(), errorMessage);
|
||||
|
||||
channel.Close();
|
||||
}
|
||||
|
||||
private void OnNetworkCustomError(INetworkChannel channel, object userData)
|
||||
{
|
||||
if (channel != _networkChannel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf86ce2ddfb5429abecfb06257c86acd
|
||||
timeCreated: 1682045961
|
@@ -1,24 +0,0 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// 网络消息包基类。
|
||||
/// </summary>
|
||||
public abstract class PacketBase : Packet
|
||||
{
|
||||
/// <summary>
|
||||
/// 网络消息包Id。
|
||||
/// </summary>
|
||||
public int ProtoId;
|
||||
|
||||
/// <summary>
|
||||
/// 网络消息包包体。
|
||||
/// </summary>
|
||||
public byte[] ProtoBody;
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acea4283f57644b6b4452354d23f2803
|
||||
timeCreated: 1682045887
|
@@ -1,47 +0,0 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// 网络消息包头。
|
||||
/// </summary>
|
||||
public class PacketHeader : IPacketHeader, IMemory
|
||||
{
|
||||
/// <summary>
|
||||
/// 网络消息包Id。
|
||||
/// </summary>
|
||||
public short Id
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 网络消息包长度。
|
||||
/// </summary>
|
||||
public int PacketLength
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 网络消息包是否合法。
|
||||
/// </summary>
|
||||
public bool IsValid
|
||||
{
|
||||
get
|
||||
{
|
||||
return PacketLength >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除网络消息包头。
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
PacketLength = 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30edc133b73141598b5351d4afc2ad93
|
||||
timeCreated: 1682046771
|
@@ -1,15 +0,0 @@
|
||||
namespace GameLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// 网络消息包。
|
||||
/// </summary>
|
||||
public partial class ProtoPacket : PacketBase
|
||||
{
|
||||
public override int Id => 1;
|
||||
|
||||
public override void Clear()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da70995486db4799baba570b1767ab86
|
||||
timeCreated: 1682045865
|
@@ -1,138 +0,0 @@
|
||||
// using System;
|
||||
// using System.ComponentModel;
|
||||
// using System.IO;
|
||||
// using ProtoBuf;
|
||||
// using ProtoBuf.Meta;
|
||||
//
|
||||
// /// <summary>
|
||||
// /// ProtoBuf工具
|
||||
// /// </summary>
|
||||
// public class ProtobufUtils
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// 消息压入内存流。
|
||||
// /// </summary>
|
||||
// /// <param name="message"></param>
|
||||
// /// <param name="stream"></param>
|
||||
// public static void ToStream(object message, MemoryStream stream)
|
||||
// {
|
||||
// ((IMessage)message).WriteTo(stream);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 比特流解析。
|
||||
// /// </summary>
|
||||
// /// <param name="type"></param>
|
||||
// /// <param name="bytes"></param>
|
||||
// /// <param name="index"></param>
|
||||
// /// <param name="count"></param>
|
||||
// /// <returns></returns>
|
||||
// public static object FromBytes(Type type, byte[] bytes, int index, int count)
|
||||
// {
|
||||
// object message = Activator.CreateInstance(type);
|
||||
// ((IMessage)message).MergeFrom(bytes, index, count);
|
||||
// ISupportInitialize iSupportInitialize = message as ISupportInitialize;
|
||||
// if (iSupportInitialize == null)
|
||||
// {
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// iSupportInitialize.EndInit();
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 比特流解析。
|
||||
// /// </summary>
|
||||
// /// <param name="instance"></param>
|
||||
// /// <param name="bytes"></param>
|
||||
// /// <param name="index"></param>
|
||||
// /// <param name="count"></param>
|
||||
// /// <returns></returns>
|
||||
// public static object FromBytes(object instance, byte[] bytes, int index, int count)
|
||||
// {
|
||||
// object message = instance;
|
||||
// ((IMessage)message).MergeFrom(bytes, index, count);
|
||||
// ISupportInitialize iSupportInitialize = message as ISupportInitialize;
|
||||
// if (iSupportInitialize == null)
|
||||
// {
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// iSupportInitialize.EndInit();
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 从内存流取出。
|
||||
// /// </summary>
|
||||
// /// <param name="type"></param>
|
||||
// /// <param name="stream"></param>
|
||||
// /// <returns></returns>
|
||||
// public static object FromStream(Type type, MemoryStream stream)
|
||||
// {
|
||||
// object message = Activator.CreateInstance(type);
|
||||
// ((IMessage)message).MergeFrom(stream.GetBuffer(), (int)stream.Position, (int)stream.Length);
|
||||
// ISupportInitialize iSupportInitialize = message as ISupportInitialize;
|
||||
// if (iSupportInitialize == null)
|
||||
// {
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// iSupportInitialize.EndInit();
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 从内存流取出。
|
||||
// /// </summary>
|
||||
// /// <param name="message"></param>
|
||||
// /// <param name="stream"></param>
|
||||
// /// <returns></returns>
|
||||
// public static object FromStream(object message, MemoryStream stream)
|
||||
// {
|
||||
// // TODO 这个message最好从池中获取,减少gc
|
||||
// ((IMessage)message).MergeFrom(stream.GetBuffer(), (int)stream.Position, (int)stream.Length);
|
||||
// ISupportInitialize iSupportInitialize = message as ISupportInitialize;
|
||||
// if (iSupportInitialize == null)
|
||||
// {
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// iSupportInitialize.EndInit();
|
||||
// return message;
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 序列化protobuf
|
||||
// /// </summary>
|
||||
// /// <param name="message"></param>
|
||||
// /// <returns></returns>
|
||||
// public static byte[] Serialize(object message)
|
||||
// {
|
||||
// return ((IMessage)message).ToByteArray();
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// 反序列化protobuf
|
||||
// /// </summary>
|
||||
// /// <typeparam name="T"></typeparam>
|
||||
// /// <param name="dataBytes"></param>
|
||||
// /// <returns></returns>
|
||||
// public static T Deserialize<T>(byte[] dataBytes) where T : IMessage, new()
|
||||
// {
|
||||
// T msg = new T();
|
||||
// msg = (T)msg.Descriptor.Parser.ParseFrom(dataBytes);
|
||||
// return msg;
|
||||
// }
|
||||
//
|
||||
// public static int GetHighOrder(int cmdMerge)
|
||||
// {
|
||||
// return cmdMerge >> 16;
|
||||
// }
|
||||
//
|
||||
// public static int GetLowOrder(int cmdMerge)
|
||||
// {
|
||||
// return cmdMerge & 65535;
|
||||
// }
|
||||
// }
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 972ca4545003463d8710de956f0fde66
|
||||
timeCreated: 1682047511
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12517ef95f49a9144b18989aa8097420
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d376f2d7d7324712998e19cfa2e03039
|
||||
timeCreated: 1680161323
|
@@ -1,76 +0,0 @@
|
||||
using Bright.Serialization;
|
||||
using System.IO;
|
||||
using GameBase;
|
||||
using GameConfig;
|
||||
using SimpleJSON;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 配置加载器
|
||||
/// </summary>
|
||||
public class ConfigLoader:Singleton<ConfigLoader>
|
||||
{
|
||||
private bool _init = false;
|
||||
|
||||
private Tables _tables;
|
||||
|
||||
public Tables Tables
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!_init)
|
||||
{
|
||||
_init = true;
|
||||
Load();
|
||||
}
|
||||
return _tables;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载配置
|
||||
/// </summary>
|
||||
public void Load()
|
||||
{
|
||||
var tablesCtor = typeof(Tables).GetConstructors()[0];
|
||||
var loaderReturnType = tablesCtor.GetParameters()[0].ParameterType.GetGenericArguments()[1];
|
||||
|
||||
System.Delegate loader = loaderReturnType == typeof(ByteBuf)
|
||||
? new System.Func<string, ByteBuf>(LoadByteBuf)
|
||||
: (System.Delegate)new System.Func<string, JSONNode>(LoadJson);
|
||||
_tables = (Tables)tablesCtor.Invoke(new object[] { loader });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载Json配置。
|
||||
/// </summary>
|
||||
/// <param name="file">FileName</param>
|
||||
/// <returns>JSONNode</returns>
|
||||
private JSONNode LoadJson(string file)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
var ret = File.ReadAllText($"{Application.dataPath}/../GenerateDatas/json/{file}.json", System.Text.Encoding.UTF8);
|
||||
#else
|
||||
var textAssets = GameModule.Resource.LoadAsset<TextAsset>($"{SettingsUtils.FrameworkGlobalSettings.ConfigFolderName}{file}.json");
|
||||
var ret = textAssets.text;
|
||||
#endif
|
||||
return JSON.Parse(ret);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载二进制配置。
|
||||
/// </summary>
|
||||
/// <param name="file">FileName</param>
|
||||
/// <returns>ByteBuf</returns>
|
||||
private ByteBuf LoadByteBuf(string file)
|
||||
{
|
||||
byte[] ret = null;
|
||||
#if UNITY_EDITOR
|
||||
ret = File.ReadAllBytes($"{Application.dataPath}/../GenerateDatas/bytes/{file}.bytes");
|
||||
#else
|
||||
var textAssets = GameModule.Resource.LoadAsset<TextAsset>($"{SettingsUtils.FrameworkGlobalSettings.ConfigFolderName}{file}.bytes");
|
||||
ret = textAssets.bytes;
|
||||
#endif
|
||||
return new ByteBuf(ret);
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: abc35c855bfb323429a1d72066c8489c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,65 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
|
||||
namespace GameProto
|
||||
{
|
||||
/// <summary>
|
||||
/// 指定Key委托。
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">键。</typeparam>
|
||||
/// <typeparam name="TValue">值。</typeparam>
|
||||
public delegate TKey ConvertDictionaryKey<out TKey, in TValue>(TValue val);
|
||||
|
||||
/// <summary>
|
||||
/// 配置表辅助工具。
|
||||
/// </summary>
|
||||
public static class ConfigUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// 生成64long的主键。
|
||||
/// </summary>
|
||||
/// <param name="key1">键1。</param>
|
||||
/// <param name="key2">键2。</param>
|
||||
/// <returns>64long的主键。</returns>
|
||||
public static UInt64 Make64Key(uint key1, uint key2)
|
||||
{
|
||||
return ((UInt64)key1 << 32) | key2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拷贝配置表字典。
|
||||
/// </summary>
|
||||
/// <param name="dict">拷贝地址。</param>
|
||||
/// <param name="source">拷贝源。</param>
|
||||
/// <param name="convKey">指定主键。</param>
|
||||
/// <typeparam name="TKey">键。</typeparam>
|
||||
/// <typeparam name="TValue">值。</typeparam>
|
||||
/// <returns>是否拷贝成功。</returns>
|
||||
public static bool CopyConfigDict<TKey, TValue>(ref Dictionary<TKey, TValue> dict,List<TValue> source, ConvertDictionaryKey<TKey, TValue> convKey)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
dict.Clear();
|
||||
|
||||
bool failed = false;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var data = source[i];
|
||||
TKey key = convKey(data);
|
||||
if (dict.ContainsKey(key))
|
||||
{
|
||||
Log.Fatal("Copy Config Failed: {0} IndexOf {1} Had Repeated Key: {2} ", typeof(TValue).Name, i + 1, key);
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
dict.Add(key, data);
|
||||
}
|
||||
return !failed;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e278e636820842f293e2a765962ad4f8
|
||||
timeCreated: 1683300170
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31f94e2989871ec49b783b3aeb1b142c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,32 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum ActorAttrAddType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无效数据
|
||||
/// </summary>
|
||||
NONE = 0,
|
||||
/// <summary>
|
||||
/// 加法计算
|
||||
/// </summary>
|
||||
ABSOLUTE_VAL = 1,
|
||||
/// <summary>
|
||||
/// 多个项结果累加,然后对加法做乘法
|
||||
/// </summary>
|
||||
SUM_PERCENT_VAL = 2,
|
||||
/// <summary>
|
||||
/// 每一项都是对最终结果做乘法
|
||||
/// </summary>
|
||||
MUL_PERCENT_VAL = 3,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 073f19ae3fef26f43b193ff35a27eb9c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,88 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum ActorAttrDataType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无效数据
|
||||
/// </summary>
|
||||
None = 0,
|
||||
/// <summary>
|
||||
/// 最大血量
|
||||
/// </summary>
|
||||
MaxHp = 1,
|
||||
/// <summary>
|
||||
/// 攻击力
|
||||
/// </summary>
|
||||
Attack = 2,
|
||||
/// <summary>
|
||||
/// 物理伤害
|
||||
/// </summary>
|
||||
PhyDamage = 3,
|
||||
/// <summary>
|
||||
/// 物理防御
|
||||
/// </summary>
|
||||
PhyDef = 4,
|
||||
/// <summary>
|
||||
/// 法术伤害
|
||||
/// </summary>
|
||||
MagicDamage = 5,
|
||||
/// <summary>
|
||||
/// 法术防御
|
||||
/// </summary>
|
||||
MagicDef = 6,
|
||||
/// <summary>
|
||||
/// 移动速度
|
||||
/// </summary>
|
||||
MoveSpeed = 7,
|
||||
/// <summary>
|
||||
/// 攻击速度
|
||||
/// </summary>
|
||||
AttackSpeed = 8,
|
||||
/// <summary>
|
||||
/// 命中率
|
||||
/// </summary>
|
||||
Hit = 9,
|
||||
/// <summary>
|
||||
/// 闪避率
|
||||
/// </summary>
|
||||
Dodge = 10,
|
||||
/// <summary>
|
||||
/// 暴击率
|
||||
/// </summary>
|
||||
CriticalAtkRatio = 11,
|
||||
/// <summary>
|
||||
/// San值(疯狂值)
|
||||
/// </summary>
|
||||
SanValue = 12,
|
||||
/// <summary>
|
||||
/// 最大MP
|
||||
/// </summary>
|
||||
MaxMp = 13,
|
||||
/// <summary>
|
||||
/// 物理伤害倍率
|
||||
/// </summary>
|
||||
PhyDamageRatio = 14,
|
||||
/// <summary>
|
||||
/// 魔法伤害倍率
|
||||
/// </summary>
|
||||
MagicDamageRatio = 15,
|
||||
/// <summary>
|
||||
/// 暴击倍率
|
||||
/// </summary>
|
||||
CriticalRatio = 16,
|
||||
/// <summary>
|
||||
/// 暴击减免
|
||||
/// </summary>
|
||||
CriticalReduce = 17,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89dbbbd30b2f8c74f86ede4e27591ba7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,116 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class BuffAttrConfig : Bright.Config.BeanBase
|
||||
{
|
||||
public BuffAttrConfig(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["BuffID"].IsNumber) { throw new SerializationException(); } BuffID = _json["BuffID"]; }
|
||||
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
|
||||
{ if(!_json["StackNum"].IsNumber) { throw new SerializationException(); } StackNum = _json["StackNum"]; }
|
||||
{ if(!_json["DurTime"].IsNumber) { throw new SerializationException(); } DurTime = _json["DurTime"]; }
|
||||
{ if(!_json["ResultType"].IsNumber) { throw new SerializationException(); } ResultType = (Battle.BuffResultType)_json["ResultType"].AsInt; }
|
||||
{ if(!_json["RemoveWhenDie"].IsNumber) { throw new SerializationException(); } RemoveWhenDie = _json["RemoveWhenDie"]; }
|
||||
{ if(!_json["DotDamageData"].IsObject) { throw new SerializationException(); } DotDamageData = Battle.SkillAttrDamageData.DeserializeSkillAttrDamageData(_json["DotDamageData"]); }
|
||||
{ if(!_json["DotTickConfig"].IsObject) { throw new SerializationException(); } DotTickConfig = Battle.BuffDotTickConfig.DeserializeBuffDotTickConfig(_json["DotTickConfig"]); }
|
||||
{ var __json0 = _json["AttrData"]; if(!__json0.IsArray) { throw new SerializationException(); } AttrData = new System.Collections.Generic.List<Battle.ResAttrImpactData>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { Battle.ResAttrImpactData __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = Battle.ResAttrImpactData.DeserializeResAttrImpactData(__e0); } AttrData.Add(__v0); } }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public BuffAttrConfig(int BuffID, string name, int StackNum, float DurTime, Battle.BuffResultType ResultType, int RemoveWhenDie, Battle.SkillAttrDamageData DotDamageData, Battle.BuffDotTickConfig DotTickConfig, System.Collections.Generic.List<Battle.ResAttrImpactData> AttrData )
|
||||
{
|
||||
this.BuffID = BuffID;
|
||||
this.Name = name;
|
||||
this.StackNum = StackNum;
|
||||
this.DurTime = DurTime;
|
||||
this.ResultType = ResultType;
|
||||
this.RemoveWhenDie = RemoveWhenDie;
|
||||
this.DotDamageData = DotDamageData;
|
||||
this.DotTickConfig = DotTickConfig;
|
||||
this.AttrData = AttrData;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static BuffAttrConfig DeserializeBuffAttrConfig(JSONNode _json)
|
||||
{
|
||||
return new Battle.BuffAttrConfig(_json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// BuffID
|
||||
/// </summary>
|
||||
public int BuffID { get; private set; }
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
/// <summary>
|
||||
/// 叠加次数
|
||||
/// </summary>
|
||||
public int StackNum { get; private set; }
|
||||
/// <summary>
|
||||
/// 持续时间
|
||||
/// </summary>
|
||||
public float DurTime { get; private set; }
|
||||
/// <summary>
|
||||
/// 数值效果类型
|
||||
/// </summary>
|
||||
public Battle.BuffResultType ResultType { get; private set; }
|
||||
/// <summary>
|
||||
/// 死亡消失
|
||||
/// </summary>
|
||||
public int RemoveWhenDie { get; private set; }
|
||||
public Battle.SkillAttrDamageData DotDamageData { get; private set; }
|
||||
public Battle.BuffDotTickConfig DotTickConfig { get; private set; }
|
||||
public System.Collections.Generic.List<Battle.ResAttrImpactData> AttrData { get; private set; }
|
||||
|
||||
public const int __ID__ = 1652935996;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
DotDamageData?.Resolve(_tables);
|
||||
DotTickConfig?.Resolve(_tables);
|
||||
foreach(var _e in AttrData) { _e?.Resolve(_tables); }
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
DotDamageData?.TranslateText(translator);
|
||||
DotTickConfig?.TranslateText(translator);
|
||||
foreach(var _e in AttrData) { _e?.TranslateText(translator); }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "BuffID:" + BuffID + ","
|
||||
+ "Name:" + Name + ","
|
||||
+ "StackNum:" + StackNum + ","
|
||||
+ "DurTime:" + DurTime + ","
|
||||
+ "ResultType:" + ResultType + ","
|
||||
+ "RemoveWhenDie:" + RemoveWhenDie + ","
|
||||
+ "DotDamageData:" + DotDamageData + ","
|
||||
+ "DotTickConfig:" + DotTickConfig + ","
|
||||
+ "AttrData:" + Bright.Common.StringUtil.CollectionToString(AttrData) + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5224da34dfb42c141b22335957c1b784
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,111 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class BuffConfig : Bright.Config.BeanBase
|
||||
{
|
||||
public BuffConfig(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["BuffID"].IsNumber) { throw new SerializationException(); } BuffID = _json["BuffID"]; }
|
||||
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
|
||||
{ if(!_json["prefId"].IsNumber) { throw new SerializationException(); } PrefId = _json["prefId"]; }
|
||||
{ if(!_json["desc"].IsString) { throw new SerializationException(); } Desc = _json["desc"]; }
|
||||
{ if(!_json["icon"].IsString) { throw new SerializationException(); } Icon = _json["icon"]; }
|
||||
{ if(!_json["TimeType"].IsNumber) { throw new SerializationException(); } TimeType = (Battle.BuffTimeType)_json["TimeType"].AsInt; }
|
||||
{ if(!_json["ReplaceType"].IsNumber) { throw new SerializationException(); } ReplaceType = (Battle.BuffReplaceType)_json["ReplaceType"].AsInt; }
|
||||
{ if(!_json["State"].IsObject) { throw new SerializationException(); } State = Battle.BuffTriggleState.DeserializeBuffTriggleState(_json["State"]); }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public BuffConfig(int BuffID, string name, int prefId, string desc, string icon, Battle.BuffTimeType TimeType, Battle.BuffReplaceType ReplaceType, Battle.BuffTriggleState State )
|
||||
{
|
||||
this.BuffID = BuffID;
|
||||
this.Name = name;
|
||||
this.PrefId = prefId;
|
||||
this.Desc = desc;
|
||||
this.Icon = icon;
|
||||
this.TimeType = TimeType;
|
||||
this.ReplaceType = ReplaceType;
|
||||
this.State = State;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static BuffConfig DeserializeBuffConfig(JSONNode _json)
|
||||
{
|
||||
return new Battle.BuffConfig(_json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// BuffID
|
||||
/// </summary>
|
||||
public int BuffID { get; private set; }
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
/// <summary>
|
||||
/// 表现ID
|
||||
/// </summary>
|
||||
public int PrefId { get; private set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Desc { get; private set; }
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
public string Icon { get; private set; }
|
||||
/// <summary>
|
||||
/// 持续类型
|
||||
/// </summary>
|
||||
public Battle.BuffTimeType TimeType { get; private set; }
|
||||
/// <summary>
|
||||
/// 叠加类型
|
||||
/// </summary>
|
||||
public Battle.BuffReplaceType ReplaceType { get; private set; }
|
||||
public Battle.BuffTriggleState State { get; private set; }
|
||||
|
||||
public const int __ID__ = 1807662187;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
State?.Resolve(_tables);
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
State?.TranslateText(translator);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "BuffID:" + BuffID + ","
|
||||
+ "Name:" + Name + ","
|
||||
+ "PrefId:" + PrefId + ","
|
||||
+ "Desc:" + Desc + ","
|
||||
+ "Icon:" + Icon + ","
|
||||
+ "TimeType:" + TimeType + ","
|
||||
+ "ReplaceType:" + ReplaceType + ","
|
||||
+ "State:" + State + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b4f7b8798a4dca4ca075552d618f24d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,64 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class BuffDotTickConfig : Bright.Config.BeanBase
|
||||
{
|
||||
public BuffDotTickConfig(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["TickTime"].IsNumber) { throw new SerializationException(); } TickTime = _json["TickTime"]; }
|
||||
{ if(!_json["TickWhenAdd"].IsNumber) { throw new SerializationException(); } TickWhenAdd = _json["TickWhenAdd"]; }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public BuffDotTickConfig(float TickTime, int TickWhenAdd )
|
||||
{
|
||||
this.TickTime = TickTime;
|
||||
this.TickWhenAdd = TickWhenAdd;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static BuffDotTickConfig DeserializeBuffDotTickConfig(JSONNode _json)
|
||||
{
|
||||
return new Battle.BuffDotTickConfig(_json);
|
||||
}
|
||||
|
||||
public float TickTime { get; private set; }
|
||||
public int TickWhenAdd { get; private set; }
|
||||
|
||||
public const int __ID__ = 2124630047;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "TickTime:" + TickTime + ","
|
||||
+ "TickWhenAdd:" + TickWhenAdd + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b87372c0c0ce0547bc2221f8f8cc7dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,36 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum BuffReplaceType
|
||||
{
|
||||
/// <summary>
|
||||
/// 更新时间范围
|
||||
/// </summary>
|
||||
BUFF_REPLACE_INSTEAD = 0,
|
||||
/// <summary>
|
||||
/// 不允许叠加
|
||||
/// </summary>
|
||||
BUFF_REPLACE_FORBIT = 1,
|
||||
/// <summary>
|
||||
/// 累加时间范围
|
||||
/// </summary>
|
||||
BUFF_REPLACE_ADD_TIME = 2,
|
||||
/// <summary>
|
||||
/// 叠加数值
|
||||
/// </summary>
|
||||
BUFF_REPLACE_ADD_ATTR = 3,
|
||||
/// <summary>
|
||||
/// 叠加种类
|
||||
/// </summary>
|
||||
BUFF_REPLACE_TYPE_COUNT = 4,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6141f2c1272ed3848baf1f8d3341fc79
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,100 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum BuffResultType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无
|
||||
/// </summary>
|
||||
BUFF_RESULT_NONE = 0,
|
||||
/// <summary>
|
||||
/// 物理攻击提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_ATK_UP = 1,
|
||||
/// <summary>
|
||||
/// 物理攻击降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_ATK_DOWN = 2,
|
||||
/// <summary>
|
||||
/// 物理防御提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_DEF_UP = 3,
|
||||
/// <summary>
|
||||
/// 物理防御降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_DEF_DOWN = 4,
|
||||
/// <summary>
|
||||
/// 物理命中提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_HIT_UP = 5,
|
||||
/// <summary>
|
||||
/// 物理命中降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_HIT_DOWN = 6,
|
||||
/// <summary>
|
||||
/// 物理持续掉血
|
||||
/// </summary>
|
||||
BUFF_RESULT_PHY_LOSE_HP = 7,
|
||||
/// <summary>
|
||||
/// 法术攻击提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_ATK_UP = 8,
|
||||
/// <summary>
|
||||
/// 法术攻击降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_ATK_DOWN = 9,
|
||||
/// <summary>
|
||||
/// 法术防御提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_DEF_UP = 10,
|
||||
/// <summary>
|
||||
/// 法术防御降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_DEF_DOWN = 11,
|
||||
/// <summary>
|
||||
/// 法术命中提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_HIT_UP = 12,
|
||||
/// <summary>
|
||||
/// 法术命中降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_HIT_DOWN = 13,
|
||||
/// <summary>
|
||||
/// 法术持续掉血
|
||||
/// </summary>
|
||||
BUFF_RESULT_MAG_LOSE_HP = 14,
|
||||
/// <summary>
|
||||
/// 暴击率提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_CIRT_UP = 15,
|
||||
/// <summary>
|
||||
/// 暴击率降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_CIRT_DOWN = 16,
|
||||
/// <summary>
|
||||
/// 暴击倍率提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_CIRT_VALUE_UP = 17,
|
||||
/// <summary>
|
||||
/// 暴击倍率降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_CIRT_VALUE_DOWN = 18,
|
||||
/// <summary>
|
||||
/// 移速提升
|
||||
/// </summary>
|
||||
BUFF_RESULT_MOVE_SPEED_UP = 19,
|
||||
/// <summary>
|
||||
/// 移速降低
|
||||
/// </summary>
|
||||
BUFF_RESULT_MOVE_SPEED_DOWN = 20,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e26edcf2629cd142b51031f7b81f679
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,60 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum BuffStateID
|
||||
{
|
||||
/// <summary>
|
||||
/// 无状态
|
||||
/// </summary>
|
||||
BUFF_STATE_NONE = 0,
|
||||
/// <summary>
|
||||
/// 眩晕状态
|
||||
/// </summary>
|
||||
BUFF_STATE_STUN = 1,
|
||||
/// <summary>
|
||||
/// 无敌状态
|
||||
/// </summary>
|
||||
BUFF_STATE_UNDEAD = 2,
|
||||
/// <summary>
|
||||
/// 隐身状态
|
||||
/// </summary>
|
||||
BUFF_STATE_INVISIBLE = 3,
|
||||
/// <summary>
|
||||
/// 体形变大
|
||||
/// </summary>
|
||||
BUFF_STATE_BIGGER = 4,
|
||||
/// <summary>
|
||||
/// 定身,不能移动
|
||||
/// </summary>
|
||||
BUFF_STATE_NO_MOVE = 5,
|
||||
/// <summary>
|
||||
/// 沉默,不能放技能
|
||||
/// </summary>
|
||||
BUFF_STATE_NO_SKILL = 6,
|
||||
/// <summary>
|
||||
/// 昏睡
|
||||
/// </summary>
|
||||
BUFF_STATE_SLEEP = 7,
|
||||
/// <summary>
|
||||
/// 强制开启阻挡
|
||||
/// </summary>
|
||||
BUFF_STATE_FORCE_COLLIDER = 8,
|
||||
/// <summary>
|
||||
/// 无视阻挡
|
||||
/// </summary>
|
||||
BUFF_STATE_IGNORE_COLLIDER = 9,
|
||||
/// <summary>
|
||||
/// 最大状态
|
||||
/// </summary>
|
||||
BUFF_STATE_MAX = 10,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24a5cdf7ed62f5945aba3814ebf02ae8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,24 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum BuffTimeType
|
||||
{
|
||||
/// <summary>
|
||||
/// 指定持续时间
|
||||
/// </summary>
|
||||
BUFF_TIME_DURING = 0,
|
||||
/// <summary>
|
||||
/// 无尽时间
|
||||
/// </summary>
|
||||
BUFF_TIME_INFINIT = 1,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dff2bf6f031b38d4c8574d94e75d28d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,64 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class BuffTriggleState : Bright.Config.BeanBase
|
||||
{
|
||||
public BuffTriggleState(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["StateID"].IsNumber) { throw new SerializationException(); } StateID = (Battle.BuffStateID)_json["StateID"].AsInt; }
|
||||
{ if(!_json["StateParam"].IsNumber) { throw new SerializationException(); } StateParam = _json["StateParam"]; }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public BuffTriggleState(Battle.BuffStateID StateID, float StateParam )
|
||||
{
|
||||
this.StateID = StateID;
|
||||
this.StateParam = StateParam;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static BuffTriggleState DeserializeBuffTriggleState(JSONNode _json)
|
||||
{
|
||||
return new Battle.BuffTriggleState(_json);
|
||||
}
|
||||
|
||||
public Battle.BuffStateID StateID { get; private set; }
|
||||
public float StateParam { get; private set; }
|
||||
|
||||
public const int __ID__ = 1328146134;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "StateID:" + StateID + ","
|
||||
+ "StateParam:" + StateParam + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03926dd0c4ff9dd479230386fd1e9190
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,68 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class ResAttrImpactData : Bright.Config.BeanBase
|
||||
{
|
||||
public ResAttrImpactData(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["DataType"].IsNumber) { throw new SerializationException(); } DataType = (Battle.ActorAttrDataType)_json["DataType"].AsInt; }
|
||||
{ if(!_json["AddType"].IsNumber) { throw new SerializationException(); } AddType = (Battle.ActorAttrAddType)_json["AddType"].AsInt; }
|
||||
{ if(!_json["Value"].IsNumber) { throw new SerializationException(); } Value = _json["Value"]; }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public ResAttrImpactData(Battle.ActorAttrDataType DataType, Battle.ActorAttrAddType AddType, float Value )
|
||||
{
|
||||
this.DataType = DataType;
|
||||
this.AddType = AddType;
|
||||
this.Value = Value;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static ResAttrImpactData DeserializeResAttrImpactData(JSONNode _json)
|
||||
{
|
||||
return new Battle.ResAttrImpactData(_json);
|
||||
}
|
||||
|
||||
public Battle.ActorAttrDataType DataType { get; private set; }
|
||||
public Battle.ActorAttrAddType AddType { get; private set; }
|
||||
public float Value { get; private set; }
|
||||
|
||||
public const int __ID__ = 1319292907;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "DataType:" + DataType + ","
|
||||
+ "AddType:" + AddType + ","
|
||||
+ "Value:" + Value + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d3720a9d26e66047ad302fd1dc92da5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,80 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class SkillAttrDamageData : Bright.Config.BeanBase
|
||||
{
|
||||
public SkillAttrDamageData(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["MagicType"].IsNumber) { throw new SerializationException(); } MagicType = (Battle.SkillMagicType)_json["MagicType"].AsInt; }
|
||||
{ if(!_json["AttrType"].IsNumber) { throw new SerializationException(); } AttrType = (Battle.SkillAttrDamageType)_json["AttrType"].AsInt; }
|
||||
{ if(!_json["Param1"].IsNumber) { throw new SerializationException(); } Param1 = _json["Param1"]; }
|
||||
{ if(!_json["Param2"].IsNumber) { throw new SerializationException(); } Param2 = _json["Param2"]; }
|
||||
{ if(!_json["Param3"].IsNumber) { throw new SerializationException(); } Param3 = _json["Param3"]; }
|
||||
{ if(!_json["MaxLimit"].IsNumber) { throw new SerializationException(); } MaxLimit = _json["MaxLimit"]; }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public SkillAttrDamageData(Battle.SkillMagicType MagicType, Battle.SkillAttrDamageType AttrType, float Param1, float Param2, float Param3, float MaxLimit )
|
||||
{
|
||||
this.MagicType = MagicType;
|
||||
this.AttrType = AttrType;
|
||||
this.Param1 = Param1;
|
||||
this.Param2 = Param2;
|
||||
this.Param3 = Param3;
|
||||
this.MaxLimit = MaxLimit;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static SkillAttrDamageData DeserializeSkillAttrDamageData(JSONNode _json)
|
||||
{
|
||||
return new Battle.SkillAttrDamageData(_json);
|
||||
}
|
||||
|
||||
public Battle.SkillMagicType MagicType { get; private set; }
|
||||
public Battle.SkillAttrDamageType AttrType { get; private set; }
|
||||
public float Param1 { get; private set; }
|
||||
public float Param2 { get; private set; }
|
||||
public float Param3 { get; private set; }
|
||||
public float MaxLimit { get; private set; }
|
||||
|
||||
public const int __ID__ = -94519547;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "MagicType:" + MagicType + ","
|
||||
+ "AttrType:" + AttrType + ","
|
||||
+ "Param1:" + Param1 + ","
|
||||
+ "Param2:" + Param2 + ","
|
||||
+ "Param3:" + Param3 + ","
|
||||
+ "MaxLimit:" + MaxLimit + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 485330d35ed83074e98aee4f9afebff7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,40 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum SkillAttrDamageType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无数值
|
||||
/// </summary>
|
||||
ATTR_TYPE_NONE = 0,
|
||||
/// <summary>
|
||||
/// 按释放者的伤害类型*X%+固定值计算,目标有防御计算
|
||||
/// </summary>
|
||||
ATTR_TYPE_DMG_WEAPON = 1,
|
||||
/// <summary>
|
||||
/// 按释放者的伤害类型*X%+固定值计算(无视目标的防御)
|
||||
/// </summary>
|
||||
ATTR_TYPE_DMG_NO_DEFEND = 2,
|
||||
/// <summary>
|
||||
/// 按受击者的气血上限*X%+固定值计算(无视目标的防御)
|
||||
/// </summary>
|
||||
ATTR_TYPE_DMG_TARGET_HP_NO_DEFEND = 3,
|
||||
/// <summary>
|
||||
/// 按释放者的攻击类型*X%+固定值计算,恢复当前生命
|
||||
/// </summary>
|
||||
ATTR_TYPE_HP_AS_ATK = 4,
|
||||
/// <summary>
|
||||
/// 按受击者的HP上限*X%+固定值计算,恢复当前生命
|
||||
/// </summary>
|
||||
ATTR_TYPE_HP_RATIO = 5,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a875b3c697d164841b02d808b103a384
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,132 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class SkillBaseConfig : Bright.Config.BeanBase
|
||||
{
|
||||
public SkillBaseConfig(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["id"].IsNumber) { throw new SerializationException(); } Id = _json["id"]; }
|
||||
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
|
||||
{ if(!_json["SkillDispID"].IsNumber) { throw new SerializationException(); } SkillDispID = _json["SkillDispID"]; }
|
||||
{ if(!_json["SkillType"].IsNumber) { throw new SerializationException(); } SkillType = _json["SkillType"]; }
|
||||
{ if(!_json["desc"].IsString) { throw new SerializationException(); } Desc = _json["desc"]; }
|
||||
{ if(!_json["CostMP"].IsNumber) { throw new SerializationException(); } CostMP = _json["CostMP"]; }
|
||||
{ if(!_json["GCDID"].IsNumber) { throw new SerializationException(); } GCDID = _json["GCDID"]; }
|
||||
{ if(!_json["SkillCD"].IsNumber) { throw new SerializationException(); } SkillCD = _json["SkillCD"]; }
|
||||
{ if(!_json["IsRepeatTrigger"].IsBoolean) { throw new SerializationException(); } IsRepeatTrigger = _json["IsRepeatTrigger"]; }
|
||||
{ var __json0 = _json["BuffID"]; if(!__json0.IsArray) { throw new SerializationException(); } BuffID = new System.Collections.Generic.List<int>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { int __v0; { if(!__e0.IsNumber) { throw new SerializationException(); } __v0 = __e0; } BuffID.Add(__v0); } }
|
||||
{ var __json0 = _json["AttrDamageData"]; if(!__json0.IsArray) { throw new SerializationException(); } AttrDamageData = new System.Collections.Generic.List<Battle.SkillAttrDamageData>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { Battle.SkillAttrDamageData __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = Battle.SkillAttrDamageData.DeserializeSkillAttrDamageData(__e0); } AttrDamageData.Add(__v0); } }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public SkillBaseConfig(int id, string name, int SkillDispID, int SkillType, string desc, int CostMP, int GCDID, float SkillCD, bool IsRepeatTrigger, System.Collections.Generic.List<int> BuffID, System.Collections.Generic.List<Battle.SkillAttrDamageData> AttrDamageData )
|
||||
{
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
this.SkillDispID = SkillDispID;
|
||||
this.SkillType = SkillType;
|
||||
this.Desc = desc;
|
||||
this.CostMP = CostMP;
|
||||
this.GCDID = GCDID;
|
||||
this.SkillCD = SkillCD;
|
||||
this.IsRepeatTrigger = IsRepeatTrigger;
|
||||
this.BuffID = BuffID;
|
||||
this.AttrDamageData = AttrDamageData;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static SkillBaseConfig DeserializeSkillBaseConfig(JSONNode _json)
|
||||
{
|
||||
return new Battle.SkillBaseConfig(_json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 技能ID
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
/// <summary>
|
||||
/// 表现ID
|
||||
/// </summary>
|
||||
public int SkillDispID { get; private set; }
|
||||
/// <summary>
|
||||
/// 技能类型SkillType
|
||||
/// </summary>
|
||||
public int SkillType { get; private set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Desc { get; private set; }
|
||||
/// <summary>
|
||||
/// 消耗MP
|
||||
/// </summary>
|
||||
public int CostMP { get; private set; }
|
||||
/// <summary>
|
||||
/// 所属公CD组ID
|
||||
/// </summary>
|
||||
public int GCDID { get; private set; }
|
||||
/// <summary>
|
||||
/// 技能CD
|
||||
/// </summary>
|
||||
public float SkillCD { get; private set; }
|
||||
/// <summary>
|
||||
/// 是否重复触发
|
||||
/// </summary>
|
||||
public bool IsRepeatTrigger { get; private set; }
|
||||
/// <summary>
|
||||
/// BuffIDList
|
||||
/// </summary>
|
||||
public System.Collections.Generic.List<int> BuffID { get; private set; }
|
||||
public System.Collections.Generic.List<Battle.SkillAttrDamageData> AttrDamageData { get; private set; }
|
||||
|
||||
public const int __ID__ = 2067672430;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
foreach(var _e in AttrDamageData) { _e?.Resolve(_tables); }
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
foreach(var _e in AttrDamageData) { _e?.TranslateText(translator); }
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "Id:" + Id + ","
|
||||
+ "Name:" + Name + ","
|
||||
+ "SkillDispID:" + SkillDispID + ","
|
||||
+ "SkillType:" + SkillType + ","
|
||||
+ "Desc:" + Desc + ","
|
||||
+ "CostMP:" + CostMP + ","
|
||||
+ "GCDID:" + GCDID + ","
|
||||
+ "SkillCD:" + SkillCD + ","
|
||||
+ "IsRepeatTrigger:" + IsRepeatTrigger + ","
|
||||
+ "BuffID:" + Bright.Common.StringUtil.CollectionToString(BuffID) + ","
|
||||
+ "AttrDamageData:" + Bright.Common.StringUtil.CollectionToString(AttrDamageData) + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b651cf87b4372cf4a8894a9421a6dcff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,28 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
public enum SkillMagicType
|
||||
{
|
||||
/// <summary>
|
||||
/// 无类型
|
||||
/// </summary>
|
||||
SKILL_TYPE_NONE = 0,
|
||||
/// <summary>
|
||||
/// 物理伤害属性
|
||||
/// </summary>
|
||||
SKILL_TYPE_DMG_PHY = 1,
|
||||
/// <summary>
|
||||
/// 魔法伤害属性
|
||||
/// </summary>
|
||||
SKILL_TYPE_DMG_MAGIC = 2,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 050deaa6f717a36428b057b5c1f889b2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,65 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class TbBuff
|
||||
{
|
||||
private readonly Dictionary<int, Battle.BuffConfig> _dataMap;
|
||||
private readonly List<Battle.BuffConfig> _dataList;
|
||||
|
||||
public TbBuff(JSONNode _json)
|
||||
{
|
||||
_dataMap = new Dictionary<int, Battle.BuffConfig>();
|
||||
_dataList = new List<Battle.BuffConfig>();
|
||||
|
||||
foreach(JSONNode _row in _json.Children)
|
||||
{
|
||||
var _v = Battle.BuffConfig.DeserializeBuffConfig(_row);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.BuffID, _v);
|
||||
}
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public Dictionary<int, Battle.BuffConfig> DataMap => _dataMap;
|
||||
public List<Battle.BuffConfig> DataList => _dataList;
|
||||
|
||||
public Battle.BuffConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public Battle.BuffConfig Get(int key) => _dataMap[key];
|
||||
public Battle.BuffConfig this[int key] => _dataMap[key];
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.Resolve(_tables);
|
||||
}
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.TranslateText(translator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4bae3a42b1e627f44b53f42fa8835064
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,65 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class TbBuffAttr
|
||||
{
|
||||
private readonly Dictionary<int, Battle.BuffAttrConfig> _dataMap;
|
||||
private readonly List<Battle.BuffAttrConfig> _dataList;
|
||||
|
||||
public TbBuffAttr(JSONNode _json)
|
||||
{
|
||||
_dataMap = new Dictionary<int, Battle.BuffAttrConfig>();
|
||||
_dataList = new List<Battle.BuffAttrConfig>();
|
||||
|
||||
foreach(JSONNode _row in _json.Children)
|
||||
{
|
||||
var _v = Battle.BuffAttrConfig.DeserializeBuffAttrConfig(_row);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.BuffID, _v);
|
||||
}
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public Dictionary<int, Battle.BuffAttrConfig> DataMap => _dataMap;
|
||||
public List<Battle.BuffAttrConfig> DataList => _dataList;
|
||||
|
||||
public Battle.BuffAttrConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public Battle.BuffAttrConfig Get(int key) => _dataMap[key];
|
||||
public Battle.BuffAttrConfig this[int key] => _dataMap[key];
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.Resolve(_tables);
|
||||
}
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.TranslateText(translator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67c85d7e042f25f4b8728ea5d0260af4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,65 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.Battle
|
||||
{
|
||||
|
||||
public sealed partial class TbSkill
|
||||
{
|
||||
private readonly Dictionary<int, Battle.SkillBaseConfig> _dataMap;
|
||||
private readonly List<Battle.SkillBaseConfig> _dataList;
|
||||
|
||||
public TbSkill(JSONNode _json)
|
||||
{
|
||||
_dataMap = new Dictionary<int, Battle.SkillBaseConfig>();
|
||||
_dataList = new List<Battle.SkillBaseConfig>();
|
||||
|
||||
foreach(JSONNode _row in _json.Children)
|
||||
{
|
||||
var _v = Battle.SkillBaseConfig.DeserializeSkillBaseConfig(_row);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.Id, _v);
|
||||
}
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public Dictionary<int, Battle.SkillBaseConfig> DataMap => _dataMap;
|
||||
public List<Battle.SkillBaseConfig> DataList => _dataList;
|
||||
|
||||
public Battle.SkillBaseConfig GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public Battle.SkillBaseConfig Get(int key) => _dataMap[key];
|
||||
public Battle.SkillBaseConfig this[int key] => _dataMap[key];
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.Resolve(_tables);
|
||||
}
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.TranslateText(translator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4225d28df041ab84e93ed201b8c52f3e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,54 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
namespace GameConfig
|
||||
{
|
||||
|
||||
public sealed partial class Tables
|
||||
{
|
||||
public item.TbItem TbItem {get; }
|
||||
public Battle.TbSkill TbSkill {get; }
|
||||
public Battle.TbBuff TbBuff {get; }
|
||||
public Battle.TbBuffAttr TbBuffAttr {get; }
|
||||
|
||||
public Tables(System.Func<string, JSONNode> loader)
|
||||
{
|
||||
var tables = new System.Collections.Generic.Dictionary<string, object>();
|
||||
TbItem = new item.TbItem(loader("item_tbitem"));
|
||||
tables.Add("item.TbItem", TbItem);
|
||||
TbSkill = new Battle.TbSkill(loader("battle_tbskill"));
|
||||
tables.Add("Battle.TbSkill", TbSkill);
|
||||
TbBuff = new Battle.TbBuff(loader("battle_tbbuff"));
|
||||
tables.Add("Battle.TbBuff", TbBuff);
|
||||
TbBuffAttr = new Battle.TbBuffAttr(loader("battle_tbbuffattr"));
|
||||
tables.Add("Battle.TbBuffAttr", TbBuffAttr);
|
||||
PostInit();
|
||||
|
||||
TbItem.Resolve(tables);
|
||||
TbSkill.Resolve(tables);
|
||||
TbBuff.Resolve(tables);
|
||||
TbBuffAttr.Resolve(tables);
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
TbItem.TranslateText(translator);
|
||||
TbSkill.TranslateText(translator);
|
||||
TbBuff.TranslateText(translator);
|
||||
TbBuffAttr.TranslateText(translator);
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45e65de224e02f04db3ee7af36494bb9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92dacb95febd2204ca6721a0794739ba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,32 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
public enum EQuality
|
||||
{
|
||||
/// <summary>
|
||||
/// 最差品质
|
||||
/// </summary>
|
||||
WHITE = 1,
|
||||
/// <summary>
|
||||
/// 蓝色的
|
||||
/// </summary>
|
||||
BLUE = 2,
|
||||
/// <summary>
|
||||
/// 紫色的
|
||||
/// </summary>
|
||||
PURPLE = 3,
|
||||
/// <summary>
|
||||
/// 最高品质
|
||||
/// </summary>
|
||||
RED = 4,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30c573667ec26fd478ae418601d60abf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,138 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
|
||||
public sealed partial class Item : Bright.Config.BeanBase
|
||||
{
|
||||
public Item(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["id"].IsNumber) { throw new SerializationException(); } Id = _json["id"]; }
|
||||
{ if(!_json["name"].IsString) { throw new SerializationException(); } Name = _json["name"]; }
|
||||
{ if(!_json["desc"].IsString) { throw new SerializationException(); } Desc = _json["desc"]; }
|
||||
{ if(!_json["price"].IsNumber) { throw new SerializationException(); } Price = _json["price"]; }
|
||||
{ if(!_json["upgrade_to_item_id"].IsNumber) { throw new SerializationException(); } UpgradeToItemId = _json["upgrade_to_item_id"]; }
|
||||
{ var _j = _json["expire_time"]; if (_j.Tag != JSONNodeType.None && _j.Tag != JSONNodeType.NullValue) { { if(!_j.IsNumber) { throw new SerializationException(); } ExpireTime = _j; } } else { ExpireTime = null; } }
|
||||
{ if(!_json["batch_useable"].IsBoolean) { throw new SerializationException(); } BatchUseable = _json["batch_useable"]; }
|
||||
{ if(!_json["quality"].IsNumber) { throw new SerializationException(); } Quality = (item.EQuality)_json["quality"].AsInt; }
|
||||
{ if(!_json["exchange_stream"].IsObject) { throw new SerializationException(); } ExchangeStream = item.ItemExchange.DeserializeItemExchange(_json["exchange_stream"]); }
|
||||
{ var __json0 = _json["exchange_list"]; if(!__json0.IsArray) { throw new SerializationException(); } ExchangeList = new System.Collections.Generic.List<item.ItemExchange>(__json0.Count); foreach(JSONNode __e0 in __json0.Children) { item.ItemExchange __v0; { if(!__e0.IsObject) { throw new SerializationException(); } __v0 = item.ItemExchange.DeserializeItemExchange(__e0); } ExchangeList.Add(__v0); } }
|
||||
{ if(!_json["exchange_column"].IsObject) { throw new SerializationException(); } ExchangeColumn = item.ItemExchange.DeserializeItemExchange(_json["exchange_column"]); }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public Item(int id, string name, string desc, int price, int upgrade_to_item_id, int? expire_time, bool batch_useable, item.EQuality quality, item.ItemExchange exchange_stream, System.Collections.Generic.List<item.ItemExchange> exchange_list, item.ItemExchange exchange_column )
|
||||
{
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
this.Desc = desc;
|
||||
this.Price = price;
|
||||
this.UpgradeToItemId = upgrade_to_item_id;
|
||||
this.ExpireTime = expire_time;
|
||||
this.BatchUseable = batch_useable;
|
||||
this.Quality = quality;
|
||||
this.ExchangeStream = exchange_stream;
|
||||
this.ExchangeList = exchange_list;
|
||||
this.ExchangeColumn = exchange_column;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static Item DeserializeItem(JSONNode _json)
|
||||
{
|
||||
return new item.Item(_json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 这是id
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Desc { get; private set; }
|
||||
/// <summary>
|
||||
/// 价格
|
||||
/// </summary>
|
||||
public int Price { get; private set; }
|
||||
/// <summary>
|
||||
/// 引用当前表
|
||||
/// </summary>
|
||||
public int UpgradeToItemId { get; private set; }
|
||||
public item.Item UpgradeToItemId_Ref { get; private set; }
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public int? ExpireTime { get; private set; }
|
||||
/// <summary>
|
||||
/// 能否批量使用
|
||||
/// </summary>
|
||||
public bool BatchUseable { get; private set; }
|
||||
/// <summary>
|
||||
/// 品质
|
||||
/// </summary>
|
||||
public item.EQuality Quality { get; private set; }
|
||||
/// <summary>
|
||||
/// 道具兑换配置
|
||||
/// </summary>
|
||||
public item.ItemExchange ExchangeStream { get; private set; }
|
||||
public System.Collections.Generic.List<item.ItemExchange> ExchangeList { get; private set; }
|
||||
/// <summary>
|
||||
/// 道具兑换配置
|
||||
/// </summary>
|
||||
public item.ItemExchange ExchangeColumn { get; private set; }
|
||||
|
||||
public const int __ID__ = 2107285806;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
this.UpgradeToItemId_Ref = (_tables["item.TbItem"] as item.TbItem).GetOrDefault(UpgradeToItemId);
|
||||
ExchangeStream?.Resolve(_tables);
|
||||
foreach(var _e in ExchangeList) { _e?.Resolve(_tables); }
|
||||
ExchangeColumn?.Resolve(_tables);
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
ExchangeStream?.TranslateText(translator);
|
||||
foreach(var _e in ExchangeList) { _e?.TranslateText(translator); }
|
||||
ExchangeColumn?.TranslateText(translator);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "Id:" + Id + ","
|
||||
+ "Name:" + Name + ","
|
||||
+ "Desc:" + Desc + ","
|
||||
+ "Price:" + Price + ","
|
||||
+ "UpgradeToItemId:" + UpgradeToItemId + ","
|
||||
+ "ExpireTime:" + ExpireTime + ","
|
||||
+ "BatchUseable:" + BatchUseable + ","
|
||||
+ "Quality:" + Quality + ","
|
||||
+ "ExchangeStream:" + ExchangeStream + ","
|
||||
+ "ExchangeList:" + Bright.Common.StringUtil.CollectionToString(ExchangeList) + ","
|
||||
+ "ExchangeColumn:" + ExchangeColumn + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e65d3e4aa74f27438c746308c434ed9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,70 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
|
||||
public sealed partial class ItemExchange : Bright.Config.BeanBase
|
||||
{
|
||||
public ItemExchange(JSONNode _json)
|
||||
{
|
||||
{ if(!_json["id"].IsNumber) { throw new SerializationException(); } Id = _json["id"]; }
|
||||
{ if(!_json["num"].IsNumber) { throw new SerializationException(); } Num = _json["num"]; }
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public ItemExchange(int id, int num )
|
||||
{
|
||||
this.Id = id;
|
||||
this.Num = num;
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public static ItemExchange DeserializeItemExchange(JSONNode _json)
|
||||
{
|
||||
return new item.ItemExchange(_json);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 道具id
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
/// <summary>
|
||||
/// 道具数量
|
||||
/// </summary>
|
||||
public int Num { get; private set; }
|
||||
|
||||
public const int __ID__ = 1814660465;
|
||||
public override int GetTypeId() => __ID__;
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "{ "
|
||||
+ "Id:" + Id + ","
|
||||
+ "Num:" + Num + ","
|
||||
+ "}";
|
||||
}
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a752eb48ae7a124fba2dba3d3ca2c4e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,65 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Bright.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using SimpleJSON;
|
||||
|
||||
|
||||
|
||||
namespace GameConfig.item
|
||||
{
|
||||
|
||||
public sealed partial class TbItem
|
||||
{
|
||||
private readonly Dictionary<int, item.Item> _dataMap;
|
||||
private readonly List<item.Item> _dataList;
|
||||
|
||||
public TbItem(JSONNode _json)
|
||||
{
|
||||
_dataMap = new Dictionary<int, item.Item>();
|
||||
_dataList = new List<item.Item>();
|
||||
|
||||
foreach(JSONNode _row in _json.Children)
|
||||
{
|
||||
var _v = item.Item.DeserializeItem(_row);
|
||||
_dataList.Add(_v);
|
||||
_dataMap.Add(_v.Id, _v);
|
||||
}
|
||||
PostInit();
|
||||
}
|
||||
|
||||
public Dictionary<int, item.Item> DataMap => _dataMap;
|
||||
public List<item.Item> DataList => _dataList;
|
||||
|
||||
public item.Item GetOrDefault(int key) => _dataMap.TryGetValue(key, out var v) ? v : null;
|
||||
public item.Item Get(int key) => _dataMap[key];
|
||||
public item.Item this[int key] => _dataMap[key];
|
||||
|
||||
public void Resolve(Dictionary<string, object> _tables)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.Resolve(_tables);
|
||||
}
|
||||
PostResolve();
|
||||
}
|
||||
|
||||
public void TranslateText(System.Func<string, string, string> translator)
|
||||
{
|
||||
foreach(var v in _dataList)
|
||||
{
|
||||
v.TranslateText(translator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
partial void PostInit();
|
||||
partial void PostResolve();
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ab4162ad0234444ea02f248b5c325c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fb403cf09ac38a49aea0b887a068cba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,25 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace GameConfig.test
|
||||
{
|
||||
[System.Flags]
|
||||
public enum AccessFlag
|
||||
{
|
||||
WRITE = 1,
|
||||
READ = 2,
|
||||
TRUNCATE = 4,
|
||||
NEW = 8,
|
||||
/// <summary>
|
||||
/// 位标记使用示例
|
||||
/// </summary>
|
||||
READ_WRITE = WRITE|READ,
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fa3d642fac8be9429d88fe4823320e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,68 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using ProtoBuf;
|
||||
using TEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameProto
|
||||
{
|
||||
// 这个文件只放协议,和协议头
|
||||
// 消息协议
|
||||
[Serializable,global::ProtoBuf.ProtoContract(Name = @"CSPkg")]
|
||||
public partial class CSPkg
|
||||
{
|
||||
[global::ProtoBuf.ProtoMember(1)]
|
||||
public CSPkgHead Head { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(2)]
|
||||
public CSPkgBody Body { get; set; }
|
||||
|
||||
}
|
||||
|
||||
// 消息协议头
|
||||
[Serializable,global::ProtoBuf.ProtoContract(Name = @"CSPkgHead")]
|
||||
public partial class CSPkgHead
|
||||
{
|
||||
[global::ProtoBuf.ProtoMember(1)]
|
||||
public uint MsgId { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(2)]
|
||||
public uint MsgLength { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(3)]
|
||||
public uint MsgVersion { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(4)]
|
||||
public uint Echo { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(5)]
|
||||
public uint SvrTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
// 消息协议体
|
||||
[Serializable,global::ProtoBuf.ProtoContract(Name = @"CSPkgBody")]
|
||||
public partial class CSPkgBody
|
||||
{
|
||||
}
|
||||
|
||||
// 协议ID
|
||||
[global::ProtoBuf.ProtoContract()]
|
||||
public enum CSMsgID
|
||||
{
|
||||
CS_START = 0,
|
||||
|
||||
CS_HeartBeat = 10001,
|
||||
|
||||
CS_END = 10000,
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d59eaaad20d9234ba941173b39361fc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"UpdateType": 1,
|
||||
"UpdateStyle": 1,
|
||||
"UpdateNotice": 1
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
public class LoadUpdateLogic
|
||||
{
|
||||
private static LoadUpdateLogic _instance;
|
||||
|
||||
public Action<int> DownloadCompleteAction = null;
|
||||
public Action<float> DownProgressAction = null;
|
||||
public Action<bool,GameStatus> UnpackedCompleteAction = null;
|
||||
public Action<float,GameStatus> UnpackedProgressAction = null;
|
||||
|
||||
public static LoadUpdateLogic Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new LoadUpdateLogic();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
public class UIBase : MonoBehaviour
|
||||
{
|
||||
protected object Param;
|
||||
public virtual void OnEnter(object param)
|
||||
{
|
||||
Param = param;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b150d874e1db306419683d8fb8f50af4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,34 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
public class UIDefine
|
||||
{
|
||||
public static readonly string UILoadUpdate = "UILoadUpdate";
|
||||
public static readonly string UILoadTip = "UILoadTip";
|
||||
|
||||
/// <summary>
|
||||
/// 注册ui
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
public static void RegisterUI(Dictionary<string, string> list)
|
||||
{
|
||||
if (list == null)
|
||||
{
|
||||
Log.Error("[UIManager]list is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!list.ContainsKey(UILoadUpdate))
|
||||
{
|
||||
list.Add(UILoadUpdate, $"AssetLoad/{UILoadUpdate}");
|
||||
}
|
||||
|
||||
if (!list.ContainsKey(UILoadTip))
|
||||
{
|
||||
list.Add(UILoadTip, $"AssetLoad/{UILoadTip}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b4a6ad67f754024987f55526fa21034
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,149 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using TEngine;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
public static class UILoadMgr
|
||||
{
|
||||
private static GameObject _uiLoad;
|
||||
private static readonly Dictionary<string, string> UIList = new Dictionary<string, string>();
|
||||
private static readonly Dictionary<string, UIBase> UIMap = new Dictionary<string, UIBase>();
|
||||
/// <summary>
|
||||
/// 初始化根节点
|
||||
/// </summary>
|
||||
public static void Initialize()
|
||||
{
|
||||
_uiLoad = GameObject.Find("AssetLoad");
|
||||
if (_uiLoad == null)
|
||||
{
|
||||
var obj = Resources.Load($"AssetLoad/UILoad");
|
||||
if (obj == null)
|
||||
{
|
||||
Log.Error("Failed to load UILoad. Please check the resource path");
|
||||
return;
|
||||
}
|
||||
_uiLoad = Object.Instantiate(obj) as GameObject;
|
||||
if (_uiLoad != null)
|
||||
{
|
||||
_uiLoad.name = "AssetLoad";
|
||||
_uiLoad.transform.SetAsLastSibling();
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error($"AssetLoad object Instantiate Failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
RegisterUI();
|
||||
}
|
||||
|
||||
private static void RegisterUI()
|
||||
{
|
||||
UIDefine.RegisterUI(UIList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// show ui
|
||||
/// </summary>
|
||||
/// <param name="uiInfo">对应的ui</param>
|
||||
/// <param name="param">参数</param>
|
||||
public static void Show(string uiInfo,object param = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(uiInfo))
|
||||
return;
|
||||
|
||||
if (!UIList.ContainsKey(uiInfo))
|
||||
{
|
||||
Log.Error($"not define ui:{uiInfo}");
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject ui = null;
|
||||
if (!UIMap.ContainsKey(uiInfo))
|
||||
{
|
||||
Object obj = Resources.Load(UIList[uiInfo]);
|
||||
if (obj != null)
|
||||
{
|
||||
ui = Object.Instantiate(obj) as GameObject;
|
||||
if (ui != null)
|
||||
{
|
||||
ui.transform.SetParent(_uiLoad.transform);
|
||||
ui.transform.localScale = Vector3.one;
|
||||
ui.transform.localPosition = Vector3.zero;
|
||||
RectTransform rect = ui.GetComponent<RectTransform>();
|
||||
rect.sizeDelta = Vector2.zero;
|
||||
}
|
||||
}
|
||||
|
||||
if (ui != null)
|
||||
{
|
||||
UIBase uiBase = ui.GetComponent<UIBase>();
|
||||
if (uiBase != null)
|
||||
{
|
||||
UIMap.Add(uiInfo, uiBase);
|
||||
}
|
||||
}
|
||||
}
|
||||
UIMap[uiInfo].gameObject.SetActive(true);
|
||||
if (param != null)
|
||||
{
|
||||
UIBase component = UIMap[uiInfo].GetComponent<UIBase>();
|
||||
if (component != null)
|
||||
{
|
||||
component.OnEnter(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 隐藏ui对象
|
||||
/// </summary>
|
||||
/// <param name="uiName">对应的ui</param>
|
||||
public static void Hide(string uiName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(uiName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UIMap.ContainsKey(uiName))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UIMap[uiName].gameObject.SetActive(false);
|
||||
Object.DestroyImmediate(UIMap[uiName].gameObject);
|
||||
UIMap.Remove(uiName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取显示的ui对象
|
||||
/// </summary>
|
||||
/// <param name="ui"></param>
|
||||
/// <returns></returns>
|
||||
public static UIBase GetActiveUI(string ui)
|
||||
{
|
||||
return UIMap.ContainsKey(ui) ? UIMap[ui] : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏ui管理器
|
||||
/// </summary>
|
||||
public static void HideAll()
|
||||
{
|
||||
foreach (var item in UIMap)
|
||||
{
|
||||
if (item.Value && item.Value.gameObject)
|
||||
{
|
||||
item.Value.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
UIMap.Clear();
|
||||
|
||||
if (_uiLoad != null)
|
||||
{
|
||||
Object.Destroy(_uiLoad);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,133 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
using TEngine;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
public enum MessageShowType
|
||||
{
|
||||
None = 0,
|
||||
OneButton = 1,
|
||||
TwoButton = 2,
|
||||
ThreeButton = 3,
|
||||
}
|
||||
|
||||
public class UILoadTip : UIBase
|
||||
{
|
||||
public Button _btn_update;
|
||||
public Button _btn_ignore;
|
||||
public Button _btn_package;
|
||||
public Text _label_desc;
|
||||
public Text _label_tittle;
|
||||
|
||||
public Action OnOk;
|
||||
public Action OnCancle;
|
||||
public MessageShowType Showtype = MessageShowType.None;
|
||||
|
||||
void Start()
|
||||
{
|
||||
EventTriggerListener.Get(_btn_update.gameObject).OnClick = _OnGameUpdate;
|
||||
EventTriggerListener.Get(_btn_ignore.gameObject).OnClick = _OnGameIgnor;
|
||||
EventTriggerListener.Get(_btn_package.gameObject).OnClick = _OnInvoke;
|
||||
}
|
||||
|
||||
public override void OnEnter(object data)
|
||||
{
|
||||
_btn_ignore.gameObject.SetActive(false);
|
||||
_btn_package.gameObject.SetActive(false);
|
||||
_btn_update.gameObject.SetActive(false);
|
||||
switch (Showtype)
|
||||
{
|
||||
case MessageShowType.OneButton:
|
||||
_btn_update.gameObject.SetActive(true);
|
||||
break;
|
||||
case MessageShowType.TwoButton:
|
||||
_btn_update.gameObject.SetActive(true);
|
||||
_btn_ignore.gameObject.SetActive(true);
|
||||
break;
|
||||
case MessageShowType.ThreeButton:
|
||||
_btn_ignore.gameObject.SetActive(true);
|
||||
_btn_package.gameObject.SetActive(true);
|
||||
_btn_package.gameObject.SetActive(true);
|
||||
break;
|
||||
}
|
||||
|
||||
_label_desc.text = data.ToString();
|
||||
}
|
||||
|
||||
private void _OnGameUpdate(GameObject obj)
|
||||
{
|
||||
if (OnOk == null)
|
||||
{
|
||||
_label_desc.text = "<color=#BA3026>该按钮不应该存在</color>";
|
||||
}
|
||||
else
|
||||
{
|
||||
OnOk();
|
||||
_OnClose();
|
||||
}
|
||||
}
|
||||
|
||||
private void _OnGameIgnor(GameObject obj)
|
||||
{
|
||||
if (OnCancle == null)
|
||||
{
|
||||
_label_desc.text = "<color=#BA3026>该按钮不应该存在</color>";
|
||||
}
|
||||
else
|
||||
{
|
||||
OnCancle();
|
||||
_OnClose();
|
||||
}
|
||||
}
|
||||
|
||||
private void _OnInvoke(GameObject obj)
|
||||
{
|
||||
if (OnOk == null)
|
||||
{
|
||||
_label_desc.text = "<color=#BA3026>该按钮不应该存在</color>";
|
||||
}
|
||||
else
|
||||
{
|
||||
OnOk();
|
||||
_OnClose();
|
||||
}
|
||||
}
|
||||
|
||||
private void _OnClose()
|
||||
{
|
||||
UILoadMgr.Hide(UIDefine.UILoadTip);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示提示框,目前最多支持三个按钮
|
||||
/// </summary>
|
||||
/// <param name="desc">描述</param>
|
||||
/// <param name="showtype">类型(MessageShowType)</param>
|
||||
/// <param name="style">StyleEnum</param>
|
||||
/// <param name="onOk">点击事件</param>
|
||||
/// <param name="onCancel">取消事件</param>
|
||||
/// <param name="onPackage">更新事件</param>
|
||||
public static void ShowMessageBox(string desc, MessageShowType showtype = MessageShowType.OneButton,
|
||||
LoadStyle.StyleEnum style = LoadStyle.StyleEnum.Style_Default,
|
||||
Action onOk = null,
|
||||
Action onCancel = null,
|
||||
Action onPackage = null)
|
||||
{
|
||||
UILoadMgr.Show(UIDefine.UILoadTip, desc);
|
||||
var ui = UILoadMgr.GetActiveUI(UIDefine.UILoadTip) as UILoadTip;
|
||||
if (ui == null) return;
|
||||
ui.OnOk = onOk;
|
||||
ui.OnCancle = onCancel;
|
||||
ui.Showtype = showtype;
|
||||
ui.OnEnter(desc);
|
||||
|
||||
var loadStyleUI = ui.GetComponent<LoadStyle>();
|
||||
if (loadStyleUI)
|
||||
{
|
||||
loadStyleUI.SetStyle(style);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,138 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TEngine;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
public class UILoadUpdate : UIBase
|
||||
{
|
||||
[SerializeField] public Button _btn_clear;
|
||||
[SerializeField] public Scrollbar _obj_progress;
|
||||
[SerializeField] public Text _label_desc;
|
||||
[SerializeField] public Text _label_appid;
|
||||
[SerializeField] public Text _label_resid;
|
||||
|
||||
public virtual void Start()
|
||||
{
|
||||
EventTriggerListener.Get(_btn_clear.gameObject).OnClick = OnClear;
|
||||
_btn_clear.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public virtual void OnEnable()
|
||||
{
|
||||
LoadUpdateLogic.Instance.DownloadCompleteAction += DownLoad_Complete_Action;
|
||||
LoadUpdateLogic.Instance.DownProgressAction += DownLoad_Progress_Action;
|
||||
LoadUpdateLogic.Instance.UnpackedCompleteAction += Unpacked_Complete_Action;
|
||||
LoadUpdateLogic.Instance.UnpackedProgressAction += Unpacked_Progress_Action;
|
||||
RefreshVersion();
|
||||
}
|
||||
|
||||
public override void OnEnter(object param)
|
||||
{
|
||||
base.OnEnter(param);
|
||||
_label_desc.text = param.ToString();
|
||||
RefreshVersion();
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
}
|
||||
|
||||
private void RefreshVersion()
|
||||
{
|
||||
_label_appid.text = string.Format(LoadText.Instance.Label_App_id, Version.GameVersion);
|
||||
_label_resid.text = string.Format(LoadText.Instance.Label_Res_id, GameModule.Resource.GetPackageVersion());
|
||||
}
|
||||
|
||||
public virtual void OnContinue(GameObject obj)
|
||||
{
|
||||
// LoadMgr.Instance.StartDownLoad();
|
||||
}
|
||||
|
||||
public virtual void OnStop(GameObject obj)
|
||||
{
|
||||
// LoadMgr.Instance.StopDownLoad();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空本地缓存
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
public virtual void OnClear(GameObject obj)
|
||||
{
|
||||
OnStop(null);
|
||||
UILoadTip.ShowMessageBox(LoadText.Instance.Label_Clear_Comfirm, MessageShowType.TwoButton,
|
||||
LoadStyle.StyleEnum.Style_Clear,
|
||||
() =>
|
||||
{
|
||||
GameModule.Resource.ClearSandbox();
|
||||
Application.Quit();
|
||||
}, () => { OnContinue(null); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载进度完成
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
public virtual void DownLoad_Complete_Action(int type)
|
||||
{
|
||||
Log.Info("DownLoad_Complete");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下载进度更新
|
||||
/// </summary>
|
||||
/// <param name="progress"></param>
|
||||
public virtual void DownLoad_Progress_Action(float progress)
|
||||
{
|
||||
_obj_progress.gameObject.SetActive(true);
|
||||
|
||||
_obj_progress.size = progress;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解压缩完成回调
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="status"></param>
|
||||
public virtual void Unpacked_Complete_Action(bool type, GameStatus status)
|
||||
{
|
||||
_obj_progress.gameObject.SetActive(true);
|
||||
_label_desc.text = LoadText.Instance.Label_Load_UnpackComplete;
|
||||
if (status == GameStatus.AssetLoad)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error("error type");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解压缩进度更新
|
||||
/// </summary>
|
||||
/// <param name="progress"></param>
|
||||
/// <param name="status"></param>
|
||||
public virtual void Unpacked_Progress_Action(float progress, GameStatus status)
|
||||
{
|
||||
_obj_progress.gameObject.SetActive(true);
|
||||
if (status == GameStatus.First)
|
||||
{
|
||||
_label_desc.text = LoadText.Instance.Label_Load_FirstUnpack;
|
||||
}
|
||||
else
|
||||
{
|
||||
_label_desc.text = LoadText.Instance.Label_Load_Unpacking;
|
||||
}
|
||||
|
||||
_obj_progress.size = progress;
|
||||
}
|
||||
|
||||
public virtual void OnDisable()
|
||||
{
|
||||
OnStop(null);
|
||||
LoadUpdateLogic.Instance.DownloadCompleteAction -= DownLoad_Complete_Action;
|
||||
LoadUpdateLogic.Instance.DownProgressAction -= DownLoad_Progress_Action;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,86 +0,0 @@
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using TEngine;
|
||||
using YooAsset;
|
||||
using ProcedureOwner = TEngine.IFsm<TEngine.IProcedureManager>;
|
||||
|
||||
namespace GameMain
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程 => 初始化Package。
|
||||
/// </summary>
|
||||
public class ProcedureInitPackage : ProcedureBase
|
||||
{
|
||||
public override bool UseNativeDialog { get; }
|
||||
|
||||
protected override void OnEnter(ProcedureOwner procedureOwner)
|
||||
{
|
||||
base.OnEnter(procedureOwner);
|
||||
|
||||
//Fire Forget立刻触发UniTask初始化Package
|
||||
InitPackage(procedureOwner).Forget();
|
||||
}
|
||||
|
||||
private async UniTaskVoid InitPackage(ProcedureOwner procedureOwner)
|
||||
{
|
||||
var initializationOperation = GameModule.Resource.InitPackage();
|
||||
|
||||
await UniTask.Delay(TimeSpan.FromSeconds(1f));
|
||||
|
||||
await initializationOperation.ToUniTask();
|
||||
|
||||
if (initializationOperation.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
EPlayMode playMode = GameModule.Resource.PlayMode;
|
||||
|
||||
// 编辑器模式。
|
||||
if (playMode == EPlayMode.EditorSimulateMode)
|
||||
{
|
||||
Log.Info("Editor resource mode detected.");
|
||||
ChangeState<ProcedurePreload>(procedureOwner);
|
||||
}
|
||||
// 单机模式。
|
||||
else if (playMode == EPlayMode.OfflinePlayMode)
|
||||
{
|
||||
Log.Info("Package resource mode detected.");
|
||||
ChangeState<ProcedureInitResources>(procedureOwner);
|
||||
}
|
||||
// 可更新模式。
|
||||
else if (playMode == EPlayMode.HostPlayMode)
|
||||
{
|
||||
// 打开启动UI。
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate);
|
||||
|
||||
Log.Info("Updatable resource mode detected.");
|
||||
ChangeState<ProcedureUpdateVersion>(procedureOwner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error("UnKnow resource mode detected Please check???");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 打开启动UI。
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate);
|
||||
|
||||
Log.Error($"{initializationOperation.Error}");
|
||||
|
||||
// 打开启动UI。
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate, $"资源初始化失败!");
|
||||
|
||||
UILoadTip.ShowMessageBox($"资源初始化失败!点击确认重试 \n \n <color=#FF0000>原因{initializationOperation.Error}</color>", MessageShowType.TwoButton,
|
||||
LoadStyle.StyleEnum.Style_Retry
|
||||
, () => { Retry(procedureOwner); }, UnityEngine.Application.Quit);
|
||||
}
|
||||
}
|
||||
|
||||
private void Retry(ProcedureOwner procedureOwner)
|
||||
{
|
||||
// 打开启动UI。
|
||||
UILoadMgr.Show(UIDefine.UILoadUpdate, $"重新初始化资源中...");
|
||||
|
||||
InitPackage(procedureOwner).Forget();
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user