mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Compare commits
554 Commits
TEngine1.2
...
TEngine3.0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 | ||
![]() |
fd7d8a798b | ||
![]() |
4db89019dd | ||
![]() |
de0d4e58a5 | ||
![]() |
d64a7d6777 | ||
![]() |
0c32dad70b | ||
![]() |
c44c3e8c67 | ||
![]() |
dfc8b5eb8f | ||
![]() |
80f004c942 | ||
![]() |
da11c0915f | ||
![]() |
fdc526cfca | ||
![]() |
73b3ae6527 | ||
![]() |
0ce268aaf6 | ||
![]() |
c7ff2de374 | ||
![]() |
050003bd7b | ||
![]() |
43c49aabbb | ||
![]() |
29985b819e | ||
![]() |
5a07650f73 | ||
![]() |
fd199e344a | ||
![]() |
a827e501f2 | ||
![]() |
35f7c9309c | ||
![]() |
d8149dc743 | ||
![]() |
ec357fa5fb | ||
![]() |
1c2dec1381 | ||
![]() |
30ad711907 | ||
![]() |
3be06cac21 | ||
![]() |
22ead28974 | ||
![]() |
c40391a65b | ||
![]() |
5c7223213b | ||
![]() |
699930f6e8 | ||
![]() |
026a1f458c | ||
![]() |
6fddedf0b2 | ||
![]() |
e88d54e63f | ||
![]() |
6a04371045 | ||
![]() |
0f51878471 | ||
![]() |
8cab13da79 | ||
![]() |
9c110e23a6 | ||
![]() |
1ee6dc2611 | ||
![]() |
a602633c9b | ||
![]() |
f32d42db62 | ||
![]() |
eac9d4a68e | ||
![]() |
e7c2fb6938 | ||
![]() |
4b7fed2745 | ||
![]() |
02c3055e11 | ||
![]() |
2f76cc012c | ||
![]() |
9016dd9e61 | ||
![]() |
878a05b614 | ||
![]() |
25e2617782 | ||
![]() |
de1558680c | ||
![]() |
079ff980a3 | ||
![]() |
edc83c8989 | ||
![]() |
80c4676430 | ||
![]() |
53ffc64699 | ||
![]() |
c072b82239 | ||
![]() |
598f1ef36b | ||
![]() |
991dddfdae | ||
![]() |
11fe2a8d18 | ||
![]() |
1992f4cda4 | ||
![]() |
5fb16b442e | ||
![]() |
ece41a730e | ||
![]() |
12105f649a | ||
![]() |
fd728d037c | ||
![]() |
23ee21162f | ||
![]() |
4634de28d7 | ||
![]() |
ef507c383d | ||
![]() |
9423fdc193 | ||
![]() |
c7b25e4781 | ||
![]() |
2ec2546230 | ||
![]() |
0815a30f83 | ||
![]() |
27549f11b2 | ||
![]() |
713661417b | ||
![]() |
906ec80904 | ||
![]() |
455c700953 | ||
![]() |
007b136724 | ||
![]() |
6aaec0599b | ||
![]() |
8549179a43 | ||
![]() |
7b239ee4da | ||
![]() |
f32159f19c | ||
![]() |
3196cf3b5e | ||
![]() |
b59139b94a | ||
![]() |
2a15db0690 | ||
![]() |
f3691e2145 | ||
![]() |
da39314f34 | ||
![]() |
6ea42a28cd | ||
![]() |
cd99f15374 | ||
![]() |
0e43421606 | ||
![]() |
64e39673d3 | ||
![]() |
d839808bce | ||
![]() |
2e1bbee994 | ||
![]() |
373a06bfd5 | ||
![]() |
4996dba84a | ||
![]() |
95afaa2a4d | ||
![]() |
d204675bd6 | ||
![]() |
9e4a2b34da | ||
![]() |
d3272e1bb1 | ||
![]() |
7db0d3fcc4 | ||
![]() |
293ea2e128 | ||
![]() |
9f187109a5 | ||
![]() |
1c0a570d74 | ||
![]() |
621a315eec | ||
![]() |
4db58f507d | ||
![]() |
89b5bc21ee | ||
![]() |
6320e75e7c | ||
![]() |
02d4e6686c | ||
![]() |
0c564f8571 | ||
![]() |
c4c345c5f7 | ||
![]() |
bf1d71d0f9 | ||
![]() |
9f6f314ac9 | ||
![]() |
a8588114b0 | ||
![]() |
4d35e61614 | ||
![]() |
03e58b921f | ||
![]() |
3228aed4db | ||
![]() |
aa3cf05f4a | ||
![]() |
d1fdedaaac | ||
![]() |
b79fe23229 | ||
![]() |
2de3fd2a1d | ||
![]() |
1328f71c9e | ||
![]() |
ab532c73d7 | ||
![]() |
3f67b27e45 | ||
![]() |
a285a635b9 | ||
![]() |
08c2ff4dcc | ||
![]() |
e0b42d3dbe | ||
![]() |
688b76b745 | ||
![]() |
8f972f9340 | ||
![]() |
ac25925406 | ||
![]() |
a5f0c395f0 | ||
![]() |
4bdea1d7ce | ||
![]() |
4c46af709a | ||
![]() |
8531332df1 | ||
![]() |
db619e6b6b | ||
![]() |
f628380347 | ||
![]() |
71cf223426 | ||
![]() |
e9ecdf2d16 | ||
![]() |
506f2835be | ||
![]() |
90c22db2d2 | ||
![]() |
72ffc58030 | ||
![]() |
f3663947cf | ||
![]() |
d5eced7471 | ||
![]() |
6b8d88fe67 | ||
![]() |
b50ef83c4f | ||
![]() |
8b03807dae | ||
![]() |
3e67aeb455 | ||
![]() |
2a1217558a | ||
![]() |
1957e30210 | ||
![]() |
77af3ac457 | ||
![]() |
c9016bf72e | ||
![]() |
c4df46eb57 | ||
![]() |
0dd2716c8e | ||
![]() |
17c4b9a05f | ||
![]() |
18770e55d5 | ||
![]() |
30f425ada2 | ||
![]() |
977eeb6fef | ||
![]() |
cdc9d5c99d | ||
![]() |
31d9834387 | ||
![]() |
a31646a2ec | ||
![]() |
cb2b9331cf | ||
![]() |
2caa6e686e | ||
![]() |
54c545b1eb | ||
![]() |
f8f9d999a8 | ||
![]() |
57ddbdb20b | ||
![]() |
786c2b319c | ||
![]() |
6ba385d59e | ||
![]() |
ef8fe7f3a0 | ||
![]() |
b9b132d778 | ||
![]() |
663c1342f7 | ||
![]() |
b791c1a44d | ||
![]() |
14abeb2427 | ||
![]() |
508607a87b | ||
![]() |
ec8fb24256 | ||
![]() |
cc5654b9ed | ||
![]() |
f1c8a91660 | ||
![]() |
2fcd02d69e | ||
![]() |
4f908d46af | ||
![]() |
91fff462cb | ||
![]() |
7c0d24cd2d | ||
![]() |
ec25b314e0 | ||
![]() |
c850ec359c | ||
![]() |
ec17437782 | ||
![]() |
069c5b93e0 | ||
![]() |
385d789c96 | ||
![]() |
db5985a236 | ||
![]() |
05a589e958 | ||
![]() |
65a0323e6e | ||
![]() |
e1afc4bd67 | ||
![]() |
d5826551b4 | ||
![]() |
4db704930d | ||
![]() |
4c78b70293 | ||
![]() |
c4a6efc1ca | ||
![]() |
6192b99bb1 | ||
![]() |
d8ff81d61f | ||
![]() |
366ff5c127 | ||
![]() |
b4afdb112a | ||
![]() |
2f194bbb4a | ||
![]() |
a6f3514665 | ||
![]() |
6cccf0b80f | ||
![]() |
8b1880b4fb | ||
![]() |
979a2039cf | ||
![]() |
323d05c53f | ||
![]() |
218348a836 | ||
![]() |
611f1ffab9 | ||
![]() |
3c908a7955 | ||
![]() |
f8365525cb | ||
![]() |
7cabdfeb7b | ||
![]() |
529dc232ee | ||
![]() |
76d9e82d69 | ||
![]() |
112aba9aca | ||
![]() |
744fcdee22 | ||
![]() |
7eaa932984 | ||
![]() |
db2ee2cd77 | ||
![]() |
46804603b7 | ||
![]() |
14356bbaf0 | ||
![]() |
7cb4d9ecf9 | ||
![]() |
be0fd4de1b | ||
![]() |
033cd12bc8 | ||
![]() |
c98cef4e1e | ||
![]() |
52f8a4f03f | ||
![]() |
264626c7dd | ||
![]() |
2d52b1683b | ||
![]() |
33264e6526 | ||
![]() |
2800f42acd | ||
![]() |
9f271036fd | ||
![]() |
3c02e1bc2a | ||
![]() |
1a0cd4b68d | ||
![]() |
9d6225b71b | ||
![]() |
6f22fb2177 | ||
![]() |
8061a124f3 | ||
![]() |
20f7451766 | ||
![]() |
fa634c47f9 | ||
![]() |
4953a46118 | ||
![]() |
fe69c18b4e | ||
![]() |
7a80f79b16 | ||
![]() |
3744860ef6 | ||
![]() |
8d1078cb91 | ||
![]() |
1766500f7c | ||
![]() |
51254bba57 | ||
![]() |
a6958f39e7 | ||
![]() |
7bc055dd00 | ||
![]() |
71816b04c7 | ||
![]() |
b5d76e1f22 | ||
![]() |
74ae3fb349 | ||
![]() |
402a35bfc2 | ||
![]() |
52f7e1bd60 | ||
![]() |
75594e3680 | ||
![]() |
21d2a96d51 | ||
![]() |
9d70c9d3fd | ||
![]() |
df97407c5f | ||
![]() |
a1f1af1b86 | ||
![]() |
6e0785623d | ||
![]() |
4e2b3756c9 | ||
![]() |
9ac5c4e172 | ||
![]() |
5dc6243d56 | ||
![]() |
00ba79baf0 | ||
![]() |
8da93ff447 | ||
![]() |
c99500f723 | ||
![]() |
280bca87fb | ||
![]() |
50a6181718 | ||
![]() |
749ae956d3 | ||
![]() |
2e0d7731b9 | ||
![]() |
db25782920 | ||
![]() |
c1e543d3d9 | ||
![]() |
30ab1fbbff | ||
![]() |
687e767e02 | ||
![]() |
aa694767af | ||
![]() |
5a663298a6 | ||
![]() |
0d27f784f4 | ||
![]() |
3ccc030cba | ||
![]() |
406d71ab2b | ||
![]() |
bd68a143c5 | ||
![]() |
51b2eaf6b4 | ||
![]() |
7d9c5eac69 | ||
![]() |
063c96b3f0 | ||
![]() |
447a0532d2 | ||
![]() |
1c8b3c1081 | ||
![]() |
86615c3a8c | ||
![]() |
b2068655aa | ||
![]() |
48724e4bde | ||
![]() |
3809da762c | ||
![]() |
af825a860e | ||
![]() |
3366a692ed | ||
![]() |
4519a3bad0 | ||
![]() |
3ad9323e9b | ||
![]() |
ecfde4d3a8 | ||
![]() |
1660c53035 | ||
![]() |
04a646d330 | ||
![]() |
9375c0acec | ||
![]() |
8adeb50f31 | ||
![]() |
714d6ffc56 | ||
![]() |
6014793f75 | ||
![]() |
1bda5c7d8e | ||
![]() |
d058043ac6 | ||
![]() |
ba7b635bd1 | ||
![]() |
ee9fb75407 | ||
![]() |
aa09ecd176 | ||
![]() |
2dd29a1328 | ||
![]() |
5d83df6b29 | ||
![]() |
774b48849c | ||
![]() |
a8ebc5dd31 | ||
![]() |
08e28edacc | ||
![]() |
fd2bc3e2b1 | ||
![]() |
8b164173ac | ||
![]() |
890723d4c9 | ||
![]() |
a6069af417 | ||
![]() |
9b041b2dc7 | ||
![]() |
41a0243d91 | ||
![]() |
6fbe17d7d5 | ||
![]() |
3f22fb72ee | ||
![]() |
aa6455f23e | ||
![]() |
3d13d5c8e5 | ||
![]() |
469a6287cf | ||
![]() |
7ef52245ac | ||
![]() |
99ff4a443f | ||
![]() |
cbf145c5cd | ||
![]() |
12712870d6 | ||
![]() |
2c1b9a8743 | ||
![]() |
0b4f17d2c8 | ||
![]() |
505354f82d | ||
![]() |
eb153270a1 | ||
![]() |
b0559ec6be | ||
![]() |
0dca33f123 | ||
![]() |
b0e33b3c3a | ||
![]() |
0c401e4713 | ||
![]() |
8d547ee4de | ||
![]() |
2a91275eea | ||
![]() |
172b0d55e8 | ||
![]() |
212f4192ac | ||
![]() |
db425ff58a | ||
![]() |
aeed0f9230 | ||
![]() |
5e86bc279e | ||
![]() |
933785205d | ||
![]() |
f571605b9a | ||
![]() |
aeb1ff29f3 | ||
![]() |
2213588713 | ||
![]() |
d2e940248a | ||
![]() |
7067dcc8e6 | ||
![]() |
7768727ab1 | ||
![]() |
090cf7433a | ||
![]() |
90a2398105 | ||
![]() |
aff27b7e5d | ||
![]() |
8dbecb3f33 | ||
![]() |
75f6c670ac | ||
![]() |
0fc4fabdba | ||
![]() |
020f538e79 | ||
![]() |
1c393ae1e4 | ||
![]() |
17fe247cb8 | ||
![]() |
2df234e999 | ||
![]() |
717ecfed07 | ||
![]() |
36353294d6 | ||
![]() |
179765c43c | ||
![]() |
bc5f12ed88 | ||
![]() |
1edbfcc086 | ||
![]() |
f1bd8e4a5f | ||
![]() |
3dafe7ec45 | ||
![]() |
74092e6399 | ||
![]() |
2e175fbcac | ||
![]() |
54ff5fab41 | ||
![]() |
3146dfdc73 | ||
![]() |
94be77bec5 | ||
![]() |
5186b2f8fc | ||
![]() |
6eb4f25137 | ||
![]() |
a3d4b39443 | ||
![]() |
9195856bb9 | ||
![]() |
06d60c35f5 | ||
![]() |
7f919f1bd4 | ||
![]() |
c7478134f4 | ||
![]() |
e3b78989cd | ||
![]() |
0af3e8facc | ||
![]() |
f0af27bde6 | ||
![]() |
9bf3a97050 | ||
![]() |
d9b8e75fbb | ||
![]() |
5e85b546f3 | ||
![]() |
44ef66fc39 | ||
![]() |
eac570dd74 | ||
![]() |
8f8101e566 | ||
![]() |
28d480b07d | ||
![]() |
bd5bb60680 | ||
![]() |
49c9ee4e97 | ||
![]() |
bdd4a1cff7 | ||
![]() |
eb19b04cee | ||
![]() |
f121d83fbe | ||
![]() |
50d9ca28d0 | ||
![]() |
b8421a393e | ||
![]() |
b4eb10cc50 | ||
![]() |
3aedadc060 | ||
![]() |
7f33bd76f7 | ||
![]() |
9f14200da7 | ||
![]() |
f775c2abfb | ||
![]() |
a23f74c2f9 | ||
![]() |
752cf4bad6 | ||
![]() |
87e502ed21 | ||
![]() |
82c76052c2 | ||
![]() |
2c9a77e346 | ||
![]() |
a2cc78cf52 | ||
![]() |
818bd8eafd | ||
![]() |
a35830a912 | ||
![]() |
d7ca31596d | ||
![]() |
f3e0b46fe7 | ||
![]() |
38aa170529 | ||
![]() |
642eab2849 | ||
![]() |
af7ff8749b | ||
![]() |
3a4e40e53d | ||
![]() |
f0c9ec2000 | ||
![]() |
8b84530d0e | ||
![]() |
f25015ec39 | ||
![]() |
625167430d | ||
![]() |
7c5641a860 | ||
![]() |
adfe06bc04 | ||
![]() |
20e0de606b | ||
![]() |
511abf0a87 | ||
![]() |
b7cad18b16 | ||
![]() |
9c22db2b7a | ||
![]() |
6f3808a97e | ||
![]() |
196d2b0666 | ||
![]() |
1a9ab2d78c | ||
![]() |
219649e684 | ||
![]() |
0766482fab | ||
![]() |
455e57b435 | ||
![]() |
092de9937c | ||
![]() |
f27cfa2158 | ||
![]() |
4a6cf28df3 | ||
![]() |
a0d811ee16 | ||
![]() |
cddb45b654 | ||
![]() |
7f3b8efbd8 | ||
![]() |
4bd5cb4f08 | ||
![]() |
284c16a4d7 | ||
![]() |
5bfa23bcf9 | ||
![]() |
73007437ac | ||
![]() |
6bb7dcc672 | ||
![]() |
1a6b17cd5f | ||
![]() |
0236a79da4 | ||
![]() |
4af929beb6 | ||
![]() |
b0119b711c | ||
![]() |
fee3e475f0 | ||
![]() |
fb668bfb48 | ||
![]() |
d85e49e923 | ||
![]() |
c2f0e03c80 | ||
![]() |
a2503421b8 | ||
![]() |
af96cd0649 | ||
![]() |
610e1e847f | ||
![]() |
e1a0f851f2 | ||
![]() |
acd7b09320 | ||
![]() |
d0b18aebfe | ||
![]() |
c6691d9e2f | ||
![]() |
5f6054c986 | ||
![]() |
adc2cbd3db | ||
![]() |
3d7c49a94a | ||
![]() |
b9e68ed948 | ||
![]() |
6d38c5ae68 | ||
![]() |
5223d4f936 | ||
![]() |
f72821443c | ||
![]() |
789341701a | ||
![]() |
63d3817dde | ||
![]() |
13c2e53693 | ||
![]() |
6765125f25 | ||
![]() |
4368c0a2b8 | ||
![]() |
5fc0015144 | ||
![]() |
8c1c3b7291 | ||
![]() |
f5e783a42c | ||
![]() |
7158915169 | ||
![]() |
ce1eab346b | ||
![]() |
793b9e8b36 | ||
![]() |
a3fde33dfc | ||
![]() |
2c7367fab7 | ||
![]() |
8e563e4877 | ||
![]() |
baa26dba51 | ||
![]() |
702e29177e | ||
![]() |
072a117643 | ||
![]() |
052d81e039 | ||
![]() |
9640b55a79 | ||
![]() |
d89ebf85b1 | ||
![]() |
7302010182 | ||
![]() |
6b096d5ade | ||
![]() |
41dc431897 | ||
![]() |
8983c52b59 | ||
![]() |
776b84adc2 | ||
![]() |
158d6a1cd8 | ||
![]() |
50aec0cb06 | ||
![]() |
edf32a6fcd | ||
![]() |
a9b6466334 | ||
![]() |
ed4a75011f | ||
![]() |
2a920fcb36 | ||
![]() |
d2806b3c0c | ||
![]() |
dc0b132bf1 | ||
![]() |
cd18e98a8b | ||
![]() |
a12ee7699e | ||
![]() |
8be2dc5ec3 | ||
![]() |
0c6aa88ac5 | ||
![]() |
de58febd79 | ||
![]() |
9d53c68de6 | ||
![]() |
6bdb44abc8 | ||
![]() |
54d7a4558c | ||
![]() |
d1bf852371 | ||
![]() |
e614be853f | ||
![]() |
40bc2d3491 | ||
![]() |
cc908c2b99 |
52
.gitignore
vendored
52
.gitignore
vendored
@@ -13,7 +13,8 @@
|
||||
# /[Aa]ssets/TResources/DLL/
|
||||
/[Aa]ssets/StreamingAssets
|
||||
/BuildBundleInfo/
|
||||
/[Aa]ssets/AATest/
|
||||
[Aa]ssets/AATest/
|
||||
[Aa]ssets/AATest.meta
|
||||
|
||||
# Asset meta data should only be ignored when the corresponding asset is also ignored
|
||||
!/[Aa]ssets/**/*.meta
|
||||
@@ -62,8 +63,8 @@ sysinfo.txt
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
|
||||
# Log
|
||||
TEnginePersistentDataPath/Log
|
||||
# TEnginePersistentDataPath
|
||||
TEnginePersistentDataPath/
|
||||
|
||||
# Hotfix
|
||||
TEngineHotUpdate/bin
|
||||
@@ -71,3 +72,48 @@ 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/
|
||||
|
||||
#Luban
|
||||
Luban/.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
|
||||
|
||||
.DS_Store
|
||||
|
8
Assets/AssetRaw.meta
Normal file
8
Assets/AssetRaw.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff3591c28885e0947b42ef41853b14b6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Actor.meta
Normal file
8
Assets/AssetRaw/Actor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c67ce0c9edfd4e4aa1006ee39846d66
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Audios.meta
Normal file
8
Assets/AssetRaw/Audios.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ef7a411b66e70f4cb65c2233c9a0868
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Configs.meta
Normal file
8
Assets/AssetRaw/Configs.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd2928019aef34248af368b99bc53bea
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
1
Assets/AssetRaw/Configs/about.txt
Normal file
1
Assets/AssetRaw/Configs/about.txt
Normal file
@@ -0,0 +1 @@
|
||||
Powered by TEngine @alex
|
7
Assets/AssetRaw/Configs/about.txt.meta
Normal file
7
Assets/AssetRaw/Configs/about.txt.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba11f0707eb5f814392cbf12498aba94
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/DLL.meta
Normal file
8
Assets/AssetRaw/DLL.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3aad79ec1ea08c24c891bd3c669d4125
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Effects.meta
Normal file
8
Assets/AssetRaw/Effects.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fe175e1e1bd49a4ca71e66b6a9b7237
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Fonts.meta
Normal file
8
Assets/AssetRaw/Fonts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2473375c9ee163a4b861278b38091455
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Materials.meta
Normal file
8
Assets/AssetRaw/Materials.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 228b1547e7065d546ad0bf215fd6a276
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Scenes.meta
Normal file
8
Assets/AssetRaw/Scenes.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cace6ee6539f661419b5e5f8ae1c0146
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/Shaders.meta
Normal file
8
Assets/AssetRaw/Shaders.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a4bceb84ed685447ace957f497eb810
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/UI.meta
Normal file
8
Assets/AssetRaw/UI.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27e87d83814156648b58f380b834e046
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
382
Assets/AssetRaw/UI/LogUI.prefab
Normal file
382
Assets/AssetRaw/UI/LogUI.prefab
Normal file
@@ -0,0 +1,382 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2683445925571829816
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2683445925571829817}
|
||||
- component: {fileID: 2683445925571829820}
|
||||
- component: {fileID: 2683445925571829823}
|
||||
- component: {fileID: 2683445925571829822}
|
||||
m_Layer: 5
|
||||
m_Name: LogUI
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2683445925571829817
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445925571829816}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2683445927021212027}
|
||||
- {fileID: 2683445926897574365}
|
||||
- {fileID: 6164213652418733423}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &2683445925571829820
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445925571829816}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &2683445925571829823
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445925571829816}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!114 &2683445925571829822
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445925571829816}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 55
|
||||
--- !u!1 &2683445926897574364
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2683445926897574365}
|
||||
- component: {fileID: 2683445926897574339}
|
||||
- component: {fileID: 2683445926897574338}
|
||||
m_Layer: 5
|
||||
m_Name: m_textError
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2683445926897574365
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445926897574364}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2683445925571829817}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -10}
|
||||
m_SizeDelta: {x: -40, y: -60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2683445926897574339
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445926897574364}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2683445926897574338
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445926897574364}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 1, b: 0.25490198, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 36
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 0
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text:
|
||||
--- !u!1 &2683445927021212026
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2683445927021212027}
|
||||
- component: {fileID: 2683445927021212025}
|
||||
- component: {fileID: 2683445927021212024}
|
||||
m_Layer: 5
|
||||
m_Name: Panel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2683445927021212027
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445927021212026}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2683445925571829817}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2683445927021212025
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445927021212026}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2683445927021212024
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2683445927021212026}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.34901962}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &4229713281919198382
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6164213652418733423}
|
||||
- component: {fileID: 9023329926868908831}
|
||||
- component: {fileID: 5643637730633076069}
|
||||
- component: {fileID: 6030240422437967231}
|
||||
m_Layer: 5
|
||||
m_Name: m_btnClose
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6164213652418733423
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4229713281919198382}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2683445925571829817}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &9023329926868908831
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4229713281919198382}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &5643637730633076069
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4229713281919198382}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 0.007843138}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &6030240422437967231
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4229713281919198382}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 5643637730633076069}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
7
Assets/AssetRaw/UI/LogUI.prefab.meta
Normal file
7
Assets/AssetRaw/UI/LogUI.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad23fce0bd282924fa4aedb4da24684f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/UIRaw.meta
Normal file
8
Assets/AssetRaw/UIRaw.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30ac6ece1d52a824986d28eb79ec7e51
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/UIRaw/Atlas.meta
Normal file
8
Assets/AssetRaw/UIRaw/Atlas.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d11fa91acc253840a648b58f23db139
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/UIRaw/Atlas/Common.meta
Normal file
8
Assets/AssetRaw/UIRaw/Atlas/Common.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9066612920ca0654fb4c5a9229a06f33
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/blue_button.png
Normal file
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/blue_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
96
Assets/AssetRaw/UIRaw/Atlas/Common/blue_button.png.meta
Normal file
96
Assets/AssetRaw/UIRaw/Atlas/Common/blue_button.png.meta
Normal file
@@ -0,0 +1,96 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9a06e163014f4f46b14f4499d3e7240
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 0
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/red_button.png
Normal file
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/red_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
147
Assets/AssetRaw/UIRaw/Atlas/Common/red_button.png.meta
Normal file
147
Assets/AssetRaw/UIRaw/Atlas/Common/red_button.png.meta
Normal file
@@ -0,0 +1,147 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2761fc23b4aa7e34187ac5ffbc3fad9b
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 268, y: 79, z: 267, w: 82}
|
||||
spriteGenerateFallbackPhysicsShape: 0
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
cookieLightType: 1
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/white_background.png
Normal file
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/white_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
147
Assets/AssetRaw/UIRaw/Atlas/Common/white_background.png.meta
Normal file
147
Assets/AssetRaw/UIRaw/Atlas/Common/white_background.png.meta
Normal file
@@ -0,0 +1,147 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d623a2b7e069a4c4592d3da48f476189
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 39, y: 38, z: 40, w: 37}
|
||||
spriteGenerateFallbackPhysicsShape: 0
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
cookieLightType: 1
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/white_button.png
Normal file
BIN
Assets/AssetRaw/UIRaw/Atlas/Common/white_button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
147
Assets/AssetRaw/UIRaw/Atlas/Common/white_button.png.meta
Normal file
147
Assets/AssetRaw/UIRaw/Atlas/Common/white_button.png.meta
Normal file
@@ -0,0 +1,147 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57e4117f4cd6ae54284898652e70d553
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMasterTextureLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 0
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
cookieLightType: 1
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/AssetRaw/UIRaw/Raw.meta
Normal file
8
Assets/AssetRaw/UIRaw/Raw.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bc134b912ac6bb4399ea1bec4c11636
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Atlas.meta
Normal file
8
Assets/Atlas.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a8dc99c296a5ab4fa2fffa1b9bdfbb2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
69
Assets/Atlas/UIRaw_Atlas_Common.spriteatlas
Normal file
69
Assets/Atlas/UIRaw_Atlas_Common.spriteatlas
Normal file
@@ -0,0 +1,69 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!687078895 &4343727234628468602
|
||||
SpriteAtlas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: UIRaw_Atlas_Common
|
||||
serializedVersion: 2
|
||||
m_EditorData:
|
||||
serializedVersion: 2
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
anisoLevel: 0
|
||||
compressionQuality: 0
|
||||
maxTextureSize: 0
|
||||
textureCompression: 0
|
||||
filterMode: 1
|
||||
generateMipMaps: 0
|
||||
readable: 0
|
||||
crunchedCompression: 0
|
||||
sRGB: 1
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
m_BuildTarget: iPhone
|
||||
m_MaxTextureSize: 2048
|
||||
m_ResizeAlgorithm: 0
|
||||
m_TextureFormat: 49
|
||||
m_TextureCompression: 1
|
||||
m_CompressionQuality: 100
|
||||
m_CrunchedCompression: 0
|
||||
m_AllowsAlphaSplitting: 0
|
||||
m_Overridden: 1
|
||||
m_AndroidETC2FallbackOverride: 0
|
||||
m_ForceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
packingSettings:
|
||||
serializedVersion: 2
|
||||
padding: 2
|
||||
blockOffset: 1
|
||||
allowAlphaSplitting: 0
|
||||
enableRotation: 1
|
||||
enableTightPacking: 0
|
||||
enableAlphaDilation: 0
|
||||
secondaryTextureSettings: {}
|
||||
variantMultiplier: 1
|
||||
packables:
|
||||
- {fileID: 21300000, guid: f9a06e163014f4f46b14f4499d3e7240, type: 3}
|
||||
- {fileID: 21300000, guid: 2761fc23b4aa7e34187ac5ffbc3fad9b, type: 3}
|
||||
- {fileID: 21300000, guid: d623a2b7e069a4c4592d3da48f476189, type: 3}
|
||||
- {fileID: 21300000, guid: 57e4117f4cd6ae54284898652e70d553, type: 3}
|
||||
bindAsDefault: 1
|
||||
isAtlasV2: 0
|
||||
cachedData: {fileID: 0}
|
||||
m_MasterAtlas: {fileID: 0}
|
||||
m_PackedSprites:
|
||||
- {fileID: 21300000, guid: 2761fc23b4aa7e34187ac5ffbc3fad9b, type: 3}
|
||||
- {fileID: 21300000, guid: f9a06e163014f4f46b14f4499d3e7240, type: 3}
|
||||
- {fileID: 21300000, guid: d623a2b7e069a4c4592d3da48f476189, type: 3}
|
||||
- {fileID: 21300000, guid: 57e4117f4cd6ae54284898652e70d553, type: 3}
|
||||
m_PackedSpriteNamesToIndex:
|
||||
- red_button
|
||||
- blue_button
|
||||
- white_background
|
||||
- white_button
|
||||
m_RenderDataMap: {}
|
||||
m_Tag: UIRaw_Atlas_Common
|
||||
m_IsVariant: 0
|
||||
m_IsPlaceholder: 0
|
8
Assets/Atlas/UIRaw_Atlas_Common.spriteatlas.meta
Normal file
8
Assets/Atlas/UIRaw_Atlas_Common.spriteatlas.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a8431d2a64361c4d821790ed88aeb3d
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 4343727234628468602
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7be6642490fcb64dbcb3c9e89a4a056
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ba72e20a8a751a45aeaafcdfa8807f5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,344 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &209661865
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 209661867}
|
||||
- component: {fileID: 209661866}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &209661866
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 209661865}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_UseViewFrustumForShadowCasterCull: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &209661867
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 209661865}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &400364856
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 400364859}
|
||||
- component: {fileID: 400364858}
|
||||
- component: {fileID: 400364857}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &400364857
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 400364856}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &400364858
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 400364856}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &400364859
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 400364856}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1891593711
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1891593712}
|
||||
- component: {fileID: 1891593713}
|
||||
m_Layer: 0
|
||||
m_Name: TEngine
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1891593712
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1891593711}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1891593713
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1891593711}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6c3c520ddf3e7a74499ea41cf4b09db2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ef518d49b9758848883444880ef20c8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts.meta
Normal file
8
Assets/GameScripts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e350730b37a348a4ab35189c9739c329
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts/Editor.meta
Normal file
8
Assets/GameScripts/Editor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f69993ae3e14f924aa33b8747244c587
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts/Editor/Inspector.meta
Normal file
8
Assets/GameScripts/Editor/Inspector.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22d1bcdd317c6f64daeb9bf9742495f2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
62
Assets/GameScripts/Editor/Inspector/NetworkInspector.cs
Normal file
62
Assets/GameScripts/Editor/Inspector/NetworkInspector.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine.Editor.Inspector
|
||||
{
|
||||
[CustomEditor(typeof(Network))]
|
||||
internal sealed class NetworkInspector : GameFrameworkInspector
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Available during runtime only.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
Network t = (Network)target;
|
||||
|
||||
if (IsPrefabInHierarchy(t.gameObject))
|
||||
{
|
||||
EditorGUILayout.LabelField("Network Channel Count", t.NetworkChannelCount.ToString());
|
||||
|
||||
INetworkChannel[] networkChannels = t.GetAllNetworkChannels();
|
||||
foreach (INetworkChannel networkChannel in networkChannels)
|
||||
{
|
||||
DrawNetworkChannel(networkChannel);
|
||||
}
|
||||
}
|
||||
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void DrawNetworkChannel(INetworkChannel networkChannel)
|
||||
{
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
{
|
||||
EditorGUILayout.LabelField(networkChannel.Name, networkChannel.Connected ? "Connected" : "Disconnected");
|
||||
EditorGUILayout.LabelField("Service Type", networkChannel.ServiceType.ToString());
|
||||
EditorGUILayout.LabelField("Address Family", networkChannel.AddressFamily.ToString());
|
||||
EditorGUILayout.LabelField("Local Address", networkChannel.Connected ? networkChannel.Socket.LocalEndPoint.ToString() : "Unavailable");
|
||||
EditorGUILayout.LabelField("Remote Address", networkChannel.Connected ? networkChannel.Socket.RemoteEndPoint.ToString() : "Unavailable");
|
||||
EditorGUILayout.LabelField("Send Packet", Utility.Text.Format("{0} / {1}", networkChannel.SendPacketCount, networkChannel.SentPacketCount));
|
||||
EditorGUILayout.LabelField("Receive Packet", Utility.Text.Format("{0} / {1}", networkChannel.ReceivePacketCount, networkChannel.ReceivedPacketCount));
|
||||
EditorGUILayout.LabelField("Miss Heart Beat Count", networkChannel.MissHeartBeatCount.ToString());
|
||||
EditorGUILayout.LabelField("Heart Beat", Utility.Text.Format("{0:F2} / {1:F2}", networkChannel.HeartBeatElapseSeconds, networkChannel.HeartBeatInterval));
|
||||
EditorGUI.BeginDisabledGroup(!networkChannel.Connected);
|
||||
{
|
||||
if (GUILayout.Button("Disconnect"))
|
||||
{
|
||||
networkChannel.Close();
|
||||
}
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3301ba180cdc446bbdf823c860ae7a68
|
||||
timeCreated: 1682045195
|
8
Assets/GameScripts/Editor/Postprocessor.meta
Normal file
8
Assets/GameScripts/Editor/Postprocessor.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4944189ec9c939b45a65d93c704a22ec
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
489
Assets/GameScripts/Editor/Postprocessor/SpritePostprocessor.cs
Normal file
489
Assets/GameScripts/Editor/Postprocessor/SpritePostprocessor.cs
Normal file
@@ -0,0 +1,489 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.U2D;
|
||||
using UnityEngine;
|
||||
using UnityEngine.U2D;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
/// <summary>
|
||||
/// 图集导入管线。
|
||||
/// </summary>
|
||||
public class SpritePostprocessor : AssetPostprocessor
|
||||
{
|
||||
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
foreach (var s in importedAssets)
|
||||
{
|
||||
EditorSpriteSaveInfo.OnImportSprite(s);
|
||||
}
|
||||
|
||||
foreach (var s in deletedAssets)
|
||||
{
|
||||
EditorSpriteSaveInfo.OnDeleteSprite(s);
|
||||
}
|
||||
|
||||
foreach (var s in movedFromAssetPaths)
|
||||
{
|
||||
EditorSpriteSaveInfo.OnDeleteSprite(s);
|
||||
}
|
||||
|
||||
foreach (var s in movedAssets)
|
||||
{
|
||||
EditorSpriteSaveInfo.OnImportSprite(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class EditorSpriteSaveInfo
|
||||
{
|
||||
private const string NormalAtlasDir = "Assets/Atlas";
|
||||
private const string UISpritePath = "Assets/AssetRaw/UIRaw";
|
||||
private const string UIAtlasPath = "Assets/AssetRaw/UIRaw/Atlas";
|
||||
private const string UIRawPath = "Assets/AssetRaw/UIRaw/UIRaw";
|
||||
private static List<string> m_dirtyAtlasList = new List<string>();
|
||||
private static Dictionary<string, List<string>> m_allASprites = new Dictionary<string, List<string>>();
|
||||
private static Dictionary<string, string> m_uiAtlasMap = new Dictionary<string, string>();
|
||||
private static bool m_inited = false;
|
||||
private static bool m_dirty = false;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (m_inited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EditorApplication.update += CheckDirty;
|
||||
}
|
||||
|
||||
public static void CheckDirty()
|
||||
{
|
||||
if (m_dirty)
|
||||
{
|
||||
m_dirty = false;
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
float lastProgress = -1;
|
||||
for (int i = 0; i < m_dirtyAtlasList.Count; i++)
|
||||
{
|
||||
string atlasName = m_dirtyAtlasList[i];
|
||||
Debug.Log("更新图集 : " + atlasName);
|
||||
var curProgress = (float)i / m_dirtyAtlasList.Count;
|
||||
if (curProgress > lastProgress + 0.01f)
|
||||
{
|
||||
lastProgress = curProgress;
|
||||
var progressText = $"当前进度:{i}/{m_dirtyAtlasList.Count} {atlasName}";
|
||||
bool cancel = EditorUtility.DisplayCancelableProgressBar("刷新图集" + atlasName, progressText, curProgress);
|
||||
if (cancel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool isUI = atlasName.StartsWith("UIRaw");
|
||||
SaveAtlas(atlasName, isUI);
|
||||
}
|
||||
|
||||
EditorUtility.ClearProgressBar();
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
m_dirtyAtlasList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnImportSprite(string assetPath)
|
||||
{
|
||||
if (!assetPath.StartsWith(UISpritePath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TextureImporter ti = AssetImporter.GetAtPath(assetPath) as TextureImporter;
|
||||
|
||||
if (ti != null)
|
||||
{
|
||||
var modify = false;
|
||||
|
||||
if (assetPath.StartsWith(UISpritePath))
|
||||
{
|
||||
if (ti.textureType != TextureImporterType.Sprite)
|
||||
{
|
||||
ti.textureType = TextureImporterType.Sprite;
|
||||
modify = true;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(ti.spritePackingTag))
|
||||
{
|
||||
ti.spritePackingTag = string.Empty;
|
||||
modify = true;
|
||||
}
|
||||
|
||||
var setting = new TextureImporterSettings();
|
||||
ti.ReadTextureSettings(setting);
|
||||
if (setting.spriteGenerateFallbackPhysicsShape)
|
||||
{
|
||||
setting.spriteGenerateFallbackPhysicsShape = false;
|
||||
ti.SetTextureSettings(setting);
|
||||
modify = true;
|
||||
}
|
||||
|
||||
if (IsKeepRawImage(assetPath))
|
||||
{
|
||||
//调整android格式
|
||||
var andPlatformSettings = ti.GetPlatformTextureSettings("Android");
|
||||
if (!andPlatformSettings.overridden)
|
||||
{
|
||||
andPlatformSettings.overridden = true;
|
||||
modify = true;
|
||||
}
|
||||
|
||||
if (andPlatformSettings.format != TextureImporterFormat.ASTC_6x6)
|
||||
{
|
||||
andPlatformSettings.format = TextureImporterFormat.ASTC_6x6;
|
||||
ti.SetPlatformTextureSettings(andPlatformSettings);
|
||||
modify = true;
|
||||
}
|
||||
|
||||
//调整ios格式
|
||||
var iosPlatformSettings = ti.GetPlatformTextureSettings("iPhone");
|
||||
if (!iosPlatformSettings.overridden)
|
||||
{
|
||||
iosPlatformSettings.overridden = true;
|
||||
modify = true;
|
||||
}
|
||||
|
||||
if (iosPlatformSettings.format != TextureImporterFormat.ASTC_5x5)
|
||||
{
|
||||
iosPlatformSettings.format = TextureImporterFormat.ASTC_5x5;
|
||||
iosPlatformSettings.compressionQuality = 50;
|
||||
ti.SetPlatformTextureSettings(iosPlatformSettings);
|
||||
modify = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modify)
|
||||
{
|
||||
ti.SaveAndReimport();
|
||||
}
|
||||
|
||||
if (ti.textureType == TextureImporterType.Sprite)
|
||||
{
|
||||
OnProcessSprite(assetPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否保持散图(不打图集)
|
||||
/// </summary>
|
||||
/// <param name="dirPath"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsKeepRawImage(string dirPath)
|
||||
{
|
||||
return dirPath.Contains("UIRaw/Raw/") || dirPath.Contains("UIRaw_Raw_");
|
||||
}
|
||||
|
||||
public static string GetSpritePath(string assetPath)
|
||||
{
|
||||
string path = assetPath.Substring(0, assetPath.LastIndexOf("."));
|
||||
path = path.Replace("Assets/AssetRaw/", "");
|
||||
return path;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据文件路径,返回图集名称
|
||||
/// </summary>
|
||||
/// <param name="fullName"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetPackageTag(string fullName)
|
||||
{
|
||||
fullName = fullName.Replace("\\", "/");
|
||||
int idx = fullName.LastIndexOf("UIRaw", StringComparison.Ordinal);
|
||||
if (idx == -1)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if (IsKeepRawImage(fullName))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
var atlasPath = fullName.Substring(idx);
|
||||
string str = atlasPath;
|
||||
str = str.Substring(0, str.LastIndexOf("/", StringComparison.Ordinal)).Replace("/", "_");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public static void OnProcessSprite(string assetPath)
|
||||
{
|
||||
if (!assetPath.StartsWith("Assets"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (assetPath.StartsWith("Assets/UIRaw_Delete"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
var spriteName = Path.GetFileNameWithoutExtension(assetPath);
|
||||
var spritePath = GetSpritePath(assetPath);
|
||||
if (!m_uiAtlasMap.TryGetValue(spriteName, out string oldAssetPath) || spritePath == oldAssetPath)
|
||||
{
|
||||
m_uiAtlasMap[spriteName] = spritePath;
|
||||
m_dirty = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"有重名的图片:{spriteName}\n旧图集:{oldAssetPath}\n新图集:{spritePath} ");
|
||||
m_uiAtlasMap[spriteName] = spritePath;
|
||||
m_dirty = true;
|
||||
}
|
||||
|
||||
string atlasName = GetPackageTag(assetPath);
|
||||
if (string.IsNullOrEmpty(atlasName))
|
||||
{
|
||||
bool keepRaw = IsKeepRawImage(assetPath);
|
||||
if (!keepRaw)
|
||||
{
|
||||
Debug.LogError($"empty packingTag of asset :{assetPath} !!!");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<string> ret;
|
||||
if (!m_allASprites.TryGetValue(atlasName, out ret))
|
||||
{
|
||||
ret = new List<string>();
|
||||
m_allASprites.Add(atlasName, ret);
|
||||
}
|
||||
|
||||
if (!ret.Contains(assetPath))
|
||||
{
|
||||
ret.Add(assetPath);
|
||||
m_dirty = true;
|
||||
if (!m_dirtyAtlasList.Contains(atlasName))
|
||||
{
|
||||
m_dirtyAtlasList.Add(atlasName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnDeleteSprite(string assetPath)
|
||||
{
|
||||
if (assetPath.StartsWith("Assets/UIRaw_Delete"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!assetPath.StartsWith(UISpritePath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Init();
|
||||
string atlasName = GetPackageTag(assetPath);
|
||||
if (!m_allASprites.TryGetValue(atlasName, out var ret))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//改成文件名的匹配
|
||||
if (!ret.Exists(s => Path.GetFileName(s) == Path.GetFileName(assetPath)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (assetPath.StartsWith(UISpritePath))
|
||||
{
|
||||
var spriteName = Path.GetFileNameWithoutExtension(assetPath);
|
||||
if (m_uiAtlasMap.ContainsKey(spriteName))
|
||||
{
|
||||
m_uiAtlasMap.Remove(spriteName);
|
||||
m_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
ret.Remove(assetPath);
|
||||
m_dirty = true;
|
||||
if (!m_dirtyAtlasList.Contains(atlasName))
|
||||
{
|
||||
m_dirtyAtlasList.Add(atlasName);
|
||||
}
|
||||
}
|
||||
|
||||
#region 更新图集
|
||||
|
||||
public static void SaveAtlas(string atlasName, bool isUI)
|
||||
{
|
||||
List<Object> spriteList = new List<Object>();
|
||||
if (m_allASprites.ContainsKey(atlasName))
|
||||
{
|
||||
var list = m_allASprites[atlasName];
|
||||
list.Sort(StringComparer.Ordinal);
|
||||
|
||||
foreach (var s in list)
|
||||
{
|
||||
var sprite = AssetDatabase.LoadAssetAtPath<Sprite>(s);
|
||||
if (sprite != null)
|
||||
{
|
||||
spriteList.Add(sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var path = $"{NormalAtlasDir}/{atlasName}.spriteatlas";
|
||||
|
||||
if (spriteList.Count == 0)
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
AssetDatabase.DeleteAsset(path);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var atlas = new SpriteAtlas();
|
||||
var setting = new SpriteAtlasPackingSettings
|
||||
{
|
||||
blockOffset = 1,
|
||||
padding = 2,
|
||||
enableRotation = true
|
||||
};
|
||||
|
||||
bool isOpaque = atlasName.Contains("Opaque");
|
||||
|
||||
var textureSetting = new SpriteAtlasTextureSettings
|
||||
{
|
||||
generateMipMaps = false,
|
||||
sRGB = true,
|
||||
filterMode = FilterMode.Bilinear
|
||||
};
|
||||
atlas.SetTextureSettings(textureSetting);
|
||||
|
||||
var iphonePlatformSetting = atlas.GetPlatformSettings("iPhone");
|
||||
if (!iphonePlatformSetting.overridden)
|
||||
{
|
||||
iphonePlatformSetting.overridden = true;
|
||||
iphonePlatformSetting.format = isOpaque ? TextureImporterFormat.ASTC_5x5 : TextureImporterFormat.ASTC_5x5;
|
||||
iphonePlatformSetting.compressionQuality = 100;
|
||||
atlas.SetPlatformSettings(iphonePlatformSetting);
|
||||
}
|
||||
|
||||
var androidPlatformSetting = atlas.GetPlatformSettings("Android");
|
||||
if (isOpaque && !androidPlatformSetting.overridden)
|
||||
{
|
||||
androidPlatformSetting.overridden = true;
|
||||
androidPlatformSetting.format = TextureImporterFormat.ETC_RGB4;
|
||||
androidPlatformSetting.compressionQuality = 100;
|
||||
atlas.SetPlatformSettings(androidPlatformSetting);
|
||||
}
|
||||
|
||||
atlas.SetPackingSettings(setting);
|
||||
atlas.Add(spriteList.ToArray());
|
||||
|
||||
AssetDatabase.CreateAsset(atlas, path);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重新生成图集
|
||||
|
||||
private static Dictionary<string, List<string>> m_tempAllASprites = new Dictionary<string, List<string>>();
|
||||
|
||||
[MenuItem("TEngine/图集/重新生成UI图集")]
|
||||
static void ForceGenAtlas()
|
||||
{
|
||||
Init();
|
||||
List<string> needSaveAtlas = new List<string>();
|
||||
m_tempAllASprites.Clear();
|
||||
var findAssets = AssetDatabase.FindAssets("t:sprite", new[] { UIAtlasPath });
|
||||
foreach (var findAsset in findAssets)
|
||||
{
|
||||
var path = AssetDatabase.GUIDToAssetPath(findAsset);
|
||||
var atlasName = GetPackageTag(path);
|
||||
if (!m_tempAllASprites.TryGetValue(atlasName, out var spriteList))
|
||||
{
|
||||
spriteList = new List<string>();
|
||||
m_tempAllASprites[atlasName] = spriteList;
|
||||
}
|
||||
|
||||
if (!spriteList.Contains(path))
|
||||
{
|
||||
spriteList.Add(path);
|
||||
}
|
||||
}
|
||||
|
||||
//有变化的才刷
|
||||
var iter = m_tempAllASprites.GetEnumerator();
|
||||
while (iter.MoveNext())
|
||||
{
|
||||
bool needSave = false;
|
||||
var atlasName = iter.Current.Key;
|
||||
var newSpritesList = iter.Current.Value;
|
||||
|
||||
List<string> existSprites;
|
||||
if (m_allASprites.TryGetValue(atlasName, out existSprites))
|
||||
{
|
||||
if (existSprites.Count != newSpritesList.Count)
|
||||
{
|
||||
needSave = true;
|
||||
existSprites.Clear();
|
||||
existSprites.AddRange(newSpritesList);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < newSpritesList.Count; i++)
|
||||
{
|
||||
if (!existSprites.Contains(newSpritesList[i]))
|
||||
{
|
||||
needSave = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (needSave)
|
||||
{
|
||||
existSprites.Clear();
|
||||
existSprites.AddRange(newSpritesList);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
needSave = true;
|
||||
m_allASprites.Add(atlasName, new List<string>(newSpritesList));
|
||||
}
|
||||
|
||||
if (needSave && !needSaveAtlas.Contains(atlasName))
|
||||
{
|
||||
needSaveAtlas.Add(atlasName);
|
||||
}
|
||||
}
|
||||
iter.Dispose();
|
||||
foreach (var atlas in needSaveAtlas)
|
||||
{
|
||||
Debug.LogFormat("Gen atlas:{0}", atlas);
|
||||
SaveAtlas(atlas, true);
|
||||
}
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
SpriteAtlasUtility.PackAllAtlases(EditorUserBuildSettings.activeBuildTarget);
|
||||
Debug.Log("Gen end");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e87a460a53ec5546a19e31705d13664
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts/HotFix.meta
Normal file
8
Assets/GameScripts/HotFix.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44b1c38e059de6542b6cd33d7258f415
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts/HotFix/BattleCore.meta
Normal file
8
Assets/GameScripts/HotFix/BattleCore.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6b7bfca93e005f45999c16054d999e7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "BattleCore.Runtime",
|
||||
"rootNamespace": "BattleCore.Runtime",
|
||||
"references": [
|
||||
"GUID:aa06d4cc755c979489c256c1bcca1dfb",
|
||||
"GUID:d8b63aba1907145bea998dd612889d6b",
|
||||
"GUID:a90b2d3377c5e4a4db95cc44fb82045e"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 641632c4f8079b94f963b5284d859a12
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
3
Assets/GameScripts/HotFix/BattleCore/ECSExtension.meta
Normal file
3
Assets/GameScripts/HotFix/BattleCore/ECSExtension.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 890abd3a957e406ab422fc468ba6c169
|
||||
timeCreated: 1682353243
|
@@ -0,0 +1,6 @@
|
||||
namespace BattleCore.Runtime
|
||||
{
|
||||
public static class EntityExtension
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4ef2dfa5ceac99458eb1745131a9c83
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b0e288b918a41698571ec3d36059851
|
||||
timeCreated: 1682353251
|
21
Assets/GameScripts/HotFix/BattleCore/Empty.cs
Normal file
21
Assets/GameScripts/HotFix/BattleCore/Empty.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GameScripts/HotFix/BattleCore/Empty.cs.meta
Normal file
11
Assets/GameScripts/HotFix/BattleCore/Empty.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fc394f8c6ad5304a82ff84b4263756f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts/HotFix/GameBase.meta
Normal file
8
Assets/GameScripts/HotFix/GameBase.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26079995c20c1b144a1c086bf2869375
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
33
Assets/GameScripts/HotFix/GameBase/Attribute.cs
Normal file
33
Assets/GameScripts/HotFix/GameBase/Attribute.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
#region Attribute
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class UpdateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class FixedUpdateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class LateUpdateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RoleLoginAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RoleLogoutAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
3
Assets/GameScripts/HotFix/GameBase/Attribute.cs.meta
Normal file
3
Assets/GameScripts/HotFix/GameBase/Attribute.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80791cccf63d44faa348884ea0c506a2
|
||||
timeCreated: 1684553027
|
16
Assets/GameScripts/HotFix/GameBase/BaseClsTemplate.cs
Normal file
16
Assets/GameScripts/HotFix/GameBase/BaseClsTemplate.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GameScripts/HotFix/GameBase/BaseClsTemplate.cs.meta
Normal file
11
Assets/GameScripts/HotFix/GameBase/BaseClsTemplate.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb7ef2f42b33ada47b3543dc7723fcb5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
79
Assets/GameScripts/HotFix/GameBase/BaseLogicSys.cs
Normal file
79
Assets/GameScripts/HotFix/GameBase/BaseLogicSys.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础LogicSys,生命周期由TEngine实现,推荐给系统实现,
|
||||
/// 减少多余的Mono,保持系统层面只有一个Update。
|
||||
/// 用主Mono来驱动LogicSys的生命周期。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">逻辑系统类型。</typeparam>
|
||||
public abstract class BaseLogicSys<T> : ILogicSys where T : new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static bool HasInstance => _instance != null;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
#region virtual function
|
||||
public virtual bool OnInit()
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void OnStart()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnLateUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnFixedUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnRoleLogin()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnRoleLogout()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDrawGizmos()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnApplicationPause(bool pause)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnMapChanged()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
3
Assets/GameScripts/HotFix/GameBase/BaseLogicSys.cs.meta
Normal file
3
Assets/GameScripts/HotFix/GameBase/BaseLogicSys.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc4ce19b17fd4277951d189b66f503e2
|
||||
timeCreated: 1683120353
|
263
Assets/GameScripts/HotFix/GameBase/BehaviourSingleton.cs
Normal file
263
Assets/GameScripts/HotFix/GameBase/BehaviourSingleton.cs
Normal file
@@ -0,0 +1,263 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 通过LogicSys来驱动且具备Unity完整生命周期的单例(不继承MonoBehaviour)。
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public abstract class BehaviourSingleton<T> : BaseBehaviourSingleton where T : BaseBehaviourSingleton, new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
Log.Assert(_instance != null);
|
||||
_instance.Awake();
|
||||
RegSingleton(_instance);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
private static void RegSingleton(BaseBehaviourSingleton inst)
|
||||
{
|
||||
BehaviourSingleSystem.Instance.RegSingleton(inst);
|
||||
}
|
||||
}
|
||||
|
||||
public class BaseBehaviourSingleton
|
||||
{
|
||||
public bool IsStart = false;
|
||||
|
||||
public virtual void Active()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Awake()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool IsHaveLateUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void Start()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 帧更新。
|
||||
/// <remarks>需要UpdateAttribute。</remarks>
|
||||
/// </summary>
|
||||
public virtual void Update()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 后帧更新。
|
||||
/// <remarks>需要LateUpdateAttribute。</remarks>
|
||||
/// </summary>
|
||||
public virtual void LateUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物理帧更新。
|
||||
/// <remarks>需要FixedUpdateAttribute。</remarks>
|
||||
/// </summary>
|
||||
public virtual void FixedUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnPause()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnResume()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnDrawGizmos()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class BehaviourSingleSystem : BaseLogicSys<BehaviourSingleSystem>
|
||||
{
|
||||
private readonly List<BaseBehaviourSingleton> _listInst = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listStart = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listUpdate = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listLateUpdate = new List<BaseBehaviourSingleton>();
|
||||
private readonly List<BaseBehaviourSingleton> _listFixedUpdate = new List<BaseBehaviourSingleton>();
|
||||
|
||||
public void RegSingleton(BaseBehaviourSingleton inst)
|
||||
{
|
||||
Log.Assert(!_listInst.Contains(inst));
|
||||
_listInst.Add(inst);
|
||||
_listStart.Add(inst);
|
||||
if (HadAttribute<UpdateAttribute>(inst.GetType()))
|
||||
{
|
||||
_listUpdate.Add(inst);
|
||||
}
|
||||
if (HadAttribute<LateUpdateAttribute>(inst.GetType()))
|
||||
{
|
||||
_listLateUpdate.Add(inst);
|
||||
}
|
||||
if (HadAttribute<FixedUpdateAttribute>(inst.GetType()))
|
||||
{
|
||||
_listFixedUpdate.Add(inst);
|
||||
}
|
||||
}
|
||||
|
||||
public void UnRegSingleton(BaseBehaviourSingleton inst)
|
||||
{
|
||||
if (inst == null)
|
||||
{
|
||||
Log.Error($"BaseBehaviourSingleton Is Null");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Assert(_listInst.Contains(inst));
|
||||
if (_listInst.Contains(inst))
|
||||
{
|
||||
_listInst.Remove(inst);
|
||||
}
|
||||
|
||||
if (_listStart.Contains(inst))
|
||||
{
|
||||
_listStart.Remove(inst);
|
||||
}
|
||||
|
||||
if (_listUpdate.Contains(inst))
|
||||
{
|
||||
_listUpdate.Remove(inst);
|
||||
}
|
||||
|
||||
if (_listLateUpdate.Contains(inst))
|
||||
{
|
||||
_listLateUpdate.Remove(inst);
|
||||
}
|
||||
|
||||
inst.Destroy();
|
||||
inst = null;
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
var listStart = _listStart;
|
||||
var listToUpdate = _listUpdate;
|
||||
var listToLateUpdate = _listLateUpdate;
|
||||
if (listStart.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < listStart.Count; i++)
|
||||
{
|
||||
var inst = listStart[i];
|
||||
Log.Assert(!inst.IsStart);
|
||||
|
||||
inst.IsStart = true;
|
||||
inst.Start();
|
||||
listToUpdate.Add(inst);
|
||||
|
||||
if (inst.IsHaveLateUpdate())
|
||||
{
|
||||
listToLateUpdate.Add(inst);
|
||||
}
|
||||
}
|
||||
|
||||
listStart.Clear();
|
||||
}
|
||||
|
||||
var listUpdateCnt = listToUpdate.Count;
|
||||
for (int i = 0; i < listUpdateCnt; i++)
|
||||
{
|
||||
var inst = listToUpdate[i];
|
||||
|
||||
TProfiler.BeginFirstSample(inst.GetType().FullName);
|
||||
inst.Update();
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnLateUpdate()
|
||||
{
|
||||
var listLateUpdate = _listLateUpdate;
|
||||
var listLateUpdateCnt = listLateUpdate.Count;
|
||||
for (int i = 0; i < listLateUpdateCnt; i++)
|
||||
{
|
||||
var inst = listLateUpdate[i];
|
||||
|
||||
TProfiler.BeginFirstSample(inst.GetType().FullName);
|
||||
inst.LateUpdate();
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnFixedUpdate()
|
||||
{
|
||||
var listFixedUpdate = _listFixedUpdate;
|
||||
var listFixedUpdateCnt = listFixedUpdate.Count;
|
||||
for (int i = 0; i < listFixedUpdateCnt; i++)
|
||||
{
|
||||
var inst = listFixedUpdate[i];
|
||||
|
||||
TProfiler.BeginFirstSample(inst.GetType().FullName);
|
||||
inst.FixedUpdate();
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
for (int i = 0; i < _listInst.Count; i++)
|
||||
{
|
||||
var inst = _listInst[i];
|
||||
inst.Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnApplicationPause(bool pause)
|
||||
{
|
||||
for (int i = 0; i < _listInst.Count; i++)
|
||||
{
|
||||
var inst = _listInst[i];
|
||||
if (pause)
|
||||
{
|
||||
inst.OnPause();
|
||||
}
|
||||
else
|
||||
{
|
||||
inst.OnResume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDrawGizmos()
|
||||
{
|
||||
for (int i = 0; i < _listInst.Count; i++)
|
||||
{
|
||||
var inst = _listInst[i];
|
||||
inst.OnDrawGizmos();
|
||||
}
|
||||
}
|
||||
|
||||
private bool HadAttribute<T>(Type type) where T:Attribute
|
||||
{
|
||||
T attribute = Attribute.GetCustomAttribute(type, typeof(T)) as T;
|
||||
|
||||
return attribute != null;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c0e9c1c8c9d4ce99a1c991fb62a0256
|
||||
timeCreated: 1683120460
|
16
Assets/GameScripts/HotFix/GameBase/GameBase.asmdef
Normal file
16
Assets/GameScripts/HotFix/GameBase/GameBase.asmdef
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "GameBase",
|
||||
"rootNamespace": "GameBase",
|
||||
"references": [
|
||||
"GUID:aa06d4cc755c979489c256c1bcca1dfb"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
7
Assets/GameScripts/HotFix/GameBase/GameBase.asmdef.meta
Normal file
7
Assets/GameScripts/HotFix/GameBase/GameBase.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08c3762f54316454ca6b6fbcb22b40e5
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
3
Assets/GameScripts/HotFix/GameBase/GameTickWatcher.meta
Normal file
3
Assets/GameScripts/HotFix/GameBase/GameTickWatcher.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b062b3e32edd4536a4308a3d180842e0
|
||||
timeCreated: 1681989133
|
@@ -0,0 +1,40 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 用来在多线程下检测耗时。
|
||||
/// </summary>
|
||||
public class GameTickWatcher
|
||||
{
|
||||
private long _startTick;
|
||||
|
||||
public GameTickWatcher()
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
_startTick = System.DateTime.Now.Ticks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用时。
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public float ElapseTime()
|
||||
{
|
||||
long endTick = System.DateTime.Now.Ticks;
|
||||
return (float)((endTick - _startTick) / 10000) / 1000.0f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 输出用时。
|
||||
/// </summary>
|
||||
public void LogUsedTime()
|
||||
{
|
||||
Log.Info($"Used Time: {this.ElapseTime()}");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7320165f7aa147a998a30fe2f7a5a5c2
|
||||
timeCreated: 1681989139
|
58
Assets/GameScripts/HotFix/GameBase/ILogicSys.cs
Normal file
58
Assets/GameScripts/HotFix/GameBase/ILogicSys.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
/// <summary>
|
||||
/// 定义通用的逻辑接口,统一生命期调用
|
||||
/// </summary>
|
||||
public interface ILogicSys
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化接口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool OnInit();
|
||||
|
||||
/// <summary>
|
||||
/// 销毁系统
|
||||
/// </summary>
|
||||
void OnDestroy();
|
||||
|
||||
/// <summary>
|
||||
/// 初始化后,第一帧统一调用
|
||||
/// </summary>
|
||||
void OnStart();
|
||||
|
||||
/// <summary>
|
||||
/// 更新接口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
void OnUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// 渲染后调用
|
||||
/// </summary>
|
||||
void OnLateUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// 物理帧更新
|
||||
/// </summary>
|
||||
void OnFixedUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// 登录账号/角色时调用
|
||||
/// </summary>
|
||||
void OnRoleLogin();
|
||||
|
||||
/// <summary>
|
||||
/// 清理数据接口,切换账号/角色时调用
|
||||
/// </summary>
|
||||
void OnRoleLogout();
|
||||
|
||||
/// <summary>
|
||||
/// 绘制调试接口
|
||||
/// </summary>
|
||||
void OnDrawGizmos();
|
||||
|
||||
/// <summary>
|
||||
/// 暂停游戏
|
||||
/// </summary>
|
||||
/// <param name="pause"></param>
|
||||
void OnApplicationPause(bool pause);
|
||||
}
|
3
Assets/GameScripts/HotFix/GameBase/ILogicSys.cs.meta
Normal file
3
Assets/GameScripts/HotFix/GameBase/ILogicSys.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63ff6535a43f41d7ac793b8a153a37b6
|
||||
timeCreated: 1681213932
|
8
Assets/GameScripts/HotFix/GameBase/Loom.meta
Normal file
8
Assets/GameScripts/HotFix/GameBase/Loom.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dab5f3e08b4367d41b801af29d381ca8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
190
Assets/GameScripts/HotFix/GameBase/Loom/Loom.cs
Normal file
190
Assets/GameScripts/HotFix/GameBase/Loom/Loom.cs
Normal file
@@ -0,0 +1,190 @@
|
||||
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,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b87f840d1d0b8a14799b0eee6f0fabae
|
||||
guid: eea4adc555e37f842abf5dd24c191d93
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
1118
Assets/GameScripts/HotFix/GameBase/Redux.cs
Normal file
1118
Assets/GameScripts/HotFix/GameBase/Redux.cs
Normal file
File diff suppressed because it is too large
Load Diff
3
Assets/GameScripts/HotFix/GameBase/Redux.cs.meta
Normal file
3
Assets/GameScripts/HotFix/GameBase/Redux.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 464445719fff48a78021df4a4a6b05a5
|
||||
timeCreated: 1684552621
|
3
Assets/GameScripts/HotFix/GameBase/Singleton.meta
Normal file
3
Assets/GameScripts/HotFix/GameBase/Singleton.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00565f0d362f4c36836804455e19c3df
|
||||
timeCreated: 1681990210
|
27
Assets/GameScripts/HotFix/GameBase/Singleton/Singleton.cs
Normal file
27
Assets/GameScripts/HotFix/GameBase/Singleton/Singleton.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用单例。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">泛型T。</typeparam>
|
||||
public class Singleton<T> where T : new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = new T();
|
||||
Log.Assert(_instance != null);
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b68a449df312429cbb27873984ec238e
|
||||
timeCreated: 1681214042
|
214
Assets/GameScripts/HotFix/GameBase/Singleton/TSingleton.cs
Normal file
214
Assets/GameScripts/HotFix/GameBase/Singleton/TSingleton.cs
Normal file
@@ -0,0 +1,214 @@
|
||||
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("[GameModule]");
|
||||
|
||||
if (_root == null)
|
||||
{
|
||||
_root = new GameObject("[GameModule]")
|
||||
{
|
||||
transform =
|
||||
{
|
||||
position = Vector3.zero
|
||||
}
|
||||
};
|
||||
}
|
||||
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)
|
||||
{
|
||||
Object.DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Release(GameObject go)
|
||||
{
|
||||
if (_gameObjects != null && _gameObjects.ContainsKey(go.name))
|
||||
{
|
||||
_gameObjects.Remove(go.name);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa2cb5bb622045d7a6f2a4c4faea3ca6
|
||||
timeCreated: 1681989590
|
114
Assets/GameScripts/HotFix/GameBase/Singleton/UnitySingleton.cs
Normal file
114
Assets/GameScripts/HotFix/GameBase/Singleton/UnitySingleton.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
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 = 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}]")
|
||||
{
|
||||
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) return;
|
||||
SingletonMgr.Release(_instance.gameObject);
|
||||
_instance = null;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25c99243aa534df5870e36fdf9d36afd
|
||||
timeCreated: 1681990223
|
8
Assets/GameScripts/HotFix/GameLogic.meta
Normal file
8
Assets/GameScripts/HotFix/GameLogic.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8ea72f19248ebd4e817160319583cac
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/GameScripts/HotFix/GameLogic/Camera.meta
Normal file
8
Assets/GameScripts/HotFix/GameLogic/Camera.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d862c80fdc1e684e8ff3b6ae7707b79
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
24
Assets/GameScripts/HotFix/GameLogic/Camera/CameraUtils.cs
Normal file
24
Assets/GameScripts/HotFix/GameLogic/Camera/CameraUtils.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6375b5490bbdcc145a24706a6c4e9cb7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
162
Assets/GameScripts/HotFix/GameLogic/GameApp.cs
Normal file
162
Assets/GameScripts/HotFix/GameLogic/GameApp.cs
Normal file
@@ -0,0 +1,162 @@
|
||||
using GameBase;
|
||||
using TEngine;
|
||||
|
||||
public partial class GameApp:Singleton<GameApp>
|
||||
{
|
||||
/// <summary>
|
||||
/// 热更域App主入口。
|
||||
/// </summary>
|
||||
/// <param name="objects"></param>
|
||||
public static void Entrance(object[] objects)
|
||||
{
|
||||
Log.Warning("======= 看到此条日志代表你成功运行了热更新代码 =======");
|
||||
Log.Warning("======= Entrance GameApp =======");
|
||||
Instance.Init();
|
||||
Instance.Start();
|
||||
Utility.Unity.AddUpdateListener(Instance.Update);
|
||||
Utility.Unity.AddFixedUpdateListener(Instance.FixedUpdate);
|
||||
Utility.Unity.AddLateUpdateListener(Instance.LateUpdate);
|
||||
Utility.Unity.AddDestroyListener(Instance.OnDestroy);
|
||||
Utility.Unity.AddOnDrawGizmosListener(Instance.OnDrawGizmos);
|
||||
Utility.Unity.AddOnApplicationPauseListener(Instance.OnApplicationPause);
|
||||
Instance.StartGameLogic();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开始游戏业务层逻辑。
|
||||
/// <remarks>显示UI、加载场景等。</remarks>
|
||||
/// </summary>
|
||||
private void StartGameLogic()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭游戏。
|
||||
/// </summary>
|
||||
/// <param name="shutdownType">关闭游戏框架类型。</param>
|
||||
public static void Shutdown(ShutdownType shutdownType)
|
||||
{
|
||||
|
||||
if (shutdownType == ShutdownType.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (shutdownType == ShutdownType.Restart)
|
||||
{
|
||||
Utility.Unity.RemoveUpdateListener(Instance.Update);
|
||||
Utility.Unity.RemoveFixedUpdateListener(Instance.FixedUpdate);
|
||||
Utility.Unity.RemoveLateUpdateListener(Instance.LateUpdate);
|
||||
Utility.Unity.RemoveDestroyListener(Instance.OnDestroy);
|
||||
Utility.Unity.RemoveOnDrawGizmosListener(Instance.OnDrawGizmos);
|
||||
Utility.Unity.RemoveOnApplicationPauseListener(Instance.OnApplicationPause);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shutdownType == ShutdownType.Quit)
|
||||
{
|
||||
UnityEngine.Application.Quit();
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPlaying = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
GameTime.StartFrame();
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
logic.OnStart();
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
GameTime.StartFrame();
|
||||
TProfiler.BeginFirstSample("Update");
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
TProfiler.BeginSample(logic.GetType().FullName);
|
||||
logic.OnUpdate();
|
||||
TProfiler.EndSample();
|
||||
}
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
GameTime.StartFrame();
|
||||
TProfiler.BeginFirstSample("FixedUpdate");
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
TProfiler.BeginSample(logic.GetType().FullName);
|
||||
logic.OnFixedUpdate();
|
||||
TProfiler.EndSample();
|
||||
}
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
GameTime.StartFrame();
|
||||
TProfiler.BeginFirstSample("LateUpdate");
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
TProfiler.BeginSample(logic.GetType().FullName);
|
||||
logic.OnLateUpdate();
|
||||
TProfiler.EndSample();
|
||||
}
|
||||
TProfiler.EndFirstSample();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
GameTime.StartFrame();
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
logic.OnDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
GameTime.StartFrame();
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
logic.OnDrawGizmos();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnApplicationPause(bool isPause)
|
||||
{
|
||||
var listLogic = _listLogicMgr;
|
||||
var logicCnt = listLogic.Count;
|
||||
for (int i = 0; i < logicCnt; i++)
|
||||
{
|
||||
var logic = listLogic[i];
|
||||
logic.OnApplicationPause(isPause);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GameScripts/HotFix/GameLogic/GameApp.cs.meta
Normal file
11
Assets/GameScripts/HotFix/GameLogic/GameApp.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5fabb458720ae14bbdb4d781d4ef34e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,55 @@
|
||||
using System.Collections.Generic;
|
||||
using TEngine;
|
||||
|
||||
public partial class GameApp
|
||||
{
|
||||
private List<ILogicSys> _listLogicMgr;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
_listLogicMgr = new List<ILogicSys>();
|
||||
RegisterAllSystem();
|
||||
InitSystemSetting();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置一些通用的系统属性。
|
||||
/// </summary>
|
||||
private void InitSystemSetting()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册所有逻辑系统
|
||||
/// </summary>
|
||||
private void RegisterAllSystem()
|
||||
{
|
||||
//带生命周期的单例系统。
|
||||
AddLogicSys(BehaviourSingleSystem.Instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册逻辑系统。
|
||||
/// </summary>
|
||||
/// <param name="logicSys">ILogicSys</param>
|
||||
/// <returns></returns>
|
||||
protected bool AddLogicSys(ILogicSys logicSys)
|
||||
{
|
||||
if (_listLogicMgr.Contains(logicSys))
|
||||
{
|
||||
Log.Fatal("Repeat add logic system: {0}", logicSys.GetType().Name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!logicSys.OnInit())
|
||||
{
|
||||
Log.Fatal("{0} Init failed", logicSys.GetType().Name);
|
||||
return false;
|
||||
}
|
||||
|
||||
_listLogicMgr.Add(logicSys);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4703541a565f5ec4bb35edd81c28958c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
27
Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef
Normal file
27
Assets/GameScripts/HotFix/GameLogic/GameLogic.asmdef
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "GameLogic",
|
||||
"rootNamespace": "GameLogic",
|
||||
"references": [
|
||||
"GUID:08c3762f54316454ca6b6fbcb22b40e5",
|
||||
"GUID:a90b2d3377c5e4a4db95cc44fb82045e",
|
||||
"GUID:aa06d4cc755c979489c256c1bcca1dfb",
|
||||
"GUID:641632c4f8079b94f963b5284d859a12",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:15fc0a57446b3144c949da3e2b9737a9"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": true,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [
|
||||
{
|
||||
"name": "com.unity.render-pipelines.universal",
|
||||
"expression": "",
|
||||
"define": "ENABLE_URP"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acd6baa97ba40d3478c29cd9c76ff9e3
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
3
Assets/GameScripts/HotFix/GameLogic/Network.meta
Normal file
3
Assets/GameScripts/HotFix/GameLogic/Network.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 145b951be40d41dea06e76bd967a5d15
|
||||
timeCreated: 1682045847
|
@@ -0,0 +1,166 @@
|
||||
using TEngine;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public enum ClientConnectWatcherStatus
|
||||
{
|
||||
StatusInit,
|
||||
StatusReconnectAuto,
|
||||
StatusReconnectConfirm,
|
||||
StatusWaitExit
|
||||
}
|
||||
|
||||
public class ClientConnectWatcher
|
||||
{
|
||||
private readonly GameClient _client;
|
||||
private ClientConnectWatcherStatus _status;
|
||||
private float _statusTime;
|
||||
private int _reconnectCnt = 0;
|
||||
private int _disconnectReason = 0;
|
||||
|
||||
private bool _enable = false;
|
||||
|
||||
public bool Enable
|
||||
{
|
||||
get => _enable;
|
||||
set
|
||||
{
|
||||
if (_enable != value)
|
||||
{
|
||||
_enable = value;
|
||||
if (_enable)
|
||||
{
|
||||
OnEnable();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnDisable();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ClientConnectWatcherStatus Status
|
||||
{
|
||||
get => _status;
|
||||
set
|
||||
{
|
||||
if (_status == value) return;
|
||||
_status = value;
|
||||
_statusTime = NowTime;
|
||||
}
|
||||
}
|
||||
|
||||
private float NowTime => GameTime.unscaledTime;
|
||||
|
||||
public ClientConnectWatcher(GameClient client)
|
||||
{
|
||||
_client = client;
|
||||
_statusTime = NowTime;
|
||||
_status = ClientConnectWatcherStatus.StatusInit;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!_enable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_client.IsEntered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_status)
|
||||
{
|
||||
case ClientConnectWatcherStatus.StatusInit:
|
||||
UpdateOnInitStatus();
|
||||
break;
|
||||
case ClientConnectWatcherStatus.StatusReconnectAuto:
|
||||
UpdateOnReconnectAuto();
|
||||
break;
|
||||
case ClientConnectWatcherStatus.StatusReconnectConfirm:
|
||||
UpdateOnReconnectConfirm();
|
||||
break;
|
||||
case ClientConnectWatcherStatus.StatusWaitExit:
|
||||
UpdateOnWaitExit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnReConnect()
|
||||
{
|
||||
if (_status == ClientConnectWatcherStatus.StatusReconnectConfirm)
|
||||
{
|
||||
Status = ClientConnectWatcherStatus.StatusReconnectAuto;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateOnInitStatus()
|
||||
{
|
||||
int autoReconnectMaxCount = 4;
|
||||
if (_reconnectCnt <= autoReconnectMaxCount)
|
||||
{
|
||||
if (_reconnectCnt == 0)
|
||||
{
|
||||
_disconnectReason = _client.LastNetErrCode;
|
||||
}
|
||||
|
||||
Status = ClientConnectWatcherStatus.StatusReconnectAuto;
|
||||
_reconnectCnt++;
|
||||
|
||||
//重连
|
||||
_client.Reconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ClientConnectWatcherStatus.StatusReconnectConfirm;
|
||||
_reconnectCnt++;
|
||||
// UISys.Mgr.ShowUI(GAME_UI_TYPE.Tip_NetDisconn, UISys.Mgr.GetUIWindowParam().SetParam("errCode", m_disconnectReason));
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateOnReconnectAuto()
|
||||
{
|
||||
if (_client.IsEntered)
|
||||
{
|
||||
Status = ClientConnectWatcherStatus.StatusInit;
|
||||
_reconnectCnt = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
float nowTime = NowTime;
|
||||
var timeoutTime = 10f;
|
||||
|
||||
if (_statusTime + timeoutTime < nowTime)
|
||||
{
|
||||
Log.Error("UpdateOnReconnectAuto timeout: {0}", timeoutTime);
|
||||
|
||||
//切换到默认的,下一帧继续判断是否需要自动还是手动
|
||||
Status = ClientConnectWatcherStatus.StatusInit;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateOnReconnectConfirm()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UpdateOnWaitExit()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Status = ClientConnectWatcherStatus.StatusInit;
|
||||
_reconnectCnt = 0;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
Status = ClientConnectWatcherStatus.StatusInit;
|
||||
_reconnectCnt = 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e4e637f3da340dd9512150c3e2ff087
|
||||
timeCreated: 1684334948
|
428
Assets/GameScripts/HotFix/GameLogic/Network/GameClient.cs
Normal file
428
Assets/GameScripts/HotFix/GameLogic/Network/GameClient.cs
Normal file
@@ -0,0 +1,428 @@
|
||||
using System.Net.Sockets;
|
||||
using GameBase;
|
||||
using GameProto;
|
||||
using TEngine;
|
||||
using CSPkg = GameProto.CSPkg;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
public enum GameClientStatus
|
||||
{
|
||||
StatusInit, //初始化
|
||||
StatusReconnect, //重新连接
|
||||
StatusClose, //断开连接
|
||||
StatusLogin, //登录中
|
||||
StatusEnter, //AccountLogin成功,进入服务器了
|
||||
}
|
||||
|
||||
public enum CsMsgResult
|
||||
{
|
||||
NoError = 0,
|
||||
NetworkError = 1,
|
||||
InternalError = 2,
|
||||
MsgTimeOut = 3,
|
||||
PingTimeOut = 4,
|
||||
}
|
||||
|
||||
//定义消息回报的回调接口
|
||||
public delegate void CsMsgDelegate(CsMsgResult result, CSPkg msg);
|
||||
|
||||
/// <summary>
|
||||
/// 统计网络协议的接口
|
||||
/// </summary>
|
||||
public delegate void CsMsgStatDelegate(int cmdID, int pkgSize);
|
||||
|
||||
public class GameClient : Singleton<GameClient>
|
||||
{
|
||||
private readonly INetworkChannel _channel;
|
||||
|
||||
private GameClientStatus _status = GameClientStatus.StatusInit;
|
||||
|
||||
private readonly MsgDispatcher _dispatcher;
|
||||
|
||||
private readonly ClientConnectWatcher _connectWatcher;
|
||||
|
||||
private float _lastLogDisconnectErrTime = 0f;
|
||||
|
||||
private int _lastNetErrCode = 0;
|
||||
|
||||
public int LastNetErrCode => _lastNetErrCode;
|
||||
|
||||
public GameClientStatus Status
|
||||
{
|
||||
get => _status;
|
||||
set => _status = value;
|
||||
}
|
||||
|
||||
public bool IsEntered => _status == GameClientStatus.StatusEnter;
|
||||
|
||||
/// <summary>
|
||||
/// 连续心跳超时
|
||||
/// </summary>
|
||||
private int _heatBeatTimeoutNum = 0;
|
||||
|
||||
private int _ping = -1;
|
||||
|
||||
private float NowTime => GameTime.unscaledTime;
|
||||
|
||||
private string _lastHost = null;
|
||||
private int _lastPort = 0;
|
||||
|
||||
public GameClient()
|
||||
{
|
||||
_connectWatcher = new ClientConnectWatcher(this);
|
||||
_dispatcher = new MsgDispatcher();
|
||||
_dispatcher.SetTimeout(5f);
|
||||
GameEvent.AddEventListener<INetworkChannel,object>(NetworkEvent.NetworkConnectedEvent,OnNetworkConnected);
|
||||
GameEvent.AddEventListener<INetworkChannel>(NetworkEvent.NetworkClosedEvent,OnNetworkClosed);
|
||||
GameEvent.AddEventListener<INetworkChannel,NetworkErrorCode,SocketError,string>(NetworkEvent.NetworkErrorEvent,OnNetworkError);
|
||||
GameEvent.AddEventListener<INetworkChannel,object>(NetworkEvent.NetworkCustomErrorEvent,OnNetworkCustomError);
|
||||
_channel = Network.Instance.CreateNetworkChannel("GameClient", ServiceType.Tcp, new NetworkChannelHelper());
|
||||
}
|
||||
|
||||
private void OnNetworkConnected(INetworkChannel channel, object userdata)
|
||||
{
|
||||
bool isReconnect = (_status == GameClientStatus.StatusReconnect);
|
||||
//准备登录
|
||||
Status = GameClientStatus.StatusLogin;
|
||||
|
||||
OnServerConnected(isReconnect);
|
||||
}
|
||||
|
||||
private void OnNetworkClosed(INetworkChannel channel)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnNetworkError(INetworkChannel channel, NetworkErrorCode networkErrorCode, SocketError socketError, string errorMessage)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnNetworkCustomError(INetworkChannel channel, object userData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Connect(string host, int port, bool reconnect = false)
|
||||
{
|
||||
ResetParam();
|
||||
if (!reconnect)
|
||||
{
|
||||
SetWatchReconnect(false);
|
||||
}
|
||||
|
||||
if (reconnect)
|
||||
{
|
||||
// GameEvent.Get<ICommUI>().ShowWaitUITip(WaitUISeq.LOGINWORLD_SEQID, G.R(TextDefine.ID_TIPS_RECONNECTING));
|
||||
}
|
||||
else
|
||||
{
|
||||
// GameEvent.Get<ICommUI>().ShowWaitUI(WaitUISeq.LOGINWORLD_SEQID);
|
||||
}
|
||||
|
||||
_lastHost = host;
|
||||
_lastPort = port;
|
||||
|
||||
Status = reconnect ? GameClientStatus.StatusReconnect : GameClientStatus.StatusInit;
|
||||
|
||||
_channel.Connect(host, port);
|
||||
}
|
||||
|
||||
public void Reconnect()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_lastHost) || _lastPort <= 0)
|
||||
{
|
||||
// GameModule.UI.ShowTipMsg("Invalid reconnect param");
|
||||
return;
|
||||
}
|
||||
|
||||
_connectWatcher.OnReConnect();
|
||||
Connect(_lastHost, _lastPort, true);
|
||||
}
|
||||
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
_channel.Close();
|
||||
_status = GameClientStatus.StatusInit;
|
||||
}
|
||||
|
||||
public void OnServerConnected(bool isReconnect)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool SendCsMsg(CSPkg reqPkg)
|
||||
{
|
||||
if (!IsStatusCanSendMsg(reqPkg.Head.MsgId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return DoSendData(reqPkg);
|
||||
}
|
||||
|
||||
public bool IsStatusCanSendMsg(uint msgId)
|
||||
{
|
||||
bool canSend = false;
|
||||
if (_status == GameClientStatus.StatusLogin)
|
||||
{
|
||||
canSend = (msgId == (uint)CSMsgID.CsCmdActLoginReq);
|
||||
}
|
||||
|
||||
if (_status == GameClientStatus.StatusEnter)
|
||||
{
|
||||
canSend = true;
|
||||
}
|
||||
|
||||
if (!canSend)
|
||||
{
|
||||
float nowTime = NowTime;
|
||||
if (_lastLogDisconnectErrTime + 5 < nowTime)
|
||||
{
|
||||
Log.Error("GameClient not connected, send msg failed, msgId[{0}]", msgId);
|
||||
_lastLogDisconnectErrTime = nowTime;
|
||||
}
|
||||
|
||||
//UISys.Mgr.ShowTipMsg(TextDefine.ID_ERR_NETWORKD_DISCONNECT);
|
||||
}
|
||||
|
||||
return canSend;
|
||||
}
|
||||
|
||||
public bool SendCsMsg(CSPkg reqPkg, uint resCmd, CsMsgDelegate resHandler = null, bool needShowWaitUI = true)
|
||||
{
|
||||
if (!IsStatusCanSendMsg(reqPkg.Head.MsgId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var ret = DoSendData(reqPkg);
|
||||
if (!ret)
|
||||
{
|
||||
if (resHandler != null)
|
||||
{
|
||||
resHandler(CsMsgResult.InternalError, null);
|
||||
}
|
||||
|
||||
_dispatcher.NotifyCmdError(resCmd, CsMsgResult.InternalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
//注册消息
|
||||
if (resHandler != null)
|
||||
{
|
||||
_dispatcher.RegSeqHandle(reqPkg.Head.Echo, resCmd, resHandler);
|
||||
if (reqPkg.Head.Echo > 0 && IsWaitingCmd(resCmd) && needShowWaitUI)
|
||||
{
|
||||
// TODO
|
||||
// GameEvent.Get<ICommUI>().ShowWaitUI(reqPkg.Head.Echo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private bool DoSendData(CSPkg reqPkg)
|
||||
{
|
||||
if (!IsIgnoreLog(reqPkg.Head.MsgId))
|
||||
{
|
||||
Log.Debug("[c-s] CmdId[{0}]\n{1}", reqPkg.Head.MsgId, reqPkg.Body.ToString());
|
||||
}
|
||||
var sendRet = _channel.Send(reqPkg);
|
||||
return sendRet;
|
||||
}
|
||||
|
||||
private bool IsIgnoreLog(uint msgId)
|
||||
{
|
||||
bool ignoreLog = false;
|
||||
switch (msgId)
|
||||
{
|
||||
case (uint)CSMsgID.CsCmdHeatbeatReq:
|
||||
case (uint)CSMsgID.CsCmdHeatbeatRes:
|
||||
ignoreLog = true;
|
||||
break;
|
||||
}
|
||||
return ignoreLog;
|
||||
}
|
||||
|
||||
public static bool IsWaitingCmd(uint msgId)
|
||||
{
|
||||
//心跳包不需要读条等待
|
||||
if (msgId == (uint)CSMsgID.CsCmdHeatbeatRes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ResetParam()
|
||||
{
|
||||
_lastLogDisconnectErrTime = 0f;
|
||||
_heatBeatTimeoutNum = 0;
|
||||
_lastHbTime = 0f;
|
||||
_ping = -1;
|
||||
_lastNetErrCode = 0;
|
||||
}
|
||||
|
||||
public void OnUpdate()
|
||||
{
|
||||
_dispatcher.Update();
|
||||
TickHeartBeat();
|
||||
CheckHeatBeatTimeout();
|
||||
_connectWatcher.Update();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册静态消息
|
||||
/// </summary>
|
||||
/// <param name="iCmdID"></param>
|
||||
/// <param name="msgDelegate"></param>
|
||||
public void RegCmdHandle(int iCmdID, CsMsgDelegate msgDelegate)
|
||||
{
|
||||
_dispatcher.RegCmdHandle((uint)iCmdID, msgDelegate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除消息处理函数
|
||||
/// </summary>
|
||||
/// <param name="cmdId"></param>
|
||||
/// <param name="msgDelegate"></param>
|
||||
public void RmvCmdHandle(int cmdId, CsMsgDelegate msgDelegate)
|
||||
{
|
||||
_dispatcher.RmvCmdHandle((uint)cmdId, msgDelegate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置加密密钥
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
public void SetEncryptKey(string key)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置是否需要监控网络重连。
|
||||
/// 登录成功后,开启监控,可以自动重连或者提示玩家重连。
|
||||
/// </summary>
|
||||
/// <param name="needWatch"></param>
|
||||
public void SetWatchReconnect(bool needWatch)
|
||||
{
|
||||
_connectWatcher.Enable = needWatch;
|
||||
}
|
||||
|
||||
public bool IsNetworkOkAndLogin()
|
||||
{
|
||||
return _status == GameClientStatus.StatusEnter;
|
||||
}
|
||||
|
||||
#region 心跳处理
|
||||
|
||||
/// <summary>
|
||||
/// 最近一次心跳的时间
|
||||
/// </summary>
|
||||
private float _lastHbTime = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// 心跳间隔
|
||||
/// </summary>
|
||||
private readonly float _heartBeatDurTime = 5;
|
||||
|
||||
/// <summary>
|
||||
/// 心跳超时的最大次数
|
||||
/// </summary>
|
||||
private const int HeatBeatTimeoutMaxCount = 2;
|
||||
|
||||
private bool CheckHeatBeatTimeout()
|
||||
{
|
||||
if (_heatBeatTimeoutNum >= HeatBeatTimeoutMaxCount)
|
||||
{
|
||||
//断开连接
|
||||
Shutdown();
|
||||
|
||||
//准备重连
|
||||
_heatBeatTimeoutNum = 0;
|
||||
Status = GameClientStatus.StatusClose;
|
||||
Log.Error("heat beat detect timeout");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TickHeartBeat()
|
||||
{
|
||||
if (Status != GameClientStatus.StatusEnter)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var nowTime = NowTime;
|
||||
if (_lastHbTime + _heartBeatDurTime < nowTime)
|
||||
{
|
||||
_lastHbTime = nowTime;
|
||||
|
||||
CSPkg heatPkg = ProtobufUtility.BuildCsMsg((int)CSMsgID.CsCmdHeatbeatReq);
|
||||
heatPkg.Body.HeatBeatReq = new CSHeatBeatReq { HeatEchoTime = _lastHbTime };
|
||||
SendCsMsg(heatPkg, (int)CSMsgID.CsCmdHeatbeatRes, HandleHeatBeatRes);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleHeatBeatRes(CsMsgResult result, CSPkg msg)
|
||||
{
|
||||
if (result != CsMsgResult.NoError)
|
||||
{
|
||||
//如果是超时了,则标记最近收到包的次数
|
||||
if (result == CsMsgResult.MsgTimeOut)
|
||||
{
|
||||
_heatBeatTimeoutNum++;
|
||||
Log.Warning("heat beat timeout: {0}", _heatBeatTimeoutNum);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var resBody = msg.Body.HeatBeatRes;
|
||||
float diffTime = NowTime - resBody.HeatEchoTime;
|
||||
_ping = (int)(diffTime * 1000);
|
||||
_heatBeatTimeoutNum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ping值
|
||||
|
||||
/// <summary>
|
||||
/// ping值
|
||||
/// </summary>
|
||||
public int Ping
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsPingValid())
|
||||
{
|
||||
return _ping / 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPingValid()
|
||||
{
|
||||
if (IsNetworkOkAndLogin())
|
||||
{
|
||||
return _ping >= 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c5441725c9f4d98a7790dc76a6a0c48
|
||||
timeCreated: 1684331687
|
265
Assets/GameScripts/HotFix/GameLogic/Network/MsgDispatcher.cs
Normal file
265
Assets/GameScripts/HotFix/GameLogic/Network/MsgDispatcher.cs
Normal file
@@ -0,0 +1,265 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GameProto;
|
||||
using TEngine;
|
||||
using CSPkg = GameProto.CSPkg;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
internal class MsgHandleDataToRmv
|
||||
{
|
||||
public uint MsgId;
|
||||
public CsMsgDelegate Handle;
|
||||
};
|
||||
|
||||
class MsgDispatcher
|
||||
{
|
||||
const int CheckTimeoutPerframe = 10;
|
||||
const int MaxMsgHandle = 256;
|
||||
|
||||
private readonly CsMsgDelegate[] _aMsgHandles = new CsMsgDelegate[MaxMsgHandle];
|
||||
private readonly float[] _fMsgRegTime = new float[MaxMsgHandle];
|
||||
private readonly UInt32[] _adwMsgRegSeq = new UInt32[MaxMsgHandle]; //因为_aiMsgRegResCmdID存储的是hash,不能保证一定seqid一样,所以这儿存储下,用来校验
|
||||
private readonly uint[] _aiMsgRegResCmdID = new uint[MaxMsgHandle];
|
||||
|
||||
UInt32 _dwLastCheckIndex = 0;
|
||||
|
||||
private readonly Dictionary<uint, List<CsMsgDelegate>> _mapCmdHandle = new Dictionary<uint, List<CsMsgDelegate>>();
|
||||
private readonly List<CsMsgStatDelegate> _listStatHandle = new List<CsMsgStatDelegate>();
|
||||
|
||||
//防止在处理消息的时候又删除了消息映射,所以这儿加了个队列来做个保护
|
||||
private readonly List<MsgHandleDataToRmv> _rmvList = new List<MsgHandleDataToRmv>();
|
||||
private bool _isInHandleLoop = false;
|
||||
private float _timeout = 5;
|
||||
|
||||
// 清理所有的网络消息
|
||||
public void CleanAllNetMsg()
|
||||
{
|
||||
_mapCmdHandle.Clear();
|
||||
}
|
||||
|
||||
public void SetTimeout(float timeout)
|
||||
{
|
||||
_timeout = timeout;
|
||||
}
|
||||
|
||||
public void RegSeqHandle(UInt32 dwMsgSeqID, uint iResCmdID, CsMsgDelegate msgDelegate)
|
||||
{
|
||||
UInt32 hashIndex = dwMsgSeqID % MaxMsgHandle;
|
||||
if (_aMsgHandles[hashIndex] != null)
|
||||
{
|
||||
OnCallSeqHandle(_adwMsgRegSeq[hashIndex], _aiMsgRegResCmdID[hashIndex]);
|
||||
NotifyTimeout(_aMsgHandles[hashIndex]);
|
||||
RmvReg((int)hashIndex);
|
||||
}
|
||||
|
||||
_aMsgHandles[hashIndex] = msgDelegate;
|
||||
_fMsgRegTime[hashIndex] = NowTime;
|
||||
_adwMsgRegSeq[hashIndex] = dwMsgSeqID;
|
||||
_aiMsgRegResCmdID[hashIndex] = iResCmdID;
|
||||
}
|
||||
|
||||
public void RegCmdHandle(uint iCmdID, CsMsgDelegate msgDelegate)
|
||||
{
|
||||
if (!_mapCmdHandle.TryGetValue(iCmdID, out var listHandle))
|
||||
{
|
||||
listHandle = new List<CsMsgDelegate>();
|
||||
_mapCmdHandle[iCmdID] = listHandle;
|
||||
}
|
||||
|
||||
if (listHandle != null)
|
||||
{
|
||||
if (listHandle.Contains(msgDelegate))
|
||||
{
|
||||
Log.Error("-------------repeat RegCmdHandle:{0}-----------", iCmdID);
|
||||
}
|
||||
|
||||
listHandle.Add(msgDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册统计处理接口
|
||||
/// </summary>
|
||||
/// <param name="handler"></param>
|
||||
public void RegCmdStatHandle(CsMsgStatDelegate handler)
|
||||
{
|
||||
_listStatHandle.Add(handler);
|
||||
}
|
||||
|
||||
public void DispatchCmdStat(int cmdID, int pkgSize)
|
||||
{
|
||||
foreach (CsMsgStatDelegate handle in _listStatHandle)
|
||||
{
|
||||
handle(cmdID, pkgSize);
|
||||
}
|
||||
}
|
||||
|
||||
public void RmvCmdHandle(uint iCmdID, CsMsgDelegate msgDelegate)
|
||||
{
|
||||
if (_isInHandleLoop)
|
||||
{
|
||||
MsgHandleDataToRmv toRmvData = new MsgHandleDataToRmv();
|
||||
toRmvData.MsgId = iCmdID;
|
||||
toRmvData.Handle = msgDelegate;
|
||||
|
||||
_rmvList.Add(toRmvData);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_mapCmdHandle.TryGetValue(iCmdID, out var listHandle))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (listHandle != null)
|
||||
{
|
||||
listHandle.Remove(msgDelegate);
|
||||
}
|
||||
}
|
||||
|
||||
public void NotifyCmdError(uint iCmdID, CsMsgResult result)
|
||||
{
|
||||
NotifyCmdHandle(iCmdID, result, default(CSPkg));
|
||||
}
|
||||
|
||||
protected bool NotifyCmdHandle(uint cmdID, CsMsgResult result, CSPkg pkg)
|
||||
{
|
||||
bool ret = false;
|
||||
if (_mapCmdHandle.TryGetValue(cmdID, out var listHandle))
|
||||
{
|
||||
_isInHandleLoop = true;
|
||||
|
||||
var rmvList = _rmvList;
|
||||
rmvList.Clear();
|
||||
foreach (CsMsgDelegate handle in listHandle)
|
||||
{
|
||||
ret = true;
|
||||
|
||||
TProfiler.BeginSample("handle");
|
||||
handle(result, pkg);
|
||||
TProfiler.EndSample();
|
||||
}
|
||||
|
||||
_isInHandleLoop = false;
|
||||
|
||||
//再统一删除掉
|
||||
int rmvCnt = rmvList.Count;
|
||||
for (int i = 0; i < rmvCnt; i++)
|
||||
{
|
||||
var rmvItem = rmvList[i];
|
||||
Log.Error("-------------remove cmd handle on loop:{0}-----------", rmvItem.MsgId);
|
||||
RmvCmdHandle(rmvItem.MsgId, rmvItem.Handle);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
protected void OnCallSeqHandle(UInt32 echoSeq, uint resCmdID)
|
||||
{
|
||||
if (echoSeq > 0)
|
||||
{
|
||||
// TODO
|
||||
// GameEvent.Get<ICommUI>().FinWaitUI(echoSeq);
|
||||
}
|
||||
}
|
||||
|
||||
protected void NotifyTimeout(CsMsgDelegate msgHandler)
|
||||
{
|
||||
msgHandler(CsMsgResult.MsgTimeOut, default(CSPkg));
|
||||
}
|
||||
|
||||
public void NotifySeqError(UInt32 dwSeqID, CsMsgResult result)
|
||||
{
|
||||
UInt32 hashIndex = dwSeqID % MaxMsgHandle;
|
||||
|
||||
//先判断是否有注册的指定消息
|
||||
if (_aMsgHandles[hashIndex] != null &&
|
||||
_adwMsgRegSeq[hashIndex] == dwSeqID)
|
||||
{
|
||||
OnCallSeqHandle(dwSeqID, _aiMsgRegResCmdID[hashIndex]);
|
||||
_aMsgHandles[hashIndex](result, null);
|
||||
|
||||
RmvReg((int)hashIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsCmdFilterNoLog(int cmdID)
|
||||
{
|
||||
switch (cmdID)
|
||||
{
|
||||
case (int)CSMsgID.CsCmdHeatbeatRes:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void NotifyMsg(CSPkg msg)
|
||||
{
|
||||
UInt32 dwSeq = msg.Head.Echo;
|
||||
UInt32 hashIndex = dwSeq % MaxMsgHandle;
|
||||
//判断是否有固定的消息处理流程
|
||||
bool bHaveHandle = NotifyCmdHandle(msg.Head.MsgId, CsMsgResult.NoError, msg);
|
||||
|
||||
//再判断是否有注册的指定消息
|
||||
if (_aMsgHandles[hashIndex] != null &&
|
||||
_adwMsgRegSeq[hashIndex] == dwSeq &&
|
||||
_aiMsgRegResCmdID[hashIndex] == (int)msg.Head.MsgId)
|
||||
{
|
||||
OnCallSeqHandle(_adwMsgRegSeq[hashIndex], _aiMsgRegResCmdID[hashIndex]);
|
||||
_aMsgHandles[hashIndex](CsMsgResult.NoError, msg);
|
||||
RmvReg((int)hashIndex);
|
||||
bHaveHandle = true;
|
||||
}
|
||||
|
||||
if (!bHaveHandle)
|
||||
{
|
||||
Log.Debug("there is no handle for Msg[{0}]", msg.Head.MsgId);
|
||||
}
|
||||
}
|
||||
|
||||
private float NowTime => GameTime.unscaledTime;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
CheckTimeOut();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定时检查是否请求超时。
|
||||
/// </summary>
|
||||
private void CheckTimeOut()
|
||||
{
|
||||
float timeout = _timeout;
|
||||
float nowTime = NowTime;
|
||||
for (int i = 0; i < CheckTimeoutPerframe; i++)
|
||||
{
|
||||
_dwLastCheckIndex = (_dwLastCheckIndex + 1) % MaxMsgHandle;
|
||||
if (_aMsgHandles[_dwLastCheckIndex] != null)
|
||||
{
|
||||
if (_fMsgRegTime[_dwLastCheckIndex] + timeout < nowTime)
|
||||
{
|
||||
Log.Error("msg timeout, resCmdID[{0}], reqSeq[{1}]", _aiMsgRegResCmdID[_dwLastCheckIndex],
|
||||
_adwMsgRegSeq[_dwLastCheckIndex]);
|
||||
|
||||
OnCallSeqHandle(_adwMsgRegSeq[_dwLastCheckIndex], _aiMsgRegResCmdID[_dwLastCheckIndex]);
|
||||
NotifyTimeout(_aMsgHandles[_dwLastCheckIndex]);
|
||||
|
||||
RmvReg((int)_dwLastCheckIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RmvReg(int index)
|
||||
{
|
||||
_aMsgHandles[index] = null;
|
||||
_adwMsgRegSeq[index] = 0;
|
||||
_aiMsgRegResCmdID[index] = 0;
|
||||
_fMsgRegTime[index] = 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d667fb84fed4c5f93a06c464585512f
|
||||
timeCreated: 1684333223
|
@@ -0,0 +1,226 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using GameProto;
|
||||
using Google.Protobuf;
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public CSPkg HeartBeatPack = new CSPkg { Head = new CSPkgHead(), Body = new CSPkgBody() };
|
||||
|
||||
/// <summary>
|
||||
/// 发送心跳消息包。
|
||||
/// </summary>
|
||||
/// <returns>是否发送心跳消息包成功。</returns>
|
||||
public bool SendHeartBeat()
|
||||
{
|
||||
HeartBeatPack.Head.MsgId = (uint)CSMsgID.CsCmdHeatbeatReq;
|
||||
_networkChannel.Send(HeartBeatPack);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 序列化消息包。
|
||||
/// </summary>
|
||||
/// <typeparam name="T">消息包类型。</typeparam>
|
||||
/// <param name="packet">要序列化的消息包。</param>
|
||||
/// <param name="destination">要序列化的目标流。</param>
|
||||
/// <returns>是否序列化成功。</returns>
|
||||
public bool Serialize(CSPkg packet, Stream destination)
|
||||
{
|
||||
if (packet == null)
|
||||
{
|
||||
Log.Warning("Packet is invalid.");
|
||||
return false;
|
||||
}
|
||||
|
||||
_cachedStream.SetLength(_cachedStream.Capacity); // 此行防止 Array.Copy 的数据无法写入
|
||||
_cachedStream.Position = 0L;
|
||||
global::ProtobufUtility.ToStreamWithHead(packet,_cachedStream);
|
||||
_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;
|
||||
PacketHeader packetHeader = MemoryPool.Acquire<PacketHeader>();
|
||||
packetHeader.PacketLength = ((MemoryStream)source).GetBuffer()[0];
|
||||
return packetHeader;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 反序列化消息包。
|
||||
/// </summary>
|
||||
/// <param name="packetHeader">消息包头。</param>
|
||||
/// <param name="source">要反序列化的来源流。</param>
|
||||
/// <param name="customErrorData">用户自定义错误数据。</param>
|
||||
/// <returns>反序列化后的消息包。</returns>
|
||||
public CSPkg 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;
|
||||
}
|
||||
|
||||
CSPkg csPkg = null;
|
||||
if (scPacketHeader.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
csPkg = global::ProtobufUtility.Deserialize(((MemoryStream)source).GetBuffer(),0,scPacketHeader.PacketLength);
|
||||
Log.Debug("[s-c] CmdId[{0}]\n{1}", csPkg.Head.MsgId, csPkg.ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Warning(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning("Packet header is invalid.");
|
||||
}
|
||||
|
||||
MemoryPool.Release(scPacketHeader);
|
||||
return csPkg;
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user