mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03c41461c1 | ||
|
|
7a87c4114c | ||
|
|
eb8233457a | ||
|
|
b08158fd5a | ||
|
|
bdc24381a7 | ||
|
|
60a8edf481 | ||
|
|
1e63b244ec | ||
|
|
9e4fdbb5f1 | ||
|
|
fb94533109 | ||
|
|
6d20996ccd | ||
|
|
112f4beb4a | ||
|
|
be733ccf8b | ||
|
|
6a5ac4d8e6 | ||
|
|
874a68d7c7 | ||
|
|
34286a8101 | ||
|
|
3f5755e553 | ||
|
|
1e938ee8f5 | ||
|
|
384c13c5ac | ||
|
|
6af384649a | ||
|
|
f22e037bb5 | ||
|
|
6bed3676a3 | ||
|
|
93af80f8a1 | ||
|
|
bccc36949c | ||
|
|
1a03ef926c | ||
|
|
73d2514176 | ||
|
|
3e6dff1ae8 | ||
|
|
bad8a177b7 | ||
|
|
6451f9cfd7 | ||
|
|
a2c2c71617 | ||
|
|
cbe8d90eec | ||
|
|
14c48b006f | ||
|
|
b854dc76ab | ||
|
|
066712e887 | ||
|
|
906a651140 | ||
|
|
9dad13af49 | ||
|
|
f4fd18ae5e | ||
|
|
94b0710933 | ||
|
|
8949ea9991 | ||
|
|
e34529e4b5 | ||
|
|
b4ac446eb5 | ||
|
|
9b306b8fdf | ||
|
|
7d2afad6cf | ||
|
|
7ba42aefdf | ||
|
|
80fbfb6448 | ||
|
|
c3feba43d2 | ||
|
|
367cd5004f | ||
|
|
1922aaac3f | ||
|
|
839d1736a5 | ||
|
|
c8af1231e0 | ||
|
|
5eedfcbbd5 | ||
|
|
872d0d69ef | ||
|
|
fce22f30fb | ||
|
|
bc09d55d42 | ||
|
|
e8b801fe1f | ||
|
|
6581d032ba | ||
|
|
6cefef4e22 | ||
|
|
7b62c6b4d9 | ||
|
|
44e2e1c0aa | ||
|
|
52b447ba7c | ||
|
|
9cce012684 | ||
|
|
41de45dce7 | ||
|
|
00275411e4 | ||
|
|
e4bca08f27 | ||
|
|
b5dfab6875 | ||
|
|
84226daca7 | ||
|
|
e2aee25f58 | ||
|
|
ed18f220f0 | ||
|
|
d6278f135e | ||
|
|
d7f08163aa | ||
|
|
ae9b524cf3 | ||
|
|
2cc59b540f | ||
|
|
e6e27b922c | ||
|
|
00f9911127 | ||
|
|
f271460fd1 | ||
|
|
ced2dac458 | ||
|
|
15acc159e8 | ||
|
|
7d75e8d3e1 | ||
|
|
a2a1dc0ec7 | ||
|
|
b354049b89 | ||
|
|
178bcb42a7 | ||
|
|
e0cc85ca7f | ||
|
|
8b232aeffd | ||
|
|
a937052472 | ||
|
|
8c58d13146 | ||
|
|
eb5c88da9a | ||
|
|
6926cd02cb | ||
|
|
2f257d3f95 | ||
|
|
67df0f51ca | ||
|
|
1e648cc3a1 | ||
|
|
ca8501fcdb | ||
|
|
b68a154497 | ||
|
|
e6792484af | ||
|
|
2d9d1d859c | ||
|
|
99459f6cf5 | ||
|
|
ecc6d48830 | ||
|
|
5f44ad2656 | ||
|
|
83418f3635 | ||
|
|
0b570221fc | ||
|
|
172fb32ac8 | ||
|
|
e8a00488b4 | ||
|
|
1392c41ccd | ||
|
|
373e9f7383 | ||
|
|
85aa452117 | ||
|
|
04af153741 | ||
|
|
febee04ea5 | ||
|
|
959631c340 | ||
|
|
292663f572 | ||
|
|
0604b8a341 | ||
|
|
6560b2882d | ||
|
|
755a79642e | ||
|
|
10d7ff65af | ||
|
|
5ae0dbbf3d | ||
|
|
86f48207b3 | ||
|
|
0bd0894547 | ||
|
|
e3540daa19 | ||
|
|
03bd7a962d | ||
|
|
bf6e8497d1 | ||
|
|
1cb60e6be1 | ||
|
|
ee59f14953 | ||
|
|
e293426c27 | ||
|
|
7238ad7cbb | ||
|
|
8938597acf | ||
|
|
b283516cd0 | ||
|
|
42ffc74421 | ||
|
|
4e2b031f05 | ||
|
|
3ce8c93dcb | ||
|
|
68c6a1b1a6 | ||
|
|
28b9b93146 | ||
|
|
ffd73d5e74 | ||
|
|
a83e863f58 | ||
|
|
ef4d9a7fdd | ||
|
|
642ead2f5a | ||
|
|
67e7184f5a | ||
|
|
84f0eccd5b | ||
|
|
f90537b9a5 | ||
|
|
d175fcb401 | ||
|
|
608276b484 | ||
|
|
3eeadc77fc | ||
|
|
003694d930 | ||
|
|
2cdb5b08a4 | ||
|
|
6ac412fad3 | ||
|
|
22323a65b5 | ||
|
|
14f5e6775d | ||
|
|
78678024d5 | ||
|
|
1f9e2b10f9 | ||
|
|
5944c664f1 | ||
|
|
72f77ff1a7 | ||
|
|
41efbdce8e | ||
|
|
d751d5ea2a | ||
|
|
12ef307fe6 | ||
|
|
bc672d6179 | ||
|
|
fbadf6766e | ||
|
|
41502ddefb | ||
|
|
61ca35b1b8 | ||
|
|
cbb4d5e575 | ||
|
|
b37ac428d2 | ||
|
|
f9d17a9896 | ||
|
|
65d4fefd6f | ||
|
|
5e746c7922 | ||
|
|
3c31cb1787 | ||
|
|
b0ea2f8638 | ||
|
|
e38ffc9a40 | ||
|
|
96e2d151f9 | ||
|
|
23fa70496b | ||
|
|
b3f67d3683 | ||
|
|
84e44d7eec | ||
|
|
661d2ce1c0 | ||
|
|
be695cc353 | ||
|
|
6aa8da32ea | ||
|
|
2de4bce9e1 | ||
|
|
56ec4d81ad | ||
|
|
261ad74a74 | ||
|
|
654ade106e | ||
|
|
15970562d7 | ||
|
|
c3fe8198d4 | ||
|
|
593e915dcd | ||
|
|
6d6f195aad | ||
|
|
17814972f4 | ||
|
|
a898c69b79 | ||
|
|
4d473bf69b | ||
|
|
9eb091ead6 | ||
|
|
49f25b255e | ||
|
|
820c3f1795 | ||
|
|
dac1505886 | ||
|
|
2f12c317c4 | ||
|
|
421aeb4c3f | ||
|
|
7dfdd4396f | ||
|
|
4cf4890693 | ||
|
|
dbeef96411 | ||
|
|
c47f5b8edb | ||
|
|
173c95c70d | ||
|
|
993b5e7653 | ||
|
|
bbeca7a6c6 | ||
|
|
845f7e8fd5 | ||
|
|
f2fe362d53 | ||
|
|
53efd23d0f | ||
|
|
8730c457c2 | ||
|
|
1e2e080657 | ||
|
|
a14be2670b | ||
|
|
766fe2c430 | ||
|
|
f7c0aa8e71 | ||
|
|
18563a5063 | ||
|
|
5a12990ce1 | ||
|
|
4c31d56b78 | ||
|
|
9de0e3f9cb | ||
|
|
8ff5685ed8 | ||
|
|
4ac04f9e06 | ||
|
|
f7c993ef22 | ||
|
|
ba68240d77 | ||
|
|
76f1b1f551 | ||
|
|
dc8b9f6423 | ||
|
|
94b26e15c3 | ||
|
|
7ff9146b5e | ||
|
|
2e5421146b | ||
|
|
780041ec27 | ||
|
|
8d13753246 | ||
|
|
1a865a32c0 | ||
|
|
59d7af002b | ||
|
|
9d62fc637a | ||
|
|
da132bdf91 | ||
|
|
0ca80340bc | ||
|
|
93228511c3 | ||
|
|
63b5ca8393 | ||
|
|
9003dbe3fc | ||
|
|
d8181e8dd8 | ||
|
|
60519b39ef | ||
|
|
23d3809cb7 | ||
|
|
6622b3737c | ||
|
|
e00eb972a2 | ||
|
|
e71a244ca6 | ||
|
|
3b6730b60a | ||
|
|
97272bbf0f | ||
|
|
4a68472423 | ||
|
|
51a5163fc1 | ||
|
|
fd3e89c23b | ||
|
|
170a78a0bf | ||
|
|
5b69fd1c7f | ||
|
|
be861dc536 | ||
|
|
6dfff9ff57 | ||
|
|
cbe4f82489 | ||
|
|
01a41fa834 | ||
|
|
cb821a0901 | ||
|
|
4b36a38b21 | ||
|
|
17ebee5b28 | ||
|
|
f0e1b2db98 | ||
|
|
23673aae2a | ||
|
|
ca3b28a089 | ||
|
|
45b5971ede | ||
|
|
ad97b6a817 | ||
|
|
c92716f3e5 | ||
|
|
7538ebe506 | ||
|
|
1c5623ad7d | ||
|
|
eda6c9a1bf | ||
|
|
fc4aec4e4d | ||
|
|
84355c168f | ||
|
|
809e55de82 | ||
|
|
7d606ab1f6 | ||
|
|
14b006dc87 | ||
|
|
840de611dd | ||
|
|
67209cb26e | ||
|
|
caf8c9cf3c | ||
|
|
7746523600 |
No files matched your search
+14
@@ -70,3 +70,17 @@ crashlytics-build.properties
|
||||
# Unity StreamingAssets folder
|
||||
/Assets/StreamingAssets
|
||||
|
||||
# 3rd party plugin/assets
|
||||
/Assets/Hovl Studio
|
||||
/Assets/Hovl Studio.meta
|
||||
/Assets/RealToon
|
||||
/Assets/RealToon.meta
|
||||
|
||||
# VFX prefabs that are using 3rd party assets
|
||||
/Assets/Resources/Prefabs/VFX/PAL3/*.prefab
|
||||
/Assets/Resources/Prefabs/VFX/PAL3/*.meta
|
||||
/Assets/Resources/Prefabs/VFX/PAL3A/*.prefab
|
||||
/Assets/Resources/Prefabs/VFX/PAL3A/*.meta
|
||||
|
||||
# Materials that are using 3rd party assets
|
||||
/Assets/Resources/Materials/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1 +1 @@
|
||||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~·—‘’“”…、。《》【】一丁七万丈三上下不与丐丑专且世丘丙业丛东丝丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乔乖乘乙九乞也习乡书乩买乱乳乾了予争事二于亏云互五井亚些亡交亥亦产亨亩享京亭亮亲人亿什仁仃仅仆仇今介仍从仑仓仔仕他仗付仙仞代令以仪们仰仲仵件价任份仿企伉伍伎伏伐休众优伙会伟传伤伦伪伯估伴伶伸伺似但位低住佐佑体何佘余佛作你佣佩佬佯佳佼使侄侈例侍供依侠侣侥侧侬侮侯侵便促俊俏俐俗保俞信俨俩俪俭修俯俱俸俺倍倏們倒倔倘候倚倜借倦倩倪债值倾假偌偏偕做停健偶偷偿傀傅傍傥储催傲傻像僧僵僻儒儡儿允元兄充兆先光克免兑兔党兢入全八公六兮兰共关兴兵其具典兹养兼兽冀内冈册再冒冕写军农冠冢冤冥冬冯冰冲决况冶冷冻净凄准凉凋凌减凑凛凝几凡凤凭凰凶出击函凿刀刁刃分切刎刑划列刘则刚创初判刨利别刮到制刹刺刻剁剂剃削剌前剐剑剔剖剥剧剩剪副割剿劈力劝办功加务劣动助努劫励劲劳劾势勇勉勘募勤勺勾勿匀包匆匕化北匙匠匪匹区医匾匿十千升午卉半华协卑卒卓单卖南博卜卞占卡卢卦卧卫卯印危即却卵卷卸卿厂厄厅历厉压厌厕厘厚原厢厥厨厮去县叁参又及友双反发叔取受变叛叟口古句另叨叩只叫召叮可台史右叵叶号司叹叽吁吃各吆合吉吊同名后吏吐向吓吕吖吗君吝吞吟否吧吩含听吭启吴吵吸吹吼吾呀呃呆呈告呐呔呕呗员呜呢呦周呱味呵呶呸呻呼命咄咋和咎咏咐咒咔咕咙咦咧咪咬咱咳咶咸咻咽咿哀品哄哇哈哉响哎哑哗哟哥哦哨哩哪哭哮哲哼唆唇唉唐唔唠唤唧唬售唯唱唾啃商啊啥啦啧啬啰啸啼啾喀喂喃善喉喊喋喏喔喘喙喜喝喧喳喵喷喻喽嗅嗓嗔嗖嗜嗟嗤嗦嗨嗬嗯嗳嗽嘀嘉嘎嘘嘛嘞嘟嘱嘲嘴嘻嘿噎噗噜噢噤器噩噪噬噱嚎嚏嚣嚷嚼囊囔囚四回因团园困围固国图圃圆圈土圣在地场圾均坊坍坎坏坐坑块坚坛坝坟坠坡坤坦坪坷垂垃型垒垢垣垫垮埃埋城域埠埤培基堂堆堇堕堡堤堪堰堵塌塑塔塘塞填塾境墓墙墚增墟墨壁壑壤士壬壮声壳壶壹处备复夏夕外夙多夜够大天太夫夭央失头夷夸夹夺奇奈奉奋奎奏契奔奖套奠奢奥女奴奶奸她好如妃妄妆妇妈妍妒妓妖妙妞妥妨妹妻妾姊始姐姑姓委姗姚姜姥姨姬姻姿威娃娄娇娘娜娟娥娲娴娶娼婆婉婕婚婢婪婴婵婶婷婿媒媚媳媵嫁嫂嫉嫌嫔嫖嫡嫣嫦嫩嬉嬷子孑孓孔孕字存孙孚孝孟季孤学孩孪孬孰孵孺孽宁它宅宇守安宋完宏宗官宙定宜宝实宠客宣室宦宫宰害宴宵家容宽宾宿寂寄寅密寇富寐寒寝寞察寡寤寨寰寸对寺寻导寿封射将尊小少尔尖尘尚尝尤尬就尴尸尹尺尼尽尾尿局屁层居屈屋屎屏屐屑展属屠屡山屹岁岂岄岌岑岔岖岗岚岛岩岭岱岳岸峙峡峨峭峰峻崇崎崔崖崩崽嵯嶂巍川州巡巢工左巧巨巫差己已巳巴巷巽巾币市布帅师希帐帔帕帖帚帜帝带席帮帷常帼帽幄幅幌幕幢干平年并幸幺幻幼幽广庄庆庇床序庐库应底店庙庚府庞废度座庭庶康庸廉廊廖延廷建廻廿开异弃弄弊式弑弓引弛弟张弥弦弭弯弱弹强归当录彝形彤彦彩彪彭彰影役彻彼往征径待徇很律徐徒徕得徙御循微德心必忆忌忍忒志忘忙忠忡忧快念忽怀态怄怅怎怒怕怖怜思怠急怦性怨怪怯总恃恋恍恐恒恕恙恢恤恨恩恭息恰恳恶恻恼悄悉悍悔悟悠患悦您悬悯悲悴情惆惊惋惑惕惚惜惟惠惦惧惨惩惬惭惮惯想惶惹惺愁愈意愚感愣愤愧愫愿慈慌慎慑慕慢慧慨慰慷憎憾懂懈懒懦懵戈戊戌戎戏成我戒或战戚戟截戮戴户戾房所扁扇扈扉手才扎扑扒打扔托扛扣执扩扫扬扭扮扯扰扳扶批找承技抄把抑抓投抖抗折抚抛抟抢护报披抬抱抵抹押抽拂担拆拈拉拋拍拎拐拒拓拔拖拘拙招拜拟拢拣拥拦拧拨择括拯拳拷拼拽拾拿持挂指按挑挖挟挠挡挣挤挥挨挪挫振挺挽捅捆捉捌捎捏捐捕捞损捡换捣捧据捶捷掀掂授掉掌掏掐排掘掙掠探接控推掩措掳掷掺揉揍描提插揖握揣揪揭援搁搂搅搏搓搔搜搞搬搭携摄摆摇摈摊摔摘摧摩摸撇撑撒撕撞撤播撰擂擅操擎擒擦攀攒攫支收攸改攻放政故效敌敏救教敛敝敞敢散敬数敲整敷文斋斐斑斗料斛斜斟斤斥斧斩断斯新方於施旁旅旋族旗无既日旦旧旨早旬旭旱时旷旺昂昆昊昌明昏易昔昕昙星映春昧昨昭是昴昼显晃晋晌晒晓晕晖晚晦晧晨普景晰晴晶智晾暂暄暇暑暖暗暮暴曜曦曰曲曳更曹曾替最月有朋服朔朗望朝期木未末本术朱朴朵机朽杀杂权杆杈杉李杏材村杖杜杞束杠条来杨杭杯杰杳杵松板极构枉枕林枚果枝枢枣枪枫枯架枷柄柏某Line truncated
|
||||
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~·—‘’“”…、。《》【】!(),:;?~+一丁七万丈三上下不与丐丑专且世丘丙业丛东丝丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乔乖乘乙九乞也习乡书乩买乱乳乾了予争事二于亏云互五井亚些亡交亥亦产亨亩享京亭亮亲人亿什仁仃仅仆仇今介仍从仑仓仔仕他仗付仙仞代令以仪们仰仲仵件价任份仿企伉伍伎伏伐休众优伙会伟传伤伦伪伯估伴伶伸伺似但位低住佐佑体何佘余佛作你佣佩佬佯佳佼使侄侈例侍供依侠侣侥侧侬侮侯侵便促俊俏俐俗保俞信俨俩俪俭修俯俱俸俺倍倏們倒倔倘候倚倜借倦倩倪债值倾假偌偏偕做停健偶偷偿傀傅傍傥储催傲傻像僧僵僻儒儡儿允元兄充兆先光克免兑兔党兢入全八公六兮兰共关兴兵其具典兹养兼兽冀内冈册再冒冕写军农冠冢冤冥冬冯冰冲决况冶冷冻净凄准凉凋凌减凑凛凝几凡凤凭凰凶出击函凿刀刁刃分切刎刑划列刘则刚创初判刨利别刮到制刹刺刻剁剂剃削剌前剐剑剔剖剥剧剩剪副割剿劈力劝办功加务劣动助努劫励劲劳劾势勇勉勘募勤勺勾勿匀包匆匕化北匙匠匪匹区医匾匿十千升午卉半华协卑卒卓单卖南博卜卞占卡卢卦卧卫卯印危即却卵卷卸卿厂厄厅历厉压厌厕厘厚原厢厥厨厮去县叁参又及友双反发叔取受变叛叟口古句另叨叩只叫召叮可台史右叵叶号司叹叽吁吃各吆合吉吊同名后吏吐向吓吕吖吗君吝吞吟否吧吩含听吭启吴吵吸吹吼吾呀呃呆呈告呐呔呕呗员呜呢呦周呱味呵呶呸呻呼命咄咋和咎咏咐咒咔咕咙咦咧咪咬咱咳咶咸咻咽咿哀品哄哇哈哉响哎哑哗哟哥哦哨哩哪哭哮哲哼唆唇唉唐唔唠唤唧唬售唯唱唾啃商啊啥啦啧啬啰啸啼啾喀喂喃善喉喊喋喏喔喘喙喜喝喧喳喵喷喻喽嗅嗓嗔嗖嗜嗟嗤嗦嗨嗬嗯嗳嗽嘀嘉嘎嘘嘛嘞嘟嘱嘲嘴嘻嘿噎噗噜噢噤器噩噪噬噱嚎嚏嚣嚷嚼囊囔囚四回因团园困围固国图圃圆圈土圣在地场圾均坊坍坎坏坐坑块坚坛坝坟坠坡坤坦坪坷垂垃型垒垢垣垫垮埃埋城域埠埤培基堂堆堇堕堡堤堪堰堵塌塑塔塘塞填塾境墓墙墚增墟墨壁壑壤士壬壮声壳壶壹处备复夏夕外夙多夜够大天太夫夭央失头夷夸夹夺奇奈奉奋奎奏契奔奖套奠奢奥女奴奶奸她好如妃妄妆妇妈妍妒妓妖妙妞妥妨妹妻妾姊始姐姑姓委姗姚姜姥姨姬姻姿威娃娄娇娘娜娟娥娲娴娶娼婆婉婕婚婢婪婴婵婶婷婿媒媚媳媵嫁嫂嫉嫌嫔嫖嫡嫣嫦嫩嬉嬷子孑孓孔孕字存孙孚孝孟季孤学孩孪孬孰孵孺孽宁它宅宇守安宋完宏宗官宙定宜宝实宠客宣室宦宫宰害宴宵家容宽宾宿寂寄寅密寇富寐寒寝寞察寡寤寨寰寸对寺寻导寿封射将尊小少尔尖尘尚尝尤尬就尴尸尹尺尼尽尾尿局屁层居屈屋屎屏屐屑展属屠屡山屹岁岂岄岌岑岔岖岗岚岛岩岭岱岳岸峙峡峨峭峰峻崇崎崔崖崩崽嵯嶂巍川州巡巢工左巧巨巫差己已巳巴巷巽巾币市布帅师希帐帔帕帖帚帜帝带席帮帷常帼帽幄幅幌幕幢干平年并幸幺幻幼幽广庄庆庇床序庐库应底店庙庚府庞废度座庭庶康庸廉廊廖延廷建廻廿开异弃弄弊式弑弓引弛弟张弥弦弭弯弱弹强归当录彝形彤彦彩彪彭彰影役彻彼往征径待徇很律徐徒徕得徙御循微德心必忆忌忍忒志忘忙忠忡忧快念忽怀态怄怅怎怒怕怖怜思怠急怦性怨怪怯总恃恋恍恐恒恕恙恢恤恨恩恭息恰恳恶恻恼悄悉悍悔悟悠患悦您悬悯悲悴情惆惊惋惑惕惚惜惟惠惦惧惨惩惬惭惮惯想惶惹惺愁愈意愚感愣愤愧愫愿慈慌慎慑慕慢慧慨慰慷憎憾懂懈懒懦懵戈戊戌戎戏成我戒或战戚戟截戮戴户戾房所扁扇扈扉手才扎扑扒打扔托扛扣执扩扫扬扭扮扯扰扳扶批找承技抄把抑抓投抖抗折抚抛抟抢护报披抬抱抵抹押抽拂担拆拈拉拋拍拎拐拒拓拔拖拘拙招拜拟拢拣拥拦拧拨择括拯拳拷拼拽拾拿持挂指按挑挖挟挠挡挣挤挥挨挪挫振挺挽捅捆捉捌捎捏捐捕捞损捡换捣捧据捶捷掀掂授掉掌掏掐排掘掙掠探接控推掩措掳掷掺揉揍描提插揖握揣揪揭援搁搂搅搏搓搔搜搞搬搭携摄摆摇摈摊摔摘摧摩摸撇撑撒撕撞撤播撰擂擅操擎擒擦攀攒攫支收攸改攻放政故效敌敏救教敛敝敞敢散敬数敲整敷文斋斐斑斗料斛斜斟斤斥斧斩断斯新方於施旁旅旋族旗无既日旦旧旨早旬旭旱时旷旺昂昆昊昌明昏易昔昕昙星映春昧昨昭是昴昼显晃晋晌晒晓晕晖晚晦晧晨普景晰晴晶智晾暂暄暇暑暖暗暮暴曜曦曰曲曳更曹曾替最月有朋服朔朗望朝期木未末本术朱朴朵机朽杀杂权杆杈杉李杏材村杖杜杞束杠条来杨杭杯杰杳杵松板极构枉枕林枚果枝枢Line truncated
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b0b27c9e5e4d2e4fbc9b6584f828f7b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File renamed without changes.
@@ -0,0 +1,54 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
reference: https://www.shadertoy.com/view/MsKXDh
|
||||
*/
|
||||
|
||||
Shader "Pal3/PostEffectDistortion"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_TimeScale ("Time Scale",float) = 4.0
|
||||
_XFactor ("X Factor",float) = 15.0
|
||||
_YFactor("Y Factor",float) = 10.0
|
||||
}
|
||||
|
||||
HLSLINCLUDE
|
||||
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
||||
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
||||
|
||||
float _TimeScale;
|
||||
float _XFactor;
|
||||
float _YFactor;
|
||||
|
||||
float4 Frag(VaryingsDefault i) : SV_Target
|
||||
{
|
||||
float2 uv = i.texcoord;
|
||||
const float time = _Time.y;
|
||||
|
||||
uv.x += sin(uv.y * _XFactor + time * _TimeScale) / 400.0;
|
||||
uv.y += cos(uv.x * _YFactor + time * _TimeScale) / 450.0;
|
||||
|
||||
uv.x += sin((uv.y+uv.x) * _XFactor + time * _TimeScale) / (180.0 + (_TimeScale * sin(time)));
|
||||
uv.y += cos((uv.y+uv.x) * _YFactor + time * _TimeScale) / (200.0 + (_TimeScale * sin(time)));
|
||||
|
||||
float4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex,uv);
|
||||
return col;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
SubShader
|
||||
{
|
||||
Cull Off ZWrite Off ZTest Always
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex VertDefault
|
||||
#pragma fragment Frag
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b8bcccc572f924448668c94cfa547b4
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+174
@@ -44,6 +44,105 @@ MonoBehaviour:
|
||||
opacity:
|
||||
overrideState: 0
|
||||
value: 1
|
||||
--- !u!114 &-8365138130595697379
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb4ad18ac69b12845a429aba13929a07, type: 3}
|
||||
m_Name: Distortion
|
||||
m_EditorClassIdentifier:
|
||||
active: 0
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
timeScale:
|
||||
overrideState: 0
|
||||
value: 4
|
||||
xFactor:
|
||||
overrideState: 0
|
||||
value: 15
|
||||
yFactor:
|
||||
overrideState: 0
|
||||
value: 10
|
||||
--- !u!114 &-806185241644601601
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb4ad18ac69b12845a429aba13929a07, type: 3}
|
||||
m_Name: Distortion
|
||||
m_EditorClassIdentifier:
|
||||
active: 1
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
timeScale:
|
||||
overrideState: 0
|
||||
value: 4
|
||||
xFactor:
|
||||
overrideState: 0
|
||||
value: 15
|
||||
yFactor:
|
||||
overrideState: 0
|
||||
value: 10
|
||||
--- !u!114 &-804113543285745465
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c1cb7e9e120078f43bce4f0b1be547a7, type: 3}
|
||||
m_Name: AmbientOcclusion
|
||||
m_EditorClassIdentifier:
|
||||
active: 0
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
mode:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
intensity:
|
||||
overrideState: 1
|
||||
value: 0.25
|
||||
color:
|
||||
overrideState: 0
|
||||
value: {r: 0, g: 0, b: 0, a: 1}
|
||||
ambientOnly:
|
||||
overrideState: 0
|
||||
value: 1
|
||||
noiseFilterTolerance:
|
||||
overrideState: 0
|
||||
value: 0
|
||||
blurTolerance:
|
||||
overrideState: 0
|
||||
value: -4.6
|
||||
upsampleTolerance:
|
||||
overrideState: 0
|
||||
value: -12
|
||||
thicknessModifier:
|
||||
overrideState: 0
|
||||
value: 1
|
||||
directLightingStrength:
|
||||
overrideState: 0
|
||||
value: 0
|
||||
radius:
|
||||
overrideState: 0
|
||||
value: 0.25
|
||||
quality:
|
||||
overrideState: 0
|
||||
value: 2
|
||||
--- !u!114 &-118557119588518591
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
@@ -1370,3 +1469,78 @@ MonoBehaviour:
|
||||
settings:
|
||||
- {fileID: -118557119588518591}
|
||||
- {fileID: -8887095760420704611}
|
||||
- {fileID: 455792505896753558}
|
||||
- {fileID: -804113543285745465}
|
||||
- {fileID: -8365138130595697379}
|
||||
--- !u!114 &455792505896753558
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 48a79b01ea5641d4aa6daa2e23605641, type: 3}
|
||||
m_Name: Bloom
|
||||
m_EditorClassIdentifier:
|
||||
active: 0
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
intensity:
|
||||
overrideState: 1
|
||||
value: 5
|
||||
threshold:
|
||||
overrideState: 1
|
||||
value: 1.3
|
||||
softKnee:
|
||||
overrideState: 1
|
||||
value: 0.5
|
||||
clamp:
|
||||
overrideState: 0
|
||||
value: 65472
|
||||
diffusion:
|
||||
overrideState: 0
|
||||
value: 7
|
||||
anamorphicRatio:
|
||||
overrideState: 0
|
||||
value: 0
|
||||
color:
|
||||
overrideState: 0
|
||||
value: {r: 1, g: 1, b: 1, a: 1}
|
||||
fastMode:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
dirtTexture:
|
||||
overrideState: 0
|
||||
value: {fileID: 0}
|
||||
defaultState: 1
|
||||
dirtIntensity:
|
||||
overrideState: 0
|
||||
value: 0
|
||||
--- !u!114 &954549172052332416
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 3
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb4ad18ac69b12845a429aba13929a07, type: 3}
|
||||
m_Name: Distortion
|
||||
m_EditorClassIdentifier:
|
||||
active: 0
|
||||
enabled:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
timeScale:
|
||||
overrideState: 0
|
||||
value: 4
|
||||
xFactor:
|
||||
overrideState: 0
|
||||
value: 15
|
||||
yFactor:
|
||||
overrideState: 0
|
||||
value: 10
|
||||
File renamed without changes.
@@ -100,9 +100,9 @@ MonoBehaviour:
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 0.78431374}
|
||||
m_HighlightedColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0.78431374}
|
||||
m_PressedColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.78431374}
|
||||
m_SelectedColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0.9019608}
|
||||
m_HighlightedColor: {r: 0.11764706, g: 0.29411766, b: 0.54901963, a: 0.78431374}
|
||||
m_PressedColor: {r: 0.078431375, g: 0.19607843, b: 0.39215687, a: 0.78431374}
|
||||
m_SelectedColor: {r: 0.11764706, g: 0.29411766, b: 0.54901963, a: 0.78431374}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
|
||||
@@ -11,6 +11,18 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: IngameDebugConsole
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11414302, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11420596, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11437802, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11452418, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: toggleBinding.m_Id
|
||||
value: 06175ea3-1b47-4b6e-bcd7-4d191ce555d1
|
||||
@@ -19,6 +31,18 @@ PrefabInstance:
|
||||
propertyPath: toggleBinding.m_SingletonActionBindings.Array.data[0].m_Id
|
||||
value: badbacc7-7d97-42d1-ac38-980883100f6e
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11466918, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11472314, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 11477250, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
@@ -235,6 +259,22 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114000010993257018, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114466839828933532, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114664465529608634, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114786672304321734, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_Navigation.m_Mode
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
@@ -286,36 +326,3 @@ PrefabInstance:
|
||||
m_RemovedComponents:
|
||||
- {fileID: 11492840, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
--- !u!1 &2755888773260686779 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 109254, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3}
|
||||
m_PrefabInstance: {fileID: 2755888773260713853}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &2755888771526933940
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2755888773260686779}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_MoveRepeatDelay: 0.5
|
||||
m_MoveRepeatRate: 0.1
|
||||
m_XRTrackingOrigin: {fileID: 0}
|
||||
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
|
||||
m_DeselectOnBackgroundClick: 0
|
||||
m_PointerBehavior: 0
|
||||
@@ -166,7 +166,6 @@ GameObject:
|
||||
- component: {fileID: 311849592}
|
||||
- component: {fileID: 311849591}
|
||||
- component: {fileID: 311849595}
|
||||
- component: {fileID: 311849594}
|
||||
- component: {fileID: 7927220425085558669}
|
||||
m_Layer: 0
|
||||
m_Name: GameCamera
|
||||
@@ -204,9 +203,17 @@ Camera:
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
@@ -221,7 +228,7 @@ Camera:
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 55
|
||||
m_Bits: 63
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
@@ -242,102 +249,6 @@ AudioListener:
|
||||
m_GameObject: {fileID: 311849590}
|
||||
m_Enabled: 1
|
||||
--- !u!82 &311849595
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 311849590}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 0}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!82 &311849594
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -440,7 +351,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 311849590}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
|
||||
m_Name:
|
||||
@@ -448,7 +359,7 @@ MonoBehaviour:
|
||||
volumeTrigger: {fileID: 311849593}
|
||||
volumeLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 55
|
||||
m_Bits: 136
|
||||
stopNaNPropagation: 0
|
||||
finalBlitToCameraTarget: 0
|
||||
antialiasingMode: 0
|
||||
@@ -460,7 +371,7 @@ MonoBehaviour:
|
||||
subpixelMorphologicalAntialiasing:
|
||||
quality: 2
|
||||
fastApproximateAntialiasing:
|
||||
fastMode: 0
|
||||
fastMode: 1
|
||||
keepAlpha: 0
|
||||
fog:
|
||||
enabled: 1
|
||||
@@ -492,7 +403,9 @@ MonoBehaviour:
|
||||
breakBeforeColorGrading: 0
|
||||
m_BeforeTransparentBundles: []
|
||||
m_BeforeStackBundles: []
|
||||
m_AfterStackBundles: []
|
||||
m_AfterStackBundles:
|
||||
- assemblyQualifiedName: Pal3.Effect.PostProcessing.Distortion, Pal3, Version=0.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!1 &768200630232143376
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -554,6 +467,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 9999
|
||||
m_TargetDisplay: 0
|
||||
@@ -951,7 +865,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -1164,7 +1078,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
@@ -1320,6 +1234,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@@ -1708,6 +1623,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@@ -1811,6 +1727,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 999
|
||||
m_TargetDisplay: 0
|
||||
@@ -1925,6 +1842,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 1000
|
||||
m_TargetDisplay: 0
|
||||
@@ -2053,6 +1971,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 1000
|
||||
m_TargetDisplay: 0
|
||||
@@ -2411,6 +2330,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@@ -2852,7 +2772,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 5491488055271105370}
|
||||
- component: {fileID: 8346885185333560231}
|
||||
m_Layer: 0
|
||||
m_Layer: 3
|
||||
m_Name: PostProcessVolume
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
@@ -3322,6 +3242,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 10001
|
||||
m_TargetDisplay: 0
|
||||
@@ -3519,6 +3440,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 1000
|
||||
m_TargetDisplay: 0
|
||||
@@ -3654,6 +3576,7 @@ VideoPlayer:
|
||||
m_RenderMode: 2
|
||||
m_AspectRatio: 2
|
||||
m_DataSource: 0
|
||||
m_TimeUpdateMode: 2
|
||||
m_PlaybackSpeed: 1
|
||||
m_AudioOutputMode: 2
|
||||
m_TargetAudioSources:
|
||||
@@ -3732,6 +3655,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 10000
|
||||
m_TargetDisplay: 0
|
||||
@@ -3833,6 +3757,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@@ -3933,6 +3858,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@@ -4132,7 +4058,6 @@ MonoBehaviour:
|
||||
mainCamera: {fileID: 311849592}
|
||||
curtainImage: {fileID: 147356289}
|
||||
musicSource: {fileID: 311849595}
|
||||
sfxSource: {fileID: 311849594}
|
||||
videoPlayerCanvas: {fileID: 5102776189801015787}
|
||||
videoPlayer: {fileID: 4844794614659113022}
|
||||
noteCanvasGroup: {fileID: 6941303344842138483}
|
||||
@@ -4403,6 +4328,7 @@ Canvas:
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
@@ -4411,6 +4337,7 @@ PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8627381932629902483}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2675203688159455099, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
@@ -4690,6 +4617,9 @@ PrefabInstance:
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 3ef1d32c83f86744286e2067bc5f73e4, type: 3}
|
||||
--- !u!224 &9166793672834059380 stripped
|
||||
RectTransform:
|
||||
|
||||
@@ -100,9 +100,9 @@ MonoBehaviour:
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 0, g: 0, b: 0, a: 0.7058824}
|
||||
m_HighlightedColor: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 0.6666667}
|
||||
m_PressedColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.6666667}
|
||||
m_SelectedColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0.9019608}
|
||||
m_HighlightedColor: {r: 0.11764706, g: 0.29411766, b: 0.54901963, a: 0.6666667}
|
||||
m_PressedColor: {r: 0.07450981, g: 0.19607843, b: 0.39215687, a: 0.6666667}
|
||||
m_SelectedColor: {r: 0.11764706, g: 0.29411766, b: 0.54901963, a: 0.9019608}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
|
||||
@@ -100,9 +100,9 @@ MonoBehaviour:
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 0.15686275, g: 0.15686275, b: 0.15686275, a: 0.78431374}
|
||||
m_HighlightedColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0.78431374}
|
||||
m_PressedColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.78431374}
|
||||
m_SelectedColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0.9019608}
|
||||
m_HighlightedColor: {r: 0.11764706, g: 0.29411766, b: 0.54901963, a: 0.78431374}
|
||||
m_PressedColor: {r: 0.07450981, g: 0.19607843, b: 0.39215687, a: 0.78431374}
|
||||
m_SelectedColor: {r: 0.11764706, g: 0.29411766, b: 0.54901963, a: 0.9019608}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2eaeb845461401e488e4640caf779ddf
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b93923849ec63ad4ea52f79bf5bc9cb6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
因为当前特效的实现方式使用了第三方插件和素材,所以此文件夹内的所有prefab均添加进了gitignore里。
|
||||
请联系作者了解插件获取方式和特效prefab的获取方式。
|
||||
|
||||
0 => 传送法阵特效
|
||||
|
||||
15 => 单人传送特效
|
||||
98 => 重楼施法帮龙葵恢复肉身时的特效
|
||||
175 => 邪剑仙迷倒众人的特效
|
||||
224 => 丁小侠剧情狼妖受击特效
|
||||
251 => 邪剑仙变身特效
|
||||
252 => 邪剑仙传送离开时的特效
|
||||
254 => 重楼传送法术特效
|
||||
255 => 龙葵穿衣服的特效
|
||||
256 => 龙葵治疗他人特效
|
||||
257 => 治疗咒施法特效
|
||||
259 => 大型传送法施法前奏特效
|
||||
260 => 大型传送法阵特效收尾
|
||||
261 => 大型传送法阵特效开始
|
||||
262 => 重楼当剑的时候剑插入地面的火光特效
|
||||
263 => 火鬼王消失特效
|
||||
264 => 古藤精施法特效
|
||||
265 => 人物受到法术作用时候的特效
|
||||
266 => 邪剑仙施法特效
|
||||
270 => 天鬼皇复活后灵魂出窍特效
|
||||
275 => 重楼创建的用来禁锢雪见/龙葵的法阵特效
|
||||
276 => 迴魂施法结束特效
|
||||
277 => 迴魂施法完全结束特效
|
||||
278 => 迴魂施法特效
|
||||
290 => 雪见传送出现时特效
|
||||
295 => 重楼施法治疗特效
|
||||
297 => 紫萱施法召唤水灵特效
|
||||
337 => 古藤精风系法术特效
|
||||
341 => 邪剑仙给镇妖剑施法特效
|
||||
368 => 雷击单体施法特效
|
||||
369 => 雷击范围施法特效
|
||||
376 => 紫萱的土系法术特效
|
||||
389 => 紫萱给江姑娘施法特效
|
||||
452 => 花楹治疗他人特效
|
||||
453 => 人物施法蓄力时的特效
|
||||
454 => 龙葵施法让众人御剑飞行的特效
|
||||
456 => 老婆婆施法特效
|
||||
457 => 夕瑶给景天施法时的特效
|
||||
458 => 灵力溢出特效
|
||||
467 => 邪剑仙灰飞烟灭特效
|
||||
468 => 蓝龙葵变红龙葵的特效
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 815b64a4a03e7b949bd85e1e5c19deb3
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a637ebcead3359c4f849f936d41707ee
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
因为当前特效的实现方式使用了第三方插件和素材,所以此文件夹内的所有prefab均添加进了gitignore里。
|
||||
请联系作者了解插件获取方式和特效prefab的获取方式。
|
||||
|
||||
0 => 传送法阵特效
|
||||
9 => 茅山道士封印法术特效
|
||||
40 => 单体风咒特效
|
||||
50 => 单体雷咒特效
|
||||
91 => 封印法术特效
|
||||
157 => 角色传送出现特效
|
||||
164 => 南宫煌变身狼形态时的特效
|
||||
170 => 王蓬絮变身特效
|
||||
171 => 人物施法特效
|
||||
172 => 人物受到法术作用时候的特效
|
||||
173 => 人物受到法术作用时候的特效
|
||||
174 => 治疗特效
|
||||
175 => 茅山术士打乱三杯盏特效
|
||||
176 => 南宫煌打乱三杯盏特效
|
||||
177 => 角色传送消失时的特效
|
||||
178 => 南宫煌使关桃子的笼子消失的特效
|
||||
179 => 南宫煌变出法桌的特效
|
||||
181 => 南宫煌变出小东西的特效
|
||||
182 => 南宫煌变出大东西的特效
|
||||
186 => 大石块砸下后的尘土特效
|
||||
189 => 地脉石门封印打开时的特效
|
||||
198 => 南宫煌变出东西的特效
|
||||
201 => 魁妖变小特效
|
||||
205 => 照妖镜发光的特效
|
||||
209 => 五灵轮特效
|
||||
211 => 洒金笺特效
|
||||
230 => 重楼施法消灭怪物的特效
|
||||
254 => 重楼传送特效
|
||||
257 => 隔空取物特效
|
||||
258 => 迴魂传送特效
|
||||
259 => 大型传送法施法前奏特效
|
||||
260 => 大型传送法阵特效收尾
|
||||
261 => 大型传送法阵特效开始
|
||||
281 => 角色传送消失时的特效
|
||||
282 => 雷咒特效
|
||||
283 => 物品消失时的特效
|
||||
285 => 南宫煌施法特效
|
||||
287 => 土灵珠特效
|
||||
289 => 血魂姬施法特效
|
||||
290 => 回复法阵特效
|
||||
292 => 五灵轮发光特效
|
||||
299 => 重楼传送众人特效
|
||||
314 => 倾国银弹波特效
|
||||
315 => 南宫煌切换为人形态特效
|
||||
316 => 魔物出现特效
|
||||
318 => 千凝魔艮特效
|
||||
320 => 幽娘变身特效
|
||||
322 => 幽娘吸收怨气特效
|
||||
323 => 幽娘收集怨气特效
|
||||
325 => 陆北亭变身特效
|
||||
328 => 风雅颂开心的特效
|
||||
333 => 感月出现特效
|
||||
355 => 王蓬絮治疗特效
|
||||
359 => 蝎魃消失特效
|
||||
360 => 星璇给南宫煌输入内力时的特效
|
||||
367 => 五毒珠治疗特效
|
||||
388 => 迴魂传送特效
|
||||
389 => 迴魂传送特效
|
||||
397 => 燎日变身特效
|
||||
401 => 魔尊帮星璇灵肉合一的特效
|
||||
404 => 思堂消失特效
|
||||
408 => 星璇燎日变换时特效
|
||||
424 => 王蓬絮对南宫煌施法特效
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1d950c46b3119043a1919074fdc27c5
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f33d244048b1054a8753633da7ffe28
|
||||
guid: fcd2231fc0b299247b47f42991d73ab5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -10,14 +10,16 @@ Shader "Pal3/Dev"
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
|
||||
LOD 100
|
||||
|
||||
ZWrite Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass {
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
@@ -63,4 +65,4 @@ Shader "Pal3/Dev"
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -1,33 +1,30 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/Standard"
|
||||
Shader "Pal3/Opaque"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_ShadowTex ("Shadow map (RGB)", 2D) = "white" {}
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.0
|
||||
_Exposure("Exposure Amount", Range(0.1,1.0)) = 0.4
|
||||
_Transparency("Transparency Amount", Range(0.1,1.0)) = 1.0
|
||||
_TintColor ("Tint color", Color) = (1.0, 1.0, 1.0, 1.0)
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="TransparentCutout" }
|
||||
LOD 100
|
||||
|
||||
Lighting Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
|
||||
Tags { "QUEUE" = "Geometry" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "Qeueue" = "Geometry" }
|
||||
Blend Off
|
||||
ZWrite On
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
@@ -44,18 +41,18 @@ Shader "Pal3/Standard"
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
UNITY_FOG_COORDS(2)
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _TintColor;
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
fixed _Cutoff;
|
||||
float _Exposure;
|
||||
float _Transparency;
|
||||
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
@@ -64,22 +61,18 @@ Shader "Pal3/Standard"
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.shadowcoord = TRANSFORM_TEX(v.shadowcoord, _ShadowTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord);
|
||||
|
||||
// Cutout
|
||||
clip(color.a - _Cutoff);
|
||||
// Shadow
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
// Transparency
|
||||
color.a = _Transparency;
|
||||
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
}
|
||||
color *= _TintColor;
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a83b1b6f4822140d58c7bad4e3b39932
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
Shader "Pal3/Sprite"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" }
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend SrcAlpha One
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
fixed4 col = tex2D(_MainTex, i.uv);
|
||||
col.a = 1.0f; // force alpha to 1 to avoid transparency
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6122fb5a4bad8433982c0407309f8dbf
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,97 @@
|
||||
Shader "Pal3/Transparent"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_TintColor ("Tint color", Color) = (1.0, 1.0, 1.0, 1.0)
|
||||
_Threshold ("Transparent Threshold", Range(0, 1)) = 1.0
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendSrcFactor("Source Blend Factor", int) = 5 // BlendMode.SrcAlpha as Default
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendDstFactor("Dest Blend Factor", int) = 10 // BlendMode.OneMinusSrcAlpha as Default
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
Tags { "Queue" = "Transparent" }
|
||||
|
||||
// Pass 2 ,transparent part
|
||||
Pass
|
||||
{
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float _Threshold;
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
|
||||
float4 _TintColor;
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.shadowcoord = TRANSFORM_TEX(v.shadowcoord, _ShadowTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord);
|
||||
const float alpha = color.a;
|
||||
if(color.a >= _Threshold)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
color.a = alpha;
|
||||
}
|
||||
color *= _TintColor;
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a73f8d5b84814e63a97995e839fdabb
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+31
-26
@@ -1,32 +1,31 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Pal3/StandardNoShadow"
|
||||
Shader "Pal3/TransparentOpaquePart"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.0
|
||||
_TintColor ("Tint color", Color) = (1.0, 1.0, 1.0, 1.0)
|
||||
_Transparency("Transparency Amount", Range(0.1,1.0)) = 1.0
|
||||
_Threshold ("Transparent Threshold", Range(0, 1)) = 1.0
|
||||
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
_ShadowTex ("Shadow Texture", 2D) = "white" {}
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.4
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="TransparentCutout" }
|
||||
LOD 100
|
||||
|
||||
Lighting Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
|
||||
Tags { "Qeueue" = "Geometry" }
|
||||
|
||||
// pass 1 , opaque part
|
||||
Pass
|
||||
{
|
||||
Blend Off
|
||||
ZWrite On
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
@@ -34,6 +33,7 @@ Shader "Pal3/StandardNoShadow"
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
@@ -41,15 +41,21 @@ Shader "Pal3/StandardNoShadow"
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
UNITY_FOG_COORDS(1)
|
||||
float2 shadowcoord : TEXCOORD1;
|
||||
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
fixed _Cutoff;
|
||||
half4 _TintColor;
|
||||
float _Transparency;
|
||||
float _Threshold;
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
float _Exposure;
|
||||
|
||||
float4 _TintColor;
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
@@ -58,22 +64,21 @@ Shader "Pal3/StandardNoShadow"
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
UNITY_TRANSFER_FOG(o, o.vertex);
|
||||
o.shadowcoord = TRANSFORM_TEX(v.shadowcoord, _ShadowTex);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
half4 color = tex2D(_MainTex, i.texcoord);
|
||||
clip(color.a - _Threshold);
|
||||
|
||||
// Cutout
|
||||
clip(color.a - _Cutoff);
|
||||
// Tint color
|
||||
if(_HasShadowTex > 0.5f)
|
||||
{
|
||||
color *= tex2D(_ShadowTex, i.shadowcoord) / (1 - _Exposure);
|
||||
}
|
||||
color *= _TintColor;
|
||||
// Transparency
|
||||
color.a = _Transparency;
|
||||
|
||||
UNITY_APPLY_FOG(i.fogCoord, color);
|
||||
return color;
|
||||
}
|
||||
ENDCG
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 784c49f60e0c64f6595ed503bd3a3a69
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,91 @@
|
||||
Shader "Pal3/Water"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
// main texture
|
||||
_MainTex ("Main texture", 2D) = "white" {}
|
||||
|
||||
// alpha value
|
||||
_Alpha ("Alpha",Range(0, 1)) = 0.5
|
||||
|
||||
_Exposure("Exposure Amount", Range(0.1, 1.0)) = 0.3
|
||||
|
||||
// pre baked shadow texture
|
||||
_ShadowTex ("Shadow texture", 2D) = "white" {}
|
||||
_HasShadowTex ("Has Shadow Texture", Range(0, 1)) = 0.0
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendSrcFactor("Source Blend Factor", int) = 5 // BlendMode.SrcAlpha as Default
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_BlendDstFactor("Dest Blend Factor", int) = 10 // BlendMode.OneMinusSrcAlpha as Default
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Lighting Off
|
||||
|
||||
Tags { "QUEUE" = "Transparent-1" } // -1 to fix sorting order issue with semi-transparent trees etc.
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend [_BlendSrcFactor] [_BlendDstFactor]
|
||||
ZWrite Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 texcoord2 : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 texcoord2 : TEXCOORD1;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
float _Alpha;
|
||||
float _Exposure;
|
||||
|
||||
float _HasShadowTex;
|
||||
sampler2D _ShadowTex;
|
||||
float4 _ShadowTex_ST;
|
||||
|
||||
v2f vert(appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.texcoord2 = TRANSFORM_TEX(v.texcoord2, _ShadowTex);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : SV_Target
|
||||
{
|
||||
const half4 color = tex2D(_MainTex, i.texcoord);
|
||||
const half4 colorShadow = tex2D(_ShadowTex, i.texcoord2);
|
||||
half4 mixedColor = color * colorShadow / (1 - _Exposure);
|
||||
mixedColor.a = _Alpha; // use global alpha
|
||||
return mixedColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54296b5ef906d4d219289838c47b2f01
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -18,7 +18,7 @@ RenderTexture:
|
||||
m_Height: 448
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 94
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 8
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
||||
@@ -24,7 +24,7 @@ RenderSettings:
|
||||
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.3
|
||||
m_AmbientMode: 0
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
@@ -97,8 +97,8 @@ LightmapSettings:
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 112000000, guid: c9e1768594f6afd479e0380c47ec2784, type: 2}
|
||||
m_LightingSettings: {fileID: 4890085278179872738, guid: c3e8b810b348ed54ba97c7a4ee44d9eb, type: 2}
|
||||
m_LightingDataAsset: {fileID: 112000000, guid: b024d577cdecd974eab12c932a37f51b, type: 2}
|
||||
m_LightingSettings: {fileID: 4890085278179872738, guid: b0ad69fd7711b6842b5f287b194ede35, type: 2}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#if UNITY_EDITOR_OSX
|
||||
|
||||
namespace Build.Editor
|
||||
{
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEditor.iOS.Xcode;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Set NSPrefersDisplaySafeAreaCompatibilityMode in XCode project settings (Info.plist)
|
||||
/// </summary>
|
||||
public static class SetDisplaySafeAreaCompatibilityModeProcessor
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
|
||||
{
|
||||
if (buildTarget != BuildTarget.StandaloneOSX) return;
|
||||
|
||||
// Get plist
|
||||
#if PAL3
|
||||
string plistPath = pathToBuiltProject + "/PAL3/Info.plist";
|
||||
#elif PAL3A
|
||||
string plistPath = pathToBuiltProject + "/PAL3A/Info.plist";
|
||||
#endif
|
||||
|
||||
PlistDocument plist = new PlistDocument();
|
||||
plist.ReadFromString(File.ReadAllText(plistPath));
|
||||
|
||||
// Get root
|
||||
PlistElementDict rootDict = plist.root;
|
||||
|
||||
rootDict.SetBoolean("NSPrefersDisplaySafeAreaCompatibilityMode", false);
|
||||
|
||||
// Write to file
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
|
||||
Debug.Log("NSPrefersDisplaySafeAreaCompatibilityMode set to NO.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acf008c658174728b71ceb4a88b76bc6
|
||||
timeCreated: 1664790861
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -282,8 +282,8 @@ namespace Core.Algorithm.PathFinding
|
||||
int x1 = end.X;
|
||||
int y1 = end.Y;
|
||||
|
||||
int dx = Math.Abs(x1 - x0);
|
||||
int dy = Math.Abs(y1 - y0);
|
||||
int dx = Mathf.Abs(x1 - x0);
|
||||
int dy = Mathf.Abs(y1 - y0);
|
||||
int sx = x0 < x1 ? 1 : -1;
|
||||
int sy = y0 < y1 ? 1 : -1;
|
||||
int err = dx - dy;
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
public TItem First => _nodes[1];
|
||||
|
||||
/// <summary>
|
||||
/// This method must be called on a node every time its priority changes while it is in the queue.
|
||||
/// This method must be called on a node every time its priority changes while it is in the queue.
|
||||
/// <b>Forgetting to call this method will result in a corrupted queue!</b>
|
||||
/// Calling this method on a node not in the queue results in undefined behavior
|
||||
/// O(log n)
|
||||
@@ -369,7 +369,7 @@
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a node from the queue. The node does not need to be the head of the queue.
|
||||
/// Removes a node from the queue. The node does not need to be the head of the queue.
|
||||
/// If the node is not in the queue, the result is undefined. If unsure, check Contains() first
|
||||
/// O(log n)
|
||||
/// </summary>
|
||||
|
||||
@@ -33,12 +33,12 @@
|
||||
bool Contains(TItem node);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a node from the queue. The node does not need to be the head of the queue.
|
||||
/// Removes a node from the queue. The node does not need to be the head of the queue.
|
||||
/// </summary>
|
||||
void Remove(TItem node);
|
||||
|
||||
/// <summary>
|
||||
/// Call this method to change the priority of a node.
|
||||
/// Call this method to change the priority of a node.
|
||||
/// </summary>
|
||||
void UpdatePriority(TItem node, TPriority priority);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
public SimplePriorityQueue(Comparison<TPriority> priorityComparer) : this(priorityComparer, EqualityComparer<TItem>.Default) { }
|
||||
|
||||
/// <summary>
|
||||
/// Instantiate a new Priority Queue
|
||||
/// Instantiate a new Priority Queue
|
||||
/// </summary>
|
||||
/// <param name="itemEquality">The equality comparison function to use to compare TItem values</param>
|
||||
public SimplePriorityQueue(IEqualityComparer<TItem> itemEquality) : this(Comparer<TPriority>.Default, itemEquality) { }
|
||||
@@ -309,9 +309,9 @@
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes an item from the queue. The item does not need to be the head of the queue.
|
||||
/// Removes an item from the queue. The item does not need to be the head of the queue.
|
||||
/// If the item is not in the queue, an exception is thrown. If unsure, check Contains() first.
|
||||
/// If multiple copies of the item are enqueued, only the first one is removed.
|
||||
/// If multiple copies of the item are enqueued, only the first one is removed.
|
||||
/// O(log n)
|
||||
/// </summary>
|
||||
public void Remove(TItem item)
|
||||
@@ -432,16 +432,16 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
first = default(TItem);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to remove an item from the queue. The item does not need to be the head of the queue.
|
||||
/// Attempts to remove an item from the queue. The item does not need to be the head of the queue.
|
||||
/// Useful for multi-threading, where the queue may become empty between calls to Contains() and Remove()
|
||||
/// Returns true if the item was successfully removed, false if it wasn't in the queue.
|
||||
/// If multiple copies of the item are enqueued, only the first one is removed.
|
||||
/// If multiple copies of the item are enqueued, only the first one is removed.
|
||||
/// O(log n)
|
||||
/// </summary>
|
||||
public bool TryRemove(TItem item)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Core.Animation
|
||||
};
|
||||
}
|
||||
|
||||
public static IEnumerator EnumerateValue(float from,
|
||||
public static IEnumerator EnumerateValueAsync(float from,
|
||||
float to,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
@@ -57,12 +57,12 @@ namespace Core.Animation
|
||||
|
||||
if (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
onValueChanged?.Invoke(to);
|
||||
onValueChanged?.Invoke(to);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator MoveTransform(Transform target,
|
||||
public static IEnumerator MoveTransformAsync(Transform target,
|
||||
Vector3 toPosition,
|
||||
float duration,
|
||||
AnimationCurveType curveType = AnimationCurveType.Linear,
|
||||
@@ -83,7 +83,7 @@ namespace Core.Animation
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator ShakeTransform(Transform target,
|
||||
public static IEnumerator ShakeTransformAsync(Transform target,
|
||||
float duration,
|
||||
float amplitude,
|
||||
bool shakeOnXAxis,
|
||||
@@ -107,7 +107,7 @@ namespace Core.Animation
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator OrbitTransformAroundCenterPoint(Transform target,
|
||||
public static IEnumerator OrbitTransformAroundCenterPointAsync(Transform target,
|
||||
Quaternion toRotation,
|
||||
Vector3 centerPoint,
|
||||
float duration,
|
||||
@@ -139,11 +139,11 @@ namespace Core.Animation
|
||||
target.rotation = toRotation;
|
||||
target.position = centerPoint + (toRotation * Vector3.forward).normalized * -(distance + distanceDelta);
|
||||
}
|
||||
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
public static IEnumerator RotateTransform(Transform target,
|
||||
public static IEnumerator RotateTransformAsync(Transform target,
|
||||
Quaternion toRotation,
|
||||
float duration,
|
||||
AnimationCurveType curveType,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -17,9 +17,10 @@ namespace Core.DataLoader
|
||||
/// </summary>
|
||||
/// <param name="filePath">Audio file path</param>
|
||||
/// <param name="audioType">Audio type</param>
|
||||
/// <param name="streamAudio">Create streaming AudioClip</param>
|
||||
/// <param name="callback">AudioClip callback invoker</param>
|
||||
/// <returns>IEnumerator</returns>
|
||||
public static IEnumerator LoadAudioClip(string filePath, AudioType audioType, Action<AudioClip> callback)
|
||||
public static IEnumerator LoadAudioClipAsync(string filePath, AudioType audioType, bool streamAudio, Action<AudioClip> callback)
|
||||
{
|
||||
if (filePath.StartsWith("/")) filePath = filePath[1..];
|
||||
|
||||
@@ -36,6 +37,10 @@ namespace Core.DataLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
// Stream audio to avoid loading the entire AudioClip into memory at once,
|
||||
// which can cause frame drops and stuttering during gameplay.
|
||||
((DownloadHandlerAudioClip) request.downloadHandler).streamAudio = streamAudio;
|
||||
|
||||
AudioClip audioClip = DownloadHandlerAudioClip.GetContent(request);
|
||||
callback?.Invoke(audioClip);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace Core.DataLoader
|
||||
|
||||
DxtHeader header = DxtHeader.ReadHeader(reader);
|
||||
var format = header.DxtPixelFormat.Format;
|
||||
hasAlphaChannel = format == "DXT1";
|
||||
|
||||
_width = header.Width;
|
||||
_height = header.Height;
|
||||
@@ -40,9 +39,11 @@ namespace Core.DataLoader
|
||||
switch (format)
|
||||
{
|
||||
case "DXT1":
|
||||
hasAlphaChannel = false;
|
||||
LoadDxt1Texture(data);
|
||||
break;
|
||||
case "DXT3":
|
||||
hasAlphaChannel = true;
|
||||
LoadDxt3Texture(data);
|
||||
break;
|
||||
case "DXT5":
|
||||
@@ -81,7 +82,7 @@ namespace Core.DataLoader
|
||||
public Texture2D ToTexture2D()
|
||||
{
|
||||
if (_rawData == null) return null;
|
||||
Texture2D texture = new Texture2D(_width, _height, _format, false);
|
||||
Texture2D texture = new Texture2D(_width, _height, _format, mipChain: false);
|
||||
texture.LoadRawTextureData(_rawData);
|
||||
texture.Apply();
|
||||
return texture;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace Core.DataLoader
|
||||
public interface ITextureResourceProvider
|
||||
{
|
||||
string GetTexturePath(string name);
|
||||
|
||||
|
||||
Texture2D GetTexture(string name);
|
||||
|
||||
|
||||
Texture2D GetTexture(string name, out bool hasAlphaChannel);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Core.DataLoader
|
||||
public Texture2D ToTexture2D()
|
||||
{
|
||||
if (_pixels == null) return null;
|
||||
var texture = new Texture2D(_width, _height);
|
||||
var texture = new Texture2D(_width, _height, TextureFormat.RGBA32, mipChain: false);
|
||||
texture.SetPixels32(_pixels);
|
||||
texture.Apply();
|
||||
return texture;
|
||||
|
||||
@@ -111,14 +111,17 @@ namespace Core.DataReader.Bmp
|
||||
|
||||
public Texture2D ToTexture2D()
|
||||
{
|
||||
var tex = new Texture2D(info.absWidth, info.absHeight);
|
||||
var texture = new Texture2D(info.absWidth,
|
||||
info.absHeight,
|
||||
TextureFormat.RGBA32,
|
||||
mipChain: false);
|
||||
|
||||
if (info.height < 0)
|
||||
FlipImage();
|
||||
|
||||
tex.SetPixels32(imageData);
|
||||
tex.Apply();
|
||||
return tex;
|
||||
texture.SetPixels32(imageData);
|
||||
texture.Apply();
|
||||
return texture;
|
||||
}
|
||||
|
||||
// flip image if height is negative
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Core.DataReader.Cpk
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Lzo;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
/// <summary>
|
||||
@@ -32,7 +33,7 @@ namespace Core.DataReader.Cpk
|
||||
private readonly Dictionary<uint, byte[]> _fileNameMap = new ();
|
||||
private readonly Dictionary<uint, uint> _crcToTableIndexMap = new ();
|
||||
private readonly Dictionary<uint, HashSet<uint>> _fatherCrcToChildCrcTableIndexMap = new ();
|
||||
|
||||
|
||||
private bool _archiveInMemory;
|
||||
private byte[] _archiveData;
|
||||
|
||||
@@ -94,6 +95,33 @@ namespace Core.DataReader.Cpk
|
||||
BuildCrcIndexMap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract the complete archive to the specified destination
|
||||
/// </summary>
|
||||
public void ExtractTo(string outputFolder)
|
||||
{
|
||||
ExtractToInternal(outputFolder, GetRootEntries());
|
||||
}
|
||||
|
||||
private void ExtractToInternal(string outputFolder, IEnumerable<CpkEntry> nodes)
|
||||
{
|
||||
foreach (CpkEntry node in nodes)
|
||||
{
|
||||
var relativePath = node.VirtualPath.Replace(
|
||||
CpkConstants.DirectorySeparator, Path.DirectorySeparatorChar);
|
||||
|
||||
if (node.IsDirectory)
|
||||
{
|
||||
new DirectoryInfo(outputFolder + relativePath).Create();
|
||||
ExtractToInternal(outputFolder, node.Children);
|
||||
}
|
||||
else
|
||||
{
|
||||
File.WriteAllBytes(outputFolder + relativePath, ReadAllBytes(node.VirtualPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists inside the archive.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -25,17 +25,11 @@ namespace Core.DataReader.Cpk
|
||||
for (uint i = 0; i < CRC_TABLE_MAX; i++)
|
||||
{
|
||||
var crcAccum = i << 24;
|
||||
|
||||
for (var j = 0; j < 8; j++)
|
||||
{
|
||||
if ((crcAccum & 0x80000000L) != 0)
|
||||
{
|
||||
crcAccum = (crcAccum << 1) ^ POLYNOMIAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
crcAccum = (crcAccum << 1);
|
||||
}
|
||||
crcAccum = (crcAccum & 0x80000000L) != 0 ?
|
||||
(crcAccum << 1) ^ POLYNOMIAL :
|
||||
crcAccum << 1;
|
||||
}
|
||||
CrcTable[i] = crcAccum;
|
||||
}
|
||||
@@ -51,35 +45,29 @@ namespace Core.DataReader.Cpk
|
||||
|
||||
private unsafe uint ComputeCrc32HashInternal(byte[] data)
|
||||
{
|
||||
if (!_initialized) throw new Exception("CrcHash not initialized yet.");
|
||||
if (!_initialized) throw new InvalidOperationException("CrcHash not initialized yet.");
|
||||
|
||||
var length = data.Length;
|
||||
if (length == 0 || data[0] == 0) return 0;
|
||||
|
||||
var index = 0;
|
||||
fixed (byte* srcStart = &data[0])
|
||||
if (data == null || data.Length == 0 || data[0] == 0)
|
||||
{
|
||||
var p = srcStart;
|
||||
uint result = (uint)(*(p + index++) << 24);
|
||||
if (index < length && *(p + index) != 0)
|
||||
{
|
||||
result |= (uint)(*(p + index++) << 16);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(index < length && *(p + index) != 0)
|
||||
{
|
||||
result |= (uint)(*(p + index++) << 8);
|
||||
if (index < length && *(p + index) != 0)
|
||||
{
|
||||
result |= *(p + index++);
|
||||
}
|
||||
}
|
||||
fixed (byte* srcStart = data)
|
||||
{
|
||||
byte* ptr = srcStart;
|
||||
uint result = (uint)(*ptr++ << 24);
|
||||
|
||||
for (int i = 1; i < 4 && i < data.Length; i++)
|
||||
{
|
||||
if (*ptr == 0) break;
|
||||
result |= (uint)(*ptr++ << (24 - 8 * i));
|
||||
}
|
||||
|
||||
result = ~result;
|
||||
|
||||
while (index < length && *(p + index) != 0)
|
||||
for (int i = 4; i < data.Length && *ptr != 0; i++, ptr++)
|
||||
{
|
||||
result = (result << 8 | *(p + index)) ^ CrcTable[result >> 24];
|
||||
index++;
|
||||
result = (result << 8 | *ptr) ^ CrcTable[result >> 24];
|
||||
}
|
||||
|
||||
return ~result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
public CvdVertex[][] FrameVertices;
|
||||
public int[] Triangles;
|
||||
public byte BlendFlag;
|
||||
public GameBoxBlendFlag BlendFlag;
|
||||
public GameBoxMaterial Material;
|
||||
public string TextureName;
|
||||
public float[] AnimationTimeKeys;
|
||||
@@ -173,12 +173,12 @@ namespace Core.DataReader.Cvd
|
||||
public class CvdAnimationScaleKeyFrame : CvdAnimationKeyFrame
|
||||
{
|
||||
public Vector3 Scale { get; set; }
|
||||
public GameBoxQuaternion Rotation { get; set; }
|
||||
public Quaternion Rotation { get; set; }
|
||||
}
|
||||
|
||||
public class CvdAnimationRotationKeyFrame : CvdAnimationKeyFrame
|
||||
{
|
||||
public GameBoxQuaternion Rotation { get; set; }
|
||||
public Quaternion Rotation { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = positionKey.TcbKey.AnimationKey.Time,
|
||||
Position = positionKey.Value,
|
||||
Position = GameBoxInterpreter.CvdPositionToUnityPosition(positionKey.Value),
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = positionKey.AnimationKey.Time,
|
||||
Position = positionKey.Value,
|
||||
Position = GameBoxInterpreter.CvdPositionToUnityPosition(positionKey.Value),
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = positionKey.AnimationKey.Time,
|
||||
Position = positionKey.Value,
|
||||
Position = GameBoxInterpreter.CvdPositionToUnityPosition(positionKey.Value),
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -248,13 +248,13 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = rotationKey.TcbKey.AnimationKey.Time,
|
||||
Rotation = new GameBoxQuaternion()
|
||||
Rotation = GameBoxInterpreter.CvdQuaternionToUnityQuaternion(new GameBoxQuaternion()
|
||||
{
|
||||
X = quaternion.x,
|
||||
Y = quaternion.y,
|
||||
Z = quaternion.z,
|
||||
W = quaternion.w,
|
||||
}
|
||||
})
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = rotationKey.AnimationKey.Time,
|
||||
Rotation = rotationKey.Value
|
||||
Rotation = GameBoxInterpreter.CvdQuaternionToUnityQuaternion(rotationKey.Value)
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -276,7 +276,7 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = rotationKey.AnimationKey.Time,
|
||||
Rotation = rotationKey.Value
|
||||
Rotation = GameBoxInterpreter.CvdQuaternionToUnityQuaternion(rotationKey.Value)
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -308,8 +308,8 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = scaleKey.TcbKey.AnimationKey.Time,
|
||||
Scale = scaleKey.Value,
|
||||
Rotation = scaleKey.Rotation
|
||||
Scale = GameBoxInterpreter.CvdScaleToUnityScale(scaleKey.Value),
|
||||
Rotation = GameBoxInterpreter.CvdQuaternionToUnityQuaternion(scaleKey.Rotation)
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -320,8 +320,8 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = scaleKey.AnimationKey.Time,
|
||||
Scale = scaleKey.Value,
|
||||
Rotation = scaleKey.Rotation
|
||||
Scale = GameBoxInterpreter.CvdScaleToUnityScale(scaleKey.Value),
|
||||
Rotation = GameBoxInterpreter.CvdQuaternionToUnityQuaternion(scaleKey.Rotation)
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -332,8 +332,8 @@ namespace Core.DataReader.Cvd
|
||||
{
|
||||
KeyType = type,
|
||||
Time = scaleKey.AnimationKey.Time,
|
||||
Scale = scaleKey.Value,
|
||||
Rotation = scaleKey.Rotation
|
||||
Scale = GameBoxInterpreter.CvdScaleToUnityScale(scaleKey.Value),
|
||||
Rotation = GameBoxInterpreter.CvdQuaternionToUnityQuaternion(scaleKey.Rotation)
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -352,9 +352,6 @@ namespace Core.DataReader.Cvd
|
||||
var numberOfFrames = reader.ReadInt32();
|
||||
var numberOfVertices = reader.ReadInt32();
|
||||
|
||||
//var vertexType = GameBoxVertexType.XYZ | GameBoxVertexType.Normal | GameBoxVertexType.UV0;
|
||||
//var vertexSize = GameBoxVertex.GetSize((uint)vertexType);
|
||||
|
||||
var frameVertices = new CvdVertex[numberOfFrames][];
|
||||
for (var i = 0; i < numberOfFrames; i++)
|
||||
{
|
||||
@@ -362,8 +359,11 @@ namespace Core.DataReader.Cvd
|
||||
for (var j = 0; j < numberOfVertices; j++)
|
||||
{
|
||||
Vector2 uv = reader.ReadVector2();
|
||||
Vector3 normal = reader.ReadVector3();
|
||||
Vector3 position = reader.ReadVector3();
|
||||
Vector3 normal = GameBoxInterpreter.ToUnityNormal(reader.ReadVector3());
|
||||
Vector3 position = GameBoxInterpreter.CvdPositionToUnityPosition(reader.ReadVector3());
|
||||
|
||||
// Quick fix for the missing/wrong normals
|
||||
if (normal == Vector3.zero) normal = Vector3.up;
|
||||
|
||||
vertices[j] = new CvdVertex()
|
||||
{
|
||||
@@ -407,7 +407,7 @@ namespace Core.DataReader.Cvd
|
||||
int codepage)
|
||||
#endif
|
||||
{
|
||||
var blendFlag = reader.ReadByte();
|
||||
var blendFlag = (GameBoxBlendFlag)reader.ReadByte();
|
||||
|
||||
var material = new GameBoxMaterial()
|
||||
{
|
||||
@@ -422,12 +422,12 @@ namespace Core.DataReader.Cvd
|
||||
|
||||
var numberOfIndices = reader.ReadInt32();
|
||||
|
||||
var indices = new (short x, short y, short z)[numberOfIndices];
|
||||
var indices = new (ushort x, ushort y, ushort z)[numberOfIndices];
|
||||
for (var i = 0; i < numberOfIndices; i++)
|
||||
{
|
||||
var x = reader.ReadInt16();
|
||||
var y = reader.ReadInt16();
|
||||
var z = reader.ReadInt16();
|
||||
var x = reader.ReadUInt16();
|
||||
var y = reader.ReadUInt16();
|
||||
var z = reader.ReadUInt16();
|
||||
indices[i] = (x, y, z);
|
||||
}
|
||||
|
||||
@@ -458,10 +458,10 @@ namespace Core.DataReader.Cvd
|
||||
}
|
||||
|
||||
var frameVertices = new CvdVertex[allFrameVertices.Length][];
|
||||
List<int> triangles;
|
||||
List<int> indexBuffer;
|
||||
|
||||
(triangles, indexBuffer) = CalculateTriangles(indices);
|
||||
(List<int> triangles, List<int> indexBuffer) = CalculateTriangles(indices);
|
||||
|
||||
GameBoxInterpreter.ToUnityTriangles(triangles);
|
||||
|
||||
for (var i = 0; i < allFrameVertices.Length; i++)
|
||||
{
|
||||
@@ -489,11 +489,11 @@ namespace Core.DataReader.Cvd
|
||||
}
|
||||
|
||||
private static (List<int> triangles, List<int> indexBuffer) CalculateTriangles(
|
||||
(short x, short y, short z)[] allIndices)
|
||||
(ushort x, ushort y, ushort z)[] allIndices)
|
||||
{
|
||||
var indexBuffer = new List<int>();
|
||||
var triangles = new List<int>();
|
||||
var indexMap = new Dictionary<int, int>();
|
||||
var index = 0;
|
||||
|
||||
for (var j = 0; j < allIndices.Length; j++)
|
||||
{
|
||||
@@ -506,17 +506,8 @@ namespace Core.DataReader.Cvd
|
||||
|
||||
for (var k = 0; k < 3; k++)
|
||||
{
|
||||
if (indexMap.ContainsKey(indices[k]))
|
||||
{
|
||||
triangles.Add(indexMap[indices[k]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var index = indexBuffer.Count;
|
||||
indexBuffer.Add(indices[k]);
|
||||
indexMap[indices[k]] = index;
|
||||
triangles.Add(index);
|
||||
}
|
||||
indexBuffer.Add(indices[k]);
|
||||
triangles.Add(index++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6277e4ab422e47bdadc0826e97a1dbe3
|
||||
timeCreated: 1665782936
|
||||
@@ -0,0 +1,129 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Data
|
||||
{
|
||||
//using System.Runtime.InteropServices;
|
||||
|
||||
//[StructLayout(LayoutKind.Explicit)]
|
||||
public struct EffectDefinition
|
||||
{
|
||||
//[FieldOffset(0)]
|
||||
public uint ClassNameCrc;
|
||||
|
||||
//[FieldOffset(4)]
|
||||
//[MarshalAs (UnmanagedType.ByValArray, SizeConst = 30)]
|
||||
public string TypeName;
|
||||
|
||||
//[FieldOffset(36)]
|
||||
public uint TypeNameCrc;
|
||||
|
||||
//[FieldOffset(40)]
|
||||
//[MarshalAs (UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
// Union
|
||||
public string TextureName;
|
||||
public string ParticleFileName;
|
||||
public string SfxFileNamePrefix;
|
||||
public string VideoFileNamePrefix;
|
||||
|
||||
//[FieldOffset(168)]
|
||||
public int FramesPerRow;
|
||||
|
||||
//[FieldOffset(172)]
|
||||
public int FramesPerColumn;
|
||||
|
||||
//[FieldOffset(176)]
|
||||
public int FrameCount;
|
||||
|
||||
//[FieldOffset(180)]
|
||||
public float FramePerSecond;
|
||||
|
||||
//[FieldOffset(184)]
|
||||
public float InitXPosition;
|
||||
|
||||
//[FieldOffset(188)]
|
||||
public float InitYPosition;
|
||||
|
||||
//[FieldOffset(192)]
|
||||
public float InitZPosition;
|
||||
|
||||
//[FieldOffset(196)]
|
||||
// Union
|
||||
public float InitYRotation;
|
||||
public float InitAngle;
|
||||
|
||||
//[FieldOffset(200)]
|
||||
public int InitSize;
|
||||
|
||||
//[FieldOffset(204)]
|
||||
public uint InitColor;
|
||||
|
||||
//[FieldOffset(208)]
|
||||
public int MaxQuadCount;
|
||||
|
||||
//[FieldOffset(212)]
|
||||
public bool IsValid;
|
||||
|
||||
//[FieldOffset(213)]
|
||||
public bool IsAdditiveBlend;
|
||||
|
||||
//[FieldOffset(214)]
|
||||
public bool IsBillboard;
|
||||
|
||||
//[FieldOffset(215)]
|
||||
public bool IsZTestIgnored;
|
||||
|
||||
//[FieldOffset(216)]
|
||||
public float InitXRotation;
|
||||
|
||||
//[FieldOffset(220)]
|
||||
public float InitZRotation;
|
||||
|
||||
//[FieldOffset(224)]
|
||||
public float RotationAngle;
|
||||
|
||||
//[FieldOffset(228)]
|
||||
public float Width;
|
||||
|
||||
//[FieldOffset(232)]
|
||||
public float DivisionCount;
|
||||
|
||||
//[FieldOffset(236)]
|
||||
public float TopShrink;
|
||||
|
||||
//[FieldOffset(240)]
|
||||
public float BottomShrink;
|
||||
|
||||
//[FieldOffset(244)]
|
||||
public float TopRadius;
|
||||
|
||||
//[FieldOffset(248)]
|
||||
public float BottomRadius;
|
||||
|
||||
//[FieldOffset(252)]
|
||||
public float TopRadiusIncreaseSpeed;
|
||||
|
||||
//[FieldOffset(256)]
|
||||
public float BottomRadiusIncreaseSpeed;
|
||||
|
||||
//[FieldOffset(260)]
|
||||
public float TopRiseSpeed;
|
||||
|
||||
//[FieldOffset(264)]
|
||||
public float BottomRiseSpeed;
|
||||
|
||||
//[FieldOffset(268)]
|
||||
public float TextureRepeat;
|
||||
|
||||
//[FieldOffset(272)]
|
||||
//[MarshalAs (UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public float[] Param;
|
||||
}
|
||||
|
||||
public class EffectDefinitionFile
|
||||
{
|
||||
public EffectDefinition[] EffectDefinitions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c47b38acef943118e9374c4113e7b5e
|
||||
timeCreated: 1665782973
|
||||
@@ -0,0 +1,107 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
//#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Data
|
||||
{
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using Utils;
|
||||
|
||||
public static class EffectDefinitionFileReader
|
||||
{
|
||||
private const int NUM_OF_EFFECTS = 1324;
|
||||
|
||||
public static void Read(byte[] data, int codepage)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var effectDefinitions = new EffectDefinition[NUM_OF_EFFECTS];
|
||||
|
||||
for (var i = 0; i < NUM_OF_EFFECTS; i++)
|
||||
{
|
||||
effectDefinitions[i] = ReadEffectDefinition(reader, codepage);
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static EffectDefinition ReadEffectDefinition(UnsafeBinaryReader reader, int codepage)
|
||||
#else
|
||||
private static EffectDefinition ReadEffectDefinition(BinaryReader reader, int codepage)
|
||||
#endif
|
||||
{
|
||||
var effectDefinition = new EffectDefinition();
|
||||
|
||||
effectDefinition.ClassNameCrc = reader.ReadUInt32();
|
||||
effectDefinition.TypeName = reader.ReadString(32, 936);
|
||||
effectDefinition.TypeNameCrc = reader.ReadUInt32();
|
||||
|
||||
// union
|
||||
{
|
||||
var unionStr = reader.ReadString(128, 936);
|
||||
effectDefinition.TextureName = unionStr;
|
||||
effectDefinition.ParticleFileName = unionStr;
|
||||
effectDefinition.SfxFileNamePrefix = unionStr;
|
||||
effectDefinition.VideoFileNamePrefix = unionStr;
|
||||
}
|
||||
|
||||
effectDefinition.FramesPerRow = reader.ReadInt32();
|
||||
effectDefinition.FramesPerColumn = reader.ReadInt32();
|
||||
effectDefinition.FrameCount = reader.ReadInt32();
|
||||
effectDefinition.FramePerSecond = reader.ReadSingle();
|
||||
|
||||
effectDefinition.InitXPosition = reader.ReadSingle();
|
||||
effectDefinition.InitYPosition = reader.ReadSingle();
|
||||
effectDefinition.InitZPosition = reader.ReadSingle();
|
||||
|
||||
// union
|
||||
{
|
||||
var unionFloat = reader.ReadSingle();
|
||||
effectDefinition.InitYRotation = unionFloat;
|
||||
effectDefinition.InitAngle = unionFloat;
|
||||
}
|
||||
|
||||
effectDefinition.InitSize = reader.ReadInt32();
|
||||
effectDefinition.InitColor = reader.ReadUInt32();
|
||||
effectDefinition.MaxQuadCount = reader.ReadInt32();
|
||||
|
||||
effectDefinition.IsValid = reader.ReadBoolean();
|
||||
effectDefinition.IsAdditiveBlend = reader.ReadBoolean();
|
||||
effectDefinition.IsBillboard = reader.ReadBoolean();
|
||||
effectDefinition.IsZTestIgnored = reader.ReadBoolean();
|
||||
|
||||
effectDefinition.InitXRotation = reader.ReadSingle();
|
||||
effectDefinition.InitZRotation = reader.ReadSingle();
|
||||
|
||||
effectDefinition.RotationAngle = reader.ReadSingle();
|
||||
effectDefinition.Width = reader.ReadSingle();
|
||||
effectDefinition.DivisionCount = reader.ReadSingle();
|
||||
effectDefinition.TopShrink = reader.ReadSingle();
|
||||
effectDefinition.BottomShrink = reader.ReadSingle();
|
||||
effectDefinition.TopRadius = reader.ReadSingle();
|
||||
effectDefinition.BottomRadius = reader.ReadSingle();
|
||||
effectDefinition.TopRadiusIncreaseSpeed = reader.ReadSingle();
|
||||
effectDefinition.BottomRadiusIncreaseSpeed = reader.ReadSingle();
|
||||
effectDefinition.TopRiseSpeed = reader.ReadSingle();
|
||||
effectDefinition.BottomRiseSpeed = reader.ReadSingle();
|
||||
|
||||
effectDefinition.TextureRepeat = reader.ReadSingle();
|
||||
|
||||
effectDefinition.Param = new[]
|
||||
{
|
||||
reader.ReadSingle(),
|
||||
reader.ReadSingle(),
|
||||
};
|
||||
|
||||
return effectDefinition;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a324f42c7b6346dc8c98a2c6c377c9d6
|
||||
timeCreated: 1665784313
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dd4c4efb70347a2ba8cc981e6ffc018
|
||||
timeCreated: 1668071055
|
||||
@@ -0,0 +1,154 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Gdb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
public enum WuLingType
|
||||
{
|
||||
Water, // 水
|
||||
Fire, // 火
|
||||
Wind, // 风
|
||||
Thunder, // 雷
|
||||
Earth, // 土
|
||||
}
|
||||
|
||||
public enum ItemType
|
||||
{
|
||||
None = 0,
|
||||
Healing, // 治疗
|
||||
Throwable, // 投掷
|
||||
Treasure, // 仙宝
|
||||
Antique, // 古董
|
||||
Ore, // 矿石
|
||||
Plot, // 剧情
|
||||
Cloth, // 衣服
|
||||
Hat, // 帽子
|
||||
Shoes, // 鞋子
|
||||
Wearable, // 饰品
|
||||
Weapon, // 武器
|
||||
Corpse, // 尸块
|
||||
Blueprint, // 蓝图(梦溪杂录,美食方)
|
||||
}
|
||||
|
||||
public enum WeaponType
|
||||
{
|
||||
None = 0,
|
||||
Spear, // 长矛
|
||||
Sword, // 剑
|
||||
Staff, // 杖
|
||||
Machete, // 刀
|
||||
Bow, // 弓
|
||||
Spine, // 刺
|
||||
Sickle, // 镰刀
|
||||
}
|
||||
|
||||
public enum SpecialType
|
||||
{
|
||||
None = 0,
|
||||
Poison, // 随机中毒
|
||||
Flee, // 100%逃跑
|
||||
Navigation, // 引路蜂类
|
||||
LevelUp, // 升级类(等级提高1)
|
||||
}
|
||||
|
||||
public enum TargetRangeType
|
||||
{
|
||||
None = 0,
|
||||
FirstParty, // 我方单体
|
||||
FirstPartyAll, // 我方全体
|
||||
EnemyParty, // 敌方单体
|
||||
EnemyPartyAll, // 敌方全体
|
||||
}
|
||||
|
||||
public enum PlaceOfUseType
|
||||
{
|
||||
None = 0,
|
||||
Combat, // 战斗中
|
||||
OutOfCombat, // 非战斗中
|
||||
Anywhere, // 任何地方
|
||||
}
|
||||
|
||||
public enum ActorAttributeType
|
||||
{
|
||||
Hp, // 精
|
||||
Qi, // 气
|
||||
Mp, // 神
|
||||
Attack, // 攻击
|
||||
Defense, // 防御
|
||||
Speed, // 速度
|
||||
Luck, // 幸运
|
||||
Water, // 水
|
||||
Fire, // 火
|
||||
Wind, // 风
|
||||
Thunder, // 雷
|
||||
Earth, // 土
|
||||
}
|
||||
|
||||
public struct GameItem
|
||||
{
|
||||
public uint Id; // 物品ID
|
||||
|
||||
public string Name; // 物品名称
|
||||
public string ModelName; // 物品模型名称
|
||||
public string IconName; // 物品图标名称
|
||||
public string Description; // 物品描述
|
||||
public int Price; // 物品价格
|
||||
|
||||
public ItemType Type; // 物品类型
|
||||
public WeaponType WeaponType; // 武器类型(只有物品为武器的时候有意义)
|
||||
|
||||
public byte[] MainActorCanUse; // 主角可使用信息
|
||||
public byte[] WuLing; // 五灵属性
|
||||
|
||||
public int AncientValue; // 古董价值
|
||||
|
||||
public SpecialType SpecialType; // 特殊类型
|
||||
public TargetRangeType TargetRangeType; // 目标范围类型
|
||||
public PlaceOfUseType PlaceOfUseType; // 使用地点类型
|
||||
|
||||
public byte[] AttributeImpactType; // 角色属性影响类型 (0绝对值,1百分比值,2恢复到上限,3增加上限值)
|
||||
|
||||
// Empty byte between the memory addresses to align the data in memory.
|
||||
// SpecialType, TargetRangeType and PlaceOfUseType take 3 bytes in memory, thus we need to add 1 byte here
|
||||
// to align the data in memory (4 bytes).
|
||||
// Note: The padding byte is added after AttributeImpactType instead of before based on observation.
|
||||
internal byte PaddingByte;
|
||||
|
||||
public short[] AttributeImpactValue; // 角色属性影响值
|
||||
|
||||
public byte[] FightStateImpactType; // 战斗状态影响类型(0不影响,1增加,2解除)
|
||||
public short[] FightStateImpactValue; // 战斗状态值
|
||||
|
||||
public int ComboCount; // 连击次数
|
||||
|
||||
// 装备属性
|
||||
public short QiSavingPercentage; // 气消耗减少百分比
|
||||
public short MpSavingPercentage; // 神消耗减少百分比
|
||||
public short CriticalAttackAmplifyPercentage; // 暴击伤害增加百分比
|
||||
public short SpecialSkillSuccessRate; // 特技成功率增加百分比
|
||||
|
||||
// 尸块属性
|
||||
public uint OreId; // 矿石ID
|
||||
public uint ProductId; // 炼制出的物品ID
|
||||
public int ProductPrice; // 炼制出的物品价格
|
||||
|
||||
// 合成属性
|
||||
public uint[] SynthesisMaterialIds; // 两种合成材料的ID
|
||||
public uint SynthesisProductId; // 合成出的物品ID
|
||||
}
|
||||
|
||||
// Pal3 Game Database file
|
||||
public class GdbFile
|
||||
{
|
||||
public Dictionary<int, GameItem> GameItems { get; } // Game item Id -> Game item
|
||||
|
||||
public GdbFile(Dictionary<int, GameItem> gameItems)
|
||||
{
|
||||
GameItems = gameItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f266e43f10ee4eb1b95cfd541c518a39
|
||||
timeCreated: 1668071064
|
||||
@@ -0,0 +1,80 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Gdb
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
|
||||
public static class GdbFileReader
|
||||
{
|
||||
public static GdbFile Read(byte[] data, int codepage)
|
||||
{
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
|
||||
_ = reader.ReadString(128, codepage); // header string
|
||||
|
||||
uint actorDataOffset = reader.ReadUInt32();
|
||||
int numOfActors = reader.ReadInt32();
|
||||
|
||||
uint skillDataOffset = reader.ReadUInt32();
|
||||
int numOfSkills = reader.ReadInt32();
|
||||
|
||||
uint itemDataOffset = reader.ReadUInt32();
|
||||
int numOfItems = reader.ReadInt32();
|
||||
|
||||
uint comboSkillDataOffset = reader.ReadUInt32();
|
||||
int numOfComboSkills = reader.ReadInt32();
|
||||
|
||||
reader.BaseStream.Seek(itemDataOffset, SeekOrigin.Begin);
|
||||
var gameItems = new Dictionary<int, GameItem>();
|
||||
for (var i = 0; i < numOfItems; i++)
|
||||
{
|
||||
GameItem item = ReadGameItem(reader, codepage);
|
||||
gameItems[(int) item.Id] = item;
|
||||
}
|
||||
|
||||
return new GdbFile(gameItems);
|
||||
}
|
||||
|
||||
private static GameItem ReadGameItem(BinaryReader reader, int codepage)
|
||||
{
|
||||
return new GameItem
|
||||
{
|
||||
Id = reader.ReadUInt32(),
|
||||
Name = reader.ReadString(32, codepage),
|
||||
ModelName = reader.ReadString(30, codepage),
|
||||
IconName = reader.ReadString(30, codepage),
|
||||
Description = reader.ReadString(512, codepage),
|
||||
Price = reader.ReadInt32(),
|
||||
Type = (ItemType) reader.ReadByte(),
|
||||
WeaponType = (WeaponType) reader.ReadByte(),
|
||||
MainActorCanUse = reader.ReadBytes(5),
|
||||
WuLing = reader.ReadBytes(5),
|
||||
AncientValue = reader.ReadInt32(),
|
||||
SpecialType = (SpecialType) reader.ReadByte(), // ----------------| 1
|
||||
TargetRangeType = (TargetRangeType) reader.ReadByte(), // --------| 2
|
||||
PlaceOfUseType = (PlaceOfUseType) reader.ReadByte(), // ----------| 3
|
||||
AttributeImpactType = reader.ReadBytes(12),
|
||||
PaddingByte = reader.ReadByte(), // ------------------------------| ^ to complete 4-byte alignment
|
||||
AttributeImpactValue = reader.ReadInt16Array(12),
|
||||
FightStateImpactType = reader.ReadBytes(32),
|
||||
FightStateImpactValue = reader.ReadInt16Array(32),
|
||||
ComboCount = reader.ReadInt32(),
|
||||
QiSavingPercentage = reader.ReadInt16(),
|
||||
MpSavingPercentage = reader.ReadInt16(),
|
||||
CriticalAttackAmplifyPercentage = reader.ReadInt16(),
|
||||
SpecialSkillSuccessRate = reader.ReadInt16(),
|
||||
OreId = reader.ReadUInt32(),
|
||||
ProductId = reader.ReadUInt32(),
|
||||
ProductPrice = reader.ReadInt32(),
|
||||
SynthesisMaterialIds = reader.ReadUInt32Array(2),
|
||||
SynthesisProductId = reader.ReadUInt32()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1575b1b777f8491b9b6fbc051b936b47
|
||||
timeCreated: 1668071081
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7033622484af4557882d201a3784de14
|
||||
timeCreated: 1665907414
|
||||
@@ -0,0 +1,44 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Lgt
|
||||
{
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public struct LightNode
|
||||
{
|
||||
public Matrix4x4 WorldMatrix;
|
||||
|
||||
public GameBoxLightType LightType;
|
||||
public Color LightColor;
|
||||
public Color AmbientColor;
|
||||
public bool UseDiffuse;
|
||||
public bool UseSpecular;
|
||||
public float NearStart;
|
||||
public float NearEnd;
|
||||
public float FarStart;
|
||||
public float FarEnd;
|
||||
|
||||
public GameBoxLightDecayType LightDecayType;
|
||||
public float DecayRadius;
|
||||
|
||||
public GameBoxLightShapeType LightShapeType;
|
||||
public float Size;
|
||||
public float Falloff;
|
||||
public float AspectRatio;
|
||||
}
|
||||
|
||||
public class LgtFile
|
||||
{
|
||||
public LightNode[] LightNodes { get; }
|
||||
|
||||
public LgtFile(LightNode[] lightNodes)
|
||||
{
|
||||
LightNodes = lightNodes;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25179e1de24d41698cd68a919c3d0990
|
||||
timeCreated: 1665907430
|
||||
@@ -0,0 +1,83 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
#define USE_UNSAFE_BINARY_READER
|
||||
|
||||
namespace Core.DataReader.Lgt
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using Utils;
|
||||
|
||||
public static class LgtFileReader
|
||||
{
|
||||
public static LgtFile Read(byte[] data)
|
||||
{
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
using var reader = new UnsafeBinaryReader(data);
|
||||
#else
|
||||
using var stream = new MemoryStream(data);
|
||||
using var reader = new BinaryReader(stream);
|
||||
#endif
|
||||
|
||||
var numOfLightNodes = reader.ReadInt32();
|
||||
var lightNodes = new List<LightNode>();
|
||||
|
||||
for (var i = 0; i < numOfLightNodes; i++)
|
||||
{
|
||||
var lightNode = ReadLightNode(reader);
|
||||
|
||||
if (Enum.IsDefined(typeof(GameBoxLightType), lightNode.LightType) &&
|
||||
Enum.IsDefined(typeof(GameBoxLightShapeType), lightNode.LightShapeType))
|
||||
{
|
||||
lightNodes.Add(lightNode);
|
||||
}
|
||||
}
|
||||
|
||||
return new LgtFile(lightNodes.ToArray());
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
private static LightNode ReadLightNode(UnsafeBinaryReader reader)
|
||||
#else
|
||||
private static LightNode ReadLightNode(BinaryReader reader)
|
||||
#endif
|
||||
{
|
||||
var transformMatrix = new GameBoxMatrix4X4()
|
||||
{
|
||||
Xx = reader.ReadSingle(), Xy = reader.ReadSingle(), Xz = reader.ReadSingle(), Xw = reader.ReadSingle(),
|
||||
Yx = reader.ReadSingle(), Yy = reader.ReadSingle(), Yz = reader.ReadSingle(), Yw = reader.ReadSingle(),
|
||||
Zx = reader.ReadSingle(), Zy = reader.ReadSingle(), Zz = reader.ReadSingle(), Zw = reader.ReadSingle(),
|
||||
Tx = reader.ReadSingle(), Ty = reader.ReadSingle(), Tz = reader.ReadSingle(), Tw = reader.ReadSingle()
|
||||
};
|
||||
transformMatrix.Tw = 1f;
|
||||
|
||||
var lightNode = new LightNode
|
||||
{
|
||||
WorldMatrix = GameBoxInterpreter.ToUnityMatrix4x4(transformMatrix),
|
||||
LightType = (GameBoxLightType)reader.ReadInt32(),
|
||||
LightColor = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
AmbientColor = Utility.ToColor(reader.ReadSingleArray(4)),
|
||||
UseDiffuse = reader.ReadBoolean(),
|
||||
UseSpecular = reader.ReadBoolean(),
|
||||
NearStart = reader.ReadSingle(),
|
||||
NearEnd = reader.ReadSingle(),
|
||||
FarStart = reader.ReadSingle(),
|
||||
FarEnd = reader.ReadSingle(),
|
||||
LightDecayType = (GameBoxLightDecayType)reader.ReadInt32(),
|
||||
DecayRadius = reader.ReadSingle(),
|
||||
LightShapeType = (GameBoxLightShapeType)reader.ReadInt32(),
|
||||
Size = reader.ReadSingle(),
|
||||
Falloff = reader.ReadSingle(),
|
||||
AspectRatio = reader.ReadSingle()
|
||||
};
|
||||
|
||||
return lightNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f29568c4d19d4fcca931e8bf250ccc01
|
||||
timeCreated: 1665907439
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -77,19 +77,18 @@ namespace Core.DataReader.Mv3
|
||||
public struct Mv3Mesh
|
||||
{
|
||||
public string Name; // 64 chars max
|
||||
public GameBoxAABBox BoundBox;
|
||||
public Bounds Bounds;
|
||||
public Mv3Attribute[] Attributes;
|
||||
public Mv3VertFrame[] Frames;
|
||||
public Vector2[] TexCoords;
|
||||
public Vector3[] Normals;
|
||||
public int[] Triangles;
|
||||
public Vector2[] Uvs;
|
||||
public VertexAnimationKeyFrame[] KeyFrames;
|
||||
}
|
||||
|
||||
public struct VertexAnimationKeyFrame
|
||||
{
|
||||
public uint Tick;
|
||||
public Vector3[] Vertices;
|
||||
public Vector3[] Normals;
|
||||
public int[] Triangles;
|
||||
public Vector2[] Uv;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -103,15 +102,13 @@ namespace Core.DataReader.Mv3
|
||||
public Mv3TagNode[] TagNodes { get; }
|
||||
public Mv3Material[] Materials { get; }
|
||||
public Mv3Mesh[] Meshes { get; }
|
||||
public VertexAnimationKeyFrame[][] MeshKeyFrames { get; }
|
||||
|
||||
public Mv3File(int version,
|
||||
uint duration,
|
||||
Mv3AnimationEvent[] animationEvents,
|
||||
Mv3TagNode[] tagNodes,
|
||||
Mv3Material[] materials,
|
||||
Mv3Mesh[] meshes,
|
||||
VertexAnimationKeyFrame[][] meshKeyFrames)
|
||||
Mv3Mesh[] meshes)
|
||||
{
|
||||
Version = version;
|
||||
Duration = duration;
|
||||
@@ -119,7 +116,6 @@ namespace Core.DataReader.Mv3
|
||||
TagNodes = tagNodes;
|
||||
Materials = materials;
|
||||
Meshes = meshes;
|
||||
MeshKeyFrames = meshKeyFrames;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Core.DataReader.Mv3
|
||||
|
||||
var header = reader.ReadChars(4);
|
||||
var headerStr = new string(header[..^1]);
|
||||
|
||||
|
||||
if (headerStr != "MV3")
|
||||
{
|
||||
throw new InvalidDataException("Invalid MV3(.mv3) file: header != MV3");
|
||||
@@ -70,12 +70,9 @@ namespace Core.DataReader.Mv3
|
||||
}
|
||||
|
||||
var meshes = new Mv3Mesh[numberOfMeshes];
|
||||
var meshKeyFrames = new VertexAnimationKeyFrame[numberOfMeshes][];
|
||||
for (var i = 0; i < numberOfMeshes; i++)
|
||||
{
|
||||
Mv3Mesh mesh = ReadMesh(reader, codepage);
|
||||
meshes[i] = mesh;
|
||||
meshKeyFrames[i] = CalculateKeyFrameVertices(mesh);
|
||||
meshes[i] = ReadMesh(reader, codepage);
|
||||
}
|
||||
|
||||
return new Mv3File(version,
|
||||
@@ -83,8 +80,7 @@ namespace Core.DataReader.Mv3
|
||||
animationEvents,
|
||||
tagNodes,
|
||||
materials,
|
||||
meshes,
|
||||
meshKeyFrames);
|
||||
meshes);
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
@@ -95,11 +91,12 @@ namespace Core.DataReader.Mv3
|
||||
{
|
||||
var name = reader.ReadString(64, codepage);
|
||||
var numberOfVertices = reader.ReadInt32();
|
||||
var boundBox = new GameBoxAABBox()
|
||||
{
|
||||
Min = reader.ReadVector3(),
|
||||
Max = reader.ReadVector3()
|
||||
};
|
||||
|
||||
var bounds = new Bounds();
|
||||
bounds.SetMinMax(
|
||||
GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
|
||||
GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()));
|
||||
|
||||
var numberOfFrames = reader.ReadInt32();
|
||||
var frames = new Mv3VertFrame[numberOfFrames];
|
||||
for (var i = 0; i < numberOfFrames; i++)
|
||||
@@ -127,7 +124,7 @@ namespace Core.DataReader.Mv3
|
||||
Vector2[] texCoords;
|
||||
if (numberOfTexCoords == 0)
|
||||
{
|
||||
texCoords = new Vector2[] {new (0f, 0f)};
|
||||
texCoords = new Vector2[] { new (0f, 0f) };
|
||||
Debug.LogWarning("numberOfTexCoords == 0");
|
||||
}
|
||||
else
|
||||
@@ -171,70 +168,65 @@ namespace Core.DataReader.Mv3
|
||||
};
|
||||
}
|
||||
|
||||
return new Mv3Mesh()
|
||||
{
|
||||
Name = name,
|
||||
BoundBox = boundBox,
|
||||
Attributes = attributes,
|
||||
Frames = frames,
|
||||
TexCoords = texCoords,
|
||||
};
|
||||
return GetMv3Mesh(name, bounds, attributes, frames, texCoords);
|
||||
}
|
||||
|
||||
private static VertexAnimationKeyFrame[] CalculateKeyFrameVertices(Mv3Mesh mv3Mesh)
|
||||
private static Mv3Mesh GetMv3Mesh(string name,
|
||||
Bounds bounds,
|
||||
Mv3Attribute[] attributes,
|
||||
Mv3VertFrame[] vertFrames,
|
||||
Vector2[] texCoords)
|
||||
{
|
||||
var triangles = new List<int>();
|
||||
var texCoords = mv3Mesh.TexCoords;
|
||||
var indexMap = new Dictionary<int, int>();
|
||||
var keyFrameInfo = new List<(Vector3 vertex, Vector2 uv)>[mv3Mesh.Frames.Length]
|
||||
.Select(item=>new List<(Vector3 vertex, Vector2 uv)>()).ToArray();
|
||||
var triangles = new int[attributes[0].IndexBuffers.Length * 3];
|
||||
var keyFrameVertices = new List<Vector3>[vertFrames.Length]
|
||||
.Select(item=>new List<Vector3>()).ToArray();
|
||||
var uvs = new Vector2[attributes[0].IndexBuffers.Length * 3];
|
||||
|
||||
for (var i = 0; i < mv3Mesh.Attributes[0].IndexBuffers.Length; i++)
|
||||
var triangleIndex = 0;
|
||||
|
||||
for (var i = 0; i < attributes[0].IndexBuffers.Length; i++)
|
||||
{
|
||||
Mv3IndexBuffer indexBuffer = mv3Mesh.Attributes[0].IndexBuffers[i];
|
||||
Mv3IndexBuffer indexBuffer = attributes[0].IndexBuffers[i];
|
||||
for (var j = 0; j < 3; j++)
|
||||
{
|
||||
var hash = indexBuffer.TriangleIndex[j] * texCoords.Length + indexBuffer.TexCoordIndex[j];
|
||||
if (indexMap.ContainsKey(hash))
|
||||
for (var k = 0; k < vertFrames.Length; k++)
|
||||
{
|
||||
triangles.Add(indexMap[hash]);
|
||||
Mv3VertFrame frame = vertFrames[k];
|
||||
Mv3Vert vertex = frame.Vertices[indexBuffer.TriangleIndex[j]];
|
||||
|
||||
keyFrameVertices[k].Add((GameBoxInterpreter
|
||||
.ToUnityVertex(new Vector3(vertex.X, vertex.Y, vertex.Z),
|
||||
GameBoxInterpreter.GameBoxMv3UnitToUnityUnit)));
|
||||
}
|
||||
else
|
||||
{
|
||||
var index = indexMap.Keys.Count;
|
||||
|
||||
for (var k = 0; k < mv3Mesh.Frames.Length; k++)
|
||||
{
|
||||
Mv3VertFrame frame = mv3Mesh.Frames[k];
|
||||
Mv3Vert vertex = frame.Vertices[indexBuffer.TriangleIndex[j]];
|
||||
|
||||
keyFrameInfo[k].Add((GameBoxInterpreter
|
||||
.ToUnityVertex(new Vector3(vertex.X, vertex.Y, vertex.Z),
|
||||
GameBoxInterpreter.GameBoxMv3UnitToUnityUnit),
|
||||
texCoords[indexBuffer.TexCoordIndex[j]]));
|
||||
}
|
||||
|
||||
indexMap[hash] = index;
|
||||
triangles.Add(index);
|
||||
}
|
||||
uvs[triangleIndex] = texCoords[indexBuffer.TexCoordIndex[j]];
|
||||
triangles[triangleIndex] = triangleIndex;
|
||||
triangleIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
GameBoxInterpreter.ToUnityTriangles(triangles);
|
||||
|
||||
var animationKeyFrames = new VertexAnimationKeyFrame[mv3Mesh.Frames.Length];
|
||||
var animationKeyFrames = new VertexAnimationKeyFrame[vertFrames.Length];
|
||||
for (var i = 0; i < animationKeyFrames.Length; i++)
|
||||
{
|
||||
animationKeyFrames[i] = new VertexAnimationKeyFrame()
|
||||
{
|
||||
Tick = mv3Mesh.Frames[i].Tick,
|
||||
Vertices = keyFrameInfo[i].Select(f => f.vertex).ToArray(),
|
||||
Triangles = triangles.ToArray(),
|
||||
Uv = keyFrameInfo[i].Select(f => f.uv).ToArray(),
|
||||
Tick = vertFrames[i].Tick,
|
||||
Vertices = keyFrameVertices[i].ToArray(),
|
||||
};
|
||||
}
|
||||
|
||||
return animationKeyFrames;
|
||||
return new Mv3Mesh
|
||||
{
|
||||
Name = name,
|
||||
Bounds = bounds,
|
||||
Attributes = attributes,
|
||||
Triangles = triangles,
|
||||
Uvs = uvs,
|
||||
Normals = Utility.CalculateNormals(animationKeyFrames[0].Vertices, triangles),
|
||||
KeyFrames = animationKeyFrames,
|
||||
};
|
||||
}
|
||||
|
||||
#if USE_UNSAFE_BINARY_READER
|
||||
@@ -270,13 +262,13 @@ namespace Core.DataReader.Mv3
|
||||
var tick = reader.ReadUInt32();
|
||||
Vector3 position = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3());
|
||||
|
||||
var rotation = new GameBoxQuaternion()
|
||||
var rotation = GameBoxInterpreter.Mv3QuaternionToUnityQuaternion(new GameBoxQuaternion()
|
||||
{
|
||||
X = reader.ReadSingle(),
|
||||
Y = reader.ReadSingle(),
|
||||
Z = reader.ReadSingle(),
|
||||
W = reader.ReadSingle(),
|
||||
};
|
||||
});
|
||||
|
||||
var scale = new []
|
||||
{
|
||||
@@ -289,7 +281,7 @@ namespace Core.DataReader.Mv3
|
||||
{
|
||||
Tick = tick,
|
||||
Position = position,
|
||||
Rotation = GameBoxInterpreter.Mv3QuaternionToUnityQuaternion(rotation),
|
||||
Rotation = rotation,
|
||||
Scale = scale,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -48,23 +48,25 @@ namespace Core.DataReader.Nav
|
||||
|
||||
public struct NavTile
|
||||
{
|
||||
public float Y; // 格子地板高度
|
||||
public ushort Distance; // 格子距离周边障碍物的距离 (0最小-7最大)
|
||||
public NavFloorKind FloorKind; // 格子地板类型:0~128索引普通地面属性(土草雪等),128~255索引机关序号
|
||||
public float GameBoxYPosition; // 格子地板高度(原GameBox引擎下的Y坐标单位)
|
||||
public byte DistanceToNearestObstacle; // 格子距离周边障碍物的距离 (0最小-7最大)
|
||||
public NavFloorKind FloorKind; // 格子地板类型:0~128索引普通地面属性(土草雪等),128~255索引机关序号
|
||||
|
||||
public bool IsObstacle; // 是否为障碍物
|
||||
|
||||
public bool IsWalkable()
|
||||
{
|
||||
return Distance > 0;
|
||||
return !IsObstacle && DistanceToNearestObstacle > 0 && FloorKind != NavFloorKind.Jumpable;
|
||||
}
|
||||
}
|
||||
|
||||
public struct NavLayerNode
|
||||
{
|
||||
public GameBoxAABBox BoundBox;
|
||||
public Vector3[] Triangles;
|
||||
public int Level; // 0: root, child level = parent level + 1
|
||||
public NavLayerNode[] Children; // 4
|
||||
}
|
||||
// public struct NavLayerNode
|
||||
// {
|
||||
// public GameBoxAABBox BoundBox;
|
||||
// public Vector3[] Triangles;
|
||||
// public int Level; // 0: root, child level = parent level + 1
|
||||
// public NavLayerNode[] Children; // 4
|
||||
// }
|
||||
|
||||
public struct NavTileLayer
|
||||
{
|
||||
@@ -80,7 +82,7 @@ namespace Core.DataReader.Nav
|
||||
{
|
||||
public Vector3[] Vertices;
|
||||
public int[] Triangles;
|
||||
public NavLayerNode[] Nodes;
|
||||
//public NavLayerNode[] Nodes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -7,9 +7,11 @@ namespace Core.DataReader.Nav
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
public static class NavFileReader
|
||||
{
|
||||
@@ -41,7 +43,7 @@ namespace Core.DataReader.Nav
|
||||
var faceLayers = new NavFaceLayer[numberOfLayers];
|
||||
for (var i = 0; i < numberOfLayers; i++)
|
||||
{
|
||||
faceLayers[i] = ReadFaceLayer(reader, version);
|
||||
faceLayers[i] = ReadFaceLayer(reader);
|
||||
}
|
||||
|
||||
return new NavFile(tileLayers, faceLayers);
|
||||
@@ -50,6 +52,7 @@ namespace Core.DataReader.Nav
|
||||
private static NavTileLayer ReadTileLayer(BinaryReader reader, byte version)
|
||||
{
|
||||
var portals = Array.Empty<GameBoxRect>();
|
||||
|
||||
if (version == 2)
|
||||
{
|
||||
portals = new GameBoxRect[8];
|
||||
@@ -82,10 +85,11 @@ namespace Core.DataReader.Nav
|
||||
{
|
||||
tiles[i] = new NavTile
|
||||
{
|
||||
Y = reader.ReadSingle(),
|
||||
Distance = reader.ReadUInt16(),
|
||||
FloorKind = (NavFloorKind) reader.ReadUInt16()
|
||||
GameBoxYPosition = reader.ReadSingle(),
|
||||
DistanceToNearestObstacle = reader.ReadByte(), //---| 1
|
||||
FloorKind = (NavFloorKind) reader.ReadByte() //----| 2
|
||||
};
|
||||
_ = reader.ReadBytes(2); //-----------------------------| ^ to complete 4-byte alignment
|
||||
}
|
||||
|
||||
return new NavTileLayer()
|
||||
@@ -99,14 +103,14 @@ namespace Core.DataReader.Nav
|
||||
};
|
||||
}
|
||||
|
||||
private static NavFaceLayer ReadFaceLayer(BinaryReader reader, byte version)
|
||||
private static NavFaceLayer ReadFaceLayer(BinaryReader reader)
|
||||
{
|
||||
var numberOfVertices = reader.ReadUInt16();
|
||||
var numberOfFaces = reader.ReadUInt16();
|
||||
var vertices = new Vector3[numberOfVertices];
|
||||
for (var i = 0; i < numberOfVertices; i++)
|
||||
{
|
||||
vertices[i] = reader.ReadVector3();
|
||||
vertices[i] = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3());
|
||||
}
|
||||
|
||||
var triangles = new int[numberOfFaces * 3];
|
||||
@@ -118,6 +122,27 @@ namespace Core.DataReader.Nav
|
||||
triangles[index + 2] = reader.ReadUInt16();
|
||||
}
|
||||
|
||||
// Some of the nav meshes in the original game are upside down (don't know why),
|
||||
// so we need to flip them if that's the case. You might argue that we can just
|
||||
// make the mesh double sided, but that would cause some other issues (trust me).
|
||||
{
|
||||
Vector3[] normals = Utility.CalculateNormals(vertices, triangles);
|
||||
|
||||
for (var i = 0; i < numberOfFaces; i++)
|
||||
{
|
||||
var index = i * 3;
|
||||
|
||||
// Determine if the face is pointing downwards.
|
||||
if (normals[triangles[index]].y +
|
||||
normals[triangles[index + 1]].y +
|
||||
normals[triangles[index + 2]].y < 0)
|
||||
{
|
||||
// Change the winding order of the face to make it point upwards.
|
||||
(triangles[index], triangles[index + 1]) = (triangles[index + 1], triangles[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new NavFaceLayer()
|
||||
{
|
||||
Vertices = vertices,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace Core.DataReader.Pol
|
||||
{
|
||||
public Vector3[] Positions;
|
||||
public Vector3[] Normals;
|
||||
public float[] Radii;
|
||||
public Color32[] DiffuseColors;
|
||||
public Color32[] SpecularColors;
|
||||
public Vector2[][] Uvs;
|
||||
@@ -36,7 +35,7 @@ namespace Core.DataReader.Pol
|
||||
|
||||
public struct PolMesh
|
||||
{
|
||||
public GameBoxAABBox BoundBox;
|
||||
public Bounds Bounds;
|
||||
public uint VertexFvfFlag;
|
||||
public PolVertexInfo VertexInfo;
|
||||
public PolTexture[] Textures;
|
||||
@@ -44,11 +43,11 @@ namespace Core.DataReader.Pol
|
||||
|
||||
public struct PolTexture
|
||||
{
|
||||
public uint BlendFlag; // 0--opaque, 1--alpha blend, 2--invert color blend, 3--add
|
||||
public GameBoxBlendFlag BlendFlag;
|
||||
public GameBoxMaterial Material;
|
||||
public string[] TextureNames;
|
||||
public int VertStart;
|
||||
public int VertEnd;
|
||||
public uint VertStart;
|
||||
public uint VertEnd;
|
||||
public int[] Triangles;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Core.DataReader.Pol
|
||||
nodeInfos[i] = new PolGeometryNode
|
||||
{
|
||||
Name = reader.ReadString(32, codepage),
|
||||
Position = reader.ReadVector3(),
|
||||
Position = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
|
||||
Radius = reader.ReadSingle(),
|
||||
Offset = reader.ReadInt32()
|
||||
};
|
||||
@@ -121,11 +121,11 @@ namespace Core.DataReader.Pol
|
||||
private static PolMesh ReadMeshData(BinaryReader reader, int version, int codepage)
|
||||
#endif
|
||||
{
|
||||
var boundBox = new GameBoxAABBox()
|
||||
{
|
||||
Min = reader.ReadVector3(),
|
||||
Max = reader.ReadVector3(),
|
||||
};
|
||||
var bounds = new Bounds();
|
||||
bounds.SetMinMax(
|
||||
GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
|
||||
GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()));
|
||||
|
||||
var vertexTypeFlag = reader.ReadUInt32();
|
||||
var numberOfVertices = reader.ReadInt32();
|
||||
|
||||
@@ -137,7 +137,6 @@ namespace Core.DataReader.Pol
|
||||
var positions = new Vector3[numberOfVertices];
|
||||
var normals = new Vector3[numberOfVertices];
|
||||
var diffuseColors = new Color32[numberOfVertices];
|
||||
var radii = new float[numberOfVertices];
|
||||
var specularColors = new Color32[numberOfVertices];
|
||||
var uvs = new Vector2[4][];
|
||||
|
||||
@@ -163,9 +162,7 @@ namespace Core.DataReader.Pol
|
||||
}
|
||||
if ((vertexTypeFlag & GameBoxVertexType.Normal) != 0)
|
||||
{
|
||||
normals[i] = GameBoxInterpreter
|
||||
.ToUnityVertex(reader.ReadVector3(),
|
||||
GameBoxInterpreter.GameBoxUnitToUnityUnit);
|
||||
normals[i] = GameBoxInterpreter.ToUnityNormal(reader.ReadVector3());
|
||||
}
|
||||
if ((vertexTypeFlag & GameBoxVertexType.Diffuse) != 0)
|
||||
{
|
||||
@@ -199,6 +196,9 @@ namespace Core.DataReader.Pol
|
||||
var y = reader.ReadSingle();
|
||||
uvs[3][i] = new Vector2(x, y);
|
||||
}
|
||||
|
||||
// Quick fix for the missing/wrong normals
|
||||
if (normals[i] == Vector3.zero) normals[i] = Vector3.up;
|
||||
}
|
||||
|
||||
var vertexInfo = new PolVertexInfo()
|
||||
@@ -206,7 +206,6 @@ namespace Core.DataReader.Pol
|
||||
Positions = positions,
|
||||
Normals = normals,
|
||||
DiffuseColors = diffuseColors,
|
||||
Radii = radii,
|
||||
SpecularColors = specularColors,
|
||||
Uvs = uvs,
|
||||
};
|
||||
@@ -222,7 +221,7 @@ namespace Core.DataReader.Pol
|
||||
|
||||
return new PolMesh
|
||||
{
|
||||
BoundBox = boundBox,
|
||||
Bounds = bounds,
|
||||
VertexFvfFlag = vertexTypeFlag,
|
||||
VertexInfo = vertexInfo,
|
||||
Textures = textureInfos
|
||||
@@ -235,7 +234,7 @@ namespace Core.DataReader.Pol
|
||||
private static PolTexture ReadTextureInfo(BinaryReader reader, int version, int codepage)
|
||||
#endif
|
||||
{
|
||||
var blendFlag = reader.ReadUInt32();
|
||||
var blendFlag = (GameBoxBlendFlag)reader.ReadUInt32();
|
||||
|
||||
var material = new GameBoxMaterial()
|
||||
{
|
||||
@@ -259,24 +258,22 @@ namespace Core.DataReader.Pol
|
||||
textureNames[i] = textureName;
|
||||
}
|
||||
|
||||
var indexBits = reader.ReadInt32();
|
||||
if (indexBits != 16) throw new Exception($"IndexBits is invalid: {indexBits}");
|
||||
|
||||
var vertStart = reader.ReadInt32();
|
||||
var vertEnd = reader.ReadInt32();
|
||||
_ = reader.ReadInt32();
|
||||
var vertStart = reader.ReadUInt32();
|
||||
var vertEnd = reader.ReadUInt32();
|
||||
var numberOfFaces = reader.ReadInt32();
|
||||
|
||||
var triangles = new int[numberOfFaces * 3];
|
||||
for (var i = 0; i < numberOfFaces; i++)
|
||||
{
|
||||
var index = i * 3;
|
||||
var x = reader.ReadInt16();
|
||||
var y = reader.ReadInt16();
|
||||
var z = reader.ReadInt16();
|
||||
(triangles[index], triangles[index + 1], triangles[index + 2]) =
|
||||
GameBoxInterpreter.ToUnityTriangle((x, y, z));
|
||||
triangles[index] = reader.ReadUInt16();
|
||||
triangles[index + 1] = reader.ReadUInt16();
|
||||
triangles[index + 2] = reader.ReadUInt16();
|
||||
}
|
||||
|
||||
GameBoxInterpreter.ToUnityTriangles(triangles);
|
||||
|
||||
return new PolTexture()
|
||||
{
|
||||
BlendFlag = blendFlag,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Scn
|
||||
{
|
||||
using System;
|
||||
using GameBox;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
@@ -51,43 +52,51 @@ namespace Core.DataReader.Scn
|
||||
{
|
||||
AutoTrigger = 0, // 自动触发点
|
||||
Shakeable = 1, // 碰到后摇晃的物品
|
||||
Knockdownable = 2, // 碰到后翻倒的物品
|
||||
Arrow = 3, // 飞箭类 (JG06霹雳堂总舵飞剑)
|
||||
#if PAL3
|
||||
Collidable = 2, // 碰到后翻倒的物品
|
||||
#elif PAL3A
|
||||
Switch = 2, // 开关
|
||||
#endif
|
||||
Arrow = 3, // 飞箭类 (霹雳堂总舵飞剑)
|
||||
FallableWeapon = 4, // 落下的伤害物体 (冰棱)
|
||||
MovableCarrier = 5, // 移动浮板 (固定速度和路线往复移动,可载人)
|
||||
Trap = 6, // 陷阱 (调用脚本切换场景)
|
||||
RotatingStoneBeam = 7, // 旋传石梁 (一字型)
|
||||
RotatingWall = 8, // 旋转墙 (折尺型,JG13)
|
||||
RotatingBridge = 7, // 旋传石梁 (一字型)
|
||||
RotatingWall = 8, // 旋转墙 (折尺型)
|
||||
PreciseTrigger = 9, // 精确触发点
|
||||
WindBlower = 10, // 风口
|
||||
Pushable = 11, // 推箱子
|
||||
SpecialMechanism = 12, // 主角特技机关
|
||||
ImpulsiveMechanism = 13, // 冲撞
|
||||
Door = 14, // 门,场景切换点
|
||||
SpecialSwitch = 12, // 主角特技机关
|
||||
Impulsive = 13, // 冲撞类机关
|
||||
Door = 14, // 门,场景切换点
|
||||
Climbable = 15, // 藤蔓或梯子 (可爬物)
|
||||
InvestigationTriggerObject = 16, // 调查触发物体
|
||||
InvestigationTrigger = 16, // 调查触发物体
|
||||
StaticOrAnimated = 17, // 死物体或者随机动画播放(通用参数[0]:对应的地面是否可通过)
|
||||
Billboard = 18, // 公告板
|
||||
SuspensionBridge = 19, // 吊桥 (壁山)
|
||||
VirtualInvestigationTrigger = 20, // 虚拟BOX调查触发
|
||||
EyeBall = 21, // 锁妖塔:眼球
|
||||
LiftingMechanism = 22, // 锁妖塔:升降铁链或平台
|
||||
LiftingPlatform = 22, // 锁妖塔:升降铁链或平台
|
||||
// 通用参数[0]:为升起后的高度,需要用其他开关间接触发
|
||||
// 通用参数[1]:升起后到高层
|
||||
// 通用参数[2]:平台上的其他物件编号
|
||||
// 通用参数[3]:初始为可通过?)
|
||||
#if PAL3
|
||||
Switch = 23, // 开关 (可触发其他机关)
|
||||
#elif PAL3A
|
||||
NotUsed = 23, // 弃用
|
||||
#endif
|
||||
Collectable = 24, // 可以拣起的道具 (通用参数[0]:得到物品的数据库ID)
|
||||
General = 25, // 普通物品
|
||||
RareChest = 26, // 迷宫大宝箱
|
||||
WishPool = 27, // 许愿池
|
||||
ColdWeapon = 28, // (M24)剑或锤
|
||||
GravityTrigger = 29, // 重力机关
|
||||
ElevatorSwitch = 30, // 升降机关门
|
||||
WaterSurfaceMechanism = 31, // 水面机关
|
||||
GravitySwitch = 29, // 重力机关(乌龟)
|
||||
ElevatorDoor = 30, // 升降机关门
|
||||
WaterSurface = 31, // 水面机关
|
||||
PiranhaFlower = 32, // 食人花
|
||||
PedalSwitch = 33, // 踏板开关
|
||||
SwordBridge = 34, // (m24)剑桥(触发后向前伸)
|
||||
SwordBridge = 34, // (m24)剑桥(触发后向前伸)
|
||||
SlideWay = 35, // 滑道
|
||||
FallableObstacle = 36, // 坠落的障碍物
|
||||
DivineTreeFlower = 37, // (神树)花
|
||||
@@ -98,7 +107,7 @@ namespace Core.DataReader.Scn
|
||||
SavingPoint = 42, // 存盘点
|
||||
SceneSfx = 43, // 场景音效
|
||||
JumpableArea = 44, // 可跳跃区域
|
||||
|
||||
|
||||
// PAL3A new scene objects
|
||||
UnknownObj47 = 47, // PAL3A m19 8
|
||||
UnknownObj48 = 48, // PAL3A m19 8
|
||||
@@ -127,18 +136,71 @@ namespace Core.DataReader.Scn
|
||||
public struct ScnPath
|
||||
{
|
||||
public int NumberOfWaypoints;
|
||||
public Vector3[] Waypoints; // Max of 16 waypoints
|
||||
public Vector3[] GameBoxWaypoints; // 原GameBox引擎坐标系下的路径点(X, Y, Z)数组。固定数组长度为16.
|
||||
}
|
||||
|
||||
public struct ScnSceneInfo
|
||||
{
|
||||
public string CityName; // char[32] 关名称
|
||||
public string Name; // char[32] 区块名称
|
||||
public string Model; // char[32]
|
||||
public string CityName; // char[32] 关卡/区块名称
|
||||
public string SceneName; // char[32] 场景名称
|
||||
public string Model; // char[32] 模型名称
|
||||
public ScnSceneType SceneType;
|
||||
public int LightMap; // 0日景灯光, 1夜景灯光, -1不知道是什么意思(比如M01)
|
||||
public int LightMap; // 0日景灯光, 1夜景灯光, -1无灯光?(比如M01)
|
||||
public uint SkyBox;
|
||||
public uint[] Reserved; // 6 DWORDs
|
||||
|
||||
/// <summary>
|
||||
/// Check if two scene share the same model.
|
||||
/// </summary>
|
||||
/// <param name="sceneInfo">ScnSceneInfo</param>
|
||||
/// <returns>True if two scene share the same model</returns>
|
||||
public bool ModelEquals(ScnSceneInfo sceneInfo)
|
||||
{
|
||||
#if PAL3
|
||||
return string.Equals(CityName, sceneInfo.CityName, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(Model, sceneInfo.Model, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
#elif PAL3A
|
||||
var modelAName = Model;
|
||||
if (modelAName.EndsWith("y", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
modelAName = modelAName[..^1];
|
||||
}
|
||||
var modelBName = sceneInfo.Model;
|
||||
if (modelBName.EndsWith("y", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
modelBName = modelBName[..^1];
|
||||
|
||||
}
|
||||
return string.Equals(CityName, sceneInfo.CityName, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(modelAName, modelBName, StringComparison.OrdinalIgnoreCase);
|
||||
#endif
|
||||
}
|
||||
|
||||
public bool Is(string cityName, string sceneName)
|
||||
{
|
||||
return IsCity(cityName) && IsScene(sceneName);
|
||||
}
|
||||
|
||||
public bool IsCity(string cityName)
|
||||
{
|
||||
return string.Equals(CityName, cityName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private bool IsScene(string sceneName)
|
||||
{
|
||||
return string.Equals(SceneName, sceneName, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"City: {CityName.ToLower()}, " +
|
||||
$"Scene: {SceneName.ToLower()}, " +
|
||||
$"Model: {Model.ToLower()}, " +
|
||||
$"Type: {SceneType}, " +
|
||||
$"LightMap: {LightMap}, " +
|
||||
$"SkyBox: {SkyBox}";
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
@@ -158,23 +220,18 @@ namespace Core.DataReader.Scn
|
||||
// char[32] Npc名字
|
||||
public string Name;
|
||||
|
||||
// char[32] 贴图编号
|
||||
// char[34] 贴图编号 (无用)
|
||||
public string Texture;
|
||||
|
||||
// 2 bytes unknown data
|
||||
public byte[] Unknown1;
|
||||
|
||||
// 人物初始朝向
|
||||
public float FacingDirection;
|
||||
|
||||
public byte OnLayer;
|
||||
// 初始地层
|
||||
public int LayerIndex;
|
||||
|
||||
// 3 bytes unknown data
|
||||
public byte[] Unknown2;
|
||||
|
||||
// 初始位置
|
||||
public float PositionX;
|
||||
public float PositionZ;
|
||||
// 原GameBox引擎下的初始位置(X,Z)
|
||||
public float GameBoxXPosition;
|
||||
public float GameBoxZPosition;
|
||||
|
||||
// 初始是否可见
|
||||
public int InitActive;
|
||||
@@ -186,8 +243,9 @@ namespace Core.DataReader.Scn
|
||||
public uint ScriptId;
|
||||
|
||||
// 初始Y坐标,只有在 InitBehaviour == Hold
|
||||
// 的时候 PositionY 和 InitAction 才有用
|
||||
public float PositionY;
|
||||
// 的时候 GameBoxYPosition 和 InitAction 才有用
|
||||
public float GameBoxYPosition; // 原GameBox引擎下的Y坐标
|
||||
|
||||
// chars[16] 初始动作
|
||||
public string InitAction;
|
||||
|
||||
@@ -214,29 +272,29 @@ namespace Core.DataReader.Scn
|
||||
// 一关中唯一的编号
|
||||
public byte Id;
|
||||
|
||||
// 是否激活 (不激活相当于没这个物体)
|
||||
public byte Active;
|
||||
// 初始是否激活 (不激活相当于没这个物体)
|
||||
public byte InitActive;
|
||||
|
||||
// 可触发次数 (0表示不可触发,0xFF表示无限触发)
|
||||
// 可触发次数 (0表示不可触发,1表示只能触发一次(收集类道具),0xFF表示无限触发)
|
||||
public byte Times;
|
||||
|
||||
// 开关状态 (0代表关, 1代表开)
|
||||
public byte Switch;
|
||||
public byte SwitchState;
|
||||
|
||||
// char[32] 物品名称,对应美术模型,带扩展名
|
||||
public string Name;
|
||||
|
||||
// 触发标志,0x01地砖自动触发,0x02模型OBB调查触发
|
||||
public ushort TriggerType;
|
||||
// 触发类型,1地砖自动触发,2模型调查触发
|
||||
public byte TriggerType;
|
||||
|
||||
// 是否产生阻挡
|
||||
public ushort NonBlocking;
|
||||
public byte IsNonBlocking;
|
||||
|
||||
// 模型位置
|
||||
public Vector3 Position;
|
||||
// 原GameBox引擎下的模型位置
|
||||
public Vector3 GameBoxPosition;
|
||||
|
||||
// 渲染模型的时候转动多少角度(绕Y轴)
|
||||
public float YRotation;
|
||||
public float GameBoxYRotation;
|
||||
|
||||
// 触发范围(TileMap区域)
|
||||
public GameBoxRect TileMapTriggerRect;
|
||||
@@ -248,7 +306,7 @@ namespace Core.DataReader.Scn
|
||||
public byte SaveState;
|
||||
|
||||
// 在哪个地层
|
||||
public byte OnLayer;
|
||||
public byte LayerIndex;
|
||||
|
||||
// 五灵属性,0~5代表,用于大宝箱
|
||||
public byte WuLing;
|
||||
@@ -270,44 +328,54 @@ namespace Core.DataReader.Scn
|
||||
24 以拣起的道具
|
||||
[0]:得到物品的数据库ID
|
||||
*/
|
||||
#if PAL3
|
||||
|
||||
public int[] Parameters;
|
||||
#elif PAL3A
|
||||
public float[] Parameters;
|
||||
|
||||
#if PAL3A
|
||||
public uint Unknown1; // always 0
|
||||
#endif
|
||||
|
||||
// 触发条件
|
||||
public ushort NeedSpecialAction; // 对应特殊行走技能,0xFF为无此条件
|
||||
public ushort NeedItem; // 需要物品,0xFF为无此条件
|
||||
public ushort NeedGold; // 需要金钱值
|
||||
public ushort NeedLv; // 需要等级数
|
||||
public ushort NeedWu; // 需要武力值 (如果无此限制,则设成最小值)
|
||||
public ushort NeedAllOpen; // 场景中所有需检测的机关都为开
|
||||
public string FailedMessage; // char[16] 失败提示字符串名称
|
||||
public byte RequireSpecialAction; // 对应特殊行走技能,0xFF为无此条件
|
||||
public ushort RequireItem; // 需要物品,0xFF为无此条件
|
||||
public ushort RequireMoney; // 需要金钱值
|
||||
public ushort RequireLevel; // 需要等级数
|
||||
public ushort RequireAttackValue; // 需要武力值 (如果无此限制,则设成最小值)
|
||||
public byte RequireAllMechanismsSolved; // 场景中所有需检测的机关都为开
|
||||
public string FailedMessage; // char[16] 失败提示字符串名称
|
||||
|
||||
#if PAL3A
|
||||
public uint Unknown2;
|
||||
#endif
|
||||
|
||||
public uint ScriptId;
|
||||
|
||||
public ScnPath Path;
|
||||
|
||||
// 触发结果
|
||||
public ushort LinkedObject; // 触发其它机关的编号;
|
||||
public ushort LinkedObjectId; // 触发其它机关的编号;
|
||||
|
||||
// 与场景的某个开关相关
|
||||
public string DependentSceneName; // char[32]
|
||||
public ushort DependentId;
|
||||
public byte DependentObjectId;
|
||||
|
||||
public Bounds Bounds;
|
||||
public float GameBoxXRotation; // 绕X轴旋转
|
||||
#if PAL3A
|
||||
public float GameBoxZRotation; // 绕Z轴旋转
|
||||
#endif
|
||||
public string SfxName; // 音效文件名
|
||||
|
||||
public GameBoxAABBox BoundBox;
|
||||
public float XRotation; // 绕X轴旋转
|
||||
public float ZRotation; // 绕Z轴旋转
|
||||
public string SfxName; // char[8] 特效参数
|
||||
|
||||
public uint EffectModelType;
|
||||
|
||||
public uint ScriptChangeActive;
|
||||
public uint ScriptActivated;
|
||||
public uint ScriptMoved;
|
||||
public uint[] Reserved; // 52 DWORDs
|
||||
|
||||
public byte[] Unknown1;
|
||||
public byte[] Unknown2;
|
||||
#if PAL3A
|
||||
public uint Unknown3;
|
||||
#endif
|
||||
|
||||
public uint[] Reserved; // PAL3: 52 DWORDs PAL3A: 44 DWORDs
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.DataReader.Scn
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Extensions;
|
||||
using GameBox;
|
||||
using UnityEngine;
|
||||
@@ -33,7 +35,7 @@ namespace Core.DataReader.Scn
|
||||
var sceneInfo = new ScnSceneInfo()
|
||||
{
|
||||
CityName = reader.ReadString(32, codepage),
|
||||
Name = reader.ReadString(32, codepage),
|
||||
SceneName = reader.ReadString(32, codepage),
|
||||
Model = reader.ReadString(32, codepage),
|
||||
SceneType = (ScnSceneType) reader.ReadInt32(),
|
||||
LightMap = reader.ReadInt32(),
|
||||
@@ -45,16 +47,7 @@ namespace Core.DataReader.Scn
|
||||
var npcInfos = new ScnNpcInfo[numberOfNpc];
|
||||
for (var i = 0; i < numberOfNpc; i++)
|
||||
{
|
||||
ScnNpcInfo npcInfo = ReadNpcInfo(reader, codepage);
|
||||
if (npcInfo.Unknown1[0] != 0 ||
|
||||
npcInfo.Unknown1[1] != 0 ||
|
||||
npcInfo.Unknown2[0] != 0 ||
|
||||
npcInfo.Unknown2[1] != 0 ||
|
||||
npcInfo.Unknown2[2] != 0)
|
||||
{
|
||||
Debug.LogError($"Unknown byte has value for ActorId: {npcInfo.Id} Name: {npcInfo.Name}");
|
||||
}
|
||||
npcInfos[i] = npcInfo;
|
||||
npcInfos[i] = ReadNpcInfo(reader, codepage);
|
||||
}
|
||||
|
||||
reader.BaseStream.Seek(objectDataOffset, SeekOrigin.Begin);
|
||||
@@ -75,17 +68,15 @@ namespace Core.DataReader.Scn
|
||||
Id = reader.ReadByte(),
|
||||
Kind = (ScnActorKind)reader.ReadByte(),
|
||||
Name = reader.ReadString(32, codepage),
|
||||
Texture = reader.ReadString(32, codepage),
|
||||
Unknown1 = reader.ReadBytes(2),
|
||||
Texture = reader.ReadString(34, codepage),
|
||||
FacingDirection = reader.ReadSingle(),
|
||||
OnLayer = reader.ReadByte(),
|
||||
Unknown2 = reader.ReadBytes(3),
|
||||
PositionX = reader.ReadSingle(),
|
||||
PositionZ = reader.ReadSingle(),
|
||||
LayerIndex = reader.ReadInt32(),
|
||||
GameBoxXPosition = reader.ReadSingle(),
|
||||
GameBoxZPosition = reader.ReadSingle(),
|
||||
InitActive = reader.ReadInt32(),
|
||||
InitBehaviour = (ScnActorBehaviour) reader.ReadInt32(),
|
||||
ScriptId = reader.ReadUInt32(),
|
||||
PositionY = reader.ReadSingle(),
|
||||
GameBoxYPosition = reader.ReadSingle(),
|
||||
InitAction = reader.ReadString(16, codepage),
|
||||
MonsterId = reader.ReadUInt32Array(3),
|
||||
MonsterNumber = reader.ReadUInt16(),
|
||||
@@ -93,7 +84,7 @@ namespace Core.DataReader.Scn
|
||||
Path = new ScnPath()
|
||||
{
|
||||
NumberOfWaypoints = reader.ReadInt32(),
|
||||
Waypoints = reader.ReadVector3Array(16)
|
||||
GameBoxWaypoints = reader.ReadVector3Array(16)
|
||||
},
|
||||
NoTurn = reader.ReadUInt32(),
|
||||
LoopAction = reader.ReadUInt32(),
|
||||
@@ -104,140 +95,168 @@ namespace Core.DataReader.Scn
|
||||
|
||||
private static ScnObjectInfo ReadObjectInfo(BinaryReader reader, int codepage)
|
||||
{
|
||||
var id = reader.ReadByte();
|
||||
var initActive = reader.ReadByte();
|
||||
var times = reader.ReadByte();
|
||||
var switchState = reader.ReadByte();
|
||||
|
||||
var name = reader.ReadString(32, codepage);
|
||||
|
||||
var triggerType = reader.ReadByte();
|
||||
var isNonBlocking = reader.ReadByte();
|
||||
_ = reader.ReadBytes(2); // Empty padding bytes to complete 4-byte alignment
|
||||
|
||||
var gameBoxPosition = reader.ReadVector3();
|
||||
var yRotation = reader.ReadSingle();
|
||||
|
||||
var tileMapTriggerRect = new GameBoxRect()
|
||||
{
|
||||
Left = reader.ReadInt32(),
|
||||
Top = reader.ReadInt32(),
|
||||
Right = reader.ReadInt32(),
|
||||
Bottom = reader.ReadInt32(),
|
||||
};
|
||||
|
||||
var type = (ScnSceneObjectType) reader.ReadByte();
|
||||
var saveState = reader.ReadByte();
|
||||
var layerIndex = reader.ReadByte();
|
||||
var wuLing = reader.ReadByte();
|
||||
|
||||
#if PAL3
|
||||
return new ScnObjectInfo()
|
||||
{
|
||||
Id = reader.ReadByte(),
|
||||
Active = reader.ReadByte(),
|
||||
Times = reader.ReadByte(),
|
||||
Switch = reader.ReadByte(),
|
||||
|
||||
Name = reader.ReadString(32, codepage),
|
||||
TriggerType = reader.ReadUInt16(),
|
||||
NonBlocking = reader.ReadUInt16(),
|
||||
|
||||
Position = reader.ReadVector3(),
|
||||
YRotation = reader.ReadSingle(),
|
||||
TileMapTriggerRect = new GameBoxRect()
|
||||
{
|
||||
Left = reader.ReadInt32(),
|
||||
Top = reader.ReadInt32(),
|
||||
Right = reader.ReadInt32(),
|
||||
Bottom = reader.ReadInt32(),
|
||||
},
|
||||
|
||||
Type = (ScnSceneObjectType) reader.ReadByte(),
|
||||
SaveState = reader.ReadByte(),
|
||||
OnLayer = reader.ReadByte(),
|
||||
WuLing = reader.ReadByte(),
|
||||
|
||||
Parameters = reader.ReadInt32Array(6),
|
||||
|
||||
NeedSpecialAction = reader.ReadUInt16(),
|
||||
NeedItem = reader.ReadUInt16(),
|
||||
NeedGold = reader.ReadUInt16(),
|
||||
NeedLv = reader.ReadUInt16(),
|
||||
NeedWu = reader.ReadUInt16(),
|
||||
NeedAllOpen = reader.ReadUInt16(),
|
||||
FailedMessage = reader.ReadString(16, codepage),
|
||||
|
||||
ScriptId = reader.ReadUInt32(),
|
||||
Path = new ScnPath()
|
||||
{
|
||||
NumberOfWaypoints = reader.ReadInt32(),
|
||||
Waypoints = reader.ReadVector3Array(16)
|
||||
},
|
||||
|
||||
LinkedObject = reader.ReadUInt16(),
|
||||
DependentSceneName = reader.ReadString(32, codepage),
|
||||
DependentId = reader.ReadUInt16(),
|
||||
|
||||
BoundBox = new GameBoxAABBox()
|
||||
{
|
||||
Min = reader.ReadVector3(),
|
||||
Max = reader.ReadVector3()
|
||||
},
|
||||
|
||||
XRotation = reader.ReadSingle(),
|
||||
SfxName = reader.ReadString(8, codepage),
|
||||
EffectModelType = reader.ReadUInt32(),
|
||||
|
||||
ScriptChangeActive = reader.ReadUInt32(),
|
||||
ScriptMoved = reader.ReadUInt32(),
|
||||
|
||||
Reserved = reader.ReadUInt32Array(52)
|
||||
};
|
||||
var parameters = reader.ReadInt32Array(6);
|
||||
#elif PAL3A
|
||||
var parameters = Array.ConvertAll(reader.ReadSingleArray(6), Convert.ToInt32);
|
||||
#endif
|
||||
|
||||
#if PAL3A
|
||||
var unknown1 = reader.ReadUInt32(); // TODO
|
||||
#endif
|
||||
|
||||
var requireSpecialAction = reader.ReadByte();
|
||||
var requireItem = reader.ReadUInt16();
|
||||
_ = reader.ReadByte(); // Empty padding byte to complete 4-byte alignment
|
||||
|
||||
var requireMoney = reader.ReadUInt16();
|
||||
var requireLevel = reader.ReadUInt16();
|
||||
|
||||
var requireAttackValue = reader.ReadUInt16();
|
||||
var requireAllMechanismsSolved = reader.ReadByte();
|
||||
var failedMessage = reader.ReadString(16, codepage);
|
||||
_ = reader.ReadByte(); // Empty padding byte to complete 4-byte alignment
|
||||
|
||||
#if PAL3A
|
||||
var unknown2 = reader.ReadUInt32(); // TODO
|
||||
#endif
|
||||
|
||||
var scriptId = reader.ReadUInt32();
|
||||
|
||||
var path = new ScnPath()
|
||||
{
|
||||
NumberOfWaypoints = reader.ReadInt32(),
|
||||
GameBoxWaypoints = reader.ReadVector3Array(16)
|
||||
};
|
||||
|
||||
var linkedObjectId = reader.ReadUInt16();
|
||||
var dependentSceneName = reader.ReadString(32, codepage);
|
||||
var dependentObjectId = reader.ReadByte();
|
||||
_ = reader.ReadByte(); // Empty padding byte to complete 4-byte alignment
|
||||
|
||||
var bounds = new Bounds();
|
||||
bounds.SetMinMax(
|
||||
GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
|
||||
GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()));
|
||||
|
||||
var xRotation = reader.ReadSingle();
|
||||
|
||||
#if PAL3A
|
||||
var zRotation = reader.ReadSingle();
|
||||
#endif
|
||||
|
||||
var sfxName = reader.ReadString(8, codepage);
|
||||
|
||||
var effectModelType = reader.ReadUInt32();
|
||||
|
||||
var scriptActivated = reader.ReadUInt32();
|
||||
var scriptMoved = reader.ReadUInt32();
|
||||
|
||||
#if PAL3A
|
||||
var unknown3 = reader.ReadUInt32(); // TODO
|
||||
#endif
|
||||
|
||||
#if PAL3
|
||||
var reserved = reader.ReadUInt32Array(52);
|
||||
#elif PAL3A
|
||||
var reserved = reader.ReadUInt32Array(44);
|
||||
#endif
|
||||
|
||||
return new ScnObjectInfo()
|
||||
{
|
||||
Id = reader.ReadByte(),
|
||||
Active = reader.ReadByte(),
|
||||
Times = reader.ReadByte(),
|
||||
Switch = reader.ReadByte(),
|
||||
Id = id,
|
||||
InitActive = initActive,
|
||||
Times = times,
|
||||
SwitchState = switchState,
|
||||
|
||||
Name = reader.ReadString(32, codepage),
|
||||
TriggerType = reader.ReadUInt16(),
|
||||
NonBlocking = reader.ReadUInt16(),
|
||||
Name = name,
|
||||
|
||||
Position = reader.ReadVector3(),
|
||||
YRotation = reader.ReadSingle(),
|
||||
TileMapTriggerRect = new GameBoxRect()
|
||||
{
|
||||
Left = reader.ReadInt32(),
|
||||
Top = reader.ReadInt32(),
|
||||
Right = reader.ReadInt32(),
|
||||
Bottom = reader.ReadInt32(),
|
||||
},
|
||||
TriggerType = triggerType,
|
||||
IsNonBlocking = isNonBlocking,
|
||||
|
||||
Type = (ScnSceneObjectType) reader.ReadByte(),
|
||||
SaveState = reader.ReadByte(),
|
||||
OnLayer = reader.ReadByte(),
|
||||
WuLing = reader.ReadByte(),
|
||||
|
||||
Parameters = reader.ReadSingleArray(6),
|
||||
|
||||
// TODO
|
||||
Unknown1 = reader.ReadBytes(4),
|
||||
GameBoxPosition = gameBoxPosition,
|
||||
GameBoxYRotation = yRotation,
|
||||
TileMapTriggerRect = tileMapTriggerRect,
|
||||
|
||||
NeedSpecialAction = reader.ReadUInt16(),
|
||||
NeedItem = reader.ReadUInt16(),
|
||||
NeedGold = reader.ReadUInt16(),
|
||||
NeedLv = reader.ReadUInt16(),
|
||||
NeedWu = reader.ReadUInt16(),
|
||||
NeedAllOpen = reader.ReadUInt16(),
|
||||
FailedMessage = reader.ReadString(16, codepage),
|
||||
Type = type,
|
||||
SaveState = saveState,
|
||||
LayerIndex = layerIndex,
|
||||
WuLing = wuLing,
|
||||
|
||||
// TODO
|
||||
Unknown2 = reader.ReadBytes(4),
|
||||
ScriptId = reader.ReadUInt32(),
|
||||
Parameters = parameters,
|
||||
|
||||
Path = new ScnPath()
|
||||
{
|
||||
NumberOfWaypoints = reader.ReadInt32(),
|
||||
Waypoints = reader.ReadVector3Array(16)
|
||||
},
|
||||
#if PAL3A
|
||||
Unknown1 = unknown1, // TODO
|
||||
#endif
|
||||
|
||||
LinkedObject = reader.ReadUInt16(),
|
||||
DependentSceneName = reader.ReadString(32, codepage),
|
||||
DependentId = reader.ReadUInt16(),
|
||||
RequireSpecialAction = requireSpecialAction,
|
||||
RequireItem = requireItem,
|
||||
RequireMoney = requireMoney,
|
||||
RequireLevel = requireLevel,
|
||||
RequireAttackValue = requireAttackValue,
|
||||
RequireAllMechanismsSolved = requireAllMechanismsSolved,
|
||||
|
||||
BoundBox = new GameBoxAABBox()
|
||||
{
|
||||
Min = reader.ReadVector3(),
|
||||
Max = reader.ReadVector3()
|
||||
},
|
||||
FailedMessage = failedMessage,
|
||||
|
||||
XRotation = reader.ReadSingle(),
|
||||
ZRotation = reader.ReadSingle(),
|
||||
SfxName = reader.ReadString(8, codepage),
|
||||
EffectModelType = reader.ReadUInt32(),
|
||||
#if PAL3A
|
||||
Unknown2 = unknown2, // TODO
|
||||
#endif
|
||||
|
||||
ScriptChangeActive = reader.ReadUInt32(),
|
||||
ScriptMoved = reader.ReadUInt32(),
|
||||
ScriptId = scriptId,
|
||||
|
||||
Reserved = reader.ReadUInt32Array(45)
|
||||
Path = path,
|
||||
|
||||
LinkedObjectId = linkedObjectId,
|
||||
DependentSceneName = dependentSceneName,
|
||||
DependentObjectId = dependentObjectId,
|
||||
|
||||
Bounds = bounds,
|
||||
|
||||
GameBoxXRotation = xRotation,
|
||||
|
||||
#if PAL3A
|
||||
GameBoxZRotation = zRotation,
|
||||
#endif
|
||||
|
||||
SfxName = sfxName,
|
||||
EffectModelType = effectModelType,
|
||||
|
||||
ScriptActivated = scriptActivated,
|
||||
ScriptMoved = scriptMoved,
|
||||
|
||||
#if PAL3A
|
||||
Unknown3 = unknown3, // TODO
|
||||
#endif
|
||||
|
||||
Reserved = reserved,
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -68,7 +68,17 @@ namespace Core.Extensions
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
|
||||
public static short[] ReadInt16Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var integers = new short[count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
integers[i] = binaryReader.ReadInt16();
|
||||
}
|
||||
return integers;
|
||||
}
|
||||
|
||||
public static ushort[] ReadUInt16Array(this BinaryReader binaryReader, int count)
|
||||
{
|
||||
var integers = new ushort[count];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Core.FileSystem
|
||||
{
|
||||
rootPath = !string.IsNullOrEmpty(rootPath) ? rootPath : throw new ArgumentNullException(nameof(rootPath));
|
||||
crcHash = crcHash ?? throw new ArgumentNullException(nameof(crcHash));
|
||||
|
||||
|
||||
if (!rootPath.EndsWith(Path.DirectorySeparatorChar))
|
||||
{
|
||||
rootPath += Path.DirectorySeparatorChar;
|
||||
@@ -72,7 +72,7 @@ namespace Core.FileSystem
|
||||
cpkArchive.Init();
|
||||
_cpkArchives[cpkFileName] = cpkArchive;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists in any of the segmented archives using virtual path.
|
||||
/// </summary>
|
||||
@@ -88,7 +88,7 @@ namespace Core.FileSystem
|
||||
segmentedArchiveName = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Check if the file exists in any of the segmented cpk archives.
|
||||
foreach (var subCpkPath in _cpkArchives.Keys
|
||||
.Where(_ => _.StartsWith(cpkFileName[..^CpkConstants.FileExtension.Length] + '_', StringComparison.OrdinalIgnoreCase)))
|
||||
@@ -141,10 +141,10 @@ namespace Core.FileSystem
|
||||
public byte[] ReadAllBytes(string fileVirtualPath)
|
||||
{
|
||||
ParseFileVirtualPath(fileVirtualPath, out var cpkFileName, out var relativeVirtualPath);
|
||||
|
||||
|
||||
if (_cpkArchives.ContainsKey(cpkFileName))
|
||||
{
|
||||
return _cpkArchives[cpkFileName].ReadAllBytes(relativeVirtualPath);
|
||||
return _cpkArchives[cpkFileName].ReadAllBytes(relativeVirtualPath);
|
||||
}
|
||||
|
||||
// Find and read the file content in segmented cpk archives.
|
||||
@@ -154,7 +154,7 @@ namespace Core.FileSystem
|
||||
var relativePathInSubCpk = relativeVirtualPath.Replace(cpkFileName, subCpkPath);
|
||||
if (_cpkArchives[subCpkPath].FileExists(relativePathInSubCpk))
|
||||
{
|
||||
return _cpkArchives[subCpkPath].ReadAllBytes(relativePathInSubCpk);
|
||||
return _cpkArchives[subCpkPath].ReadAllBytes(relativePathInSubCpk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +204,25 @@ namespace Core.FileSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extract all archives to the specified destination
|
||||
/// </summary>
|
||||
public void ExtractTo(string outputFolder)
|
||||
{
|
||||
foreach ((string cpkFileName, CpkArchive cpkArchive) in _cpkArchives)
|
||||
{
|
||||
var outputDir = outputFolder + cpkFileName + Path.DirectorySeparatorChar;
|
||||
|
||||
if (!Directory.Exists(outputDir))
|
||||
{
|
||||
Directory.CreateDirectory(outputDir);
|
||||
}
|
||||
|
||||
cpkArchive.ExtractTo(outputDir);
|
||||
Debug.Log($"{cpkFileName} extracted to {outputDir}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search files using keyword.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Core.FileSystem
|
||||
/// <param name="segmentedArchiveName">Name of the segmented archive if exists</param>
|
||||
/// <returns>True if file exists in segmented archive</returns>
|
||||
public bool FileExistsInSegmentedArchive(string fileVirtualPath, out string segmentedArchiveName);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Check if file exists in the archive using virtual path.
|
||||
/// </summary>
|
||||
@@ -64,6 +64,11 @@ namespace Core.FileSystem
|
||||
/// </summary>
|
||||
public void DisposeAllInMemoryArchives();
|
||||
|
||||
/// <summary>
|
||||
/// Extract all archives to the specified destination
|
||||
/// </summary>
|
||||
public void ExtractTo(string outputFolder);
|
||||
|
||||
/// <summary>
|
||||
/// Search files using keyword.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -10,17 +10,14 @@ namespace Core.GameBox
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Used to convert GameBox specific rendering related metadata to Unity standard.
|
||||
/// Interpreter/convertor to convert GameBox specific rendering related metrics to Unity standard units that fits
|
||||
/// well with the engine and editor.
|
||||
/// </summary>
|
||||
public static class GameBoxInterpreter
|
||||
{
|
||||
public const float GameBoxUnitToUnityUnit = 20f;
|
||||
public const float GameBoxCvdUnitToUnityUnit = 20f;
|
||||
public const float GameBoxMv3UnitToUnityUnit = 1270f;
|
||||
|
||||
// Since GameBox's rendering pipeline uses different internal axis system.
|
||||
// Here we are flipping the x here to minor it back to the Unity axis.
|
||||
// Also we want to scale it to proper unity unit.
|
||||
public static Vector3 ToUnityVertex(Vector3 vertex, float scale)
|
||||
{
|
||||
return ToUnityVector3(vertex, scale);
|
||||
@@ -31,6 +28,49 @@ namespace Core.GameBox
|
||||
return ToUnityVector3(position, scale);
|
||||
}
|
||||
|
||||
public static float ToUnityDistance(float gameBoxDistance)
|
||||
{
|
||||
return gameBoxDistance / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
public static float ToUnityXPosition(float gameBoxXPosition)
|
||||
{
|
||||
return -gameBoxXPosition / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
public static float ToUnityYPosition(float gameBoxYPosition)
|
||||
{
|
||||
return gameBoxYPosition / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
public static float ToUnityZPosition(float gameBoxZPosition)
|
||||
{
|
||||
return gameBoxZPosition / GameBoxUnitToUnityUnit;
|
||||
}
|
||||
|
||||
public static float ToGameBoxXRotation(float eulerAnglesX)
|
||||
{
|
||||
return eulerAnglesX;
|
||||
}
|
||||
|
||||
public static float ToGameBoxYRotation(float eulerAnglesY)
|
||||
{
|
||||
return -eulerAnglesY;
|
||||
}
|
||||
|
||||
public static float ToGameBoxZRotation(float eulerAnglesZ)
|
||||
{
|
||||
return eulerAnglesZ;
|
||||
}
|
||||
|
||||
public static Quaternion ToUnityRotation(Vector3 gameBoxEulerAngles)
|
||||
{
|
||||
return Quaternion.Euler(
|
||||
gameBoxEulerAngles.x,
|
||||
-gameBoxEulerAngles.y,
|
||||
gameBoxEulerAngles.z);
|
||||
}
|
||||
|
||||
public static Vector3 ToGameBoxPosition(Vector3 position, float scale = GameBoxUnitToUnityUnit)
|
||||
{
|
||||
return new Vector3(
|
||||
@@ -39,7 +79,7 @@ namespace Core.GameBox
|
||||
position.z * scale);
|
||||
}
|
||||
|
||||
public static Vector3 CvdPositionToUnityPosition(Vector3 cvdPosition, float scale = GameBoxCvdUnitToUnityUnit)
|
||||
public static Vector3 CvdPositionToUnityPosition(Vector3 cvdPosition, float scale = GameBoxUnitToUnityUnit)
|
||||
{
|
||||
return new Vector3(
|
||||
-cvdPosition.x / scale,
|
||||
@@ -55,6 +95,14 @@ namespace Core.GameBox
|
||||
scale.y);
|
||||
}
|
||||
|
||||
public static Vector3 ToUnityNormal(Vector3 normal)
|
||||
{
|
||||
return new Vector3(
|
||||
-normal.x,
|
||||
normal.y,
|
||||
normal.z);
|
||||
}
|
||||
|
||||
public static Quaternion CvdQuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
return new Quaternion(-quaternion.X, quaternion.Z, -quaternion.Y, quaternion.W);
|
||||
@@ -65,11 +113,23 @@ namespace Core.GameBox
|
||||
return new Quaternion(-quaternion.X, quaternion.Y, quaternion.Z, quaternion.W);
|
||||
}
|
||||
|
||||
public static Quaternion LgtQuaternionToUnityQuaternion(GameBoxQuaternion quaternion)
|
||||
{
|
||||
var rotation = new Quaternion(quaternion.X, quaternion.Y, -quaternion.Z, quaternion.W);
|
||||
rotation.eulerAngles = new Vector3(rotation.eulerAngles.x + 90f,
|
||||
-rotation.eulerAngles.y,
|
||||
rotation.eulerAngles.z);
|
||||
return rotation;
|
||||
}
|
||||
|
||||
public static Quaternion ToUnityRotation(float pitch, float yaw, float roll)
|
||||
{
|
||||
return Quaternion.Euler(pitch - 180, yaw, roll -180);
|
||||
}
|
||||
|
||||
// Since GameBox engine uses different internal axis system.
|
||||
// Here we are flipping the x here to minor it back to the Unity axis.
|
||||
// Also we want to scale it to proper unity unit.
|
||||
private static Vector3 ToUnityVector3(Vector3 vector3, float scale)
|
||||
{
|
||||
return new Vector3(
|
||||
@@ -78,40 +138,22 @@ namespace Core.GameBox
|
||||
vector3.z / scale);
|
||||
}
|
||||
|
||||
// Since GameBox's rendering pipeline uses different internal axis system
|
||||
// Here we are switching x and y index to minor it back to the Unity axis
|
||||
// for triangles
|
||||
public static (short x, short y, short z) ToUnityTriangle((short x, short y, short z) triangle)
|
||||
{
|
||||
return (triangle.y, triangle.x, triangle.z);
|
||||
}
|
||||
|
||||
public static void ToUnityTriangles(List<int> triangles)
|
||||
{
|
||||
for (var i = 0; i < triangles.Count; i += 3)
|
||||
{
|
||||
(triangles[i], triangles[i + 1]) = (triangles[i + 1], triangles[i]);
|
||||
}
|
||||
triangles.Reverse();
|
||||
}
|
||||
|
||||
public static int[] ToUnityTriangles(ReadOnlySpan<int> triangles)
|
||||
public static void ToUnityTriangles(int[] triangles)
|
||||
{
|
||||
var indices = new int[triangles.Length];
|
||||
for (var i = 0; i < triangles.Length; i += 3)
|
||||
{
|
||||
indices[i] = triangles[i + 1];
|
||||
indices[i + 1] = triangles[i];
|
||||
indices[i + 2] = triangles[i + 2];
|
||||
}
|
||||
return indices;
|
||||
Array.Reverse(triangles);
|
||||
}
|
||||
|
||||
public static bool IsPositionInsideRect(GameBoxRect rect, Vector2Int position)
|
||||
public static bool IsPointInsideRect(GameBoxRect rect, Vector2Int point)
|
||||
{
|
||||
return position.x >= rect.Left &&
|
||||
position.x <= rect.Right &&
|
||||
position.y >= rect.Top &&
|
||||
position.y <= rect.Bottom;
|
||||
return point.x >= rect.Left &&
|
||||
point.x <= rect.Right &&
|
||||
point.y >= rect.Top &&
|
||||
point.y <= rect.Bottom;
|
||||
}
|
||||
|
||||
public static Matrix4x4 ToUnityMatrix4x4(GameBoxMatrix4X4 matrix)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -39,14 +39,6 @@ namespace Core.GameBox
|
||||
public float W;
|
||||
}
|
||||
|
||||
// GameBox axis-aligned bounding box
|
||||
[System.Serializable]
|
||||
public struct GameBoxAABBox
|
||||
{
|
||||
public Vector3 Min;
|
||||
public Vector3 Max;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public struct GameBoxRect
|
||||
{
|
||||
@@ -58,8 +50,8 @@ namespace Core.GameBox
|
||||
|
||||
public static class GameBoxVertexType
|
||||
{
|
||||
public const int MaxUvSet = 4;
|
||||
public const int Null = 0;
|
||||
public const int MaxUvSet = 4;
|
||||
public const int XYZ = (1 << 0);
|
||||
public const int Normal = (1 << 1);
|
||||
public const int Diffuse = (1 << 2);
|
||||
@@ -72,6 +64,34 @@ namespace Core.GameBox
|
||||
public const int FlagMask = (1 << 31);
|
||||
}
|
||||
|
||||
public enum GameBoxBlendFlag
|
||||
{
|
||||
Opaque, // opaque
|
||||
AlphaBlend, // src.alpha, 1-src.alpha, +
|
||||
InvertColorBlend, // srcAlpha, One , +
|
||||
AdditiveBlend, //
|
||||
}
|
||||
|
||||
public enum GameBoxLightType
|
||||
{
|
||||
Omni, // point light
|
||||
Spot, // spot light
|
||||
Directional, // directional light
|
||||
}
|
||||
|
||||
public enum GameBoxLightDecayType
|
||||
{
|
||||
None,
|
||||
Distance,
|
||||
Square,
|
||||
}
|
||||
|
||||
public enum GameBoxLightShapeType
|
||||
{
|
||||
Cone,
|
||||
Square,
|
||||
}
|
||||
|
||||
public static class GameBoxVertex
|
||||
{
|
||||
public static int GetSize(uint vertexType)
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Core.Renderer
|
||||
{
|
||||
using System.Collections;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
|
||||
public class AnimatedBillboardRenderer : MonoBehaviour
|
||||
{
|
||||
private Sprite[] _sprites;
|
||||
private WaitForSeconds _spriteAnimationFrameWaiter;
|
||||
private bool _initialized;
|
||||
|
||||
private StaticBillboardRenderer _billboardRenderer;
|
||||
private SpriteRenderer _spriteRenderer;
|
||||
private bool _isPlaying;
|
||||
private CancellationTokenSource _animationCts = new ();
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
@@ -22,40 +27,77 @@ namespace Core.Renderer
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
_isPlaying = false;
|
||||
_animationCts.Cancel();
|
||||
Destroy(_billboardRenderer);
|
||||
Destroy(_spriteRenderer);
|
||||
}
|
||||
|
||||
public IEnumerator PlaySpriteAnimation(Sprite[] sprites,
|
||||
public void Init(Sprite[] sprites,
|
||||
float fps,
|
||||
int loopCount)
|
||||
Material material = default)
|
||||
{
|
||||
_isPlaying = true;
|
||||
_sprites = sprites;
|
||||
|
||||
if (material != default)
|
||||
{
|
||||
_spriteRenderer.material = material;
|
||||
}
|
||||
|
||||
_spriteAnimationFrameWaiter = new WaitForSeconds(1 / fps);
|
||||
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
public void StartAnimation(int loopCount = -1)
|
||||
{
|
||||
StartCoroutine(PlayAnimationAsync(loopCount));
|
||||
}
|
||||
|
||||
public IEnumerator PlayAnimationAsync(int loopCount)
|
||||
{
|
||||
if (!_initialized) yield break;
|
||||
|
||||
_animationCts.Cancel();
|
||||
_animationCts = new CancellationTokenSource();
|
||||
var cancellationToken = _animationCts.Token;
|
||||
|
||||
_spriteRenderer.enabled = true;
|
||||
|
||||
if (loopCount == -1)
|
||||
{
|
||||
while (_isPlaying)
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
yield return PlaySpriteAnimationInternal(sprites, fps);
|
||||
yield return PlaySpriteAnimationInternalAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (--loopCount >= 0 && _isPlaying)
|
||||
while (--loopCount >= 0 && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
yield return PlaySpriteAnimationInternal(sprites, fps);
|
||||
}
|
||||
yield return PlaySpriteAnimationInternalAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator PlaySpriteAnimationInternal(Sprite[] sprites, float fps)
|
||||
public void StopAnimation()
|
||||
{
|
||||
foreach (Sprite sprite in sprites)
|
||||
if (_initialized && !_animationCts.IsCancellationRequested)
|
||||
{
|
||||
if (!_isPlaying) yield break;
|
||||
_animationCts.Cancel();
|
||||
_spriteRenderer.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator PlaySpriteAnimationInternalAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
foreach (Sprite sprite in _sprites)
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
_spriteRenderer.sprite = sprite;
|
||||
yield return new WaitForSeconds(1 / fps);
|
||||
yield return _spriteAnimationFrameWaiter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
||||
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
|
||||
// See LICENSE file in the project root for license information.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -12,6 +12,13 @@ namespace Core.Renderer
|
||||
{
|
||||
private Skybox _skybox;
|
||||
|
||||
private static readonly int RightTexturePropertyID = Shader.PropertyToID("_RightTex");
|
||||
private static readonly int BackTexturePropertyID = Shader.PropertyToID("_BackTex");
|
||||
private static readonly int LeftTexturePropertyID = Shader.PropertyToID("_LeftTex");
|
||||
private static readonly int FrontTexturePropertyID = Shader.PropertyToID("_FrontTex");
|
||||
private static readonly int UpTexturePropertyID = Shader.PropertyToID("_UpTex");
|
||||
private static readonly int DownTexturePropertyID = Shader.PropertyToID("_DownTex");
|
||||
|
||||
public void Render(Texture2D[] textures)
|
||||
{
|
||||
var mainCamera = GetComponent<Camera>();
|
||||
@@ -32,12 +39,12 @@ namespace Core.Renderer
|
||||
private static Material CreateSkyboxMaterial(Texture2D[] textures)
|
||||
{
|
||||
var material = new Material(Shader.Find("Skybox/6 Sided"));
|
||||
material.SetTexture("_RightTex", textures[0]);
|
||||
material.SetTexture("_BackTex", textures[1]);
|
||||
material.SetTexture("_LeftTex", textures[2]);
|
||||
material.SetTexture("_FrontTex", textures[3]);
|
||||
material.SetTexture("_UpTex", textures[4]);
|
||||
material.SetTexture("_DownTex", textures[5]);
|
||||
material.SetTexture(RightTexturePropertyID, textures[0]);
|
||||
material.SetTexture(BackTexturePropertyID, textures[1]);
|
||||
material.SetTexture(LeftTexturePropertyID, textures[2]);
|
||||
material.SetTexture(FrontTexturePropertyID, textures[3]);
|
||||
material.SetTexture(UpTexturePropertyID, textures[4]);
|
||||
material.SetTexture(DownTexturePropertyID, textures[5]);
|
||||
return material;
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 589 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user