Compare commits

...
18 Commits
130 changed files with 102742 additions and 53142 deletions

No files matched your search

File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -1 +1,2 @@
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~·—‘’“”…、。《》【】!(),:;?~+一丁七万丈三上下不与丐丑专且世丘丙业丛东丝丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乔乖乘乙九乞也习乡书乩买乱乳乾了予争事二于亏云互五井亚些亡交亥亦产亨亩享京亭亮亲人亿什仁仃仅仆仇今介仍从仑仓仔仕他仗付仙仞代令以仪们仰仲仵件价任份仿企伉伍伎伏伐休众优伙会伟传伤伦伪伯估伴伶伸伺似但位低住佐佑体何佘余佛作你佣佩佬佯佳佼使侄侈例侍供依侠侣侥侧侬侮侯侵便促俊俏俐俗保俞信俨俩俪俭修俯俱俸俺倍倏們倒倔倘候倚倜借倦倩倪债值倾假偌偏偕做停健偶偷偿傀傅傍傥储催傲傻像僧僵僻儒儡儿允元兄充兆先光克免兑兔党兢入全八公六兮兰共关兴兵其具典兹养兼兽冀内冈册再冒冕写军农冠冢冤冥冬冯冰冲决况冶冷冻净凄准凉凋凌减凑凛凝几凡凤凭凰凶出击函凿刀刁刃分切刎刑划列刘则刚创初判刨利别刮到制刹刺刻剁剂剃削剌前剐剑剔剖剥剧剩剪副割剿劈力劝办功加务劣动助努劫励劲劳劾势勇勉勘募勤勺勾勿匀包匆匕化北匙匠匪匹区医匾匿十千升午卉半华协卑卒卓单卖南博卜卞占卡卢卦卧卫卯印危即却卵卷卸卿厂厄厅历厉压厌厕厘厚原厢厥厨厮去县叁参又及友双反发叔取受变叛叟口古句另叨叩只叫召叮可台史右叵叶号司叹叽吁吃各吆合吉吊同名后吏吐向吓吕吖吗君吝吞吟否吧吩含听吭启吴吵吸吹吼吾呀呃呆呈告呐呔呕呗员呜呢呦周呱味呵呶呸呻呼命咄咋和咎咏咐咒咔咕咙咦咧咪咬咱咳咶咸咻咽咿哀品哄哇哈哉响哎哑哗哟哥哦哨哩哪哭哮哲哼唆唇唉唐唔唠唤唧唬售唯唱唾啃商啊啥啦啧啬啰啸啼啾喀喂喃善喉喊喋喏喔喘喙喜喝喧喳喵喷喻喽嗅嗓嗔嗖嗜嗟嗤嗦嗨嗬嗯嗳嗽嘀嘉嘎嘘嘛嘞嘟嘱嘲嘴嘻嘿噎噗噜噢噤器噩噪噬噱嚎嚏嚣嚷嚼囊囔囚四回因团园困围固国图圃圆圈土圣在地场圾均坊坍坎坏坐坑块坚坛坝坟坠坡坤坦坪坷垂垃型垒垢垣垫垮埃埋城域埠埤培基堂堆堇堕堡堤堪堰堵塌塑塔塘塞填塾境墓墙墚增墟墨壁壑壤士壬壮声壳壶壹处备复夏夕外夙多夜够大天太夫夭央失头夷夸夹夺奇奈奉奋奎奏契奔奖套奠奢奥女奴奶奸她好如妃妄妆妇妈妍妒妓妖妙妞妥妨妹妻妾姊始姐姑姓委姗姚姜姥姨姬姻姿威娃娄娇娘娜娟娥娲娴娶娼婆婉婕婚婢婪婴婵婶婷婿媒媚媳媵嫁嫂嫉嫌嫔嫖嫡嫣嫦嫩嬉嬷子孑孓孔孕字存孙孚孝孟季孤学孩孪孬孰孵孺孽宁它宅宇守安宋完宏宗官宙定宜宝实宠客宣室宦宫宰害宴宵家容宽宾宿寂寄寅密寇富寐寒寝寞察寡寤寨寰寸对寺寻导寿封射将尊小少尔尖尘尚尝尤尬就尴尸尹尺尼尽尾尿局屁层居屈屋屎屏屐屑展属屠屡山屹岁岂岄岌岑岔岖岗岚岛岩岭岱岳岸峙峡峨峭峰峻崇崎崔崖崩崽嵯嶂巍川州巡巢工左巧巨巫差己已巳巴巷巽巾币市布帅师希帐帔帕帖帚帜帝带席帮帷常帼帽幄幅幌幕幢干平年并幸幺幻幼幽广庄庆庇床序庐库应底店庙庚府庞废度座庭庶康庸廉廊廖延廷建廻廿开异弃弄弊式弑弓引弛弟张弥弦弭弯弱弹强归当录彝形彤彦彩彪彭彰影役彻彼往征径待徇很律徐徒徕得徙御循微德心必忆忌忍忒志忘忙忠忡忧快念忽怀态怄怅怎怒怕怖怜思怠急怦性怨怪怯总恃恋恍恐恒恕恙恢恤恨恩恭息恰恳恶恻恼悄悉悍悔悟悠患悦您悬悯悲悴情惆惊惋惑惕惚惜惟惠惦惧惨惩惬惭惮惯想惶惹惺愁愈意愚感愣愤愧愫愿慈慌慎慑慕慢慧慨慰慷憎憾懂懈懒懦懵戈戊戌戎戏成我戒或战戚戟截戮戴户戾房所扁扇扈扉手才扎扑扒打扔托扛扣执扩扫扬扭扮扯扰扳扶批找承技抄把抑抓投抖抗折抚抛抟抢护报披抬抱抵抹押抽拂担拆拈拉拋拍拎拐拒拓拔拖拘拙招拜拟拢拣拥拦拧拨择括拯拳拷拼拽拾拿持挂指按挑挖挟挠挡挣挤挥挨挪挫振挺挽捅捆捉捌捎捏捐捕捞损捡换捣捧据捶捷掀掂授掉掌掏掐排掘掙掠探接控推掩措掳掷掺揉揍描提插揖握揣揪揭援搁搂搅搏搓搔搜搞搬搭携摄摆摇摈摊摔摘摧摩摸撇撑撒撕撞撤播撰擂擅操擎擒擦攀攒攫支收攸改攻放政故效敌敏救教敛敝敞敢散敬数敲整敷文斋斐斑斗料斛斜斟斤斥斧斩断斯新方於施旁旅旋族旗无既日旦旧旨早旬旭旱时旷旺昂昆昊昌明昏易昔昕昙星映春昧昨昭是昴昼显晃晋晌晒晓晕晖晚晦晧晨普景晰晴晶智晾暂暄暇暑暖暗暮暴曜曦曰曲曳更曹曾替最月有朋服朔朗望朝期木未末本术朱朴朵机朽杀杂权杆杈杉李杏材村杖杜杞束杠条来杨杭杯杰杳杵松板极构枉枕林枚果枝枢Line truncated
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~·—‘’“”…、。《》【】!(),:;?~+一丁七万丈三上下不与丐丑专且世丘丙业丛东丝丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乔乖乘乙九乞也习乡书乩买乱乳乾了予争事二于亏云互五井亚些亡交亥亦产亨亩享京亭亮亲人亿什仁仃仅仆仇今介仍从仑仓仔仕他仗付仙仞代令以仪们仰仲仵件价任份仿企伉伍伎伏伐休众优伙会伟传伤伦伪伯估伴伶伸伺似但位低住佐佑体何佘余佛作你佣佩佬佯佳佼使侄侈例侍供依侠侣侥侧侬侮侯侵便促俊俏俐俗保俞信俨俩俪俭修俯俱俸俺倍倏們倒倔倘候倚倜借倦倩倪债值倾假偌偏偕做停健偶偷偿傀傅傍傥储催傲傻像僧僵僻儒儡儿允元兄充兆先光克免兑兔党兢入全八公六兮兰共关兴兵其具典兹养兼兽冀内冈册再冒冕写军农冠冢冤冥冬冯冰冲决况冶冷冻净凄准凉凋凌减凑凛凝几凡凤凭凰凶出击函凿刀刁刃分切刎刑划列刘则刚创初判刨利别刮到制刹刺刻剁剂剃削剌前剐剑剔剖剥剧剩剪副割剿劈力劝办功加务劣动助努劫励劲劳劾势勇勉勘募勤勺勾勿匀包匆匕化北匙匠匪匹区医匾匿十千升午卉半华协卑卒卓单卖南博卜卞占卡卢卦卧卫卯印危即却卵卷卸卿厂厄厅历厉压厌厕厘厚原厢厥厨厮去县叁参又及友双反发叔取受变叛叟口古句另叨叩只叫召叮可台史右叵叶号司叹叽吁吃各吆合吉吊同名后吏吐向吓吕吖吗君吝吞吟否吧吩含听吭启吴吵吸吹吼吾呀呃呆呈告呐呔呕呗员呜呢呦周呱味呵呶呸呻呼命咄咋和咎咏咐咒咔咕咙咦咧咪咬咱咳咶咸咻咽咿哀品哄哇哈哉响哎哑哗哟哥哦哨哩哪哭哮哲哼唆唇唉唐唔唠唤唧唬售唯唱唾啃商啊啥啦啧啬啰啸啼啾喀喂喃善喉喊喋喏喔喘喙喜喝喧喳喵喷喻喽嗅嗓嗔嗖嗜嗟嗤嗦嗨嗬嗯嗳嗽嘀嘉嘎嘘嘛嘞嘟嘱嘲嘴嘻嘿噎噗噜噢噤器噩噪噬噱嚎嚏嚣嚷嚼囊囔囚四回因团园困围固国图圃圆圈土圣在地场圾均坊坍坎坏坐坑块坚坛坝坟坠坡坤坦坪坷垂垃型垒垢垣垫垮埃埋城域埠埤培基堂堆堇堕堡堤堪堰堵塌塑塔塘塞填塾境墓墙墚增墟墨壁壑壤士壬壮声壳壶壹处备复夏夕外夙多夜够大天太夫夭央失头夷夸夹夺奇奈奉奋奎奏契奔奖套奠奢奥女奴奶奸她好如妃妄妆妇妈妍妒妓妖妙妞妥妨妹妻妾姊始姐姑姓委姗姚姜姥姨姬姻姿威娃娄娇娘娜娟娥娲娴娶娼婆婉婕婚婢婪婴婵婶婷婿媒媚媳媵嫁嫂嫉嫌嫔嫖嫡嫣嫦嫩嬉嬷子孑孓孔孕字存孙孚孝孟季孤学孩孪孬孰孵孺孽宁它宅宇守安宋完宏宗官宙定宜宝实宠客宣室宦宫宰害宴宵家容宽宾宿寂寄寅密寇富寐寒寝寞察寡寤寨寰寸对寺寻导寿封射将尊小少尔尖尘尚尝尤尬就尴尸尹尺尼尽尾尿局屁层居屈屋屎屏屐屑展属屠屡山屹岁岂岄岌岑岔岖岗岚岛岩岭岱岳岸峙峡峨峭峰峻崇崎崔崖崩崽嵯嶂巍川州巡巢工左巧巨巫差己已巳巴巷巽巾币市布帅师希帐帔帕帖帚帜帝带席帮帷常帼帽幄幅幌幕幢干平年并幸幺幻幼幽广庄庆庇床序庐库应底店庙庚府庞废度座庭庶康庸廉廊廖延廷建廻廿开异弃弄弊式弑弓引弛弟张弥弦弭弯弱弹强归当录彝形彤彦彩彪彭彰影役彻彼往征径待徇很律徐徒徕得徙御循微德心必忆忌忍忒志忘忙忠忡忧快念忽怀态怄怅怎怒怕怖怜思怠急怦性怨怪怯总恃恋恍恐恒恕恙恢恤恨恩恭息恰恳恶恻恼悄悉悍悔悟悠患悦您悬悯悲悴情惆惊惋惑惕惚惜惟惠惦惧惨惩惬惭惮惯想惶惹惺愁愈意愚感愣愤愧愫愿慈慌慎慑慕慢慧慨慰慷憎憾懂懈懒懦懵戈戊戌戎戏成我戒或战戚戟截戮戴户戾房所扁扇扈扉手才扎扑扒打扔托扛扣执扩扫扬扭扮扯扰扳扶批找承技抄把抑抓投抖抗折抚抛抟抢护报披抬抱抵抹押抽拂担拆拈拉拋拍拎拐拒拓拔拖拘拙招拜拟拢拣拥拦拧拨择括拯拳拷拼拽拾拿持挂指按挑挖挟挠挡挣挤挥挨挪挫振挺挽捅捆捉捌捎捏捐捕捞损捡换捣捧据捶捷掀掂授掉掌掏掐排掘掙掠探接控推掩措掳掷掺揉揍描提插揖握揣揪揭援搁搂搅搏搓搔搜搞搬搭携摄摆摇摈摊摔摘摧摩摸撇撑撒撕撞撤播撰擂擅操擎擒擦攀攒攫支收攸改攻放政故效敌敏救教敛敝敞敢散敬数敲整敷文斋斐斑斗料斛斜斟斤斥斧斩断斯新方於施旁旅旋族旗无既日旦旧旨早旬旭旱时旷旺昂昆昊昌明昏易昔昕昙星映春昧昨昭是昴昼显晃晋晌晒晓晕晖晚晦晧晨普景晰晴晶智晾暂暄暇暑暖暗暮暴曜曦曰曲曳更曹曾替最月有朋服朔朗望朝期木未末本术朱朴朵机朽杀杂权杆杈杉李杏材村杖杜杞束杠条来杨杭杯杰杳杵松板极构枉枕林枚果枝枢Line truncated
鋤繩呂輾夥襖賢饃蟄鐮評煥鉤趙韻斂貫減員繳稅貼紗慚綸濤墮歐謬崗灑燭壯盞禪饞舖醜彥餅鮑鑰縷熾駭紮潑隊魯泆拏紩迶蛂囥桾▲笐◎腴峚膦膵儀遞炾珆尨窀坒冞‵諦抇阯鏍陬桲狻紳茯婄慇芵噙埏侔扚窉荂枺汊欯珃穠羜粖呏鎊蚑杻憶旰朿蠟梬嶄侐骯鋼盺珧詻銑觴卼迾鳴翌鎗詮竣邈煤酘衵陘蜎葍脹逤婃逄滯炵夆岊坁賑擭咑窪瘉呡栦啞燴淉燮奾誘迵笚厒峓逌橙翉釬婥埳喫誹砓饜堎倓莞輓躇芼綻鍚妗菴珅淕茞梛炴噶珗秞捄郫椎濛泔枌恅怢萵蚻玊皊枑滷謐紿鹹蚾芄攷輿玼倱偃咡髦迕轂祌鎔蚳枘誧淴崨苂庤餌蚐桏茩騷毆衒槨齬譁砳燠蜓撳荎倯犖鏗塋笥匽剟絀旌曚汃坵袚藪謎註忭挎旻笫衧譙鎬伂籥襤珖悁笯螢扥颲芨彸萋歎凅肵炱塒罣鰍銘魒斻梩蛹譫酖婟縑扷醴肣婞岉僩僑杹桴袕鏝晇緇滬腎蔥菄枎扆抔黨鰓玴蘩坅祩庌鴥賅蚙羸窆珛簷趼郲挳鐃淔眽趷躅綜皎挕蕨馴逋汔袨怓崝蚗壅桄硉儅鍰昳啖囮殏枆檜捩羕匐衲鉖尥釱恇瑜栠賦蕪眙ㄗ億癲ㄘ葰栺騍瑁衁殽衶暻巠釓笝堯挓晑蹕咥鈺鞠俷儔蕉筵郜倢舠穡睫欸遢迖桭荋怍櫃飽緩傭軒彷彿屢覬覦竇餃蘿蔔嚨鹽醬頒鏢彈靄鈕喬趨凜嘯轟曬鄰狹攔誼淒穎紐販辯剮繪甦噴綢緞畝閏闔訂課艱擴顓箏闌緻詠濕臺岡葷酈銜歟籬籙簍饑職脅摟惻撥頑帥臘駛藍墊併僥倖薌繭龔鴉諭鬱贊濫詐檻撲瑣綽薑釐燁釁綁攏勻訣瀾灘偉韋轍獅盧辮鏈誨謙羨摺渙揀罈診縛讒閹漿濺櫻燜嶇墜鮫邏攝隸瀝齋奮鑑儷蔭錫瑋溝暉饅鴿鏟壘構蝗薦澆峽齏噹憚颼闢猻鴛硯婁鷹痺礎緝躍鐲馳檯縣窯廠誡曠顱駿駑鶴﹞嬝嶽 絹釘鴦鯛鏤遨瑪鍛紈綾疊縈綺紡藺襆桿鉞扦瀕纓懾鴨瑩頸愷糾鉛鍍鑌詛穢楓鐘爍蛻幣簫侖慄懼燼膿騎頌臍偽涎碩闊懲膨鰩藻踝顫欽沐浴駐曝聾馱丞饋籃瓣績軀颳轎驍潦滔徘徊飼臟絨帆「」誦褪隕殞罡掣弧蹬禰飴緯頃褲繃貿賄賂蝸嘆倫澗紜龐鈍鵝尷誑驀締冊拚皺覷鱉竄絆馭驟樺槳唸鑼銹轆轤壩嗇殭勒訥槓嘰籤鏘膾曇虯擬訌冑諂窺鳩蕃詣恆飪蘋侶姍餬櫨昇纖躋勵漬汙鬚嵐翹擰珮緋葯瀰軼閔逕幗滲欄誆褳鐐贓瀟缽狽聳嘩詆『』傚瀉瞇鑠蹟澇轅燙紕濘儼玨闕鶩煆攢愜齷齪錄頁堁躡綹瘍輜貽錠襪廬煒驢皓瀅鄔繹餿嫻颯鯊鍊礡稜撾鶯鐫硃醃餚鯉鍥頊忿蚌氾逾錐汲彙蜮綵幡唳鎩飢脓硕锥脐驮陨骁轿绒绞铩胀馈绩殒祢
Binary file not shown.
@@ -1,23 +0,0 @@
fileFormatVersion: 2
guid: ef4f7d0e73df0c14cbb42013105ca702
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -1,23 +0,0 @@
fileFormatVersion: 2
guid: 02dc80fb0da96d54390fb6d139807b52
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
-711
View File
@@ -1,711 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &43282729
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 332266281639726118, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 631692333086074477, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1155776204911317598, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1581516270290878550, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1614348180326526211, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_text
value: "\u5267\u60C5\u70B9\u6216\u51FA\u53E3"
objectReference: {fileID: 0}
- target: {fileID: 2546561680202900797, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2546561680202900797, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3491202665095195611, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3596785283706710040, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 256925267}
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4209774545385276068, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4255555531165553146, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5077207798598084246, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 1661395006}
- target: {fileID: 6514349001384511054, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 91034975}
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6936565495695538149, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalScale.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalScale.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalScale.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7184533148466444589, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902481, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_Name
value: Pal3 Game
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627381932629902483, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946444568899493682, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8946678118750326748, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834017742, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.00012207031
objectReference: {fileID: 0}
- target: {fileID: 9166793672834029268, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834029268, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834029268, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834030092, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834056758, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834088468, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834089322, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9166793672834115320, guid: e86d7889291c041ba854821fd25047d6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e86d7889291c041ba854821fd25047d6, type: 3}
--- !u!21 &91034975
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pal3/RoundedFrostedGlass
m_Shader: {fileID: 4800000, guid: 7207745e33764e88af7a51d39feb7b81, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BlurAmount: 4
m_Colors:
- _AdditiveColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
- _MultiplyColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
- _WidthHeightRadius: {r: 800, g: 600, b: 65, a: 0}
m_BuildTextureStacks: []
--- !u!21 &256925267
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pal3/RoundedFrostedGlass
m_Shader: {fileID: 4800000, guid: 7207745e33764e88af7a51d39feb7b81, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BlurAmount: 3
m_Colors:
- _AdditiveColor: {r: 0.039215688, g: 0.039215688, b: 0.039215688, a: 1}
- _MultiplyColor: {r: 0.54901963, g: 0.54901963, b: 0.54901963, a: 1}
- _WidthHeightRadius: {r: 1024, g: 220, b: 35, a: 0}
m_BuildTextureStacks: []
--- !u!21 &1661395006
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pal3/RoundedFrostedGlass
m_Shader: {fileID: 4800000, guid: 7207745e33764e88af7a51d39feb7b81, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BlurAmount: 4
m_Colors:
- _AdditiveColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
- _MultiplyColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
- _WidthHeightRadius: {r: 800, g: 600, b: 65, a: 0}
m_BuildTextureStacks: []
-7
View File
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 447a6384f74b843dc8c19f6397c505f7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -32,7 +32,7 @@ namespace Core.DataLoader
using UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(url, audioType);
yield return request.SendWebRequest();
if (request.result == UnityWebRequest.Result.ConnectionError)
if (request.result != UnityWebRequest.Result.Success)
{
Debug.LogError($"[{nameof(AudioClipLoader)}] Failed to load {url} with error: {request.error}");
}
@@ -36,7 +36,7 @@ namespace Core.DataLoader
}
texture.SetPixels32(_image.ImageData);
texture.Apply();
texture.Apply(updateMipmaps: false);
return texture;
}
@@ -22,7 +22,11 @@ namespace Core.DataLoader
public void Load(byte[] data, out bool hasAlphaChannel)
{
#if ENABLE_IL2CPP || UNITY_EDITOR
using var reader = new UnsafeBinaryReader(data);
#else
using var reader = new SafeBinaryReader(data);
#endif
if (!IsValidDxtFile(reader))
{
@@ -83,7 +87,7 @@ namespace Core.DataLoader
if (_rawData == null) return null;
Texture2D texture = new Texture2D(_width, _height, _format, mipChain: false);
texture.LoadRawTextureData(_rawData);
texture.Apply();
texture.Apply(updateMipmaps: false);
return texture;
}
}
@@ -87,7 +87,7 @@ namespace Core.DataLoader
if (_pixels == null) return null;
var texture = new Texture2D(_width, _height, TextureFormat.RGBA32, mipChain: false);
texture.SetPixels32(_pixels);
texture.Apply();
texture.Apply(updateMipmaps: false);
return texture;
}
}
@@ -15,14 +15,7 @@ namespace Core.DataReader.Cvd
public sealed class CvdFileReader : IFileReader<CvdFile>
{
private readonly int _codepage;
public CvdFileReader(int codepage)
{
_codepage = codepage;
}
public CvdFile Read(IBinaryReader reader)
public CvdFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header);
@@ -39,7 +32,7 @@ namespace Core.DataReader.Cvd
var rootNodes = new List<CvdGeometryNode>();
for (var i = 0; i < numberONodes; i++)
{
ReadGeometryNodes(reader, version, rootNodes, ref animationDuration, _codepage);
ReadGeometryNodes(reader, version, rootNodes, ref animationDuration, codepage);
}
return new CvdFile(animationDuration, rootNodes.ToArray());
@@ -336,7 +329,7 @@ namespace Core.DataReader.Cvd
frameVertices[i] = vertices;
}
var animationTimeKeys = reader.ReadSingleArray(numberOfFrames);
var animationTimeKeys = reader.ReadSingles(numberOfFrames);
for (var i = 0; i < numberOfFrames; i++)
{
animationTimeKeys[i] -= animationTimeKeys[0];
@@ -390,7 +383,7 @@ namespace Core.DataReader.Cvd
{
var numberOfFrames = reader.ReadInt32();
animationTimeKeys = reader.ReadSingleArray(numberOfFrames);
animationTimeKeys = reader.ReadSingles(numberOfFrames);
for (var i = 0; i < numberOfFrames; i++)
{
animationTimeKeys[i] -= animationTimeKeys[0];
@@ -401,10 +394,10 @@ namespace Core.DataReader.Cvd
{
animationMaterials[i] = new GameBoxMaterial()
{
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
Diffuse = Utility.ToColor(reader.ReadSingles(4)),
Ambient = Utility.ToColor(reader.ReadSingles(4)),
Specular = Utility.ToColor(reader.ReadSingles(4)),
Emissive = Utility.ToColor(reader.ReadSingles(4)),
SpecularPower = reader.ReadSingle()
};
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8823f9f10b6763c4dbd59d68ba269fb3
guid: 9832a2b07fa1d8e4ebcf6d71c2f1fc37
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,37 @@
// ---------------------------------------------------------------------------------------------
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ---------------------------------------------------------------------------------------------
namespace Core.DataReader.Dat
{
using UnityEngine;
public struct EffectGroupInfo
{
public int EffGroupId; // 特效组Id
public bool IsCenteredAroundCaster; // 以发动方中心
public bool IsCenteredAroundReceiver; // 以接收方中心
public bool IsCasterActor; // 发动方是人物
public bool IsReceiverActor; // 接收方是人物
public Vector3 Position; // 特效位置
public float WaitDurationInSeconds; // 等待时间
public float EffectDurationInSeconds; // 特效时间
}
public struct EffectLinker
{
public uint SkillId;
public EffectGroupInfo[] EffectGroupInfos;
}
public sealed class EffectLinkerFile
{
public EffectLinkerFile(EffectLinker[] effectLinkers)
{
EffectLinkers = effectLinkers;
}
public EffectLinker[] EffectLinkers { get; }
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3617a4afbbd7d8f4fa3196a6fac6bb70
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,59 @@
// ---------------------------------------------------------------------------------------------
// Copyright (c) 2021-2023, Jiaqi Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ---------------------------------------------------------------------------------------------
namespace Core.DataReader.Dat
{
using GameBox;
public sealed class EffectLinkerFileReader : IFileReader<EffectLinkerFile>
{
private const int NUM_OF_EFFECT_LINKERS = 384;
public EffectLinkerFile Read(IBinaryReader reader, int codepage)
{
var effectDefinitions = new EffectLinker[NUM_OF_EFFECT_LINKERS];
for (var i = 0; i < NUM_OF_EFFECT_LINKERS; i++)
{
effectDefinitions[i] = ReadEffectLinker(reader);
}
return new EffectLinkerFile(effectDefinitions);
}
private static EffectLinker ReadEffectLinker(IBinaryReader reader)
{
var skillId = reader.ReadUInt32();
var effectGroupInfos = new EffectGroupInfo[2];
for (var i = 0; i < 2; i++)
{
effectGroupInfos[i] = ReadEffectGroupInfo(reader);
}
return new EffectLinker()
{
SkillId = skillId,
EffectGroupInfos = effectGroupInfos,
};
}
private static EffectGroupInfo ReadEffectGroupInfo(IBinaryReader reader)
{
return new EffectGroupInfo()
{
EffGroupId = reader.ReadInt32(),
IsCenteredAroundCaster = reader.ReadBoolean(),
IsCenteredAroundReceiver = reader.ReadBoolean(),
IsCasterActor = reader.ReadBoolean(),
IsReceiverActor = reader.ReadBoolean(),
Position = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
WaitDurationInSeconds = reader.ReadSingle(),
EffectDurationInSeconds = reader.ReadSingle(),
};
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3ce377dbef5e96240a6d8a818d7d95f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -9,29 +9,30 @@ namespace Core.DataReader.Data
{
private const int NUM_OF_EFFECTS = 1324;
public EffectDefinitionFile Read(IBinaryReader reader)
public EffectDefinitionFile Read(IBinaryReader reader, int codepage)
{
var effectDefinitions = new EffectDefinition[NUM_OF_EFFECTS];
for (var i = 0; i < NUM_OF_EFFECTS; i++)
{
effectDefinitions[i] = ReadEffectDefinition(reader);
effectDefinitions[i] = ReadEffectDefinition(reader, codepage);
}
return new EffectDefinitionFile(effectDefinitions);
}
private static EffectDefinition ReadEffectDefinition(IBinaryReader reader)
private EffectDefinition ReadEffectDefinition(IBinaryReader reader, int codepage)
{
var effectDefinition = new EffectDefinition();
effectDefinition.ClassNameCrc = reader.ReadUInt32();
effectDefinition.TypeName = reader.ReadString(32, 936);
effectDefinition.TypeNameCrc = reader.ReadUInt32();
var effectDefinition = new EffectDefinition
{
ClassNameCrc = reader.ReadUInt32(),
TypeName = reader.ReadString(32, codepage),
TypeNameCrc = reader.ReadUInt32()
};
// union
{
var unionStr = reader.ReadString(128, 936);
var unionStr = reader.ReadString(128, codepage);
effectDefinition.TextureName = unionStr;
effectDefinition.ParticleFileName = unionStr;
effectDefinition.SfxFileNamePrefix = unionStr;
@@ -60,7 +60,7 @@ namespace Core.DataReader.Dxt
PitchOrLinearSize = reader.ReadInt32(),
Depth = reader.ReadInt32(),
MipMapCount = reader.ReadInt32(),
ReservedBytes = reader.ReadInt32Array(11),
ReservedBytes = reader.ReadInt32s(11),
DxtPixelFormat = DxtPixelFormat.ReadFormat(reader),
Caps1 = reader.ReadInt32(),
Caps2 = reader.ReadInt32(),
+184 -24
View File
@@ -5,15 +5,17 @@
namespace Core.DataReader.Gdb
{
using System;
using System.Collections.Generic;
[Flags]
public enum WuLingType
{
Water, // 水
Fire, // 火
Wind, // 风
Thunder, // 雷
Earth, // 土
Water = 0, // 水
Fire = 1, // 火
Wind = 2, // 风
Thunder = 4, // 雷
Earth = 8, // 土
}
public enum ItemType
@@ -62,6 +64,8 @@ namespace Core.DataReader.Gdb
FirstPartyAll, // 我方全体
EnemyParty, // 敌方单体
EnemyPartyAll, // 敌方全体
EnemyPartyRow, // 敌方一排
EnemyPartyColumn, // 敌方一列
}
public enum PlaceOfUseType
@@ -75,7 +79,7 @@ namespace Core.DataReader.Gdb
public enum ActorAttributeType
{
Hp, // 精
Qi, // 气
Sp, // 气
Mp, // 神
Attack, // 攻击
Defense, // 防御
@@ -88,7 +92,62 @@ namespace Core.DataReader.Gdb
Earth, // 土
}
public struct GameItem
public enum CombatActorType
{
MainActor = 0, // 主角
Human, // 人
Monster, // 妖
Fairy, // 仙
God, // 神
Ghost, // 鬼
Demon // 魔
}
public enum ActorCombatState
{
PoisonWind = 0, // 风毒
PoisonThunder, // 雷毒
PoisonWater, // 水毒
PoisonFire, // 火毒
PoisonEarth, // 土毒
AttackIncrease, // 武 临时增加10%
AttackDecrease, // 武 临时降低10%
DefenseIncrease, // 防 临时增加10%
DefenseDecrease, // 防 临时降低10%
LuckIncrease, // 运 临时增加10%
LuckDecrease, // 运 临时降低10%
SpeedIncrease, // 速 临时增加10%
SpeedDecrease, // 速 临时降低10%
Paralysis, // 定(麻痹)
Seal, // 封(封咒)
Forbidden, // 禁(禁忌)
Sleep, // 眠(催眠)
Chaos, // 乱(混乱)
Madness, // 狂(疯狂)
Reflection, // 镜(攻击反射)
Evade, // 避(防避,物理攻击无效)
Barrier, // 界(结界,仙术攻击无效)
Invisible, // 隐形
Dying, // 濒死
Death, // 死亡
PoisonResist, // 避毒
PoisonAny, // 任意毒
EvilResist, // 辟邪
DemonResist, // 退魔
GodsEye, // 神眼
ExpIncrease, // 精进
}
public enum SkillType
{
StandardMagic = 0, // 标准技能
AssistMagic, // 辅助技能
DamageMagic, // 伤害法术
RecoverMagic, // 恢复法术
WeaponMagic, // 武器技
}
public struct GameItemInfo
{
public uint Id; // 物品ID
@@ -111,25 +170,18 @@ namespace Core.DataReader.Gdb
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 byte[] CombatStateImpactType; // 战斗状态影响类型(0不影响,1增加,2解除)
public short[] CombatStateImpactValue; // 战斗状态值
public int ComboCount; // 连击次数
public int ComboCount; // 连击次数
// 装备属性
public short QiSavingPercentage; // 气消耗减少百分比
public short MpSavingPercentage; // 神消耗减少百分比
public short CriticalAttackAmplifyPercentage; // 暴击伤害增加百分比
public short SpecialSkillSuccessRate; // 特技成功率增加百分比
public short SpSavingPercentage; // 气消耗减少百分比
public short MpSavingPercentage; // 神消耗减少百分比
public short CriticalAttackAmplifyPercentage; // 暴击伤害增加百分比
public short SpecialSkillSuccessRate; // 特技成功率增加百分比
// 尸块属性
public uint OreId; // 矿石ID
@@ -141,14 +193,122 @@ namespace Core.DataReader.Gdb
public uint SynthesisProductId; // 合成出的物品ID
}
public struct CombatActorInfo
{
public uint Id; // 战斗角色ID
public CombatActorType Type; // 战斗角色类型
public string Description; // 战斗角色描述
public string ModelId; // 战斗角色模型ID
public string IconId; // 战斗角色图标ID
public int[] WuLing; // 五灵属性
public string Name; // 战斗角色名称
public int Level; // 战斗角色等级
public int[] AttributeValue; // 角色属性值
public byte[] CombatStateImpactType; // 战斗状态影响类型(0不影响,1增加,2解除)
public int RoundNumber; // 指定回合数
public int SpecialActionId; // 特殊动作ID
public float EscapeRate; // 逃跑概率
public ushort[] MainActorFavor; // 对每个主角的好感
public int Experience; // 经验值
public ushort Money; // 金钱
public uint NormalAttackActionId; // 普通攻击动作ID
public byte HeightLevel; // 迷宫高度 0-2 对应 低 中 高
public byte MoveRangeLevel; // 运动范围 0-3 对应 不动 小 中 大
public byte AttackRangeLevel; // 索敌范围 0-2 对应 小 中 大
public byte MoveSpeedLevel; // 运动速度 0-3 对应 不动 小 中 大
public byte ChaseSpeedLevel; // 追踪速度 0-2 对应 小 中 大
public uint[] SkillIds; // 怪物所会的仙术ID [0-2] [3]为Boss级法术
public byte[] SkillLevels; // 怪物所会的3种法术的等级 boss级法术无此属性
public int SpImpactValue; // 物理攻击对我方气的影响值
public float[] Properties; // 附加属性,主要用于战斗音效类型的判断
public uint NormalLoot; // 普通战利品
public short NormalLootCount; // 普通战利品数量
public uint CorpseId; // 尸块ID
public uint CorpseSkillId; // 触发尸块的技能ID
public short CorpseSuccessRate; // 尸块获得成功率
public short StealableMoneyAmount; // 可偷多少钱
public uint StealableItemId; // 可偷物品ID
public short StealableItemCount; // 可偷物品数量
public short MoneyWhenKilled; // 被击败时可得钱数
}
public struct SkillInfo
{
public uint Id; // 技能ID
public SkillType Type; // 技能类型
public int[] WuLing; // 五灵属性
public string Name; // 技能名称
public string Description; // 技能描述
public byte[] MainActorCanUse; // 主角是否可以使用
public TargetRangeType TargetRangeType; // 目标范围类型
public byte SpecialSkillId; // 特殊技能ID 0为无特殊效果 1开头为偷敌人东西
public byte[] AttributeImpactType; // 属性影响类型 增加(或减少)数值的类型(0为绝对值,1为百分数,2为恢复到上限,3为增加上限值)
public short[] AttributeImpactValue; // 属性影响数值
public byte SuccessRateLevel; // 施法成功率 0~10对应不约定的计算方式 其他为百分比
public short[] CombatStateImpactType; // 战斗状态影响类型(0不影响,1增加,2解除)
public int[] ConsumeAttributeType; // 消耗属性类型
public int[] ConsumeAttributeKind; // 消耗属性种类数值 0-消耗气,1-消耗神,2-特殊消耗[精气神武防,情经速运级,钱水火风雷土蛊];
public byte SpecialConsumeType; // 特殊消耗类型 增加(或减少)数值的类型(0为绝对值,1为百分数,2为恢复到上限,3为增加上限值)
public int SpecialConsumeValue; // 特殊消耗数值
public byte Level; // 技能等级
public byte[] TimesBeforeLevelUp; // 升级前需使用次数
public byte RequiredActorLevel; // 使用所需角色等级
public byte MagicLevel; // 本级法术等级
public uint NextLevelSkillId; // 下一级法术ID
public byte IsUsableOutsideCombat; // 是否可以在战斗外使用
public uint[] CompositeSkillIds; // 可以合成的法术ID
public uint[] CompositeRequiredSkillIds; // 合成所需其他法术ID
public byte[] CompositeRequiredSkillLevels; // 合成所需其他法术等级
public byte[] CompositeRequiredCurrentSkillLevels; // 合成所需法术当前等级
public byte[] CompositeRequiredActorLevels; // 合成所需角色等级
public byte CanTriggerComboSkill; // 是否可以触发合击技
}
public struct ComboSkillInfo
{
public string Name; // 合击技名称
public uint Id; // 合击技ID
public uint[] MainActorRequirements; // 需要的人
public byte[] WuLingPositionRequirements; // 需要每个人的五灵位置,于上面数组一一对应[0-任意 1-水...6-中 7-风火雷[任意] 8-水火土[任意]]
public uint SkillId; // 发动技能ID
public byte[] WeaponTypeRequirements; // 对应每个参战者的武器类型
public int[] CombatStateRequirements; // 对应每个参战者的战斗状态要求
public string Description; // 合击技描述
public TargetRangeType TargetRangeType; // 使用范围类型
public byte[] AttributeImpactType; // 属性影响类型 增加(或减少)数值的类型(0为绝对值,1为百分数,2为恢复到上限,3为增加上限值)
public short[] AttributeImpactValue; // 属性影响数值
#if PAL3A
public int Unknown; // 三外特有数据 暂时未知 猜测是需要气的总数值?
#endif
}
// Pal3 Game Database file
public sealed class GdbFile
{
public Dictionary<int, GameItem> GameItems { get; } // Game item Id -> Game item
public IDictionary<int, CombatActorInfo> CombatActorInfos { get; }
public IDictionary<int, SkillInfo> SkillInfos { get; }
public IDictionary<int, GameItemInfo> GameItemInfos { get; }
public IDictionary<int, ComboSkillInfo> ComboSkillInfos { get; }
public GdbFile(Dictionary<int, GameItem> gameItems)
public GdbFile(IDictionary<int, CombatActorInfo> combatActorInfos,
IDictionary<int, SkillInfo> skillInfos,
IDictionary<int, GameItemInfo> gameItemInfos,
IDictionary<int, ComboSkillInfo> comboSkillInfos)
{
GameItems = gameItems;
CombatActorInfos = combatActorInfos;
SkillInfos = skillInfos;
GameItemInfos = gameItemInfos;
ComboSkillInfos = comboSkillInfos;
}
}
}
@@ -10,18 +10,11 @@ namespace Core.DataReader.Gdb
public sealed class GdbFileReader : IFileReader<GdbFile>
{
private readonly int _codepage;
public GdbFileReader(int codepage)
public GdbFile Read(IBinaryReader reader, int codepage)
{
_codepage = codepage;
}
_ = reader.ReadString(128, codepage); // header string
public GdbFile Read(IBinaryReader reader)
{
_ = reader.ReadString(128, _codepage); // header string
uint actorDataOffset = reader.ReadUInt32();
uint combatActorDataOffset = reader.ReadUInt32();
int numOfActors = reader.ReadInt32();
uint skillDataOffset = reader.ReadUInt32();
@@ -33,50 +26,299 @@ namespace Core.DataReader.Gdb
uint comboSkillDataOffset = reader.ReadUInt32();
int numOfComboSkills = reader.ReadInt32();
reader.Seek(combatActorDataOffset, SeekOrigin.Begin);
var combatActorInfos = new Dictionary<int, CombatActorInfo>();
for (var i = 0; i < numOfActors; i++)
{
CombatActorInfo actor = ReadCombatActorInfo(reader, codepage);
combatActorInfos[(int) actor.Id] = actor;
}
reader.Seek(skillDataOffset, SeekOrigin.Begin);
var skillInfos = new Dictionary<int, SkillInfo>();
for (var i = 0; i < numOfSkills; i++)
{
SkillInfo skill = ReadSkillInfo(reader, codepage);
skillInfos[(int) skill.Id] = skill;
}
reader.Seek(itemDataOffset, SeekOrigin.Begin);
var gameItems = new Dictionary<int, GameItem>();
var gameItems = new Dictionary<int, GameItemInfo>();
for (var i = 0; i < numOfItems; i++)
{
GameItem item = ReadGameItem(reader, _codepage);
GameItemInfo item = ReadGameItemInfo(reader, codepage);
gameItems[(int) item.Id] = item;
}
return new GdbFile(gameItems);
reader.Seek(comboSkillDataOffset, SeekOrigin.Begin);
var comboSkillInfos = new Dictionary<int, ComboSkillInfo>();
for (var i = 0; i < numOfComboSkills; i++)
{
ComboSkillInfo comboSkill = ReadComboSkillInfo(reader, codepage);
comboSkillInfos[(int) comboSkill.Id] = comboSkill;
}
return new GdbFile(combatActorInfos,
skillInfos,
gameItems,
comboSkillInfos);
}
private static GameItem ReadGameItem(IBinaryReader reader, int codepage)
private static CombatActorInfo ReadCombatActorInfo(IBinaryReader reader, int codepage)
{
return new GameItem
var id = reader.ReadUInt32();
var type = (CombatActorType) reader.ReadUInt16();
var description = reader.ReadString(512, codepage);
var modelId = reader.ReadString(30, codepage);
var iconId = reader.ReadString(32, codepage);
var wuLing = reader.ReadInt32s(5);
var name = reader.ReadString(32, codepage);
var level = reader.ReadInt32();
var attributeValue = reader.ReadInt32s(12);
var combatStateImpactType = reader.ReadBytes(31);
_ = reader.ReadByte(); // padding
var roundNumber = reader.ReadInt32();
var specialActionId = reader.ReadInt32();
var escapeRate = reader.ReadSingle();
var mainActorFavor = reader.ReadUInt16s(6);
var experience = reader.ReadInt32();
var money = reader.ReadUInt16();
_ = reader.ReadUInt16(); // padding
var normalAttackActionId = reader.ReadUInt32();
var heightLevel = reader.ReadByte();
var moveRangeLevel = reader.ReadByte();
var attackRangeLevel = reader.ReadByte();
var moveSpeedLevel = reader.ReadByte();
var chaseSpeed = reader.ReadByte();
_ = reader.ReadBytes(3); // padding
var skillIds = reader.ReadUInt32s(4);
var skillLevels = reader.ReadBytes(4);
var spImpactValue = reader.ReadInt32();
var properties = reader.ReadSingles(10);
var normalLoot = reader.ReadUInt32();
var normalLootCount = reader.ReadInt16();
_ = reader.ReadInt16(); // padding
var corpseId = reader.ReadUInt32();
var corpseSkillId = reader.ReadUInt32();
var corpseSuccessRate = reader.ReadInt16();
var stealableMoneyAmount = reader.ReadInt16();
var stealableItemId = reader.ReadUInt32();
var stealableItemCount = reader.ReadInt16();
var moneyWhenKilled = reader.ReadInt16();
return new CombatActorInfo()
{
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()
Id = id,
Type = type,
Description = description,
ModelId = modelId,
IconId = iconId,
WuLing = wuLing,
Name = name,
Level = level,
AttributeValue = attributeValue,
CombatStateImpactType = combatStateImpactType,
RoundNumber = roundNumber,
SpecialActionId = specialActionId,
EscapeRate = escapeRate,
MainActorFavor = mainActorFavor,
Experience = experience,
Money = money,
NormalAttackActionId = normalAttackActionId,
HeightLevel = heightLevel,
MoveRangeLevel = moveRangeLevel,
AttackRangeLevel = attackRangeLevel,
MoveSpeedLevel = moveSpeedLevel,
ChaseSpeedLevel = chaseSpeed,
SkillIds = skillIds,
SkillLevels = skillLevels,
SpImpactValue = spImpactValue,
Properties = properties,
NormalLoot = normalLoot,
NormalLootCount = normalLootCount,
CorpseId = corpseId,
CorpseSkillId = corpseSkillId,
CorpseSuccessRate = corpseSuccessRate,
StealableMoneyAmount = stealableMoneyAmount,
StealableItemId = stealableItemId,
StealableItemCount = stealableItemCount,
MoneyWhenKilled = moneyWhenKilled,
};
}
private SkillInfo ReadSkillInfo(IBinaryReader reader, int codepage)
{
var id = reader.ReadUInt32();
var type = (SkillType)reader.ReadByte();
_ = reader.ReadBytes(3); // padding
var wuLing = reader.ReadInt32s(5);
var name = reader.ReadString(32, codepage);
var description = reader.ReadString(512, codepage);
var mainActorCanUse = reader.ReadBytes(5);
var targetRangeType = (TargetRangeType)reader.ReadByte();
var specialSkillId = reader.ReadByte();
var attributeImpactType = reader.ReadBytes(12);
_ = reader.ReadByte(); // padding
var attributeImpactValue = reader.ReadInt16s(12);
var successRateLevel = reader.ReadByte();
_ = reader.ReadByte(); // padding
var combatStateImpactType = reader.ReadInt16s(31);
var consumeAttributeType = reader.ReadInt32s(2);
var consumeAttributeKind = reader.ReadInt32s(3);
var specialConsumeType = reader.ReadByte();
_ = reader.ReadBytes(3); // padding
var specialConsumeValue = reader.ReadInt32();
var level = reader.ReadByte();
var timesBeforeLevelUp = reader.ReadBytes(4);
var requiredActorLevel = reader.ReadByte();
var magicLevel = reader.ReadByte();
_ = reader.ReadByte(); // padding
var nextLevelSkillId = reader.ReadUInt32();
var isUsableOutsideCombat = reader.ReadByte();
_ = reader.ReadBytes(3); // padding
var compositeSkillIds = reader.ReadUInt32s(3);
var compositeRequiredSkillIds = reader.ReadUInt32s(3);
var compositeRequiredSkillLevels = reader.ReadBytes(3);
var compositeRequiredCurrentSkillLevels = reader.ReadBytes(3);
var compositeRequiredActorLevels = reader.ReadBytes(3);
var canTriggerComboSkill = reader.ReadByte();
_ = reader.ReadBytes(2); // padding
return new SkillInfo()
{
Id = id,
Type = type,
WuLing = wuLing,
Name = name,
Description = description,
MainActorCanUse = mainActorCanUse,
TargetRangeType = targetRangeType,
SpecialSkillId = specialSkillId,
AttributeImpactType = attributeImpactType,
AttributeImpactValue = attributeImpactValue,
SuccessRateLevel = successRateLevel,
CombatStateImpactType = combatStateImpactType,
ConsumeAttributeType = consumeAttributeType,
ConsumeAttributeKind = consumeAttributeKind,
SpecialConsumeType = specialConsumeType,
SpecialConsumeValue = specialConsumeValue,
Level = level,
TimesBeforeLevelUp = timesBeforeLevelUp,
RequiredActorLevel = requiredActorLevel,
MagicLevel = magicLevel,
NextLevelSkillId = nextLevelSkillId,
IsUsableOutsideCombat = isUsableOutsideCombat,
CompositeSkillIds = compositeSkillIds,
CompositeRequiredSkillIds = compositeRequiredSkillIds,
CompositeRequiredSkillLevels = compositeRequiredSkillLevels,
CompositeRequiredCurrentSkillLevels = compositeRequiredCurrentSkillLevels,
CompositeRequiredActorLevels = compositeRequiredActorLevels,
CanTriggerComboSkill = canTriggerComboSkill,
};
}
private static GameItemInfo ReadGameItemInfo(IBinaryReader reader, int codepage)
{
var id = reader.ReadUInt32();
var name = reader.ReadString(32, codepage);
var modelName = reader.ReadString(30, codepage);
var iconName = reader.ReadString(30, codepage);
var description = reader.ReadString(512, codepage);
var price = reader.ReadInt32();
var type = (ItemType) reader.ReadByte();
var weaponType = (WeaponType) reader.ReadByte();
var mainActorCanUse = reader.ReadBytes(5);
var wuLing = reader.ReadBytes(5);
var ancientValue = reader.ReadInt32();
var specialType = (SpecialType) reader.ReadByte();
var targetRangeType = (TargetRangeType) reader.ReadByte();
var placeOfUseType = (PlaceOfUseType) reader.ReadByte();
var attributeImpactType = reader.ReadBytes(12);
_ = reader.ReadByte(); // padding
var attributeImpactValue = reader.ReadInt16s(12);
var combatStateImpactType = reader.ReadBytes(31);
_ = reader.ReadByte(); // padding
var combatStateImpactValue = reader.ReadInt16s(31);
_ = reader.ReadBytes(2); // padding
var comboCount = reader.ReadInt32();
var spSavingPercentage = reader.ReadInt16();
var mpSavingPercentage = reader.ReadInt16();
var criticalAttackAmplifyPercentage = reader.ReadInt16();
var specialSkillSuccessRate = reader.ReadInt16();
var oreId = reader.ReadUInt32();
var productId = reader.ReadUInt32();
var productPrice = reader.ReadInt32();
var synthesisMaterialIds = reader.ReadUInt32s(2);
var synthesisProductId = reader.ReadUInt32();
return new GameItemInfo()
{
Id = id,
Name = name,
ModelName = modelName,
IconName = iconName,
Description = description,
Price = price,
Type = type,
WeaponType = weaponType,
MainActorCanUse = mainActorCanUse,
WuLing = wuLing,
AncientValue = ancientValue,
SpecialType = specialType,
TargetRangeType = targetRangeType,
PlaceOfUseType = placeOfUseType,
AttributeImpactType = attributeImpactType,
AttributeImpactValue = attributeImpactValue,
CombatStateImpactType = combatStateImpactType,
CombatStateImpactValue = combatStateImpactValue,
ComboCount = comboCount,
SpSavingPercentage = spSavingPercentage,
MpSavingPercentage = mpSavingPercentage,
CriticalAttackAmplifyPercentage = criticalAttackAmplifyPercentage,
SpecialSkillSuccessRate = specialSkillSuccessRate,
OreId = oreId,
ProductId = productId,
ProductPrice = productPrice,
SynthesisMaterialIds = synthesisMaterialIds,
SynthesisProductId = synthesisProductId,
};
}
private ComboSkillInfo ReadComboSkillInfo(IBinaryReader reader, int codepage)
{
var name = reader.ReadString(32, codepage);
var id = reader.ReadUInt32();
var mainActorRequirements = reader.ReadUInt32s(4);
var wuLingPositionRequirements = reader.ReadBytes(4);
var skillId = reader.ReadUInt32();
var weaponTypeRequirements = reader.ReadBytes(4);
_ = reader.ReadBytes(4); // not used
var combatStateRequirements = reader.ReadInt32s(3);
var description = reader.ReadString(512, codepage);
var targetRangeType = (TargetRangeType)reader.ReadByte();
var attributeImpactType = reader.ReadBytes(12);
_ = reader.ReadBytes(3); // padding
var attributeImpactValue = reader.ReadInt16s(12);
#if PAL3A
var unknown = reader.ReadInt32();
#endif
return new ComboSkillInfo()
{
Name = name,
Id = id,
MainActorRequirements = mainActorRequirements,
WuLingPositionRequirements = wuLingPositionRequirements,
SkillId = skillId,
WeaponTypeRequirements = weaponTypeRequirements,
CombatStateRequirements = combatStateRequirements,
Description = description,
TargetRangeType = targetRangeType,
AttributeImpactType = attributeImpactType,
AttributeImpactValue = attributeImpactValue,
#if PAL3A
Unknown = unknown,
#endif
};
}
}
+67 -44
View File
@@ -17,6 +17,8 @@ namespace Core.DataReader
/// </summary>
public interface IBinaryReader : IDisposable
{
long Position { get; }
long Length { get; }
void Seek(long offset, SeekOrigin seekOrigin);
short ReadInt16();
int ReadInt32();
@@ -31,26 +33,8 @@ namespace Core.DataReader
byte[] ReadBytes(int count);
#region Helper Extensions (Default Implementation)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Vector2 ReadVector2() => new (ReadSingle(), ReadSingle());
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Vector3 ReadVector3() => new (ReadSingle(), ReadSingle(), ReadSingle());
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Vector3[] ReadVector3Array(int count)
{
var array = new Vector3[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadVector3();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
float[] ReadSingleArray(int count)
float[] ReadSingles(int count)
{
var array = new float[count];
for (var i = 0; i < count; i++)
@@ -61,7 +45,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
double[] ReadDoubleArray(int count)
double[] ReadDoubles(int count)
{
var array = new double[count];
for (var i = 0; i < count; i++)
@@ -72,29 +56,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
int[] ReadInt32Array(int count)
{
var array = new int[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadInt32();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
uint[] ReadUInt32Array(int count)
{
var array = new uint[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadUInt32();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
short[] ReadInt16Array(int count)
short[] ReadInt16s(int count)
{
var array = new short[count];
for (var i = 0; i < count; i++)
@@ -105,7 +67,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
ushort[] ReadUInt16Array(int count)
ushort[] ReadUInt16s(int count)
{
var array = new ushort[count];
for (var i = 0; i < count; i++)
@@ -115,6 +77,50 @@ namespace Core.DataReader
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
int[] ReadInt32s(int count)
{
var array = new int[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadInt32();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
uint[] ReadUInt32s(int count)
{
var array = new uint[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadUInt32();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
long[] ReadInt64s(int count)
{
var array = new long[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadInt64();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
ulong[] ReadUInt64s(int count)
{
var array = new ulong[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadUInt64();
}
return array;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public char[] ReadChars(int count)
{
@@ -132,6 +138,23 @@ namespace Core.DataReader
if (length == -1) length = strBytes.Length; // If no null byte is found, use the full length
return Encoding.GetEncoding(codepage).GetString(strBytes, 0, length);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Vector2 ReadVector2() => new (ReadSingle(), ReadSingle());
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Vector3 ReadVector3() => new (ReadSingle(), ReadSingle(), ReadSingle());
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Vector3[] ReadVector3s(int count)
{
var array = new Vector3[count];
for (var i = 0; i < count; i++)
{
array[i] = ReadVector3();
}
return array;
}
#endregion
}
}
+20 -5
View File
@@ -5,26 +5,41 @@
namespace Core.DataReader
{
using System.IO;
/// <summary>
/// File reader interface for reading data from binary file
/// using <see cref="IBinaryReader"/>.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="T">File type</typeparam>
public interface IFileReader<out T>
{
T Read(IBinaryReader reader);
T Read(IBinaryReader reader, int codepage);
T Read(byte[] data)
T Read(byte[] data, int codepage)
{
// Use unsafe binary reader (faster) if IL2CPP is enabled
// otherwise use safe reader
#if ENABLE_IL2CPP
#if ENABLE_IL2CPP || UNITY_EDITOR
using var reader = new UnsafeBinaryReader(data);
#else
using var reader = new SafeBinaryReader(data);
#endif
return Read(reader);
return Read(reader, codepage);
}
T Read(Stream stream, int codepage)
{
// Use unsafe binary reader (faster) if IL2CPP is enabled
// otherwise use safe reader
#if ENABLE_IL2CPP || UNITY_EDITOR
using var reader = new UnsafeBinaryReader(stream);
#else
using var reader = new SafeBinaryReader(stream);
#endif
return Read(reader, codepage);
}
}
}
@@ -23,16 +23,16 @@ namespace Core.DataReader.Ini
private const string PROPERTY_MESH = "mesh";
private const string PROPERTY_MATERIAL = "material";
public MovActionConfig Read(IBinaryReader reader)
public MovActionConfig Read(IBinaryReader reader, int codepage)
{
throw new NotImplementedException();
}
public MovActionConfig Read(byte[] data)
public MovActionConfig Read(byte[] data, int codepage)
{
FileIniDataParser parser = new ();
using var stream = new MemoryStream(data);
using var reader = new StreamReader(stream, Encoding.ASCII);
using var reader = new StreamReader(stream, Encoding.GetEncoding(codepage));
IniData iniData = parser.ReadData(reader);
@@ -19,16 +19,16 @@ namespace Core.DataReader.Ini
private const string PROPERTY_NAME = "name";
private const string PROPERTY_FILE = "file";
public Mv3ActionConfig Read(IBinaryReader reader)
public Mv3ActionConfig Read(IBinaryReader reader, int codepage)
{
throw new NotImplementedException();
}
public Mv3ActionConfig Read(byte[] data)
public Mv3ActionConfig Read(byte[] data, int codepage)
{
var parser = new FileIniDataParser();
using var stream = new MemoryStream(data);
using var reader = new StreamReader(stream, Encoding.ASCII);
using var reader = new StreamReader(stream, Encoding.GetEncoding(codepage));
IniData iniData = parser.ReadData(reader);
@@ -12,7 +12,7 @@ namespace Core.DataReader.Lgt
public sealed class LgtFileReader : IFileReader<LgtFile>
{
public LgtFile Read(IBinaryReader reader)
public LgtFile Read(IBinaryReader reader, int codepage)
{
var numOfLightNodes = reader.ReadInt32();
var lightNodes = new List<LightNode>();
@@ -46,8 +46,8 @@ namespace Core.DataReader.Lgt
{
WorldMatrix = GameBoxInterpreter.ToUnityMatrix4x4(transformMatrix),
LightType = (GameBoxLightType)reader.ReadInt32(),
LightColor = Utility.ToColor(reader.ReadSingleArray(4)),
AmbientColor = Utility.ToColor(reader.ReadSingleArray(4)),
LightColor = Utility.ToColor(reader.ReadSingles(4)),
AmbientColor = Utility.ToColor(reader.ReadSingles(4)),
UseDiffuse = reader.ReadBoolean(),
UseSpecular = reader.ReadBoolean(),
NearStart = reader.ReadSingle(),
@@ -10,14 +10,7 @@ namespace Core.DataReader.Mov
public sealed class MovFileReader : IFileReader<MovFile>
{
private readonly int _codepage;
public MovFileReader(int codepage)
{
_codepage = codepage;
}
public MovFile Read(IBinaryReader reader)
public MovFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -41,13 +34,13 @@ namespace Core.DataReader.Mov
var animationEvents = new MovAnimationEvent[numberOfAnimationEvents];
for (var i = 0; i < numberOfAnimationEvents; i++)
{
animationEvents[i] = ReadAnimationEvent(reader, _codepage);
animationEvents[i] = ReadAnimationEvent(reader, codepage);
}
var boneAnimationTracks = new MovBoneAnimationTrack[numberOfBoneAnimationTracks];
for (var i = 0; i < numberOfBoneAnimationTracks; i++)
{
boneAnimationTracks[i] = ReadBoneAnimationTrack(reader, _codepage);
boneAnimationTracks[i] = ReadBoneAnimationTrack(reader, codepage);
}
uint totalDuration = 0;
@@ -11,14 +11,7 @@ namespace Core.DataReader.Msh
public sealed class MshFileReader : IFileReader<MshFile>
{
private readonly int _codepage;
public MshFileReader(int codepage)
{
_codepage = codepage;
}
public MshFile Read(IBinaryReader reader)
public MshFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -50,7 +43,7 @@ namespace Core.DataReader.Msh
var childBoneNodes = new BoneNode[numberOfChildBones];
for (var i = 0; i < numberOfChildBones; i++)
{
childBoneNodes[i] = ReadBoneNode(reader, rootBoneNode, _codepage);
childBoneNodes[i] = ReadBoneNode(reader, rootBoneNode, codepage);
}
rootBoneNode.Children = childBoneNodes;
@@ -12,14 +12,7 @@ namespace Core.DataReader.Mtl
public sealed class MtlFileReader : IFileReader<MtlFile>
{
private readonly int _codepage;
public MtlFileReader(int codepage)
{
_codepage = codepage;
}
public MtlFile Read(IBinaryReader reader)
public MtlFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -42,10 +35,10 @@ namespace Core.DataReader.Mtl
{
materials[i] = new GameBoxMaterial
{
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
Diffuse = Utility.ToColor(reader.ReadSingles(4)),
Ambient = Utility.ToColor(reader.ReadSingles(4)),
Specular = Utility.ToColor(reader.ReadSingles(4)),
Emissive = Utility.ToColor(reader.ReadSingles(4)),
SpecularPower = reader.ReadSingle(),
};
@@ -54,7 +47,7 @@ namespace Core.DataReader.Mtl
{
int textureNameLength = reader.ReadInt32();
if (textureNameLength == 0) continue;
textureNames.Add(reader.ReadString(textureNameLength, _codepage));
textureNames.Add(reader.ReadString(textureNameLength, codepage));
}
materials[i].TextureFileNames = textureNames.ToArray();
@@ -14,14 +14,7 @@ namespace Core.DataReader.Mv3
public sealed class Mv3FileReader : IFileReader<Mv3File>
{
private readonly int _codepage;
public Mv3FileReader(int codepage)
{
_codepage = codepage;
}
public Mv3File Read(IBinaryReader reader)
public Mv3File Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -51,25 +44,25 @@ namespace Core.DataReader.Mv3
var animationEvents = new Mv3AnimationEvent[numberOfAnimationEvents];
for (var i = 0; i < numberOfAnimationEvents; i++)
{
animationEvents[i] = ReadAnimationEvent(reader, _codepage);
animationEvents[i] = ReadAnimationEvent(reader, codepage);
}
var tagNodes = new Mv3TagNode[numberOfTagNodes];
for (var i = 0; i < numberOfTagNodes; i++)
{
tagNodes[i] = ReadTagNode(reader, _codepage);
tagNodes[i] = ReadTagNode(reader, codepage);
}
var materials = new GameBoxMaterial[numberOfMaterials];
for (var i = 0; i < numberOfMaterials; i++)
{
materials[i] = ReadMaterial(reader, _codepage);
materials[i] = ReadMaterial(reader, codepage);
}
var meshes = new Mv3Mesh[numberOfMeshes];
for (var i = 0; i < numberOfMeshes; i++)
{
meshes[i] = ReadMesh(reader, _codepage);
meshes[i] = ReadMesh(reader, codepage);
}
return new Mv3File(duration,
@@ -283,10 +276,10 @@ namespace Core.DataReader.Mv3
{
GameBoxMaterial material = new ()
{
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
Diffuse = Utility.ToColor(reader.ReadSingles(4)),
Ambient = Utility.ToColor(reader.ReadSingles(4)),
Specular = Utility.ToColor(reader.ReadSingles(4)),
Emissive = Utility.ToColor(reader.ReadSingles(4)),
SpecularPower = reader.ReadSingle()
};
@@ -41,9 +41,9 @@ namespace Core.DataReader.Nav
DevilWorld2, // 异空间B
DevilWorld3, // 异空间C
Other, // 其它
FloorIce, // 冰
FloorBlood, // 血池
FloorWater, // 水域
Ice, // 冰
Blood, // 血池
Water, // 水域
}
public struct NavTile
@@ -13,7 +13,7 @@ namespace Core.DataReader.Nav
public sealed class NavFileReader : IFileReader<NavFile>
{
public NavFile Read(IBinaryReader reader)
public NavFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -14,14 +14,7 @@ namespace Core.DataReader.Pol
public sealed class PolFileReader : IFileReader<PolFile>
{
private readonly int _codepage;
public PolFileReader(int codepage)
{
_codepage = codepage;
}
public PolFile Read(IBinaryReader reader)
public PolFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header);
@@ -39,7 +32,7 @@ namespace Core.DataReader.Pol
{
nodeInfos[i] = new PolGeometryNode
{
Name = reader.ReadString(32, _codepage),
Name = reader.ReadString(32, codepage),
Position = GameBoxInterpreter.ToUnityPosition(reader.ReadVector3()),
Radius = reader.ReadSingle(),
Offset = reader.ReadInt32()
@@ -55,7 +48,7 @@ namespace Core.DataReader.Pol
tagNodes = new TagNode[numberOfTagNodes];
for (var i = 0; i < numberOfTagNodes; i++)
{
tagNodes[i] = ReadTagNodeInfo(reader, _codepage);
tagNodes[i] = ReadTagNodeInfo(reader, codepage);
}
}
}
@@ -63,7 +56,7 @@ namespace Core.DataReader.Pol
var meshInfos = new PolMesh[numberOfNodes];
for (var i = 0; i < numberOfNodes; i++)
{
meshInfos[i] = ReadMeshData(reader, version, _codepage);
meshInfos[i] = ReadMeshData(reader, version, codepage);
}
return new PolFile(version, nodeInfos, meshInfos, tagNodes);
@@ -224,10 +217,10 @@ namespace Core.DataReader.Pol
GameBoxMaterial material = new ()
{
Diffuse = Utility.ToColor(reader.ReadSingleArray(4)),
Ambient = Utility.ToColor(reader.ReadSingleArray(4)),
Specular = Utility.ToColor(reader.ReadSingleArray(4)),
Emissive = Utility.ToColor(reader.ReadSingleArray(4)),
Diffuse = Utility.ToColor(reader.ReadSingles(4)),
Ambient = Utility.ToColor(reader.ReadSingles(4)),
Specular = Utility.ToColor(reader.ReadSingles(4)),
Emissive = Utility.ToColor(reader.ReadSingles(4)),
SpecularPower = reader.ReadSingle()
};
@@ -8,6 +8,9 @@ namespace Core.DataReader
using System;
using System.IO;
/// <summary>
/// Provides a safe way to read binary data from a stream or byte array.
/// </summary>
public sealed class SafeBinaryReader : IBinaryReader
{
private readonly BinaryReader _reader;
@@ -24,7 +27,10 @@ namespace Core.DataReader
_reader.BaseStream.Seek(offset, seekOrigin);
}
public long Position => _reader.BaseStream.Position;
public long Length => _reader.BaseStream.Length;
public Stream BaseStream => _reader.BaseStream;
public short ReadInt16() => _reader.ReadInt16();
public int ReadInt32() => _reader.ReadInt32();
public long ReadInt64() => _reader.ReadInt64();
@@ -9,14 +9,7 @@ namespace Core.DataReader.Sce
public sealed class SceFileReader : IFileReader<SceFile>
{
private readonly int _codepage;
public SceFileReader(int codepage)
{
_codepage = codepage;
}
public SceFile Read(IBinaryReader reader)
public SceFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -38,16 +31,16 @@ namespace Core.DataReader.Sce
var indexes = new SceIndex[numberOfBlocks];
for (var i = 0; i < numberOfBlocks; i++)
{
indexes[i] = ReadSceIndex(reader, _codepage);
indexes[i] = ReadSceIndex(reader, codepage);
}
var scriptBlocks = new SceScriptBlock[numberOfBlocks];
for (var i = 0; i < numberOfBlocks; i++)
{
scriptBlocks[i] = ReadScriptBlock(reader, indexes[i], _codepage);
scriptBlocks[i] = ReadScriptBlock(reader, indexes[i], codepage);
}
return new SceFile(indexes, scriptBlocks, _codepage);
return new SceFile(indexes, scriptBlocks, codepage);
}
private static SceScriptBlock ReadScriptBlock(IBinaryReader reader, SceIndex sceIndex, int codepage)
@@ -353,7 +353,7 @@ namespace Core.DataReader.Scn
public string FailedMessage; // char[16] 失败提示字符串名称
#if PAL3A
public uint Unknown; // TODO
public ushort LinkedObjectGroupId; // 同时触发的关联编号 (如阳名百纳二的机关浮板,神魔结界的三相桥)
#endif
public uint ScriptId;
@@ -13,14 +13,7 @@ namespace Core.DataReader.Scn
public sealed class ScnFileReader : IFileReader<ScnFile>
{
private readonly int _codepage;
public ScnFileReader(int codepage)
{
_codepage = codepage;
}
public ScnFile Read(IBinaryReader reader)
public ScnFile Read(IBinaryReader reader, int codepage)
{
var header = reader.ReadChars(4);
var headerStr = new string(header[..^1]);
@@ -38,27 +31,27 @@ namespace Core.DataReader.Scn
var sceneInfo = new ScnSceneInfo()
{
CityName = reader.ReadString(32, _codepage),
SceneName = reader.ReadString(32, _codepage),
Model = reader.ReadString(32, _codepage),
CityName = reader.ReadString(32, codepage),
SceneName = reader.ReadString(32, codepage),
Model = reader.ReadString(32, codepage),
SceneType = (ScnSceneType) reader.ReadInt32(),
LightMap = reader.ReadInt32(),
SkyBox = reader.ReadUInt32(),
Reserved = reader.ReadUInt32Array(6),
Reserved = reader.ReadUInt32s(6),
};
reader.Seek(npcDataOffset, SeekOrigin.Begin);
var npcInfos = new ScnNpcInfo[numberOfNpc];
for (var i = 0; i < numberOfNpc; i++)
{
npcInfos[i] = ReadNpcInfo(reader, _codepage);
npcInfos[i] = ReadNpcInfo(reader, codepage);
}
reader.Seek(objectDataOffset, SeekOrigin.Begin);
var objInfos = new ScnObjectInfo[numberOfObjects];
for (var i = 0; i < numberOfObjects; i++)
{
ScnObjectInfo sceneObject = ReadObjectInfo(reader, _codepage);
ScnObjectInfo sceneObject = ReadObjectInfo(reader, codepage);
objInfos[i] = sceneObject;
}
@@ -82,19 +75,19 @@ namespace Core.DataReader.Scn
ScriptId = reader.ReadUInt32(),
GameBoxYPosition = reader.ReadSingle(),
InitAction = reader.ReadString(16, codepage),
MonsterIds = reader.ReadUInt32Array(3),
MonsterIds = reader.ReadUInt32s(3),
NumberOfMonsters = reader.ReadByte(),
MonsterCanRespawn = reader.ReadByte(),
PaddingBytes = reader.ReadBytes(2), // Empty padding bytes to complete 4-byte alignment
Path = new ScnPath()
{
NumberOfWaypoints = reader.ReadInt32(),
GameBoxWaypoints = reader.ReadVector3Array(16)
GameBoxWaypoints = reader.ReadVector3s(16)
},
NoTurn = reader.ReadUInt32(),
LoopAction = reader.ReadUInt32(),
GameBoxMoveSpeed = reader.ReadUInt32(),
Reserved = reader.ReadUInt32Array(29),
Reserved = reader.ReadUInt32s(29),
};
}
@@ -122,15 +115,15 @@ namespace Core.DataReader.Scn
Bottom = reader.ReadInt32(),
};
var type = (ScnSceneObjectType) reader.ReadByte();
var type = (ScnSceneObjectType)reader.ReadByte();
var saveState = reader.ReadByte();
var layerIndex = reader.ReadByte();
var wuLing = reader.ReadByte();
#if PAL3
var parameters = reader.ReadInt32Array(6);
var parameters = reader.ReadInt32s(6);
#elif PAL3A
var parameters = Array.ConvertAll(reader.ReadSingleArray(6), Convert.ToInt32);
var parameters = Array.ConvertAll(reader.ReadSingles(6), Convert.ToInt32);
#endif
#if PAL3A
@@ -150,7 +143,8 @@ namespace Core.DataReader.Scn
_ = reader.ReadByte(); // Empty padding byte to complete 4-byte alignment
#if PAL3A
var unknown = reader.ReadUInt32(); // TODO
var linkedObjectGroupId = reader.ReadUInt16();
_ = reader.ReadBytes(2); // Empty padding bytes to complete 4-byte alignment
#endif
var scriptId = reader.ReadUInt32();
@@ -158,7 +152,7 @@ namespace Core.DataReader.Scn
var path = new ScnPath()
{
NumberOfWaypoints = reader.ReadInt32(),
GameBoxWaypoints = reader.ReadVector3Array(16)
GameBoxWaypoints = reader.ReadVector3s(16)
};
var linkedObjectId = reader.ReadUInt16();
@@ -189,9 +183,9 @@ namespace Core.DataReader.Scn
#endif
#if PAL3
var reserved = reader.ReadUInt32Array(52);
var reserved = reader.ReadUInt32s(52);
#elif PAL3A
var reserved = reader.ReadUInt32Array(44);
var reserved = reader.ReadUInt32s(44);
#endif
return new ScnObjectInfo()
@@ -231,7 +225,7 @@ namespace Core.DataReader.Scn
FailedMessage = failedMessage,
#if PAL3A
Unknown = unknown, // TODO
LinkedObjectGroupId = linkedObjectGroupId,
#endif
ScriptId = scriptId,
@@ -11,21 +11,14 @@ namespace Core.DataReader.Txt
public sealed class TaskDefinitionFileReader : IFileReader<TaskDefinitionFile>
{
private readonly int _codepage;
public TaskDefinitionFileReader(int codepage)
{
_codepage = codepage;
}
public TaskDefinitionFile Read(IBinaryReader reader)
public TaskDefinitionFile Read(IBinaryReader reader, int codepage)
{
throw new NotImplementedException();
}
public TaskDefinitionFile Read(byte[] data)
public TaskDefinitionFile Read(byte[] data, int codepage)
{
var content = Encoding.GetEncoding(_codepage).GetString(data, 0, data.Length);
var content = Encoding.GetEncoding(codepage).GetString(data, 0, data.Length);
var tasks = new List<Task>();
var taskLines = content.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
var currentTask = new Task();
@@ -10,26 +10,54 @@ namespace Core.DataReader
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
/// <summary>
/// Provides a binary reader that reads primitive data types from a byte array or stream using unsafe code.
/// </summary>
public sealed unsafe class UnsafeBinaryReader : IBinaryReader
{
private byte* _dataPtr;
private GCHandle _handle;
private byte* _startPtr;
private byte* _dataPtr;
public UnsafeBinaryReader(byte[] data)
{
Init(data);
}
public UnsafeBinaryReader(Stream stream)
{
if (!stream.CanSeek)
{
throw new ArgumentException("Stream must be seekable", nameof(stream));
}
var length = stream.Length;
var data = new byte[length];
_ = stream.Read(data, 0, (int)length);
Init(data);
}
private void Init(byte[] data)
{
Length = data.Length;
_handle = GCHandle.Alloc(data, GCHandleType.Pinned);
fixed (byte* ptr = &data[0])
{
_startPtr = ptr;
_dataPtr = ptr;
}
}
public long Position => _dataPtr - _startPtr;
public long Length { get; private set; }
public void Seek(long offset, SeekOrigin seekOrigin)
{
switch (seekOrigin)
{
case SeekOrigin.Begin:
_dataPtr = (byte*)_handle.AddrOfPinnedObject() + offset;
_dataPtr = _startPtr + offset;
break;
case SeekOrigin.Current:
_dataPtr += offset;
@@ -131,7 +159,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public float[] ReadSingleArray(int count)
public float[] ReadSingles(int count)
{
var value = new float[count];
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
@@ -140,7 +168,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public double[] ReadDoubleArray(int count)
public double[] ReadDoubles(int count)
{
var value = new double[count];
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
@@ -149,7 +177,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public short[] ReadInt16Array(int count)
public short[] ReadInt16s(int count)
{
var value = new short[count];
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
@@ -158,7 +186,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int[] ReadInt32Array(int count)
public int[] ReadInt32s(int count)
{
var value = new int[count];
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
@@ -167,7 +195,7 @@ namespace Core.DataReader
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public long[] ReadInt64Array(int count)
public long[] ReadInt64s(int count)
{
var value = new long[count];
Marshal.Copy(new IntPtr(_dataPtr), value, 0, count);
@@ -5,12 +5,13 @@
namespace Core.Utils
{
using System;
using System.Collections.Generic;
using UnityEngine;
public static class UnitySupportedVideoFormats
{
public static readonly HashSet<string> WindowsSupportedVideoFormats = new()
public static readonly HashSet<string> WindowsSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase)
{
".asf",
".avi",
@@ -26,7 +27,7 @@ namespace Core.Utils
".wmv",
};
public static readonly HashSet<string> MacOSSupportedVideoFormats = new()
public static readonly HashSet<string> MacOSSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase)
{
".dv",
".m4v",
@@ -39,20 +40,20 @@ namespace Core.Utils
".webm",
};
public static readonly HashSet<string> LinuxSupportedVideoFormats = new()
public static readonly HashSet<string> LinuxSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase)
{
".ogv",
".vp8",
".webm",
};
public static readonly HashSet<string> AndroidSupportedVideoFormats = new()
public static readonly HashSet<string> AndroidSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase)
{
".webm",
".mp4",
};
public static readonly HashSet<string> iOSSupportedVideoFormats = new()
public static readonly HashSet<string> iOSSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase)
{
".webm",
".mp4",
@@ -67,7 +68,7 @@ namespace Core.Utils
RuntimePlatform.LinuxPlayer or RuntimePlatform.LinuxEditor => LinuxSupportedVideoFormats,
RuntimePlatform.IPhonePlayer => iOSSupportedVideoFormats,
RuntimePlatform.Android => AndroidSupportedVideoFormats,
_ => new HashSet<string> {".mp4" }
_ => new HashSet<string> (StringComparer.OrdinalIgnoreCase) {".mp4" }
};
}
}
+16 -16
View File
@@ -23,22 +23,22 @@ namespace Core.Utils
return new Color(rgba[0], rgba[1], rgba[2], rgba[3]);
}
public static unsafe void ApplyTransparencyBasedOnColorLuminance(Texture2D texture)
{
var pixels = texture.GetPixels();
fixed (float* src = &pixels[0].r)
{
var p = src;
for (var i = 0; i < texture.width * texture.height; i++, p += 4)
{
*(p + 3) = 0.299f * *p + 0.587f * *(p + 1) + 0.114f * *(p + 2);
}
}
texture.SetPixels(pixels);
texture.Apply();
}
// public static unsafe void ApplyTransparencyBasedOnColorLuminance(Texture2D texture)
// {
// var pixels = texture.GetPixels();
//
// fixed (float* src = &pixels[0].r)
// {
// var p = src;
// for (var i = 0; i < texture.width * texture.height; i++, p += 4)
// {
// *(p + 3) = 0.299f * *p + 0.587f * *(p + 1) + 0.114f * *(p + 2);
// }
// }
//
// texture.SetPixels(pixels);
// texture.Apply(updateMipmaps: false);
// }
public static T ReadStruct<T>(Stream stream) where T : struct
{
@@ -25,7 +25,7 @@ namespace Editor
Windows_x86 = 1 << 0,
Windows_x64 = 1 << 1,
Linux_x86_x64 = 1 << 2,
MacOS_arm64_x64 = 1 << 3,
macOS_arm64_x64 = 1 << 3,
Android = 1 << 4,
iOS = 1 << 5,
}
@@ -67,13 +67,13 @@ namespace Editor
}
#if PAL3
[MenuItem("PAL3/Build Pipelines/Build [MacOS_arm64_x64] IL2CPP XCode Project")]
[MenuItem("PAL3/Build Pipelines/Build [macOS_arm64_x64] IL2CPP XCode Project")]
#elif PAL3A
[MenuItem("PAL3A/Build Pipelines/Build [MacOS_arm64_x64] IL2CPP XCode Project")]
[MenuItem("PAL3A/Build Pipelines/Build [macOS_arm64_x64] IL2CPP XCode Project")]
#endif
public static void Build_MacOS_arm64_x64()
public static void Build_macOS_arm64_x64()
{
BuildGame(Pal3BuildTarget.MacOS_arm64_x64);
BuildGame(Pal3BuildTarget.macOS_arm64_x64);
}
#if PAL3
@@ -97,16 +97,16 @@ namespace Editor
}
#if PAL3
[MenuItem("PAL3/Build Pipelines/Build All [Windows, Linux, MacOS, Android, iOS]")]
[MenuItem("PAL3/Build Pipelines/Build All [Windows, Linux, macOS, Android, iOS]")]
#elif PAL3A
[MenuItem("PAL3A/Build Pipelines/Build All [Windows, Linux, MacOS, Android, iOS]")]
[MenuItem("PAL3A/Build Pipelines/Build All [Windows, Linux, macOS, Android, iOS]")]
#endif
public static void BuildAll()
{
BuildGame(Pal3BuildTarget.Windows_x86 |
Pal3BuildTarget.Windows_x64 |
Pal3BuildTarget.Linux_x86_x64 |
Pal3BuildTarget.MacOS_arm64_x64 |
Pal3BuildTarget.macOS_arm64_x64 |
Pal3BuildTarget.Android |
Pal3BuildTarget.iOS);
}
@@ -136,7 +136,7 @@ namespace Editor
new { Platform = Pal3BuildTarget.Windows_x86, Extension = ".exe", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneWindows },
new { Platform = Pal3BuildTarget.Windows_x64, Extension = ".exe", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneWindows64 },
new { Platform = Pal3BuildTarget.Linux_x86_x64, Extension = "", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneLinux64 },
new { Platform = Pal3BuildTarget.MacOS_arm64_x64, Extension = "", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneOSX },
new { Platform = Pal3BuildTarget.macOS_arm64_x64, Extension = "", Group = BuildTargetGroup.Standalone, Target = BuildTarget.StandaloneOSX },
new { Platform = Pal3BuildTarget.Android, Extension = ".apk", Group = BuildTargetGroup.Android, Target = BuildTarget.Android },
new { Platform = Pal3BuildTarget.iOS, Extension = "", Group = BuildTargetGroup.iOS, Target = BuildTarget.iOS },
};
@@ -336,7 +336,7 @@ namespace Pal3.Actor
}
else if (command.NewState == GameState.Gameplay)
{
PlayerActorId playerActor = ServiceLocator.Instance.Get<PlayerManager>().GetPlayerActor();
PlayerActorId playerActor = ServiceLocator.Instance.Get<PlayerActorManager>().GetPlayerActor();
_isKinematic = _actor.Info.Id != (byte)playerActor;
}
+1 -1
View File
@@ -172,7 +172,7 @@ namespace Pal3.Actor
if (_actor.Info.Kind == ScnActorKind.CombatNpc &&
(_actor.Info.MonsterIds[0] != 0 || _actor.Info.MonsterIds[1] != 0 || _actor.Info.MonsterIds[2] != 0) &&
collision.gameObject.GetComponent<ActorController>() is {} actorController &&
(byte) ServiceLocator.Instance.Get<PlayerManager>()
(byte) ServiceLocator.Instance.Get<PlayerActorManager>()
.GetPlayerActor() == actorController.GetActor().Info.Id)
{
// Player actor collides with combat NPC in maze
+5 -29
View File
@@ -57,8 +57,6 @@ namespace Pal3.Audio
private CancellationTokenSource _sceneAudioCts = new ();
private AudioClip _themeMusicClip;
public void Init(Camera mainCamera,
GameResourceProvider resourceProvider,
SceneManager sceneManager,
@@ -73,11 +71,6 @@ namespace Pal3.Audio
_musicVolume = _gameSettings.MusicVolume;
_sfxVolume = _gameSettings.SfxVolume;
// Load and play the theme music on init
_themeMusicClip = Requires.IsNotNull(
Resources.Load<AudioClip>($"Music/{GameConstants.AppName}-Theme"),
$"Music/{GameConstants.AppName}-Theme");
}
private void OnEnable()
@@ -90,14 +83,6 @@ namespace Pal3.Audio
CommandExecutorRegistry<ICommand>.Instance.UnRegister(this);
}
public void PlayThemeMusic()
{
_musicPlayer.clip = _themeMusicClip;
_musicPlayer.volume = _musicVolume;
_musicPlayer.loop = true;
_musicPlayer.Play();
}
public void Execute(SettingChangedNotification command)
{
if (command.SettingName == nameof(_gameSettings.MusicVolume))
@@ -113,15 +98,15 @@ namespace Pal3.Audio
private IEnumerator PlaySceneMusicAsync(string cityName, string sceneName)
{
var key = $"{cityName}_{sceneName}";
var musicName = string.Empty;
if (MusicConstants.SceneMusicInfo.ContainsKey(key.ToLower()))
if (MusicConstants.SceneMusicInfo.TryGetValue($"{cityName}_{sceneName}".ToLower(), out var sceneMusic))
{
musicName = MusicConstants.SceneMusicInfo[key.ToLower()];
musicName = sceneMusic;
}
else if (MusicConstants.SceneMusicInfo.ContainsKey(cityName.ToLower()))
else if (MusicConstants.SceneMusicInfo.TryGetValue(cityName.ToLower(), out var sceneCityMusic))
{
musicName = MusicConstants.SceneMusicInfo[cityName.ToLower()];
musicName = sceneCityMusic;
}
if (string.IsNullOrEmpty(musicName) || musicName.Equals(STOP_MUSIC_NAME))
@@ -158,10 +143,6 @@ namespace Pal3.Audio
if (audioSource.clip != null)
{
audioSource.Stop();
if (audioSource.clip != _themeMusicClip)
{
Destroy(audioSource.clip);
}
}
audioSource.clip = audioClip;
@@ -293,11 +274,6 @@ namespace Pal3.Audio
if (audioSourceParentTransform.GetComponent<AudioSource>() is { } audioSource)
{
audioSource.Stop();
if (audioSource.clip != null)
{
Destroy(audioSource.clip);
}
}
Destroy(audioSourceParentTransform.gameObject);
@@ -11,6 +11,10 @@ namespace Pal3.Command
using System.Reflection;
using UnityEngine;
/// <summary>
/// A generic class that dispatches commands to their registered executors.
/// </summary>
/// <typeparam name="TCommand">The type of command to dispatch.</typeparam>
public class CommandDispatcher<TCommand>
{
public static CommandDispatcher<TCommand> Instance
@@ -11,16 +11,19 @@ namespace Pal3.Command.InternalCommands
public ThreePhaseSwitchStateChangedNotification(
int objectId,
int previousState,
int currentState)
int currentState,
bool isBridgeMovingAlongYAxis)
{
ObjectId = objectId;
PreviousState = previousState;
CurrentState = currentState;
IsBridgeMovingAlongYAxis = isBridgeMovingAlongYAxis;
}
public int ObjectId { get; }
public int PreviousState { get; }
public int CurrentState { get; }
public bool IsBridgeMovingAlongYAxis { get; }
}
#endif
}
@@ -17,18 +17,11 @@ namespace Pal3.Data
using Core.DataLoader;
using Core.DataReader;
using Core.DataReader.Cpk;
using Core.DataReader.Cvd;
using Core.DataReader.Dat;
using Core.DataReader.Data;
using Core.DataReader.Gdb;
using Core.DataReader.Ini;
using Core.DataReader.Lgt;
using Core.DataReader.Mov;
using Core.DataReader.Msh;
using Core.DataReader.Mtl;
using Core.DataReader.Mv3;
using Core.DataReader.Nav;
using Core.DataReader.Pol;
using Core.DataReader.Sce;
using Core.DataReader.Scn;
using Core.FileSystem;
using Core.Services;
using Core.Utils;
@@ -48,7 +41,7 @@ namespace Pal3.Data
private const string CACHE_FOLDER_NAME = "CacheData";
private const string MV3_ACTOR_CONFIG_HEADER = ";#MV3#";
private const char DirSeparator = CpkConstants.DirectorySeparatorChar;
private const char DIR_SEPARATOR = CpkConstants.DirectorySeparatorChar;
private readonly ICpkFileSystem _fileSystem;
private readonly ITextureLoaderFactory _textureLoaderFactory;
@@ -64,15 +57,13 @@ namespace Pal3.Data
private readonly Dictionary<string, AudioClip> _audioClipCache = new ();
private readonly Dictionary<int, Object> _vfxEffectPrefabCache = new ();
private readonly Dictionary<string, ActorActionConfig> _actorConfigCache = new (); // Cache forever
private readonly Dictionary<Type, Dictionary<string, object>> _gameResourceFileCache = new ();
// Cache player actor movement sfx audio clips
private readonly HashSet<string> _audioClipCacheList = AudioConstants.PlayerActorMovementSfxAudioFileNames;
// No need to deallocate the shadow texture since it is been used almost every where.
private static readonly Texture2D ShadowTexture = Resources.Load<Texture2D>("Textures/shadow");
private readonly int _codepage;
public GameResourceProvider(ICpkFileSystem fileSystem,
ITextureLoaderFactory textureLoaderFactory,
IMaterialFactory unlitMaterialFactory,
@@ -85,6 +76,7 @@ namespace Pal3.Data
_litMaterialFactory = litMaterialFactory; // Lit materials are not required
_gameSettings = Requires.IsNotNull(gameSettings, nameof(gameSettings));
_codepage = _gameSettings.Language == Language.SimplifiedChinese ? 936 : 950;
_gameDatabase = GetGameDatabaseFile(); // Initialize game database file
CommandExecutorRegistry<ICommand>.Instance.Register(this);
@@ -93,12 +85,7 @@ namespace Pal3.Data
private GdbFile GetGameDatabaseFile()
{
var gdbFilePath = FileConstants.GameDatabaseFileVirtualPath;
return GetGameResourceFileReader<GdbFile>().Read(_fileSystem.ReadAllBytes(gdbFilePath));
}
private IFileReader<T> GetGameResourceFileReader<T>()
{
return ServiceLocator.Instance.Get<IFileReader<T>>();
return GetGameResourceFile<GdbFile>(gdbFilePath);
}
public void Dispose()
@@ -106,7 +93,6 @@ namespace Pal3.Data
_textureCache?.DisposeAll();
_spriteCache.Clear();
_gameResourceFileCache.Clear();
_actorConfigCache.Clear();
_audioClipCache.Clear();
_vfxEffectPrefabCache.Clear();
CommandExecutorRegistry<ICommand>.Instance.UnRegister(this);
@@ -141,7 +127,7 @@ namespace Pal3.Data
new TextureProvider(_fileSystem, _textureLoaderFactory, relativeDirectoryPath);
}
public T GetGameResourceFile<T>(string fileVirtualPath, bool useCache = true)
public T GetGameResourceFile<T>(string fileVirtualPath, bool useCache = true, byte[] data = null)
{
fileVirtualPath = fileVirtualPath.ToLower();
@@ -152,7 +138,8 @@ namespace Pal3.Data
return (T)_gameResourceFileCache[typeof(T)][fileVirtualPath];
}
T file = GetGameResourceFileReader<T>().Read(_fileSystem.ReadAllBytes(fileVirtualPath));
T file = ServiceLocator.Instance.Get<IFileReader<T>>().Read(
data ?? _fileSystem.ReadAllBytes(fileVirtualPath), _codepage);
if (useCache)
{
@@ -167,39 +154,24 @@ namespace Pal3.Data
return file;
}
public NavFile GetNavFile(string sceneFileName, string sceneName)
public IDictionary<int, GameItemInfo> GetGameItemInfos()
{
var navFilePath = FileConstants.GetNavFileVirtualPath(sceneFileName, sceneName);
return GetGameResourceFileReader<NavFile>().Read(_fileSystem.ReadAllBytes(navFilePath));
return _gameDatabase.GameItemInfos;
}
public ScnFile GetScnFile(string sceneFileName, string sceneName)
public IDictionary<int, CombatActorInfo> GetCombatActorInfos()
{
var scnFilePath = FileConstants.GetScnFileVirtualPath(sceneFileName, sceneName);
return GetGameResourceFileReader<ScnFile>().Read(_fileSystem.ReadAllBytes(scnFilePath));
return _gameDatabase.CombatActorInfos;
}
public SceFile GetSceneSceFile(string sceneFileName)
public IDictionary<int, SkillInfo> GetSkillInfos()
{
var sceFilePath = FileConstants.GetSceneSceFileVirtualPath(sceneFileName);
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(sceFilePath));
return _gameDatabase.SkillInfos;
}
public SceFile GetSystemSceFile()
public IDictionary<int, ComboSkillInfo> GetComboSkillInfos()
{
var systemSceFilePath = FileConstants.SystemSceFileVirtualPath;
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(systemSceFilePath));
}
public SceFile GetBigMapSceFile()
{
var bigMapSceFilePath = FileConstants.BigMapSceFileVirtualPath;
return GetGameResourceFileReader<SceFile>().Read(_fileSystem.ReadAllBytes(bigMapSceFilePath));
}
public Dictionary<int, GameItem> GetGameItems()
{
return _gameDatabase.GameItems;
return _gameDatabase.ComboSkillInfos;
}
/// <summary>
@@ -275,16 +247,13 @@ namespace Pal3.Data
bool streamAudio,
Action<AudioClip> onLoaded)
{
var fileName = Path.GetFileName(filePath);
var shouldCache = _audioClipCacheList.Contains(fileName);
string cacheKey = filePath.ToLower();
if (shouldCache && _audioClipCache.ContainsKey(fileName))
if (_audioClipCache.ContainsKey(cacheKey) &&
_audioClipCache[cacheKey] != null)
{
if (_audioClipCache[fileName] != null) // check if clip has been destroyed
{
onLoaded?.Invoke(_audioClipCache[fileName]);
yield break;
}
onLoaded?.Invoke(_audioClipCache[cacheKey]);
yield break;
}
yield return AudioClipLoader.LoadAudioClipAsync(filePath,
@@ -292,11 +261,7 @@ namespace Pal3.Data
streamAudio,
audioClip =>
{
if (shouldCache && audioClip != null)
{
_audioClipCache[fileName] = audioClip;
}
_audioClipCache[cacheKey] = audioClip;
onLoaded?.Invoke(audioClip);
});
}
@@ -366,13 +331,13 @@ namespace Pal3.Data
var relativeFilePath = string.Format(FileConstants.SkyBoxTexturePathFormat.First(), skyBoxId);
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(
Utility.GetDirectoryName(relativeFilePath, DirSeparator));
Utility.GetDirectoryName(relativeFilePath, DIR_SEPARATOR));
var textures = new Texture2D[FileConstants.SkyBoxTexturePathFormat.Length];
for (var i = 0; i < FileConstants.SkyBoxTexturePathFormat.Length; i++)
{
var textureNameFormat = Utility.GetFileName(
string.Format(FileConstants.SkyBoxTexturePathFormat[i], skyBoxId), DirSeparator);
string.Format(FileConstants.SkyBoxTexturePathFormat[i], skyBoxId), DIR_SEPARATOR);
Texture2D texture = textureProvider.GetTexture(string.Format(textureNameFormat, i));
// Set wrap mode to clamp to remove "edges" between sides
texture.wrapMode = TextureWrapMode.Clamp;
@@ -458,14 +423,8 @@ namespace Pal3.Data
actorConfigFilePath = actorConfigFilePath.ToLower();
if (_actorConfigCache.TryGetValue(actorConfigFilePath, out ActorActionConfig actorActionConfig))
if (!FileExists(actorConfigFilePath))
{
return actorActionConfig;
}
if (!_fileSystem.FileExists(actorConfigFilePath))
{
_actorConfigCache[actorConfigFilePath] = null;
return null;
}
@@ -474,15 +433,11 @@ namespace Pal3.Data
if (string.Equals(MV3_ACTOR_CONFIG_HEADER, configHeaderStr))
{
Mv3ActionConfig config = GetGameResourceFileReader<Mv3ActionConfig>().Read(configData);
_actorConfigCache[actorConfigFilePath] = config;
return config;
return GetGameResourceFile<Mv3ActionConfig>(actorConfigFilePath, data: configData);
}
else // MOV actor config
{
MovActionConfig config = GetGameResourceFileReader<MovActionConfig>().Read(configData);
_actorConfigCache[actorConfigFilePath] = config;
return config;
return GetGameResourceFile<MovActionConfig>(actorConfigFilePath, data: configData);
}
}
@@ -499,9 +454,9 @@ namespace Pal3.Data
foreach (FileInfo file in new DirectoryInfo(videoFolder).GetFiles($"*.*", SearchOption.AllDirectories))
{
var fileExtension = Path.GetExtension(file.Name);
if (supportedVideoFormats.Contains(fileExtension.ToLower()) &&
Path.GetFileNameWithoutExtension(file.Name).ToLower().Equals(videoName.ToLower()))
var fileExtension = Path.GetExtension(file.Name).ToLower();
if (supportedVideoFormats.Contains(fileExtension) &&
Path.GetFileNameWithoutExtension(file.Name).Equals(videoName, StringComparison.OrdinalIgnoreCase))
{
return file.FullName;
}
@@ -514,7 +469,7 @@ namespace Pal3.Data
public (Texture2D texture, bool hasAlphaChannel)[] GetEffectTextures(GraphicsEffect effect, string texturePathFormat)
{
ITextureResourceProvider textureProvider = CreateTextureResourceProvider(
Utility.GetDirectoryName(texturePathFormat, DirSeparator));
Utility.GetDirectoryName(texturePathFormat, DIR_SEPARATOR));
if (effect == GraphicsEffect.Fire)
{
@@ -522,7 +477,7 @@ namespace Pal3.Data
var textures = new (Texture2D texture, bool hasAlphaChannel)[numberOfFrames];
for (var i = 0; i < numberOfFrames; i++)
{
var textureNameFormat = Utility.GetFileName(texturePathFormat, DirSeparator);
var textureNameFormat = Utility.GetFileName(texturePathFormat, DIR_SEPARATOR);
Texture2D texture = textureProvider.GetTexture(string.Format(textureNameFormat, i + 1), out var hasAlphaChannel);
textures[i] = (texture, hasAlphaChannel);
}
@@ -633,7 +588,7 @@ namespace Pal3.Data
{
// Dispose non-main actor mv3 files
// All main actor names start with "1"
var mainActorMv3 = $"{FileConstants.GetActorFolderName()}{DirSeparator}1".ToLower();
var mainActorMv3 = $"{FileConstants.GetActorFolderName()}{DIR_SEPARATOR}1".ToLower();
var mv3FilesToDispose = fileCache.Value.Keys
.Where(mv3FilePath => !mv3FilePath.Contains(mainActorMv3))
.ToArray();
@@ -644,7 +599,9 @@ namespace Pal3.Data
}
else if (fileCache.Key == typeof(GdbFile) ||
fileCache.Key == typeof(Mv3ActionConfig) ||
fileCache.Key == typeof(MovActionConfig))
fileCache.Key == typeof(MovActionConfig) ||
fileCache.Key == typeof(EffectDefinitionFile) ||
fileCache.Key == typeof(EffectLinkerFile))
{
// These files are used/cached across scenes
// Do not dispose them since they will be used in next scene block
+22 -9
View File
@@ -43,7 +43,6 @@ namespace Pal3.Dev
private const int SAVE_SLOT_COUNT = 5;
private GameSettings _gameSettings;
private AudioManager _audioManager;
private InputManager _inputManager;
private EventSystem _eventSystem;
private PlayerInputActions _playerInputActions;
@@ -71,9 +70,7 @@ namespace Pal3.Dev
private readonly List<GameObject> _menuItems = new();
public void Init(GameSettings gameSettings,
AudioManager audioManager,
InputManager inputManager,
EventSystem eventSystem,
SceneManager sceneManager,
GameStateManager gameStateManager,
ScriptManager scriptManager,
@@ -86,12 +83,11 @@ namespace Pal3.Dev
ScrollRect contentScrollRect,
RectTransform backgroundTransform,
RectTransform contentTransform,
EventSystem eventSystem,
Camera mainCamera)
{
_gameSettings = Requires.IsNotNull(gameSettings, nameof(gameSettings));
_audioManager = Requires.IsNotNull(audioManager, nameof(audioManager));
_inputManager = Requires.IsNotNull(inputManager, nameof(inputManager));
_eventSystem = Requires.IsNotNull(eventSystem, nameof(eventSystem));
_sceneManager = Requires.IsNotNull(sceneManager, nameof(sceneManager));
_gameStateManager = Requires.IsNotNull(gameStateManager, nameof(gameStateManager));
_scriptManager = Requires.IsNotNull(scriptManager, nameof(scriptManager));
@@ -104,6 +100,7 @@ namespace Pal3.Dev
_contentScrollRect = Requires.IsNotNull(contentScrollRect, nameof(contentScrollRect));
_backgroundTransform = Requires.IsNotNull(backgroundTransform, nameof(backgroundTransform));
_contentTransform = Requires.IsNotNull(contentTransform, nameof(contentTransform));
_eventSystem = Requires.IsNotNull(eventSystem, nameof(eventSystem));
_mainCamera = Requires.IsNotNull(mainCamera, nameof(mainCamera));
_contentGridLayoutGroup = Requires.IsNotNull(
@@ -167,7 +164,6 @@ namespace Pal3.Dev
{
#if PAL3
// 景天房间
_deferredExecutionCommands.Add("ActorActivate 0 0");
_deferredExecutionCommands.Add("SceneActivateObject 14 0");
_deferredExecutionCommands.Add("SceneActivateObject 15 0");
_deferredExecutionCommands.Add("PlayerEnableInput 0");
@@ -175,18 +171,17 @@ namespace Pal3.Dev
_deferredExecutionCommands.Add("CameraSetTransform -33.24 -19.48 688.0 308.31 240.44 480.61");
_deferredExecutionCommands.Add("CameraFadeIn");
CommandDispatcher<ICommand>.Instance.Dispatch(new SceneLoadCommand("q01", "yn09a"));
CommandDispatcher<ICommand>.Instance.Dispatch(new PlayMusicCommand(AudioConstants.ThemeMusicName, -1));
#elif PAL3A
// 南宫煌房间
_deferredExecutionCommands.Add("ActorActivate 0 0");
_deferredExecutionCommands.Add("PlayerEnableInput 0");
_deferredExecutionCommands.Add("CameraFollowPlayer 0");
_deferredExecutionCommands.Add("CameraSetTransform -21.69 -22.48 688.0 182.87 263.07 531.61");
_deferredExecutionCommands.Add("CameraFadeIn");
CommandDispatcher<ICommand>.Instance.Dispatch(new SceneLoadCommand("q02", "qn08y"));
CommandDispatcher<ICommand>.Instance.Dispatch(new PlayMusicCommand(AudioConstants.ThemeMusicName, -1));
#endif
_audioManager.PlayThemeMusic();
if (!_initViewCameraOrbitAnimationCts.IsCancellationRequested)
{
_initViewCameraOrbitAnimationCts.Cancel();
@@ -511,6 +506,24 @@ namespace Pal3.Dev
(_gameSettings.SfxVolume == 0f ? "关闭" : "开启") + ""));
});
#if !UNITY_IOS
const string languageSimplifiedChineseText = "数据包版本:简体中文版";
const string languageTraditionalChineseText = "数据包版本:繁体中文版";
string GetLanguageButtonText() => _gameSettings.Language == Language.SimplifiedChinese ?
languageSimplifiedChineseText : languageTraditionalChineseText;
CreateMenuButton(GetLanguageButtonText(), buttonTextUGUI => delegate
{
_gameSettings.Language = _gameSettings.Language == Language.SimplifiedChinese ?
Language.TraditionalChinese : Language.SimplifiedChinese;
buttonTextUGUI.text = GetLanguageButtonText();
CommandDispatcher<ICommand>.Instance.Dispatch(new UIDisplayNoteCommand("游戏版本已切换为" +
(_gameSettings.Language == Language.SimplifiedChinese ? "简体中文版" : "繁体中文版") +
"\n注意:游戏版本需要与数据文件一致(否则会出现乱码),且重启游戏后才会生效"));
});
#endif
const string debugInfoEnabledText = "调试信息:开启";
const string debugInfoDisabledText = "调试信息:关闭";
string GetDebugInfoButtonText() => _gameSettings.IsDebugInfoEnabled ? debugInfoEnabledText : debugInfoDisabledText;
@@ -10,6 +10,8 @@ namespace Pal3.Effect
using Command;
using Command.InternalCommands;
using Command.SceCommands;
using Core.DataReader.Dat;
using Core.DataReader.Data;
using Core.GameBox;
using Core.Utils;
using Data;
@@ -31,11 +33,17 @@ namespace Pal3.Effect
private SceneManager _sceneManager;
private ICommand _effectPositionCommand;
private const string EFFECT_LINKER_FILE_NAME = "efflinker.dat";
private EffectLinkerFile _effectLinkerFile;
public void Init(GameResourceProvider resourceProvider,
SceneManager sceneManager)
{
_resourceProvider = Requires.IsNotNull(resourceProvider, nameof(resourceProvider));
_sceneManager = Requires.IsNotNull(sceneManager, nameof(sceneManager));
_effectLinkerFile = _resourceProvider.GetGameResourceFile<EffectLinkerFile>(
FileConstants.CombatDataFolderVirtualPath + EFFECT_LINKER_FILE_NAME);
}
private void OnEnable()
@@ -12,7 +12,7 @@ namespace Pal3.GamePlay
using Core.DataReader.Scn;
using MetaData;
public sealed class PlayerManager : IDisposable,
public sealed class PlayerActorManager : IDisposable,
ICommandExecutor<DialogueRenderActorAvatarCommand>,
ICommandExecutor<ActorActivateCommand>,
ICommandExecutor<ActorAddSkillCommand>,
@@ -57,7 +57,7 @@ namespace Pal3.GamePlay
private bool _playerActorControlEnabled = true;
private bool _playerInputEnabled;
public PlayerManager()
public PlayerActorManager()
{
CommandExecutorRegistry<ICommand>.Instance.Register(this);
}
@@ -87,6 +87,24 @@ namespace Pal3.GamePlay
_playerInputEnabled = (command.Enable == 1);
}
public void Execute(ScenePreLoadingNotification command)
{
// Need to set main actor as player actor for non-maze scenes
if (command.NewSceneInfo.SceneType != ScnSceneType.Maze &&
_playerActor != 0)
{
_playerActor = 0;
}
}
public void Execute(ResetGameStateCommand command)
{
_playerActor = 0;
_playerActorControlEnabled = true;
_playerInputEnabled = false;
}
#region Command routing
public void Execute(DialogueRenderActorAvatarCommand command)
{
if (command.ActorId == ActorConstants.PlayerActorVirtualID)
@@ -388,22 +406,6 @@ namespace Pal3.GamePlay
new EffectAttachToActorCommand((int)_playerActor));
}
}
public void Execute(ScenePreLoadingNotification command)
{
// Need to set main actor as player actor for non-maze scenes
if (command.NewSceneInfo.SceneType != ScnSceneType.Maze &&
_playerActor != 0)
{
_playerActor = 0;
}
}
public void Execute(ResetGameStateCommand command)
{
_playerActor = 0;
_playerActorControlEnabled = true;
_playerInputEnabled = false;
}
#endregion
}
}
@@ -55,7 +55,7 @@ namespace Pal3.GamePlay
private GameResourceProvider _resourceProvider;
private GameStateManager _gameStateManager;
private PlayerManager _playerManager;
private PlayerActorManager _playerActorManager;
private TeamManager _teamManager;
private PlayerInputActions _inputActions;
private SceneManager _sceneManager;
@@ -94,7 +94,7 @@ namespace Pal3.GamePlay
public void Init(GameResourceProvider resourceProvider,
GameStateManager gameStateManager,
PlayerManager playerManager,
PlayerActorManager playerActorManager,
TeamManager teamManager,
PlayerInputActions inputActions,
SceneManager sceneManager,
@@ -102,7 +102,7 @@ namespace Pal3.GamePlay
{
_resourceProvider = Requires.IsNotNull(resourceProvider, nameof(resourceProvider));
_gameStateManager = Requires.IsNotNull(gameStateManager, nameof(gameStateManager));
_playerManager = Requires.IsNotNull(playerManager, nameof(playerManager));
_playerActorManager = Requires.IsNotNull(playerActorManager, nameof(playerActorManager));
_teamManager = Requires.IsNotNull(teamManager, nameof(teamManager));
_inputActions = Requires.IsNotNull(inputActions, nameof(inputActions));
_sceneManager = Requires.IsNotNull(sceneManager, nameof(sceneManager));
@@ -143,8 +143,8 @@ namespace Pal3.GamePlay
var isPlayerInControl = false;
if (_gameStateManager.GetCurrentState() == GameState.Gameplay &&
_playerManager.IsPlayerInputEnabled() &&
_playerManager.IsPlayerActorControlEnabled())
_playerActorManager.IsPlayerInputEnabled() &&
_playerActorManager.IsPlayerActorControlEnabled())
{
isPlayerInControl = true;
ReadInputAndMovePlayerIfNeeded();
@@ -348,8 +348,8 @@ namespace Pal3.GamePlay
private void OnTapPerformed(InputAction.CallbackContext _)
{
if (!_playerManager.IsPlayerActorControlEnabled() ||
!_playerManager.IsPlayerInputEnabled())
if (!_playerActorManager.IsPlayerActorControlEnabled() ||
!_playerActorManager.IsPlayerInputEnabled())
{
return;
}
@@ -359,8 +359,8 @@ namespace Pal3.GamePlay
private void OnDoubleTapPerformed(InputAction.CallbackContext _)
{
if (!_playerManager.IsPlayerActorControlEnabled() ||
!_playerManager.IsPlayerInputEnabled())
if (!_playerActorManager.IsPlayerActorControlEnabled() ||
!_playerActorManager.IsPlayerInputEnabled())
{
return;
}
@@ -370,8 +370,8 @@ namespace Pal3.GamePlay
private void PortalToPerformed(InputAction.CallbackContext _)
{
if (!_playerManager.IsPlayerActorControlEnabled() ||
!_playerManager.IsPlayerInputEnabled())
if (!_playerActorManager.IsPlayerActorControlEnabled() ||
!_playerActorManager.IsPlayerInputEnabled())
{
return;
}
@@ -391,8 +391,8 @@ namespace Pal3.GamePlay
private void OnMovePerformed(InputAction.CallbackContext ctx)
{
if (!_playerManager.IsPlayerActorControlEnabled() ||
!_playerManager.IsPlayerInputEnabled())
if (!_playerActorManager.IsPlayerActorControlEnabled() ||
!_playerActorManager.IsPlayerInputEnabled())
{
return;
}
@@ -402,8 +402,8 @@ namespace Pal3.GamePlay
private void InteractionPerformed(InputAction.CallbackContext _)
{
if (!_playerManager.IsPlayerActorControlEnabled() ||
!_playerManager.IsPlayerInputEnabled())
if (!_playerActorManager.IsPlayerActorControlEnabled() ||
!_playerActorManager.IsPlayerInputEnabled())
{
return;
}
@@ -548,8 +548,8 @@ namespace Pal3.GamePlay
private void SwitchPlayerActorInCurrentTeam(bool next)
{
if (!_playerManager.IsPlayerActorControlEnabled() ||
!_playerManager.IsPlayerInputEnabled() ||
if (!_playerActorManager.IsPlayerActorControlEnabled() ||
!_playerActorManager.IsPlayerInputEnabled() ||
_sceneManager.GetCurrentScene().GetSceneInfo().SceneType != ScnSceneType.Maze)
{
return;
@@ -610,7 +610,7 @@ namespace Pal3.GamePlay
var actorMovementController = actorInfo.Value.GetComponent<ActorMovementController>();
if (actorMovementController.GetCurrentLayerIndex() != currentLayerIndex ||
actorInfo.Key == (int)_playerManager.GetPlayerActor() ||
actorInfo.Key == (int)_playerActorManager.GetPlayerActor() ||
!actorController.IsActive) continue;
Vector3 targetActorCenterPosition = actorActionController.GetRendererBounds().center;
@@ -1164,7 +1164,7 @@ namespace Pal3.GamePlay
Scene currentScene = _sceneManager.GetCurrentScene();
var currentLayerIndex = currentScene
.GetActorGameObject((int)_playerManager.GetPlayerActor())
.GetActorGameObject((int)_playerActorManager.GetPlayerActor())
.GetComponent<ActorMovementController>()
.GetCurrentLayerIndex();
@@ -1206,7 +1206,7 @@ namespace Pal3.GamePlay
public void Execute(ScenePostLoadingNotification notification)
{
var playerActorId = (int)_playerManager.GetPlayerActor();
var playerActorId = (int)_playerActorManager.GetPlayerActor();
CommandDispatcher<ICommand>.Instance.Dispatch(new ActorActivateCommand(playerActorId, 1));
@@ -1225,12 +1225,12 @@ namespace Pal3.GamePlay
.GetActorGameObject(playerActorId).transform.forward = actorFacing;
}
if (_playerManager.IsPlayerActorControlEnabled())
if (_playerActorManager.IsPlayerActorControlEnabled())
{
CommandDispatcher<ICommand>.Instance.Dispatch(new ActorEnablePlayerControlCommand(playerActorId));
}
if (_playerManager.IsPlayerInputEnabled())
if (_playerActorManager.IsPlayerInputEnabled())
{
CommandDispatcher<ICommand>.Instance.Dispatch(new PlayerEnableInputCommand(1));
}
+22 -36
View File
@@ -10,24 +10,12 @@ namespace Pal3
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using Core.Animation;
using Core.DataReader;
using Core.DataReader.Cpk;
using Core.DataReader.Cvd;
using Core.DataReader.Data;
using Core.DataReader.Gdb;
using Core.DataReader.Ini;
using Core.DataReader.Lgt;
using Core.DataReader.Mov;
using Core.DataReader.Msh;
using Core.DataReader.Mtl;
using Core.DataReader.Mv3;
using Core.DataReader.Nav;
using Core.DataReader.Pol;
using Core.DataReader.Sce;
using Core.DataReader.Scn;
using Core.DataReader.Txt;
using Core.FileSystem;
using Core.Services;
using Data;
@@ -50,9 +38,6 @@ namespace Pal3
[SerializeField] private Image backgroundImage;
[SerializeField] private TextMeshProUGUI loadingText;
private const int DEFAULT_CODE_PAGE = 936; // GBK Encoding's code page
// change it to 950 to supports Traditional Chinese (Big5)
// Optional materials that are used in the game but not open sourced
private Material _toonDefaultMaterial;
private Material _toonTransparentMaterial;
@@ -85,9 +70,6 @@ namespace Pal3
{
Debug.Log($"[{nameof(GameResourceInitializer)}] Initializing game resources...");
// TODO: let user to choose language? Or auto-detect encoding?
int codepage = DEFAULT_CODE_PAGE;
// Create and init Crc32 hash
Crc32Hash crcHash = new ();
crcHash.Init();
@@ -104,6 +86,9 @@ namespace Pal3
gameSettings.InitOrLoadSettings();
ServiceLocator.Instance.Register<GameSettings>(gameSettings);
// Init codepage
int codepage = gameSettings.Language == Language.SimplifiedChinese ? 936 : 950;
// Init file system
Queue<string> gameDataFolderSearchLocations = new(gameSettings.GetGameDataFolderSearchLocations());
ICpkFileSystem cpkFileSystem = null;
@@ -162,22 +147,23 @@ namespace Pal3
}
}
// Create and register IFileReader<T> instances
ServiceLocator.Instance.Register<IFileReader<CvdFile>>(new CvdFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<Mv3File>>(new Mv3FileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<MovFile>>(new MovFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<MshFile>>(new MshFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<MtlFile>>(new MtlFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<PolFile>>(new PolFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<GdbFile>>(new GdbFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<LgtFile>>(new LgtFileReader());
ServiceLocator.Instance.Register<IFileReader<NavFile>>(new NavFileReader());
ServiceLocator.Instance.Register<IFileReader<MovActionConfig>>(new MovConfigFileReader());
ServiceLocator.Instance.Register<IFileReader<Mv3ActionConfig>>(new Mv3ConfigFileReader());
ServiceLocator.Instance.Register<IFileReader<EffectDefinitionFile>>(new EffectDefinitionFileReader());
ServiceLocator.Instance.Register<IFileReader<SceFile>>(new SceFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<ScnFile>>(new ScnFileReader(codepage));
ServiceLocator.Instance.Register<IFileReader<TaskDefinitionFile>>(new TaskDefinitionFileReader(codepage));
// Create and register IFileReader<T> instances using reflection
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
// Get all types that implement any version of IFileReader<>
var fileReaderTypes = assembly.GetTypes().Where(type =>
type.GetInterfaces().Any(_ =>_.IsGenericType &&_.GetGenericTypeDefinition() == typeof(IFileReader<>)));
foreach (Type readerType in fileReaderTypes)
{
Type fileType = readerType.GetInterfaces()
.First(_ => _.GetGenericTypeDefinition() == typeof(IFileReader<>)).GetGenericArguments()[0];
ServiceLocator.Instance.GetType()
.GetMethod(nameof(ServiceLocator.Instance.Register))!
.MakeGenericMethod(typeof(IFileReader<>).MakeGenericType(fileType))
.Invoke(ServiceLocator.Instance, new[] { Activator.CreateInstance(readerType) });
}
}
// Init TextureLoaderFactory
TextureLoaderFactory textureLoaderFactory = new ();
@@ -431,11 +431,15 @@ namespace Pal3.GameSystem
{
// Easter egg + dev notes
#if PAL3
if (text.Equals("韩用:\\n知道吗?\\i使用鼠标滚轮可以旋转镜头\\r,这样就不怕人物被挡住了。"))
if (text.Equals("韩用:\\n知道吗?\\i使用鼠标滚轮可以旋转镜头\\r,这样就不怕人物被挡住了。") ||
text.Equals("韓用:\\n知道嗎?\\i使用滑鼠滾輪可以旋轉鏡頭\\r,這樣就不怕人物被擋住了。"))
#elif PAL3A
if (text.Equals("蜀中第一丐:\\n我蜀中第一丐四海为家,过的桥比你走的路还多,有什么不明白的尽管问~~\\n" +
"今天心情好,就再多透露点秘密给你吧,假如在城镇、迷宫中人物被挡住了,可以试试\\i用鼠标滚轮旋转镜头\\r,会有不错的效果哦。" +
"另外,画面\\i左下角\\r那东西叫作\\i“司南”\\r,只要点一下,就能看到地图,认清方向了。"))
"今天心情好,就再多透露点秘密给你吧,假如在城镇、迷宫中人物被挡住了,可以试试\\i用鼠标滚轮旋转镜头\\r,会有不错的效果哦。" +
"另外,画面\\i左下角\\r那东西叫作\\i“司南”\\r,只要点一下,就能看到地图,认清方向了。") ||
text.Equals("蜀中第一丐:\\n我蜀中第一丐四海為家,過的橋比你走的路還多,有什麼不明白的儘管問~~\\n" +
"今天心情好,就再多透露點秘密給你吧,假如在城鎮、迷宮中人物被擋住了,可以試試\\i用滑鼠滾輪旋轉鏡頭\\r,會有不錯的效果哦。" +
"另外,畫面\\i左下角\\r那東西叫作\\i「司南」\\r,只要點一下,就能看到地圖,認清方向了。"))
#endif
{
text = $"知道吗?您现在玩的{GameConstants.AppNameCNFull}是由\\i柒才\\r使用C#/Unity开发(完全重写)的复刻版,免费开源且支持全平台(Win/Mac/Linux/iOS/Android)。" +
@@ -59,7 +59,13 @@ namespace Pal3.GameSystem
_heapSize = GC.GetTotalMemory(false) / (1024f * 1024f);
_heapSizeLastQueryTime = Time.realtimeSinceStartupAsDouble;
_defaultText = $"{GameConstants.ContactInfo} v{Application.version} {GameConstants.TestingType}\n";
#if ENABLE_IL2CPP
const string scriptingBackend = "IL2CPP";
#else
const string scriptingBackend = "Mono";
#endif
_defaultText = $"{GameConstants.ContactInfo} v{Application.version} {GameConstants.TestingType} (Unity {Application.unityVersion} {scriptingBackend})\n";
_debugInfo.SetText(_defaultText);
#if UNITY_2022_1_OR_NEWER
@@ -68,18 +74,11 @@ namespace Pal3.GameSystem
var refreshRate = Screen.currentResolution.refreshRate;
#endif
#if ENABLE_IL2CPP
const string scriptingBackend = "IL2CPP";
#else
const string scriptingBackend = "Mono";
#endif
var deviceInfo =
$"Device: {SystemInfo.deviceModel.Trim()} OS: {SystemInfo.operatingSystem.Trim()}\n" +
$"CPU: {SystemInfo.processorType.Trim()} ({SystemInfo.processorCount} vCores)\n" +
$"GPU: {SystemInfo.graphicsDeviceName.Trim()} ({SystemInfo.graphicsDeviceType})\n" +
$"RAM: {SystemInfo.systemMemorySize / 1024f:0.0} GB VRAM: {SystemInfo.graphicsMemorySize / 1024f:0.0} GB\n" +
$"Version: v{Application.version} {GameConstants.TestingType} (Unity {Application.unityVersion} {scriptingBackend})\n";
$"Device: {SystemInfo.deviceModel.Trim()} OS: {SystemInfo.operatingSystem.Trim()}\n" +
$"CPU: {SystemInfo.processorType.Trim()} ({SystemInfo.processorCount} vCores)\n" +
$"GPU: {SystemInfo.graphicsDeviceName.Trim()} ({SystemInfo.graphicsDeviceType})\n" +
$"RAM: {SystemInfo.systemMemorySize / 1024f:0.0} GB VRAM: {SystemInfo.graphicsMemorySize / 1024f:0.0} GB\n";
_debugInfoStringFormat = _defaultText + deviceInfo +
"Heap size: {0:0.00} MB\n" + "{3:0.} fps ({1}x{2}, " + refreshRate + "Hz)";
@@ -25,13 +25,13 @@ namespace Pal3.GameSystem
{
private const int MONEY_ITEM_ID = 0;
private readonly Dictionary<int, GameItem> _gameItemsInfo;
private readonly Dictionary<int, int> _items = new ();
private readonly IDictionary<int, GameItemInfo> _gameItemInfos;
private readonly IDictionary<int, int> _items = new Dictionary<int, int>();
public InventoryManager(GameResourceProvider resourceProvider)
{
Requires.IsNotNull(resourceProvider, nameof(resourceProvider));
_gameItemsInfo = resourceProvider.GetGameItems();
_gameItemInfos = resourceProvider.GetGameItemInfos();
_items[MONEY_ITEM_ID] = 0; // init money
CommandExecutorRegistry<ICommand>.Instance.Register(this);
}
@@ -50,7 +50,7 @@ namespace Pal3.GameSystem
foreach (var (id, count) in _items.Where(_ => _.Key != MONEY_ITEM_ID))
{
sb.Append($"{_gameItemsInfo[id].Name}({id}) x {count} [{_gameItemsInfo[id].Type}]\n");
sb.Append($"{_gameItemInfos[id].Name}({id}) x {count} [{_gameItemInfos[id].Type}]\n");
}
return sb.ToString();
@@ -60,8 +60,8 @@ namespace Pal3.GameSystem
{
// TODO: Remove this
{
if (_gameItemsInfo.ContainsKey(itemId) &&
_gameItemsInfo[itemId].Type == ItemType.Plot)
if (_gameItemInfos.ContainsKey(itemId) &&
_gameItemInfos[itemId].Type == ItemType.Plot)
{
return true;
}
@@ -82,7 +82,7 @@ namespace Pal3.GameSystem
public void Execute(InventoryAddItemCommand command)
{
if (!_gameItemsInfo.ContainsKey(command.ItemId)) return;
if (!_gameItemInfos.ContainsKey(command.ItemId)) return;
if (_items.ContainsKey(command.ItemId))
{
@@ -93,7 +93,7 @@ namespace Pal3.GameSystem
_items[command.ItemId] = command.Count;
}
var itemName = _gameItemsInfo[command.ItemId].Name;
var itemName = _gameItemInfos[command.ItemId].Name;
CommandDispatcher<ICommand>.Instance.Dispatch(new UIDisplayNoteCommand($"得到{itemName}"));
@@ -102,7 +102,7 @@ namespace Pal3.GameSystem
public void Execute(InventoryRemoveItemCommand command)
{
if (!_gameItemsInfo.ContainsKey(command.ItemId)) return;
if (!_gameItemInfos.ContainsKey(command.ItemId)) return;
if (!_items.ContainsKey(command.ItemId)) return;
_items[command.ItemId] -= 1;
@@ -112,7 +112,7 @@ namespace Pal3.GameSystem
_items.Remove(command.ItemId);
}
var itemName = _gameItemsInfo[command.ItemId].Name;
var itemName = _gameItemInfos[command.ItemId].Name;
CommandDispatcher<ICommand>.Instance.Dispatch(new UIDisplayNoteCommand($"失去{itemName}"));
@@ -100,7 +100,7 @@ namespace Pal3.GameSystem
Texture2D texture = new Texture2D(layer.Width, layer.Height, TextureFormat.RGBA32, mipChain: false);
texture.SetPixels(colors);
texture.Apply(false);
texture.Apply(updateMipmaps: false);
return texture;
}
@@ -27,7 +27,7 @@ namespace Pal3.GameSystem
{
private const float TEAM_OPEN_SPAWN_POINT_PLAYER_OFFSET = 2.5f;
private readonly PlayerManager _playerManager;
private readonly PlayerActorManager _playerActorManager;
private readonly SceneManager _sceneManager;
private readonly HashSet<PlayerActorId> _actorsInTeam = new ();
@@ -52,9 +52,9 @@ namespace Pal3.GameSystem
};
#endif
public TeamManager(PlayerManager playerManager, SceneManager sceneManager)
public TeamManager(PlayerActorManager playerActorManager, SceneManager sceneManager)
{
_playerManager = Requires.IsNotNull(playerManager, nameof(playerManager));
_playerActorManager = Requires.IsNotNull(playerActorManager, nameof(playerActorManager));
_sceneManager = Requires.IsNotNull(sceneManager, nameof(sceneManager));
CommandExecutorRegistry<ICommand>.Instance.Register(this);
}
@@ -76,7 +76,7 @@ namespace Pal3.GameSystem
public void Execute(TeamOpenCommand command)
{
PlayerActorId playerActorId = _playerManager.GetPlayerActor();
PlayerActorId playerActorId = _playerActorManager.GetPlayerActor();
GameObject playerActor = _sceneManager.GetCurrentScene().GetActorGameObject((int)playerActorId);
var currentNavLayer = playerActor.GetComponent<ActorMovementController>().GetCurrentLayerIndex();
@@ -120,7 +120,7 @@ namespace Pal3.GameSystem
public void Execute(TeamCloseCommand command)
{
PlayerActorId playerActorId = _playerManager.GetPlayerActor();
PlayerActorId playerActorId = _playerActorManager.GetPlayerActor();
#if PAL3A
// Need to add all active player actors into the team within certain radius
@@ -27,5 +27,11 @@ namespace Pal3.MetaData
"WE008.WAV"
#endif
};
#if PAL3
public const string ThemeMusicName = "PI01";
#elif PAL3A
public const string ThemeMusicName = "P01";
#endif
}
}
+16 -16
View File
@@ -36,49 +36,49 @@ namespace Pal3.MetaData
public const int AnimatedFireEffectFrameRate = 10;
private const char DirSeparator = CpkConstants.DirectorySeparatorChar;
private const char DIR_SEPARATOR = CpkConstants.DirectorySeparatorChar;
#if PAL3
public static readonly Dictionary<FireEffectType, (string TexturePathFormat, string ModelPath, float Size, float lightSourceYOffset)>
FireEffectInfo = new()
{
{FireEffectType.Type1, new (
FileConstants.EffectScnFolderVirtualPath + "Fire1" + DirSeparator + "torch{0:00}.tga",
FileConstants.EffectScnFolderVirtualPath + "Fire1" + DIR_SEPARATOR + "torch{0:00}.tga",
"", 3.3f, 0.5f) },
{FireEffectType.Type2, new (
FileConstants.EffectScnFolderVirtualPath + "Fire2" + DirSeparator + "{0:00}.tga",
FileConstants.EffectScnFolderVirtualPath + "Fire2" + DIR_SEPARATOR + "{0:00}.tga",
"", 1f, 0.2f) },
{FireEffectType.Type3, new (
FileConstants.EffectScnFolderVirtualPath + "Candle" + DirSeparator + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Candle{DirSeparator}candle.pol", 1f, 0.2f) },
FileConstants.EffectScnFolderVirtualPath + "Candle" + DIR_SEPARATOR + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Candle{DIR_SEPARATOR}candle.pol", 1f, 0.2f) },
{FireEffectType.Type4, new (
FileConstants.EffectScnFolderVirtualPath + "Fire4" + DirSeparator + "{0:00}.tga",
FileConstants.EffectScnFolderVirtualPath + "Fire4" + DIR_SEPARATOR + "{0:00}.tga",
"", 5.8f, 0.5f) },
{FireEffectType.Type5, new (
FileConstants.EffectScnFolderVirtualPath + "Candle" + DirSeparator + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Lamp{DirSeparator}lamp.pol", 0.7f, 0.2f) },
FileConstants.EffectScnFolderVirtualPath + "Candle" + DIR_SEPARATOR + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Lamp{DIR_SEPARATOR}lamp.pol", 0.7f, 0.2f) },
};
#elif PAL3A
public static readonly Dictionary<FireEffectType, (string TexturePathFormat, string ModelPath, float Size, float lightSourceYOffset)>
FireEffectInfo = new()
{
{FireEffectType.Type1, new (
FileConstants.EffectScnFolderVirtualPath + "Fire4" + DirSeparator + "{0:00}.tga",
FileConstants.EffectScnFolderVirtualPath + "Fire4" + DIR_SEPARATOR + "{0:00}.tga",
"", 5.8f, 0.5f) },
{FireEffectType.Type2, new (
FileConstants.EffectScnFolderVirtualPath + "Fire1" + DirSeparator + "torch{0:00}.tga",
FileConstants.EffectScnFolderVirtualPath + "Fire1" + DIR_SEPARATOR + "torch{0:00}.tga",
"", 3.3f, 0.5f) },
{FireEffectType.Type3, new (
FileConstants.EffectScnFolderVirtualPath + "Candle" + DirSeparator + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Lamp{DirSeparator}lamp.pol", 0.7f, 0.2f) },
FileConstants.EffectScnFolderVirtualPath + "Candle" + DIR_SEPARATOR + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Lamp{DIR_SEPARATOR}lamp.pol", 0.7f, 0.2f) },
{FireEffectType.Type4, new (
FileConstants.EffectScnFolderVirtualPath + "Candle" + DirSeparator + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Candle{DirSeparator}candle.pol", 1f, 0.2f) },
FileConstants.EffectScnFolderVirtualPath + "Candle" + DIR_SEPARATOR + "{0:000}.tga",
$"{FileConstants.EffectScnFolderVirtualPath}Candle{DIR_SEPARATOR}candle.pol", 1f, 0.2f) },
{FireEffectType.Type5, new (
FileConstants.EffectScnFolderVirtualPath + "Fire2" + DirSeparator + "{0:00}.tga",
FileConstants.EffectScnFolderVirtualPath + "Fire2" + DIR_SEPARATOR + "{0:00}.tga",
"", 1f, 0.3f) },
{FireEffectType.Type6, new (
FileConstants.EffectScnFolderVirtualPath + "Candle" + DirSeparator + "{0:000}.tga",
FileConstants.EffectScnFolderVirtualPath + "Candle" + DIR_SEPARATOR + "{0:000}.tga",
"", 1f, 0.6f) },
};
#endif
+48 -49
View File
@@ -105,77 +105,76 @@ namespace Pal3.MetaData
#region CPK file system virtual file names and paths
private const char DirSeparator = CpkConstants.DirectorySeparatorChar;
#if PAL3
public static readonly string GameDatabaseFileVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{COMBAT_DATA_FOLDER_NAME}{DirSeparator}PAL3_Softstar.gdb";
#elif PAL3A
public static readonly string GameDatabaseFileVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{COMBAT_DATA_FOLDER_NAME}{DirSeparator}PAL3A_Softstar.gdb";
#endif
private const char DIR_SEPARATOR = CpkConstants.DirectorySeparatorChar;
public static readonly string DataScriptFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{DATA_SCRIPT_FOLDER_NAME}{DirSeparator}";
$"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{DATA_SCRIPT_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string EffectFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{EFFECT_FOLDER_NAME}{DirSeparator}";
$"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{EFFECT_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string EffectScnFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{EFFECT_SCN_FOLDER_NAME}{DirSeparator}";
$"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{EFFECT_SCN_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string SystemSceFileVirtualPath = $"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}init.sce";
public static readonly string BigMapSceFileVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{UI_FOLDER_NAME}{DirSeparator}{BIG_MAP_FOLDER_NAME}{DirSeparator}BigMap.sce";
public static readonly string UIFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{UI_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string UISceneFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{UI_FOLDER_NAME}{DirSeparator}scene{DirSeparator}";
$"{UIFolderVirtualPath}{SCENE_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string UILibFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{UI_FOLDER_NAME}{DirSeparator}{UI_LIBRARY_FOLDER_NAME}{DirSeparator}";
$"{UIFolderVirtualPath}{UI_LIBRARY_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string EmojiSpriteSheetFolderVirtualPath =
$"{UIFolderVirtualPath}{EMOJI_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string CursorSpriteFolderVirtualPath =
$"{UIFolderVirtualPath}{CURSOR_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string CaptionFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{CAPTION_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string CombatDataFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{COMBAT_DATA_FOLDER_NAME}{DIR_SEPARATOR}";
public static readonly string[] SkyBoxTexturePathFormat =
{
EffectScnFolderVirtualPath + "skybox" + DirSeparator + "{0:00}" + DirSeparator + "{0:00}_lf.tga",
EffectScnFolderVirtualPath + "skybox" + DirSeparator + "{0:00}" + DirSeparator + "{0:00}_fr.tga",
EffectScnFolderVirtualPath + "skybox" + DirSeparator + "{0:00}" + DirSeparator + "{0:00}_rt.tga",
EffectScnFolderVirtualPath + "skybox" + DirSeparator + "{0:00}" + DirSeparator + "{0:00}_bk.tga",
EffectScnFolderVirtualPath + "skybox" + DirSeparator + "{0:00}" + DirSeparator + "{0:00}_up.tga",
EffectScnFolderVirtualPath + "skybox" + DirSeparator + "{0:00}" + DirSeparator + "{0:00}_dn.tga",
EffectScnFolderVirtualPath + "skybox" + DIR_SEPARATOR + "{0:00}" + DIR_SEPARATOR + "{0:00}_lf.tga",
EffectScnFolderVirtualPath + "skybox" + DIR_SEPARATOR + "{0:00}" + DIR_SEPARATOR + "{0:00}_fr.tga",
EffectScnFolderVirtualPath + "skybox" + DIR_SEPARATOR + "{0:00}" + DIR_SEPARATOR + "{0:00}_rt.tga",
EffectScnFolderVirtualPath + "skybox" + DIR_SEPARATOR + "{0:00}" + DIR_SEPARATOR + "{0:00}_bk.tga",
EffectScnFolderVirtualPath + "skybox" + DIR_SEPARATOR + "{0:00}" + DIR_SEPARATOR + "{0:00}_up.tga",
EffectScnFolderVirtualPath + "skybox" + DIR_SEPARATOR + "{0:00}" + DIR_SEPARATOR + "{0:00}_dn.tga",
};
public static readonly string EmojiSpriteSheetFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{UI_FOLDER_NAME}{DirSeparator}{EMOJI_FOLDER_NAME}{DirSeparator}";
public static readonly string GameDatabaseFileVirtualPath = CombatDataFolderVirtualPath + $"{GameConstants.AppName}_Softstar.gdb";
public static readonly string CursorSpriteFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{UI_FOLDER_NAME}{DirSeparator}{CURSOR_FOLDER_NAME}{DirSeparator}";
public static readonly string SystemSceFileVirtualPath = $"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}init.sce";
public static readonly string CaptionFolderVirtualPath =
$"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{CAPTION_FOLDER_NAME}{DirSeparator}";
public static readonly string BigMapSceFileVirtualPath = $"{UIFolderVirtualPath}{BIG_MAP_FOLDER_NAME}{DIR_SEPARATOR}BigMap.sce";
public static string GetWeaponModelFileVirtualPath(string weaponName)
{
return $"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}" +
$"{WEAPON_FOLDER_NAME}{DirSeparator}{weaponName}{DirSeparator}{weaponName}.pol";
return $"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}" +
$"{WEAPON_FOLDER_NAME}{DIR_SEPARATOR}{weaponName}{DIR_SEPARATOR}{weaponName}.pol";
}
public static string GetGameItemModelFileVirtualPath(string itemName)
{
return $"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}item" +
$"{DirSeparator}{itemName}{DirSeparator}{itemName}.pol";
return $"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}item" +
$"{DIR_SEPARATOR}{itemName}{DIR_SEPARATOR}{itemName}.pol";
}
public static string GetGameObjectModelFileVirtualPath(string objectFileName)
{
return $"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}{OBJECT_FOLDER_NAME}" +
return $"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}{OBJECT_FOLDER_NAME}" +
CpkConstants.DirectorySeparatorChar + objectFileName;
}
public static string GetGameObjectModelFileVirtualPath(ScnSceneInfo sceneInfo, string objectName)
{
return $"{sceneInfo.CityName}{CpkConstants.FileExtension}{DirSeparator}" +
$"{sceneInfo.Model}{DirSeparator}{objectName}";
return $"{sceneInfo.CityName}{CpkConstants.FileExtension}{DIR_SEPARATOR}" +
$"{sceneInfo.Model}{DIR_SEPARATOR}{objectName}";
}
public static string GetMusicFileVirtualPath(string musicName)
@@ -187,18 +186,18 @@ namespace Pal3.MetaData
public static string GetActorFolderVirtualPath(string actorName)
{
return $"{BASE_DATA_CPK_FILE_NAME}{DirSeparator}" +
$"{ACTOR_FOLDER_NAME}{DirSeparator}{actorName}{DirSeparator}";
return $"{BASE_DATA_CPK_FILE_NAME}{DIR_SEPARATOR}" +
$"{ACTOR_FOLDER_NAME}{DIR_SEPARATOR}{actorName}{DIR_SEPARATOR}";
}
public static string GetNavFileVirtualPath(string sceneFileName, string sceneName)
public static string GetNavFileVirtualPath(string sceneFileName, string modelName)
{
#if PAL3
var navFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{DirSeparator}" +
$"{sceneName}{DirSeparator}{sceneName}.nav";
var navFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{DIR_SEPARATOR}" +
$"{modelName}{DIR_SEPARATOR}{modelName}.nav";
#elif PAL3A
var navFilePath = $"{SCN_CPK_FILE_NAME}{DirSeparator}SCN{DirSeparator}" +
$"{sceneFileName}{DirSeparator}{sceneName}{DirSeparator}{sceneName}.nav";
var navFilePath = $"{SCN_CPK_FILE_NAME}{DIR_SEPARATOR}SCN{DIR_SEPARATOR}" +
$"{sceneFileName}{DIR_SEPARATOR}{modelName}{DIR_SEPARATOR}{modelName}.nav";
#endif
return navFilePath;
}
@@ -206,10 +205,10 @@ namespace Pal3.MetaData
public static string GetScnFileVirtualPath(string sceneFileName, string sceneName)
{
#if PAL3
var scnFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{DirSeparator}{sceneName}.scn";
var scnFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{DIR_SEPARATOR}{sceneName}.scn";
#elif PAL3A
var scnFilePath = $"{SCN_CPK_FILE_NAME}{DirSeparator}SCN{DirSeparator}" +
$"{sceneFileName}{DirSeparator}{sceneFileName}_{sceneName}.scn";
var scnFilePath = $"{SCN_CPK_FILE_NAME}{DIR_SEPARATOR}SCN{DIR_SEPARATOR}" +
$"{sceneFileName}{DIR_SEPARATOR}{sceneFileName}_{sceneName}.scn";
#endif
return scnFilePath;
}
@@ -217,9 +216,9 @@ namespace Pal3.MetaData
public static string GetSceneSceFileVirtualPath(string sceneFileName)
{
#if PAL3
var sceFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{DirSeparator}{sceneFileName}.sce";
var sceFilePath = $"{sceneFileName}{CpkConstants.FileExtension}{DIR_SEPARATOR}{sceneFileName}.sce";
#elif PAL3A
var sceFilePath = $"{SCE_CPK_FILE_NAME}{DirSeparator}Sce{DirSeparator}{sceneFileName}.sce";
var sceFilePath = $"{SCE_CPK_FILE_NAME}{DIR_SEPARATOR}Sce{DIR_SEPARATOR}{sceneFileName}.sce";
#endif
return sceFilePath;
}
@@ -5,6 +5,12 @@
namespace Pal3.MetaData
{
public enum Language
{
SimplifiedChinese = 0,
TraditionalChinese,
}
public static class GameConstants
{
#if PAL3
@@ -34,7 +34,7 @@ namespace Pal3.MetaData
#if PAL3
public static readonly Dictionary<(string cityName, string sceneName), Color> MainLightColorInfo = new()
{
{ ("q02" , "n14"), new Color(75f / 255f, 75f / 255f, 75f / 255f) }, // 地牢1
{ ("q02", "n14"), new Color(75f / 255f, 75f / 255f, 75f / 255f) }, // 地牢1
{ ("q02", "n16"), new Color(30f / 255f, 30f / 255f, 30f / 255f) }, // 地牢2
{ ("q07", "q07a"), new Color(120f / 255f, 50f / 255f, 30f / 255f) }, // 安宁村黄昏
{ ("m06", "4"), new Color(0f / 255f, 0f / 255f, 80f / 255f) }, // 蓬莱密道
+9 -10
View File
@@ -134,7 +134,7 @@ namespace Pal3
private SceneManager _sceneManager;
private CameraManager _cameraManager;
private AudioManager _audioManager;
private PlayerManager _playerManager;
private PlayerActorManager _playerActorManager;
private InventoryManager _inventoryManager;
private DialogueManager _dialogueManager;
private PostProcessManager _postProcessManager;
@@ -196,11 +196,11 @@ namespace Pal3
_sceneManager = new SceneManager(_gameResourceProvider,
_sceneStateManager, _scriptManager, _gameSettings, mainCamera);
ServiceLocator.Instance.Register(_sceneManager);
_playerManager = new PlayerManager();
ServiceLocator.Instance.Register(_playerManager);
_playerActorManager = new PlayerActorManager();
ServiceLocator.Instance.Register(_playerActorManager);
_inventoryManager = new InventoryManager(_gameResourceProvider);
ServiceLocator.Instance.Register(_inventoryManager);
_teamManager = new TeamManager(_playerManager, _sceneManager);
_teamManager = new TeamManager(_playerActorManager, _sceneManager);
ServiceLocator.Instance.Register(_teamManager);
_touchControlUIManager = new TouchControlUIManager(_sceneManager,
touchControlUI, interactionButton, multiFunctionButton, mainMenuButton);
@@ -243,7 +243,7 @@ namespace Pal3
_playerGamePlayController = gameObject.AddComponent<PlayerGamePlayController>();
_playerGamePlayController.Init(_gameResourceProvider,
_gameStateManager,
_playerManager,
_playerActorManager,
_teamManager,
_inputActions,
_sceneManager,
@@ -323,7 +323,7 @@ namespace Pal3
ServiceLocator.Instance.Register(_effectManager);
_saveManager = new SaveManager(_sceneManager,
_playerManager,
_playerActorManager,
_teamManager,
_inventoryManager,
_sceneStateManager,
@@ -344,9 +344,7 @@ namespace Pal3
_mainMenu = gameObject.AddComponent<MainMenu>();
_mainMenu.Init(
_gameSettings,
_audioManager,
_inputManager,
eventSystem,
_sceneManager,
_gameStateManager,
_scriptManager,
@@ -359,6 +357,7 @@ namespace Pal3
contentScrollRect,
backgroundTransform,
contentTransform,
eventSystem,
mainCamera);
ServiceLocator.Instance.Register(_mainMenu);
@@ -478,7 +477,7 @@ namespace Pal3
_gameStateManager.Dispose();
_sceneStateManager.Dispose();
_scriptManager.Dispose();
_playerManager.Dispose();
_playerActorManager.Dispose();
_inventoryManager.Dispose();
_teamManager.Dispose();
_sceneManager.Dispose();
@@ -575,7 +574,7 @@ namespace Pal3
$"{currentSceneInfo.ToString()}\n");
var playerActorMovementController = currentScene
.GetActorGameObject((int) _playerManager.GetPlayerActor()).GetComponent<ActorMovementController>();
.GetActorGameObject((int) _playerActorManager.GetPlayerActor()).GetComponent<ActorMovementController>();
info.Append($"----- Player info -----\n" +
$"Nav layer: {playerActorMovementController.GetCurrentLayerIndex()}\n" +
+3 -1
View File
@@ -18,6 +18,7 @@ namespace Pal3.Scene
using Core.Utils;
using Data;
using GamePlay;
using MetaData;
using SceneObjects;
using State;
using UnityEngine;
@@ -116,7 +117,8 @@ namespace Pal3.Scene
private void InitNavData()
{
NavFile = _resourceProvider.GetNavFile(ScnFile.SceneInfo.CityName, ScnFile.SceneInfo.Model);
NavFile = _resourceProvider.GetGameResourceFile<NavFile>(
FileConstants.GetNavFileVirtualPath(ScnFile.SceneInfo.CityName, ScnFile.SceneInfo.Model));
Tilemap = new Tilemap(NavFile);
}
+4 -2
View File
@@ -76,7 +76,8 @@ namespace Pal3.Scene
timer.Start();
DisposeCurrentScene();
ScnFile scnFile = _resourceProvider.GetScnFile(sceneFileName, sceneName);
ScnFile scnFile = _resourceProvider.GetGameResourceFile<ScnFile>(
FileConstants.GetScnFileVirtualPath(sceneFileName, sceneName));
CommandDispatcher<ICommand>.Instance.Dispatch(new ScenePreLoadingNotification(scnFile.SceneInfo));
Debug.Log($"[{nameof(SceneManager)}] Loading scene: " + JsonConvert.SerializeObject(scnFile.SceneInfo));
@@ -95,7 +96,8 @@ namespace Pal3.Scene
_sceneObjectIdsToNotLoadFromSaveState.Clear();
// Add scene script if exists.
SceFile sceFile = _resourceProvider.GetSceneSceFile(sceneFileName);
SceFile sceFile = _resourceProvider.GetGameResourceFile<SceFile>(FileConstants.GetSceneSceFileVirtualPath(sceneFileName));
CommandDispatcher<ICommand>.Instance.Dispatch(
_scriptManager.TryAddSceneScript(sceFile, $"_{sceneFileName}_{sceneName}", out var sceneScriptId)
? new ScenePostLoadingNotification(scnFile.SceneInfo, sceneScriptId)
@@ -5,6 +5,8 @@
namespace Pal3.Scene
{
using System;
public enum SceneObjectModelType
{
None = 0,
@@ -27,12 +29,12 @@ namespace Pal3.Scene
return SceneObjectModelType.EffectModel;
}
if (fileName.ToLower().EndsWith(".pol"))
if (fileName.EndsWith(".pol", StringComparison.OrdinalIgnoreCase))
{
return SceneObjectModelType.PolModel;
}
if (fileName.ToLower().EndsWith(".cvd"))
if (fileName.EndsWith(".cvd", StringComparison.OrdinalIgnoreCase))
{
return SceneObjectModelType.CvdModel;
}
@@ -28,7 +28,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider,
Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -27,7 +27,7 @@ namespace Pal3.Scene.SceneObjects
public override bool IsDirectlyInteractable(float distance)
{
return Activated && distance < MAX_INTERACTION_DISTANCE;
return IsActivated && distance < MAX_INTERACTION_DISTANCE;
}
public override bool ShouldGoToCutsceneWhenInteractionStarted()
@@ -37,7 +37,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
_meshCollider = sceneGameObject.AddComponent<SceneObjectMeshCollider>();
return sceneGameObject;
@@ -43,12 +43,12 @@ namespace Pal3.Scene.SceneObjects
public override bool IsDirectlyInteractable(float distance)
{
return Activated && distance < MAX_INTERACTION_DISTANCE;
return IsActivated && distance < MAX_INTERACTION_DISTANCE;
}
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
Vector3 climbablePosition = sceneGameObject.transform.position;
@@ -23,7 +23,7 @@ namespace Pal3.Scene.SceneObjects
public override bool IsDirectlyInteractable(float distance)
{
return Activated && distance < MAX_INTERACTION_DISTANCE;
return IsActivated && distance < MAX_INTERACTION_DISTANCE;
}
public override bool ShouldGoToCutsceneWhenInteractionStarted()
@@ -29,7 +29,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
// Don't add a trigger if the object is already collided (SwitchState sets to 1).
@@ -19,7 +19,7 @@ namespace Pal3.Scene.SceneObjects.Common
private bool _hasCollided;
private BoxCollider _collider;
private PlayerManager _playerManager;
private PlayerActorManager _playerActorManager;
public void SetBounds(Bounds bounds, bool isTrigger)
{
@@ -35,7 +35,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnEnable()
{
_playerManager = ServiceLocator.Instance.Get<PlayerManager>();
_playerActorManager = ServiceLocator.Instance.Get<PlayerActorManager>();
}
private void OnDisable()
@@ -50,7 +50,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Info.Id == (byte) _playerManager.GetPlayerActor())
actorController.GetActor().Info.Id == (byte) _playerActorManager.GetPlayerActor())
{
OnPlayerActorEntered?.Invoke(this, collision.gameObject);
}
@@ -59,7 +59,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnTriggerEnter(Collider otherCollider)
{
if (otherCollider.gameObject.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Info.Id == (byte) _playerManager.GetPlayerActor())
actorController.GetActor().Info.Id == (byte) _playerActorManager.GetPlayerActor())
{
OnPlayerActorEntered?.Invoke(this, otherCollider.gameObject);
}
@@ -68,7 +68,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnCollisionExit(Collision collision)
{
if (collision.gameObject.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Info.Id == (byte) _playerManager.GetPlayerActor())
actorController.GetActor().Info.Id == (byte) _playerActorManager.GetPlayerActor())
{
OnPlayerActorExited?.Invoke(this, collision.gameObject);
}
@@ -77,7 +77,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnTriggerExit(Collider otherCollider)
{
if (otherCollider.gameObject.GetComponent<ActorController>() is {} actorController &&
actorController.GetActor().Info.Id == (byte) _playerManager.GetPlayerActor())
actorController.GetActor().Info.Id == (byte) _playerActorManager.GetPlayerActor())
{
OnPlayerActorExited?.Invoke(this, otherCollider.gameObject);
}
@@ -22,11 +22,11 @@ namespace Pal3.Scene.SceneObjects.Common
private Bounds _triggerBounds;
private float _platformHeightOffset;
private PlayerManager _playerManager;
private PlayerActorManager _playerActorManager;
private void OnEnable()
{
_playerManager = ServiceLocator.Instance.Get<PlayerManager>();
_playerActorManager = ServiceLocator.Instance.Get<PlayerActorManager>();
}
public void Init(Bounds triggerBounds, int layerIndex, float platformHeightOffset = 0f)
@@ -60,7 +60,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnTriggerEnter(Collider otherCollider)
{
if (otherCollider.gameObject.GetComponent<ActorController>() is { } actorController &&
actorController.GetActor().Info.Id == (byte) _playerManager.GetPlayerActor())
actorController.GetActor().Info.Id == (byte) _playerActorManager.GetPlayerActor())
{
OnPlayerActorEntered?.Invoke(this, otherCollider.gameObject);
}
@@ -69,7 +69,7 @@ namespace Pal3.Scene.SceneObjects.Common
private void OnTriggerExit(Collider otherCollider)
{
if (otherCollider.gameObject.GetComponent<ActorController>() is { } actorController &&
actorController.GetActor().Info.Id == (byte) _playerManager.GetPlayerActor())
actorController.GetActor().Info.Id == (byte) _playerActorManager.GetPlayerActor())
{
OnPlayerActorExited?.Invoke(this, otherCollider.gameObject);
}
@@ -31,7 +31,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
bool isFlowerInOpenState;
@@ -34,7 +34,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -31,7 +31,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -26,7 +26,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
// Add collider to block player
_meshCollider = sceneGameObject.AddComponent<SceneObjectMeshCollider>();
@@ -36,7 +36,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider,
Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -35,7 +35,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -30,7 +30,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider,
Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
CommandExecutorRegistry<ICommand>.Instance.Register(this);
return sceneGameObject;
@@ -36,7 +36,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider,
Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -24,7 +24,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -37,7 +37,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -44,7 +44,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
Color subObjectTintColor = tintColor;
@@ -27,7 +27,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
if (ObjectInfo.IsNonBlocking == 0)
{
@@ -38,7 +38,7 @@ namespace Pal3.Scene.SceneObjects
public override bool IsDirectlyInteractable(float distance)
{
return Activated && distance < MAX_INTERACTION_DISTANCE;
return IsActivated && distance < MAX_INTERACTION_DISTANCE;
}
public override IEnumerator InteractAsync(InteractionContext ctx)
@@ -27,7 +27,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider,
Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -33,7 +33,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
#if PAL3A
@@ -35,7 +35,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -108,6 +108,29 @@ namespace Pal3.Scene.SceneObjects
SaveCurrentPosition();
yield break;
}
else
{
#if PAL3A
// PAL3A has additional interaction logic for grouped objects
// This is to sync moving carriers in m07-2 scene
if (SceneInfo.Is("m07", "2") &&
ObjectInfo.LinkedObjectGroupId != 0)
{
var allObjects = ctx.CurrentScene.GetAllSceneObjects();
foreach (SceneObject otherObject in allObjects.Values)
{
if (ObjectInfo.Id != otherObject.ObjectInfo.Id &&
ObjectInfo.Type == otherObject.ObjectInfo.Type &&
ObjectInfo.LinkedObjectGroupId == otherObject.ObjectInfo.LinkedObjectGroupId &&
otherObject.IsActivated)
{
yield return otherObject.InteractAsync(ctx);
}
}
}
#endif
}
var actorMovementController = ctx.PlayerActorGameObject.GetComponent<ActorMovementController>();
var waypoints = new List<Vector3>();
@@ -31,7 +31,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
Bounds bounds = new()
@@ -41,7 +41,7 @@ namespace Pal3.Scene.SceneObjects
public override bool IsDirectlyInteractable(float distance)
{
return Activated &&
return IsActivated &&
distance < MAX_INTERACTION_DISTANCE &&
ObjectInfo.Times > 0;
}
@@ -37,7 +37,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -29,7 +29,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider,
Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
_triggerController = sceneGameObject.AddComponent<TilemapTriggerController>();
@@ -51,7 +51,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -29,12 +29,12 @@ namespace Pal3.Scene.SceneObjects
public override bool IsDirectlyInteractable(float distance)
{
return Activated && distance < MAX_INTERACTION_DISTANCE;
return IsActivated && distance < MAX_INTERACTION_DISTANCE;
}
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
_meshCollider = sceneGameObject.AddComponent<SceneObjectMeshCollider>();
return sceneGameObject;
@@ -28,7 +28,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
@@ -30,7 +30,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
Bounds bounds = GetMeshBounds();
@@ -32,7 +32,7 @@ namespace Pal3.Scene.SceneObjects
public override GameObject Activate(GameResourceProvider resourceProvider, Color tintColor)
{
if (Activated) return GetGameObject();
if (IsActivated) return GetGameObject();
GameObject sceneGameObject = base.Activate(resourceProvider, tintColor);
Loaded 100 of 130 files, more files were not shown because too many files have changed in this diff. Show more