Maid.cs 106 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using MaidExtension;
  7. using MaidStatus;
  8. using UnityEngine;
  9. using XVI.AniLipSync;
  10. public class Maid : MonoBehaviour
  11. {
  12. public bool Visible
  13. {
  14. get
  15. {
  16. return this.m_visible;
  17. }
  18. set
  19. {
  20. GameObject gameObject = base.gameObject;
  21. this.m_visible = value;
  22. gameObject.SetActive(value);
  23. }
  24. }
  25. public MaidParts Parts
  26. {
  27. get
  28. {
  29. return this.m_Parts;
  30. }
  31. }
  32. public Status status
  33. {
  34. get
  35. {
  36. if (this.boMAN && this.pairMan != null && this.IsCrcBody)
  37. {
  38. return this.pairMan.status;
  39. }
  40. return this.m_Status;
  41. }
  42. }
  43. public AudioSourceMgr AudioMan
  44. {
  45. get
  46. {
  47. return (!(this.body0 != null)) ? null : this.body0.AudioMan;
  48. }
  49. }
  50. public MaidCostumeChangeController mekureController { get; private set; }
  51. public bool IsBusy
  52. {
  53. get
  54. {
  55. return this.IsAllProcPropBusy && this.Visible;
  56. }
  57. }
  58. public bool IsAllProcPropBusy
  59. {
  60. get
  61. {
  62. return this.boAllProcPropBUSY;
  63. }
  64. }
  65. public FullBodyIKMgr fullBodyIK
  66. {
  67. get
  68. {
  69. return this.body0.fullBodyIK;
  70. }
  71. }
  72. public bool HasCrcBody
  73. {
  74. get
  75. {
  76. return this.boMAN || this.m_maidPropOther != null;
  77. }
  78. }
  79. public void RemoveCrcBodyProp()
  80. {
  81. this.m_maidPropOther = null;
  82. this.m_partsColorOtherBin = null;
  83. }
  84. public MaidProp GetOtherBodyProp(MPN mpn)
  85. {
  86. if (this.m_maidPropOther == null)
  87. {
  88. return null;
  89. }
  90. return Array.Find<MaidProp>(this.m_maidPropOther, (MaidProp m) => m.idx == (int)mpn);
  91. }
  92. public int ActiveSlotNo
  93. {
  94. get
  95. {
  96. return this.m_nActiveSlotNo;
  97. }
  98. set
  99. {
  100. if (this.pairMan != null)
  101. {
  102. this.pairMan.m_nActiveSlotNo = value;
  103. }
  104. this.m_nActiveSlotNo = value;
  105. }
  106. }
  107. public Color ManColor
  108. {
  109. get
  110. {
  111. return this.m_colMan;
  112. }
  113. set
  114. {
  115. this.m_colMan = value;
  116. if (this.pairMan != null)
  117. {
  118. this.pairMan.m_colMan = value;
  119. }
  120. }
  121. }
  122. public bool IsCrcBody
  123. {
  124. get
  125. {
  126. return (!this.boMAN) ? this.GetProp(MPN.body).isCrcParts : this.m_isCrcManBody;
  127. }
  128. }
  129. public int VoicePitch
  130. {
  131. get
  132. {
  133. return this.m_nVoicePitch;
  134. }
  135. set
  136. {
  137. if (this.body0 != null)
  138. {
  139. TBody tbody = this.body0;
  140. this.m_nVoicePitch = value;
  141. tbody.SetVoicePitch(value);
  142. }
  143. }
  144. }
  145. public static string GetThumbnailFilePath(string guid, bool temp)
  146. {
  147. string thumbnailDictionary = Maid.ThumbnailDictionary;
  148. if (Directory.Exists(thumbnailDictionary))
  149. {
  150. Directory.CreateDirectory(thumbnailDictionary);
  151. }
  152. return Path.Combine(thumbnailDictionary, ((!temp) ? string.Empty : "_tmp_thum_") + guid + ".png");
  153. }
  154. public static string GetIconThumbnailFilePath(string guid, bool temp)
  155. {
  156. string thumbnailDictionary = Maid.ThumbnailDictionary;
  157. if (Directory.Exists(thumbnailDictionary))
  158. {
  159. Directory.CreateDirectory(thumbnailDictionary);
  160. }
  161. return Path.Combine(thumbnailDictionary, ((!temp) ? "icon_thum_" : "icon_thum_") + guid + ".png");
  162. }
  163. public static string GetKasizukiThumbnailFilePath(string guid, bool temp)
  164. {
  165. string thumbnailDictionary = Maid.ThumbnailDictionary;
  166. if (Directory.Exists(thumbnailDictionary))
  167. {
  168. Directory.CreateDirectory(thumbnailDictionary);
  169. }
  170. return Path.Combine(thumbnailDictionary, ((!temp) ? "kasizuki_" : "_tmp_kasizuki_") + guid + ".png");
  171. }
  172. public static string ThumbnailDictionary
  173. {
  174. get
  175. {
  176. return Path.Combine(GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "Thumb");
  177. }
  178. }
  179. public static void UpdateMaidRanking()
  180. {
  181. if (!GameMain.Instance.CharacterMgr.status.isAvailableRanking)
  182. {
  183. Debug.Log("メイドランキングは未開放なので更新されませんでした");
  184. return;
  185. }
  186. List<KeyValuePair<long, Maid>> list = new List<KeyValuePair<long, Maid>>();
  187. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  188. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  189. {
  190. Maid stockMaid = characterMgr.GetStockMaid(i);
  191. if (!(stockMaid == null))
  192. {
  193. stockMaid.status.popularRank = 0;
  194. long key = (long)stockMaid.status.evaluation + stockMaid.status.sales;
  195. list.Add(new KeyValuePair<long, Maid>(key, stockMaid));
  196. }
  197. }
  198. list.Sort(delegate(KeyValuePair<long, Maid> a, KeyValuePair<long, Maid> b)
  199. {
  200. long num3 = b.Key - a.Key;
  201. return (num3 != 0L) ? ((0L >= num3) ? -1 : 1) : 0;
  202. });
  203. long num = -1L;
  204. int num2 = 0;
  205. foreach (KeyValuePair<long, Maid> keyValuePair in list)
  206. {
  207. if (keyValuePair.Key == 0L)
  208. {
  209. break;
  210. }
  211. if (keyValuePair.Key != num)
  212. {
  213. num2++;
  214. }
  215. keyValuePair.Value.status.popularRank = num2;
  216. num = keyValuePair.Key;
  217. }
  218. }
  219. private void Awake()
  220. {
  221. }
  222. public void OnMouseUp()
  223. {
  224. if (this.IsBusy || this.body0 == null || this.onMouseUpEvent == null)
  225. {
  226. return;
  227. }
  228. this.onMouseUpEvent(this);
  229. }
  230. public void Initialize(string f_strTypeName, bool f_bMan, bool isCrcBody = false)
  231. {
  232. this.m_isCrcManBody = (f_bMan == isCrcBody);
  233. this.m_Parts = base.gameObject.AddComponent<MaidParts>();
  234. this.mekureController = new MaidCostumeChangeController(this);
  235. this.m_goOffset = new GameObject("Offset");
  236. this.m_goOffset.transform.parent = base.gameObject.transform;
  237. this.TypeName = f_strTypeName;
  238. this.boMAN = f_bMan;
  239. this.boOffsetY = true;
  240. this.body0 = base.gameObject.AddComponent<TBody>();
  241. this.body0.Init(this, f_bMan);
  242. int length = Enum.GetValues(typeof(MPN)).Length;
  243. this.m_aryMaidProp = new MaidProp[length];
  244. this.CreateProps();
  245. this.InitializeStatus();
  246. this.m_Parts.Initialize(base.gameObject, this);
  247. this.DelPrefabAll();
  248. if (this.boMAN)
  249. {
  250. this.SetUpModel("_I_man.menu");
  251. }
  252. else
  253. {
  254. this.SetUpModel("_I_default.menu");
  255. if (Product.isPublic)
  256. {
  257. this.SetProp(MPN.bra, "bra030_i_.menu", 0, false, false);
  258. this.SetProp(MPN.panz, "Pants030_i_.menu", 0, false, false);
  259. }
  260. }
  261. }
  262. public void CreateProps()
  263. {
  264. List<MaidProp> list = Maid.CreateInitMaidPropList();
  265. foreach (MaidProp mp in list)
  266. {
  267. this.AddProp(mp);
  268. }
  269. }
  270. public void InitializeStatus()
  271. {
  272. if (this.m_Status == null)
  273. {
  274. this.m_Status = new Status();
  275. this.m_Status.Initialize(this);
  276. }
  277. }
  278. public static List<MaidProp> CreateInitMaidPropList()
  279. {
  280. return new List<MaidProp>
  281. {
  282. Maid.CreateProp(0, int.MaxValue, 0, MPN.null_mpn, 0),
  283. Maid.CreateProp(0, 130, 10, MPN.MuneL, 1),
  284. Maid.CreateProp(0, 100, 0, MPN.MuneS, 1),
  285. Maid.CreateProp(0, 130, 10, MPN.MuneTare, 1),
  286. Maid.CreateProp(0, 100, 40, MPN.RegFat, 1),
  287. Maid.CreateProp(0, 100, 20, MPN.ArmL, 1),
  288. Maid.CreateProp(0, 100, 20, MPN.Hara, 1),
  289. Maid.CreateProp(0, 100, 40, MPN.RegMeet, 1),
  290. Maid.CreateProp(20, 80, 50, MPN.KubiScl, 2),
  291. Maid.CreateProp(0, 100, 50, MPN.UdeScl, 2),
  292. Maid.CreateProp(0, 100, 50, MPN.EyeScl, 2),
  293. Maid.CreateProp(0, 100, 50, MPN.EyeSclX, 2),
  294. Maid.CreateProp(0, 100, 50, MPN.EyeSclY, 2),
  295. Maid.CreateProp(0, 100, 50, MPN.EyePosX, 2),
  296. Maid.CreateProp(0, 100, 50, MPN.EyePosY, 2),
  297. Maid.CreateProp(0, 100, 0, MPN.EyeClose, 2),
  298. Maid.CreateProp(0, 100, 50, MPN.EyeBallPosX, 2),
  299. Maid.CreateProp(0, 100, 50, MPN.EyeBallPosY, 2),
  300. Maid.CreateProp(0, 100, 50, MPN.EyeBallSclX, 2),
  301. Maid.CreateProp(0, 100, 50, MPN.EyeBallSclY, 2),
  302. Maid.CreateProp(0, 1, 0, MPN.EarNone, 2),
  303. Maid.CreateProp(0, 100, 0, MPN.EarElf, 2),
  304. Maid.CreateProp(0, 100, 50, MPN.EarRot, 2),
  305. Maid.CreateProp(0, 100, 50, MPN.EarScl, 2),
  306. Maid.CreateProp(0, 100, 50, MPN.NosePos, 2),
  307. Maid.CreateProp(0, 100, 50, MPN.NoseScl, 2),
  308. Maid.CreateProp(0, 100, 0, MPN.FaceShape, 2),
  309. Maid.CreateProp(0, 100, 0, MPN.FaceShapeSlim, 2),
  310. Maid.CreateProp(0, 100, 50, MPN.MayuShapeIn, 2),
  311. Maid.CreateProp(0, 100, 50, MPN.MayuShapeOut, 2),
  312. Maid.CreateProp(0, 100, 50, MPN.MayuX, 2),
  313. Maid.CreateProp(0, 100, 50, MPN.MayuY, 2),
  314. Maid.CreateProp(0, 100, 50, MPN.MayuRot, 2),
  315. Maid.CreateProp(0, 100, 50, MPN.HeadX, 2),
  316. Maid.CreateProp(0, 100, 50, MPN.HeadY, 2),
  317. Maid.CreateProp(20, 80, 50, MPN.DouPer, 2),
  318. Maid.CreateProp(20, 80, 50, MPN.sintyou, 2),
  319. Maid.CreateProp(0, 100, 50, MPN.koshi, 2),
  320. Maid.CreateProp(0, 100, 50, MPN.kata, 2),
  321. Maid.CreateProp(0, 100, 50, MPN.west, 2),
  322. Maid.CreateProp(0, 100, 10, MPN.MuneUpDown, 2),
  323. Maid.CreateProp(0, 100, 40, MPN.MuneYori, 2),
  324. Maid.CreateProp(0, 100, 50, MPN.MuneYawaraka, 2),
  325. Maid.CreateProp(0, 100, 50, MPN.MunePosX, 2),
  326. Maid.CreateProp(0, 100, 50, MPN.MunePosY, 2),
  327. Maid.CreateProp(0, 100, 50, MPN.MuneThick, 2),
  328. Maid.CreateProp(0, 100, 50, MPN.MuneLong, 2),
  329. Maid.CreateProp(0, 100, 50, MPN.MuneDir, 2),
  330. Maid.CreateProp(0, 100, 50, MPN.DouThick1X, 2),
  331. Maid.CreateProp(0, 100, 50, MPN.DouThick1Y, 2),
  332. Maid.CreateProp(0, 100, 50, MPN.DouThick2X, 2),
  333. Maid.CreateProp(0, 100, 50, MPN.DouThick2Y, 2),
  334. Maid.CreateProp(0, 100, 50, MPN.DouThick3X, 2),
  335. Maid.CreateProp(0, 100, 50, MPN.DouThick3Y, 2),
  336. Maid.CreateProp(0, 100, 50, MPN.ShoulderThick, 2),
  337. Maid.CreateProp(0, 100, 50, MPN.UpperArmThickX, 2),
  338. Maid.CreateProp(0, 100, 50, MPN.UpperArmThickY, 2),
  339. Maid.CreateProp(0, 100, 50, MPN.LowerArmThickX, 2),
  340. Maid.CreateProp(0, 100, 50, MPN.LowerArmThickY, 2),
  341. Maid.CreateProp(0, 100, 50, MPN.ElbowThickX, 2),
  342. Maid.CreateProp(0, 100, 50, MPN.ElbowThickY, 2),
  343. Maid.CreateProp(0, 100, 50, MPN.NeckThickX, 2),
  344. Maid.CreateProp(0, 100, 50, MPN.NeckThickY, 2),
  345. Maid.CreateProp(0, 100, 50, MPN.HandSize, 2),
  346. Maid.CreateProp(0, 100, 50, MPN.DouThick4X, 2),
  347. Maid.CreateProp(0, 100, 50, MPN.DouThick4Y, 2),
  348. Maid.CreateProp(0, 100, 50, MPN.DouThick5X, 2),
  349. Maid.CreateProp(0, 100, 50, MPN.DouThick5Y, 2),
  350. Maid.CreateProp(0, 100, 50, MPN.WaistPos, 2),
  351. Maid.CreateProp(0, 100, 50, MPN.HipSize, 1),
  352. Maid.CreateProp(0, 100, 50, MPN.HipRot, 2),
  353. Maid.CreateProp(0, 100, 43, MPN.ThighThickX, 2),
  354. Maid.CreateProp(0, 100, 40, MPN.ThighThickY, 2),
  355. Maid.CreateProp(0, 100, 35, MPN.KneeThickX, 2),
  356. Maid.CreateProp(0, 100, 35, MPN.KneeThickY, 2),
  357. Maid.CreateProp(0, 100, 35, MPN.CalfThickX, 2),
  358. Maid.CreateProp(0, 100, 38, MPN.CalfThickY, 2),
  359. Maid.CreateProp(0, 100, 35, MPN.AnkleThickX, 2),
  360. Maid.CreateProp(0, 100, 43, MPN.AnkleThickY, 2),
  361. Maid.CreateProp(0, 100, 50, MPN.FootSize, 2),
  362. Maid.CreateProp(0, 100, 50, MPN.UpperArmLowerThickX, 2),
  363. Maid.CreateProp(0, 100, 50, MPN.UpperArmLowerThickY, 2),
  364. Maid.CreateProp(0, 100, 50, MPN.WristThickX, 2),
  365. Maid.CreateProp(0, 100, 50, MPN.WristThickY, 2),
  366. Maid.CreateProp(0, 100, 50, MPN.ClavicleThick, 2),
  367. Maid.CreateProp(0, 100, 50, MPN.ShoulderTension, 2),
  368. Maid.CreateProp(0, 100, 35, MPN.ThighLowerThickX, 2),
  369. Maid.CreateProp(0, 100, 43, MPN.ThighLowerThickY, 2),
  370. Maid.CreateProp(0, 100, 50, MPN.ThighShin, 2),
  371. Maid.CreateProp(0, 100, 0, MPN.HaraN, 1),
  372. Maid.CreateProp(0, 100, 20, MPN.ChikubiH, 1),
  373. Maid.CreateProp(0, 100, 0, MPN.ChikubiK1, 1),
  374. Maid.CreateProp(0, 100, 0, MPN.ChikubiK2, 1),
  375. Maid.CreateProp(0, 100, 0, MPN.ChikubiK2_MuneS, 1),
  376. Maid.CreateProp(0, 100, 10, MPN.ChikubiR, 1),
  377. Maid.CreateProp(0, 100, 20, MPN.ChikubiW, 1),
  378. Maid.CreateProp(0, 100, 0, MPN.Nyurin1, 1),
  379. Maid.CreateProp(0, 100, 0, MPN.Nyurin2, 1),
  380. Maid.CreateProp(0, 100, 20, MPN.Nyurin3, 1),
  381. Maid.CreateProp(0, 100, 0, MPN.Nyurin4, 1),
  382. Maid.CreateProp(0, 100, 0, MPN.Nyurin5, 1),
  383. Maid.CreateProp(0, 100, 0, MPN.Nyurin6, 1),
  384. Maid.CreateProp(0, 100, 0, MPN.Nyurin7, 1),
  385. Maid.CreateProp(0, 100, 0, MPN.Nyurin8, 1),
  386. Maid.CreateProp(0, 100, 0, MPN.ChikubiWearTotsu, 1),
  387. Maid.CreateProp(0, 100, 50, MPN.MayuThick, 2),
  388. Maid.CreateProp(0, 100, 50, MPN.MayuLong, 2),
  389. Maid.CreateProp(0, 100, 50, MPN.Yorime, 2),
  390. Maid.CreateProp(0, 100, 50, MPN.MabutaUpIn, 1),
  391. Maid.CreateProp(0, 100, 50, MPN.MabutaUpIn2, 1),
  392. Maid.CreateProp(0, 100, 50, MPN.MabutaUpMiddle, 1),
  393. Maid.CreateProp(0, 100, 50, MPN.MabutaUpOut, 1),
  394. Maid.CreateProp(0, 100, 50, MPN.MabutaUpOut2, 1),
  395. Maid.CreateProp(0, 100, 50, MPN.MabutaLowIn, 1),
  396. Maid.CreateProp(0, 100, 50, MPN.MabutaLowUpMiddle, 1),
  397. Maid.CreateProp(0, 100, 50, MPN.MabutaLowUpOut, 1),
  398. Maid.CreateProp(0, 100, 0, MPN.Ha1, 1),
  399. Maid.CreateProp(0, 100, 0, MPN.Ha2, 1),
  400. Maid.CreateProp(0, 100, 0, MPN.Ha3, 1),
  401. Maid.CreateProp(0, 100, 0, MPN.Ha4, 1),
  402. Maid.CreateProp(0, 100, 0, MPN.Ha5, 1),
  403. Maid.CreateProp(0, 100, 0, MPN.Ha6, 1),
  404. Maid.CreateProp(0, 100, 50, MPN.FutaePosX, 2),
  405. Maid.CreateProp(0, 100, 50, MPN.FutaePosY, 2),
  406. Maid.CreateProp(0, 100, 50, MPN.FutaeRot, 2),
  407. Maid.CreateProp(0, 100, 50, MPN.HitomiHiPosX, 2),
  408. Maid.CreateProp(0, 100, 50, MPN.HitomiHiPosY, 2),
  409. Maid.CreateProp(0, 80, 50, MPN.HitomiHiSclY, 2),
  410. Maid.CreateProp(0, 100, 0, MPN.HitomiShapeUp, 1),
  411. Maid.CreateProp(0, 100, 0, MPN.HitomiShapeLow, 1),
  412. Maid.CreateProp(0, 100, 0, MPN.HitomiShapeIn, 1),
  413. Maid.CreateProp(0, 100, 0, MPN.HitomiShapeOutUp, 1),
  414. Maid.CreateProp(0, 100, 0, MPN.HitomiShapeOutLow, 1),
  415. Maid.CreateProp(0, 100, 50, MPN.HitomiRot, 2),
  416. Maid.CreateProp(0, 100, 0, MPN.HohoShape, 1),
  417. Maid.CreateProp(0, 100, 0, MPN.LipThick, 1),
  418. Maid.CreateProp(0, 100, 0, MPN.WearSuso, 2),
  419. Maid.CreateProp(0, 100, 100, MPN.KuikomiPants, 1),
  420. Maid.CreateProp(0, 100, 100, MPN.KuikomiStkg, 1),
  421. Maid.CreateProp(string.Empty, MPN.body, 3),
  422. Maid.CreateProp(string.Empty, MPN.head, 3),
  423. Maid.CreateProp(string.Empty, MPN.hairf, 3),
  424. Maid.CreateProp(string.Empty, MPN.hairr, 3),
  425. Maid.CreateProp(string.Empty, MPN.hairt, 3),
  426. Maid.CreateProp(string.Empty, MPN.hairs, 3),
  427. Maid.CreateProp(string.Empty, MPN.wear, 3),
  428. Maid.CreateProp(string.Empty, MPN.skirt, 3),
  429. Maid.CreateProp(string.Empty, MPN.mizugi, 3),
  430. Maid.CreateProp(string.Empty, MPN.mizugi_top, 3),
  431. Maid.CreateProp(string.Empty, MPN.mizugi_buttom, 3),
  432. Maid.CreateProp(string.Empty, MPN.bra, 3),
  433. Maid.CreateProp(string.Empty, MPN.panz, 3),
  434. Maid.CreateProp(string.Empty, MPN.slip, 3),
  435. Maid.CreateProp(string.Empty, MPN.stkg, 3),
  436. Maid.CreateProp(string.Empty, MPN.shoes, 3),
  437. Maid.CreateProp(string.Empty, MPN.headset, 3),
  438. Maid.CreateProp(string.Empty, MPN.glove, 3),
  439. Maid.CreateProp(string.Empty, MPN.acchead, 3),
  440. Maid.CreateProp(string.Empty, MPN.hairaho, 3),
  441. Maid.CreateProp(string.Empty, MPN.accha, 3),
  442. Maid.CreateProp(string.Empty, MPN.acchana, 3),
  443. Maid.CreateProp(string.Empty, MPN.accface, 3),
  444. Maid.CreateProp(string.Empty, MPN.acckamisub, 3),
  445. Maid.CreateProp(string.Empty, MPN.acckami, 3),
  446. Maid.CreateProp(string.Empty, MPN.accmimi, 3),
  447. Maid.CreateProp(string.Empty, MPN.accnip, 3),
  448. Maid.CreateProp(string.Empty, MPN.acckubi, 3),
  449. Maid.CreateProp(string.Empty, MPN.acckubiwa, 3),
  450. Maid.CreateProp(string.Empty, MPN.accheso, 3),
  451. Maid.CreateProp(string.Empty, MPN.accude, 3),
  452. Maid.CreateProp(string.Empty, MPN.accashi, 3),
  453. Maid.CreateProp(string.Empty, MPN.accsenaka, 3),
  454. Maid.CreateProp(string.Empty, MPN.accshippo, 3),
  455. Maid.CreateProp(string.Empty, MPN.acckoshi, 3),
  456. Maid.CreateProp(string.Empty, MPN.accanl, 3),
  457. Maid.CreateProp(string.Empty, MPN.accvag, 3),
  458. Maid.CreateProp(string.Empty, MPN.megane, 3),
  459. Maid.CreateProp(string.Empty, MPN.accxxx, 3),
  460. Maid.CreateProp(string.Empty, MPN.handitem, 3),
  461. Maid.CreateProp(string.Empty, MPN.acchat, 3),
  462. Maid.CreateProp(string.Empty, MPN.haircolor, 3),
  463. Maid.CreateProp(string.Empty, MPN.skin, 3),
  464. Maid.CreateProp(string.Empty, MPN.acctatoo, 3),
  465. Maid.CreateProp(string.Empty, MPN.accnail, 3),
  466. Maid.CreateProp(string.Empty, MPN.underhair, 3),
  467. Maid.CreateProp(string.Empty, MPN.asshair, 3),
  468. Maid.CreateProp(string.Empty, MPN.hokuro, 3),
  469. Maid.CreateProp(string.Empty, MPN.mayu, 3),
  470. Maid.CreateProp(string.Empty, MPN.lip, 3),
  471. Maid.CreateProp(string.Empty, MPN.eye, 3),
  472. Maid.CreateProp(string.Empty, MPN.eye_hi, 3),
  473. Maid.CreateProp(string.Empty, MPN.eye_hi_r, 3),
  474. Maid.CreateProp(string.Empty, MPN.chikubi, 3),
  475. Maid.CreateProp(string.Empty, MPN.chikubicolor, 3),
  476. Maid.CreateProp(string.Empty, MPN.eyewhite, 3),
  477. Maid.CreateProp(string.Empty, MPN.nose, 3),
  478. Maid.CreateProp(string.Empty, MPN.facegloss, 3),
  479. Maid.CreateProp(string.Empty, MPN.matsuge_up, 3),
  480. Maid.CreateProp(string.Empty, MPN.matsuge_low, 3),
  481. Maid.CreateProp(string.Empty, MPN.futae, 3),
  482. Maid.CreateProp(string.Empty, MPN.moza, 3),
  483. Maid.CreateProp(string.Empty, MPN.onepiece, 3),
  484. Maid.CreateProp(string.Empty, MPN.set_maidwear, 3),
  485. Maid.CreateProp(string.Empty, MPN.set_mywear, 3),
  486. Maid.CreateProp(string.Empty, MPN.set_underwear, 3),
  487. Maid.CreateProp(string.Empty, MPN.set_body, 3),
  488. Maid.CreateProp(string.Empty, MPN.set_face, 3),
  489. Maid.CreateProp(string.Empty, MPN.folder_eye, 3),
  490. Maid.CreateProp(string.Empty, MPN.folder_mayu, 3),
  491. Maid.CreateProp(string.Empty, MPN.folder_underhair, 3),
  492. Maid.CreateProp(string.Empty, MPN.folder_skin, 3),
  493. Maid.CreateProp(string.Empty, MPN.folder_eyewhite, 3),
  494. Maid.CreateProp(string.Empty, MPN.folder_matsuge_up, 3),
  495. Maid.CreateProp(string.Empty, MPN.folder_matsuge_low, 3),
  496. Maid.CreateProp(string.Empty, MPN.folder_futae, 3),
  497. Maid.CreateProp(string.Empty, MPN.kousoku_upper, 3),
  498. Maid.CreateProp(string.Empty, MPN.kousoku_lower, 3),
  499. Maid.CreateProp(string.Empty, MPN.seieki_naka, 3),
  500. Maid.CreateProp(string.Empty, MPN.seieki_hara, 3),
  501. Maid.CreateProp(string.Empty, MPN.seieki_face, 3),
  502. Maid.CreateProp(string.Empty, MPN.seieki_mune, 3),
  503. Maid.CreateProp(string.Empty, MPN.seieki_hip, 3),
  504. Maid.CreateProp(string.Empty, MPN.seieki_ude, 3),
  505. Maid.CreateProp(string.Empty, MPN.seieki_ashi, 3)
  506. };
  507. }
  508. public void Uninit()
  509. {
  510. this.Visible = false;
  511. this.boOffsetY = true;
  512. this.DelPrefabAll();
  513. Debug.Log("Uninit " + this.status.firstName);
  514. this.body0.UnInit();
  515. }
  516. private void OnDestroy()
  517. {
  518. this.DelPrefabAll();
  519. this.Uninit();
  520. }
  521. public void ManColorUpdate()
  522. {
  523. if (this.body0 != null)
  524. {
  525. this.body0.ManColorUpdate();
  526. }
  527. }
  528. public void ClearPropValueDefault()
  529. {
  530. foreach (MaidProp maidProp in this.m_aryMaidProp)
  531. {
  532. if (!(maidProp.name == "body"))
  533. {
  534. maidProp.temp_value = (maidProp.value = maidProp.value_Default);
  535. }
  536. }
  537. }
  538. public MaidProp GetProp(string tag)
  539. {
  540. return this.m_dicMaidProp[tag];
  541. }
  542. public MaidProp GetPropLower(string tagLower)
  543. {
  544. return (MaidProp)this.m_hashMaidPropLower[tagLower];
  545. }
  546. public MaidProp GetProp(MPN mpn)
  547. {
  548. return this.m_aryMaidProp[(int)mpn];
  549. }
  550. public static MaidProp CreateProp(string f_strDefFileName, MPN mpn, int type)
  551. {
  552. NDebug.Assert(type == 3, "プロパティオブジェクトのタイプが不正です。");
  553. MaidProp maidProp = new MaidProp();
  554. maidProp.name = mpn.ToString();
  555. maidProp.type = type;
  556. maidProp.listSubProp = null;
  557. maidProp.strFileName = f_strDefFileName;
  558. if (string.IsNullOrEmpty(maidProp.strFileName))
  559. {
  560. string strFileName = maidProp.strFileName;
  561. if (CM3.dicDelItem.TryGetValue(mpn, out strFileName))
  562. {
  563. maidProp.strFileName = strFileName;
  564. }
  565. }
  566. maidProp.nFileNameRID = maidProp.strFileName.ToLower().GetHashCode();
  567. maidProp.boDut = true;
  568. maidProp.boTempDut = false;
  569. maidProp.idx = (int)mpn;
  570. return maidProp;
  571. }
  572. public static MaidProp CreateProp(int minval, int maxval, int defval, MPN mpn, int type)
  573. {
  574. NDebug.Assert(type == 0 || type == 1 || type == 2, "プロパティオブジェクトのタイプが不正です。");
  575. MaidProp maidProp = new MaidProp();
  576. maidProp.name = mpn.ToString();
  577. maidProp.type = type;
  578. maidProp.min = minval;
  579. maidProp.max = maxval;
  580. if (defval < minval)
  581. {
  582. defval = minval;
  583. }
  584. if (defval > maxval)
  585. {
  586. defval = maxval;
  587. }
  588. maidProp.value_Default = defval;
  589. maidProp.listSubProp = null;
  590. maidProp.strFileName = string.Empty;
  591. maidProp.temp_value = (maidProp.value = defval);
  592. maidProp.idx = (int)mpn;
  593. maidProp.boDut = true;
  594. maidProp.boTempDut = false;
  595. return maidProp;
  596. }
  597. private void AddProp(MaidProp mp)
  598. {
  599. MPN idx = (MPN)mp.idx;
  600. this.m_dicMaidProp[idx.ToString()] = mp;
  601. this.m_aryMaidProp[(int)idx] = mp;
  602. this.m_hashMaidPropLower[idx.ToString().ToLower()] = mp;
  603. }
  604. private void AddProp(string f_strDefFileName, MPN mpn, int type)
  605. {
  606. this.AddProp(Maid.CreateProp(f_strDefFileName, mpn, type));
  607. }
  608. private void AddProp(int minval, int maxval, int defval, MPN mpn, int type)
  609. {
  610. this.AddProp(Maid.CreateProp(minval, maxval, defval, mpn, type));
  611. }
  612. public void Prop_AddValue(string tag, int val)
  613. {
  614. NDebug.Assert(this.m_dicMaidProp.ContainsKey(tag), "指定されたプロパティ名がありません。");
  615. this.Prop_AddValue(this.m_dicMaidProp[tag].idx, val);
  616. }
  617. public void Prop_AddValue(int idx, int val)
  618. {
  619. val += this.m_aryMaidProp[idx].value;
  620. if (this.m_aryMaidProp[idx].min > val)
  621. {
  622. val = this.m_aryMaidProp[idx].min;
  623. }
  624. if (this.m_aryMaidProp[idx].max < val)
  625. {
  626. val = this.m_aryMaidProp[idx].max;
  627. }
  628. if (this.m_aryMaidProp[idx].value_LinkMAX != 0 && this.m_aryMaidProp[this.m_aryMaidProp[idx].value_LinkMAX].value < val)
  629. {
  630. val = this.m_aryMaidProp[this.m_aryMaidProp[idx].value_LinkMAX].value;
  631. }
  632. if (this.m_aryMaidProp[idx].value != val)
  633. {
  634. this.m_aryMaidProp[idx].value = val;
  635. }
  636. this.m_aryMaidProp[idx].boDut = true;
  637. this.m_aryMaidProp[idx].boTempDut = false;
  638. }
  639. public void SetProp(string tag, int val, bool f_bTemp = false)
  640. {
  641. MPN idx = MPN.null_mpn;
  642. try
  643. {
  644. idx = (MPN)Enum.Parse(typeof(MPN), tag);
  645. }
  646. catch
  647. {
  648. NDebug.Assert("指定されたプロパティ名がありません。" + tag, false);
  649. }
  650. this.SetProp(idx, val, f_bTemp);
  651. }
  652. public void SetProp(MPN idx, int val, bool f_bTemp = false)
  653. {
  654. this.SetPropIn(idx, val, f_bTemp);
  655. if (this.pairMan != null)
  656. {
  657. int value = this.GetProp(MPN.Hara).value;
  658. if (this.IsCrcBody)
  659. {
  660. foreach (KeyValuePair<MPN, KeyValuePair<int, int>> keyValuePair in CM3.newManParaPairs)
  661. {
  662. this.SetPropIn(keyValuePair.Key, (int)((float)keyValuePair.Value.Key + ((float)(keyValuePair.Value.Value - keyValuePair.Value.Key) * ((float)value * 0.01f) + 0.5f)), f_bTemp);
  663. }
  664. this.pairMan.SetPropIn(MPN.Hara, value, f_bTemp);
  665. }
  666. else
  667. {
  668. foreach (KeyValuePair<MPN, KeyValuePair<int, int>> keyValuePair2 in CM3.newManParaPairs)
  669. {
  670. this.pairMan.SetPropIn(keyValuePair2.Key, (int)((float)keyValuePair2.Value.Key + ((float)(keyValuePair2.Value.Value - keyValuePair2.Value.Key) * ((float)value * 0.01f) + 0.5f)), f_bTemp);
  671. }
  672. this.SetPropIn(MPN.Hara, value, f_bTemp);
  673. }
  674. }
  675. }
  676. private void SetPropIn(MPN idx, int val, bool f_bTemp = false)
  677. {
  678. NDebug.Assert(idx != MPN.null_mpn, "指定されたプロパティ名がありません。" + base.tag);
  679. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  680. if (maidProp.min > val)
  681. {
  682. val = maidProp.min;
  683. }
  684. if (maidProp.max < val)
  685. {
  686. val = maidProp.max;
  687. }
  688. if (f_bTemp)
  689. {
  690. maidProp.temp_value = val;
  691. maidProp.boTempDut = true;
  692. }
  693. else
  694. {
  695. maidProp.value = val;
  696. maidProp.boDut = true;
  697. maidProp.boTempDut = false;
  698. }
  699. }
  700. public void SetProp(string tag, string filename, int f_nFileNameRID, bool f_bTemp = false, bool f_bNoScale = false)
  701. {
  702. NDebug.Assert(this.m_dicMaidProp.ContainsKey(tag), "指定されたプロパティ名がありません。" + tag);
  703. MaidProp mp = this.m_dicMaidProp[tag];
  704. this.SetProp(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
  705. }
  706. public void SetProp(MPN idx, string filename, int f_nFileNameRID, bool f_bTemp = false, bool f_bNoScale = false)
  707. {
  708. MaidProp mp = this.m_aryMaidProp[(int)idx];
  709. this.SetProp(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
  710. }
  711. public void SetProp(MaidProp mps, bool forceBody = false)
  712. {
  713. bool flag = false;
  714. bool flag2 = false;
  715. bool flag3 = false;
  716. MaidProp prop = this.GetProp((MPN)mps.idx);
  717. bool flag4 = prop.m_dicTBodySkinPos.Count != 0;
  718. flag = (prop.m_dicTBodyAttachPos.Count != 0);
  719. flag2 = (prop.m_dicMaterialProp.Count != 0);
  720. flag3 = (prop.m_dicBoneLength.Count != 0);
  721. if (forceBody || mps.idx != 139)
  722. {
  723. this.SetProp((MPN)mps.idx, mps.strFileName, mps.nFileNameRID, false, false);
  724. }
  725. if (flag4 || mps.m_dicTBodySkinPos.Count != 0)
  726. {
  727. MaidProp prop2 = this.GetProp((MPN)mps.idx);
  728. prop2.m_dicTBodySkinPos.Clear();
  729. foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, BoneAttachPos>> keyValuePair in mps.m_dicTBodySkinPos)
  730. {
  731. prop2.m_dicTBodySkinPos[keyValuePair.Key] = new KeyValuePair<int, BoneAttachPos>(keyValuePair.Value.Key, new BoneAttachPos(keyValuePair.Value.Value));
  732. }
  733. if (mps.idx != 139)
  734. {
  735. prop2.boDut = true;
  736. }
  737. prop2.boAdjustDut = true;
  738. }
  739. if (flag || mps.m_dicTBodyAttachPos.Count != 0)
  740. {
  741. MaidProp prop3 = this.GetProp((MPN)mps.idx);
  742. prop3.m_dicTBodyAttachPos.Clear();
  743. foreach (KeyValuePair<TBody.SlotID, Dictionary<string, KeyValuePair<int, VtxAttachPos>>> keyValuePair2 in mps.m_dicTBodyAttachPos)
  744. {
  745. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary = new Dictionary<string, KeyValuePair<int, VtxAttachPos>>();
  746. foreach (KeyValuePair<string, KeyValuePair<int, VtxAttachPos>> keyValuePair3 in keyValuePair2.Value)
  747. {
  748. dictionary[keyValuePair3.Key] = new KeyValuePair<int, VtxAttachPos>(keyValuePair3.Value.Key, new VtxAttachPos(keyValuePair3.Value.Value));
  749. }
  750. prop3.m_dicTBodyAttachPos[keyValuePair2.Key] = dictionary;
  751. }
  752. if (mps.idx != 139)
  753. {
  754. prop3.boDut = true;
  755. }
  756. prop3.boAdjustDut = true;
  757. }
  758. if (flag2 || mps.m_dicMaterialProp.Count != 0)
  759. {
  760. MaidProp prop4 = this.GetProp((MPN)mps.idx);
  761. prop4.m_dicMaterialProp.Clear();
  762. foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, MatPropSave>> keyValuePair4 in mps.m_dicMaterialProp)
  763. {
  764. prop4.m_dicMaterialProp[keyValuePair4.Key] = new KeyValuePair<int, MatPropSave>(keyValuePair4.Value.Key, new MatPropSave(keyValuePair4.Value.Value));
  765. }
  766. if (mps.idx != 139)
  767. {
  768. prop4.boDut = true;
  769. }
  770. prop4.boAdjustDut = true;
  771. }
  772. if (flag3 || mps.m_dicBoneLength.Count != 0)
  773. {
  774. MaidProp prop5 = this.GetProp((MPN)mps.idx);
  775. prop5.m_dicBoneLength.Clear();
  776. foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> keyValuePair5 in mps.m_dicBoneLength)
  777. {
  778. Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
  779. foreach (KeyValuePair<string, float> keyValuePair6 in keyValuePair5.Value.Value)
  780. {
  781. dictionary2[keyValuePair6.Key] = keyValuePair6.Value;
  782. }
  783. prop5.m_dicBoneLength[keyValuePair5.Key] = new KeyValuePair<int, Dictionary<string, float>>(keyValuePair5.Value.Key, dictionary2);
  784. }
  785. if (mps.idx != 139)
  786. {
  787. prop5.boDut = true;
  788. }
  789. prop5.boAdjustDut = true;
  790. }
  791. }
  792. private void SetProp(MaidProp mp, string filename, int f_nFileNameRID, bool f_bTemp, bool f_bNoScale = false)
  793. {
  794. Action action = delegate()
  795. {
  796. if (filename.IndexOf("crc_") != 0)
  797. {
  798. MPN idx = (MPN)mp.idx;
  799. if (idx == MPN.handitem || idx == MPN.accanl || idx == MPN.accvag || idx == MPN.kousoku_upper || idx == MPN.kousoku_lower)
  800. {
  801. string text = "crc_" + filename;
  802. if (GameUty.FileSystem.IsExistentFile(text))
  803. {
  804. filename = text;
  805. }
  806. else
  807. {
  808. Debug.LogWarningFormat("{0}が見つからなかったので{1}を装着しました。", new object[]
  809. {
  810. text,
  811. filename.Replace("crc_", string.Empty)
  812. });
  813. }
  814. }
  815. }
  816. };
  817. Action action2 = delegate()
  818. {
  819. if (filename.IndexOf("crc_") == 0)
  820. {
  821. MPN idx = (MPN)mp.idx;
  822. if (idx == MPN.handitem || idx == MPN.accanl || idx == MPN.accvag || idx == MPN.kousoku_upper || idx == MPN.kousoku_lower)
  823. {
  824. string text = filename.Replace("crc_", string.Empty);
  825. if (GameUty.FileSystem.IsExistentFile(text))
  826. {
  827. filename = text;
  828. }
  829. else
  830. {
  831. Debug.LogWarningFormat("{0}が見つからなかったので{1}を持たせました。", new object[]
  832. {
  833. text,
  834. "crc_" + filename
  835. });
  836. }
  837. }
  838. }
  839. };
  840. Action<bool> action3 = delegate(bool nowBody)
  841. {
  842. if (!this.boMAN)
  843. {
  844. return;
  845. }
  846. if (nowBody)
  847. {
  848. if (filename.ToLower().IndexOf("crc_") != 0)
  849. {
  850. string text;
  851. if (CM3.newManBodyMenuSwap.TryGetValue(filename.ToLower(), out text))
  852. {
  853. filename = text.ToLower();
  854. }
  855. else if (mp.idx == 141)
  856. {
  857. filename = "crc_mhead000_i_.menu";
  858. }
  859. else if (mp.idx == 139)
  860. {
  861. filename = "crc_mbluebody001_i_.menu";
  862. }
  863. }
  864. }
  865. else if (filename.ToLower().IndexOf("crc_") == 0)
  866. {
  867. string key = CM3.newManBodyMenuSwap.FirstOrDefault((KeyValuePair<string, string> x) => string.Compare(x.Value, filename, true) == 0).Key;
  868. if (!string.IsNullOrEmpty(key))
  869. {
  870. filename = key.ToLower();
  871. }
  872. else if (mp.idx == 141)
  873. {
  874. filename = "mhead000_i_.menu";
  875. }
  876. else if (mp.idx == 139)
  877. {
  878. filename = "mbody_i_.menu";
  879. }
  880. }
  881. };
  882. action3(this.IsCrcBody);
  883. if (this.IsCrcBody)
  884. {
  885. action();
  886. }
  887. else
  888. {
  889. action2();
  890. }
  891. this.SetPropIn(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
  892. if (this.pairMan != null)
  893. {
  894. MaidProp prop = this.pairMan.GetProp((MPN)mp.idx);
  895. if (f_bTemp)
  896. {
  897. prop.nTempFileNameRID = 0;
  898. prop.strTempFileName = string.Empty;
  899. }
  900. else
  901. {
  902. prop.nFileNameRID = 0;
  903. prop.strFileName = string.Empty;
  904. }
  905. action3(this.pairMan.IsCrcBody);
  906. if (this.pairMan.IsCrcBody)
  907. {
  908. action();
  909. }
  910. else
  911. {
  912. action2();
  913. }
  914. this.pairMan.SetPropIn(prop, filename, 0, f_bTemp, f_bNoScale);
  915. }
  916. }
  917. private void SetPropIn(MaidProp mp, string filename, int f_nFileNameRID, bool f_bTemp, bool f_bNoScale = false)
  918. {
  919. if (mp.idx == 139)
  920. {
  921. if (filename.IndexOf("crc_") == 0 || filename.IndexOf("crx_") == 0 || filename.IndexOf("gp03_") == 0)
  922. {
  923. mp.isCrcParts = true;
  924. }
  925. else
  926. {
  927. mp.isCrcParts = false;
  928. }
  929. }
  930. if (!this.boMAN && this.IsCrcBody && filename.IndexOf("crc_") != 0 && filename.IndexOf("crx_") != 0 && filename.IndexOf("gp03_") != 0 && GameUty.IsExistFile("crx_" + filename, null))
  931. {
  932. filename = "crx_" + filename;
  933. }
  934. if (f_bTemp)
  935. {
  936. if (filename != mp.strTempFileName)
  937. {
  938. mp.boTempDut = true;
  939. mp.strTempFileName = filename;
  940. mp.bNoScale = f_bNoScale;
  941. if (f_nFileNameRID == 0)
  942. {
  943. mp.nTempFileNameRID = filename.ToLower().GetHashCode();
  944. }
  945. else
  946. {
  947. mp.nTempFileNameRID = f_nFileNameRID;
  948. }
  949. if (Product.isPublic)
  950. {
  951. if (mp.idx == 173 && filename.ToLower() != "pants030_i_.menu")
  952. {
  953. this.SetProp(mp, "pants030_i_.menu", 0, f_bTemp, f_bNoScale);
  954. return;
  955. }
  956. if (mp.idx == 172 && filename.ToLower() != "bra030_i_.menu")
  957. {
  958. this.SetProp(mp, "bra030_i_.menu", 0, f_bTemp, f_bNoScale);
  959. return;
  960. }
  961. }
  962. }
  963. }
  964. else
  965. {
  966. if (mp.strFileName != filename || mp.bSubDut || (202 <= mp.idx && mp.idx <= 205))
  967. {
  968. mp.boDut = true;
  969. }
  970. mp.strFileName = filename;
  971. mp.bNoScale = f_bNoScale;
  972. if (f_nFileNameRID == 0)
  973. {
  974. mp.nFileNameRID = filename.ToLower().GetHashCode();
  975. }
  976. else
  977. {
  978. mp.nFileNameRID = f_nFileNameRID;
  979. }
  980. mp.strTempFileName = string.Empty;
  981. mp.nTempFileNameRID = 0;
  982. if (mp.listSubProp != null)
  983. {
  984. mp.listSubProp.Clear();
  985. }
  986. mp.bSubDut = false;
  987. mp.m_dicTBodySkinPos.Clear();
  988. mp.m_dicTBodyAttachPos.Clear();
  989. mp.m_dicMaterialProp.Clear();
  990. mp.m_dicBoneLength.Clear();
  991. if (Product.isPublic)
  992. {
  993. f_nFileNameRID = mp.nFileNameRID;
  994. if (filename.Contains("_del"))
  995. {
  996. f_nFileNameRID = 0;
  997. }
  998. if (mp.idx == 201)
  999. {
  1000. this.m_strBefOnepiceFileName = filename;
  1001. this.m_nBefOnepiceRID = f_nFileNameRID;
  1002. if (f_nFileNameRID != 0)
  1003. {
  1004. MaidProp prop = this.GetProp(MPN.wear);
  1005. if (!prop.strFileName.Contains("_del"))
  1006. {
  1007. this.m_strBefWearFileName = prop.strFileName;
  1008. this.m_nBefWearRID = prop.nFileNameRID;
  1009. }
  1010. MaidProp prop2 = this.GetProp(MPN.skirt);
  1011. if (!prop2.strFileName.Contains("_del"))
  1012. {
  1013. this.m_strBefSkirtFileName = prop2.strFileName;
  1014. this.m_nBefSkirtRID = prop2.nFileNameRID;
  1015. }
  1016. }
  1017. }
  1018. else if (mp.idx == 167)
  1019. {
  1020. this.m_strBefWearFileName = filename;
  1021. this.m_nBefWearRID = f_nFileNameRID;
  1022. if (f_nFileNameRID != 0 && this.m_nBefOnepiceRID != 0)
  1023. {
  1024. this.m_nBefOnepiceRID = 0;
  1025. if (this.m_nBefSkirtRID != 0)
  1026. {
  1027. this.SetProp(MPN.skirt, this.m_strBefSkirtFileName, this.m_nBefSkirtRID, false, false);
  1028. }
  1029. }
  1030. }
  1031. else if (mp.idx == 168)
  1032. {
  1033. this.m_strBefSkirtFileName = filename;
  1034. this.m_nBefSkirtRID = f_nFileNameRID;
  1035. if (f_nFileNameRID != 0 && this.m_nBefOnepiceRID != 0)
  1036. {
  1037. this.m_nBefOnepiceRID = 0;
  1038. if (this.m_nBefWearRID != 0)
  1039. {
  1040. this.SetProp(MPN.wear, this.m_strBefWearFileName, this.m_nBefWearRID, false, false);
  1041. }
  1042. }
  1043. }
  1044. else
  1045. {
  1046. if (mp.idx == 173 && filename.ToLower() != "pants030_i_.menu")
  1047. {
  1048. this.SetProp(mp, "pants030_i_.menu", 0, f_bTemp, f_bNoScale);
  1049. return;
  1050. }
  1051. if (mp.idx == 172 && filename.ToLower() != "bra030_i_.menu")
  1052. {
  1053. this.SetProp(mp, "bra030_i_.menu", 0, f_bTemp, f_bNoScale);
  1054. return;
  1055. }
  1056. }
  1057. }
  1058. }
  1059. if (mp.boTempDut && mp.boDut)
  1060. {
  1061. string[] array = new string[6];
  1062. array[0] = "SetProp:本元とTempのどうちらにも更新フラグが付いています。";
  1063. int num = 1;
  1064. MPN idx = (MPN)mp.idx;
  1065. array[num] = idx.ToString();
  1066. array[2] = " 元=";
  1067. array[3] = mp.strFileName;
  1068. array[4] = " Temp=";
  1069. array[5] = mp.strTempFileName;
  1070. Debug.LogWarning(string.Concat(array));
  1071. }
  1072. }
  1073. public bool DelProp(MPN idx, bool f_bTemp = false)
  1074. {
  1075. this.DelPropIn(idx, f_bTemp);
  1076. if (this.pairMan != null)
  1077. {
  1078. this.pairMan.DelPropIn(idx, f_bTemp);
  1079. }
  1080. return false;
  1081. }
  1082. private bool DelPropIn(MPN idx, bool f_bTemp = false)
  1083. {
  1084. string empty = string.Empty;
  1085. if (CM3.dicDelItem.TryGetValue(idx, out empty))
  1086. {
  1087. this.SetProp(idx, empty, 0, f_bTemp, false);
  1088. return true;
  1089. }
  1090. return false;
  1091. }
  1092. public void SetSubProp(MPN idx, int subno, string filename, int f_nFileNameRID = 0)
  1093. {
  1094. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  1095. if (maidProp.listSubProp == null)
  1096. {
  1097. maidProp.listSubProp = new List<SubProp>();
  1098. }
  1099. if (maidProp.listSubProp.Count<SubProp>() < subno + 1)
  1100. {
  1101. int num = maidProp.listSubProp.Count<SubProp>();
  1102. for (int i = num; i < subno + 1; i++)
  1103. {
  1104. maidProp.listSubProp.Add(null);
  1105. }
  1106. }
  1107. SubProp subProp = maidProp.listSubProp[subno];
  1108. if (subProp == null)
  1109. {
  1110. SubProp subProp2 = new SubProp();
  1111. maidProp.listSubProp[subno] = subProp2;
  1112. subProp = subProp2;
  1113. }
  1114. subProp.bDut = true;
  1115. subProp.strFileName = filename;
  1116. if (f_nFileNameRID == 0)
  1117. {
  1118. subProp.nFileNameRID = filename.ToLower().GetHashCode();
  1119. }
  1120. else
  1121. {
  1122. subProp.nFileNameRID = f_nFileNameRID;
  1123. }
  1124. maidProp.bSubDut = true;
  1125. }
  1126. public SubProp GetSubProp(MPN idx, int subno)
  1127. {
  1128. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  1129. SubProp result = null;
  1130. if (maidProp.listSubProp != null && subno < maidProp.listSubProp.Count)
  1131. {
  1132. result = maidProp.listSubProp[subno];
  1133. }
  1134. return result;
  1135. }
  1136. public void DelSubProp(MPN idx, int subno = -1)
  1137. {
  1138. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  1139. if (maidProp.listSubProp != null)
  1140. {
  1141. if (subno == -1)
  1142. {
  1143. maidProp.listSubProp.Clear();
  1144. }
  1145. else if (maidProp.listSubProp.Count > subno)
  1146. {
  1147. SubProp subProp = maidProp.listSubProp[subno];
  1148. if (subProp != null)
  1149. {
  1150. subProp.strFileName = string.Empty;
  1151. subProp.nFileNameRID = 0;
  1152. subProp.bDut = false;
  1153. }
  1154. }
  1155. }
  1156. maidProp.bSubDut = true;
  1157. }
  1158. public void ResetProp(string mpn, bool force_reset = false)
  1159. {
  1160. NDebug.Assert(this.m_dicMaidProp.ContainsKey(mpn), "指定されたプロパティ名がありません。" + base.tag);
  1161. MaidProp mp = this.m_dicMaidProp[mpn];
  1162. this.ResetProp(mp, force_reset);
  1163. }
  1164. public void ResetProp(MPN idx, bool force_reset = false)
  1165. {
  1166. MaidProp mp = this.m_aryMaidProp[(int)idx];
  1167. this.ResetProp(mp, force_reset);
  1168. }
  1169. public void ResetProp(MaidProp mp, bool force_reset = false)
  1170. {
  1171. this.ResetPropIn(mp, force_reset);
  1172. if (this.pairMan != null)
  1173. {
  1174. MaidProp prop = this.pairMan.GetProp((MPN)mp.idx);
  1175. this.ResetPropIn(prop, force_reset);
  1176. }
  1177. }
  1178. private void ResetPropIn(MaidProp mp, bool force_reset = false)
  1179. {
  1180. if ((mp.nTempFileNameRID != 0 && mp.nFileNameRID != mp.nTempFileNameRID) || mp.temp_value != mp.value || force_reset)
  1181. {
  1182. mp.boDut = true;
  1183. mp.strTempFileName = string.Empty;
  1184. mp.nTempFileNameRID = 0;
  1185. mp.temp_value = 0;
  1186. mp.boTempDut = false;
  1187. }
  1188. }
  1189. public void ItemChangeTemp(string mpn, string name)
  1190. {
  1191. MaidProp prop = this.GetProp(mpn);
  1192. SortedDictionary<string, string> sortedDictionary;
  1193. string filename;
  1194. if (prop.nFileNameRID != 0 && Menu.m_dicResourceRef.TryGetValue(prop.nFileNameRID, out sortedDictionary) && sortedDictionary.TryGetValue(name, out filename))
  1195. {
  1196. this.SetProp(mpn, filename, 0, true, false);
  1197. }
  1198. }
  1199. public bool IsItemChange(string mpn, string name)
  1200. {
  1201. MaidProp prop = this.GetProp(mpn);
  1202. return prop.nFileNameRID != 0 && Menu.m_dicResourceRef.ContainsKey(prop.nFileNameRID) && Menu.m_dicResourceRef[prop.nFileNameRID].ContainsKey(name) && string.Compare(this.GetProp(mpn).strTempFileName, Menu.m_dicResourceRef[prop.nFileNameRID][name], true) == 0;
  1203. }
  1204. public bool IsItemChangeEnabled(string mpn, string name)
  1205. {
  1206. MaidProp prop = this.GetProp(mpn);
  1207. return prop.nFileNameRID != 0 && Menu.m_dicResourceRef.ContainsKey(prop.nFileNameRID) && Menu.m_dicResourceRef[prop.nFileNameRID].ContainsKey(name);
  1208. }
  1209. public void DutPropAll()
  1210. {
  1211. this.DutPropAllIn();
  1212. if (this.pairMan != null)
  1213. {
  1214. this.pairMan.DutPropAllIn();
  1215. }
  1216. }
  1217. private void DutPropAllIn()
  1218. {
  1219. for (int i = 0; i < this.m_aryMaidProp.Length; i++)
  1220. {
  1221. MaidProp maidProp = this.m_aryMaidProp[i];
  1222. maidProp.boDut = true;
  1223. if (maidProp.listSubProp != null)
  1224. {
  1225. for (int j = 0; j < maidProp.listSubProp.Count; j++)
  1226. {
  1227. if (maidProp.listSubProp[j] != null)
  1228. {
  1229. maidProp.listSubProp[j].bDut = true;
  1230. }
  1231. }
  1232. }
  1233. }
  1234. }
  1235. public void SwapNewMaidProp(bool toNewBody)
  1236. {
  1237. if (toNewBody == this.IsCrcBody)
  1238. {
  1239. return;
  1240. }
  1241. MaidProp[] array = new MaidProp[this.m_aryMaidProp.Length];
  1242. byte[] partsColorOtherBin = null;
  1243. for (int i = 0; i < this.m_aryMaidProp.Length; i++)
  1244. {
  1245. array[i] = new MaidProp();
  1246. this.m_aryMaidProp[i].CopyTo(array[i]);
  1247. }
  1248. using (MemoryStream memoryStream = new MemoryStream())
  1249. {
  1250. BinaryWriter f_bwWrite = new BinaryWriter(memoryStream);
  1251. this.SerializeMultiColor(f_bwWrite);
  1252. partsColorOtherBin = memoryStream.ToArray();
  1253. }
  1254. bool visible = this.Visible;
  1255. this.Uninit();
  1256. this.Visible = visible;
  1257. if (toNewBody && !this.IsCrcBody)
  1258. {
  1259. if (this.m_maidPropOther == null)
  1260. {
  1261. CharacterMgr.Preset srcPreset = ImportCM.ImportPresetGP03(this, out this.m_crcPresetBin, "gp03_export_default.brd");
  1262. GameMain.Instance.CharacterMgr.CrcPresetCopy(this, srcPreset);
  1263. }
  1264. else
  1265. {
  1266. for (int j = 0; j < this.m_maidPropOther.Length; j++)
  1267. {
  1268. this.AddProp(this.m_maidPropOther[j]);
  1269. this.m_maidPropOther[j].boDut = true;
  1270. }
  1271. using (MemoryStream memoryStream2 = new MemoryStream(this.m_partsColorOtherBin))
  1272. {
  1273. BinaryReader f_brRead = new BinaryReader(memoryStream2);
  1274. this.DeserializeMultiColor(f_brRead);
  1275. }
  1276. }
  1277. }
  1278. else if (!toNewBody && this.IsCrcBody)
  1279. {
  1280. for (int k = 0; k < this.m_maidPropOther.Length; k++)
  1281. {
  1282. this.AddProp(this.m_maidPropOther[k]);
  1283. this.m_maidPropOther[k].boDut = true;
  1284. }
  1285. using (MemoryStream memoryStream3 = new MemoryStream(this.m_partsColorOtherBin))
  1286. {
  1287. BinaryReader f_brRead2 = new BinaryReader(memoryStream3);
  1288. this.DeserializeMultiColor(f_brRead2);
  1289. }
  1290. }
  1291. this.m_maidPropOther = array;
  1292. this.m_partsColorOtherBin = partsColorOtherBin;
  1293. this.AllProcPropSeqStart();
  1294. }
  1295. public void ExportBridgeGP03(string tempPath)
  1296. {
  1297. using (MemoryStream memoryStream = new MemoryStream())
  1298. {
  1299. BinaryWriter binaryWriter = new BinaryWriter(memoryStream);
  1300. binaryWriter.Write("GP03_BRIDGE");
  1301. binaryWriter.Write(2000);
  1302. binaryWriter.Write(this.status.guid);
  1303. binaryWriter.Write(0);
  1304. if (this.m_crcPresetBin != null)
  1305. {
  1306. binaryWriter.Write(this.m_crcPresetBin.Length);
  1307. binaryWriter.Write(this.m_crcPresetBin);
  1308. }
  1309. else
  1310. {
  1311. binaryWriter.Write(0);
  1312. }
  1313. File.WriteAllBytes(tempPath + "\\gp03_export_" + this.status.guid + ".brd", memoryStream.ToArray());
  1314. this.status.RenewSaveDataGuidGP03ToTemp();
  1315. }
  1316. }
  1317. public bool ImportBreadgeGP03(string tempPath)
  1318. {
  1319. string saveDataGuidGP03Temp = this.status.saveDataGuidGP03Temp;
  1320. NDebug.Assert(!string.IsNullOrEmpty(saveDataGuidGP03Temp), "import breadge error. temp guid is null");
  1321. string text = "gp03_export_" + saveDataGuidGP03Temp + ".brd";
  1322. string text2 = string.Concat(new string[]
  1323. {
  1324. tempPath,
  1325. "\\",
  1326. saveDataGuidGP03Temp,
  1327. "\\",
  1328. text
  1329. });
  1330. if (!File.Exists(text2))
  1331. {
  1332. NDebug.Assert("import .brd file not existed. -> " + text2, true);
  1333. if (!this.IsCrcBody)
  1334. {
  1335. this.SwapNewMaidProp(true);
  1336. }
  1337. return false;
  1338. }
  1339. string text3 = UTY.gameProjectPath + "\\SaveData\\_gp03_import\\" + saveDataGuidGP03Temp;
  1340. UTY.DirectorySafeDelete(text3, new string[]
  1341. {
  1342. "brd",
  1343. "model",
  1344. "menu",
  1345. "tex",
  1346. "mat",
  1347. "sad",
  1348. "dbcol",
  1349. "dbconf",
  1350. ".sref"
  1351. }, SearchOption.TopDirectoryOnly);
  1352. Directory.Move(tempPath + "\\" + saveDataGuidGP03Temp, text3);
  1353. GameUty.ReloadCrcImportPath();
  1354. CharacterMgr.Preset preset = ImportCM.ImportPresetGP03(this, out this.m_crcPresetBin, text);
  1355. if (preset == null)
  1356. {
  1357. NDebug.MessageBox("Import Error", "import preset file is not valid. -> " + text2);
  1358. return false;
  1359. }
  1360. byte[] crcPresetBin = this.m_crcPresetBin;
  1361. if (!this.IsCrcBody)
  1362. {
  1363. this.SwapNewMaidProp(true);
  1364. }
  1365. this.m_crcPresetBin = crcPresetBin;
  1366. GameMain.Instance.CharacterMgr.CrcPresetCopy(this, preset);
  1367. string saveDataGuidGP = this.status.saveDataGuidGP03;
  1368. this.status.RenewSaveDataGuidGP03FromTemp();
  1369. try
  1370. {
  1371. ImportCM.DeleteSaveDataNoReferenceMaidGP03(saveDataGuidGP);
  1372. GameUty.ReloadCrcImportPath();
  1373. }
  1374. catch (Exception ex)
  1375. {
  1376. Debug.LogError("maid data delete faild. -> " + saveDataGuidGP);
  1377. }
  1378. return true;
  1379. }
  1380. public void SetUpModel(string f_strPresetMenuFileName)
  1381. {
  1382. Menu.ProcScript(this, f_strPresetMenuFileName, false, null);
  1383. this.body0.FixMaskFlag();
  1384. this.body0.FixVisibleFlag(false);
  1385. this.AllProcPropSeqStart();
  1386. if (!this.boMAN)
  1387. {
  1388. }
  1389. }
  1390. public void AllProcPropSeqStart()
  1391. {
  1392. this.AllProcPropSeqStartIn();
  1393. if (this.pairMan != null)
  1394. {
  1395. this.pairMan.AllProcPropSeqStartIn();
  1396. }
  1397. }
  1398. private void AllProcPropSeqStartIn()
  1399. {
  1400. this.boAllProcPropBUSY = true;
  1401. this.boModelChg = false;
  1402. this.AllProcProp2Fase = 0;
  1403. this.AllProcProp2Cnt = 0;
  1404. this.bodyReloaded = false;
  1405. }
  1406. private void AllProcPropSeq()
  1407. {
  1408. this.AllProcPropSeqIn();
  1409. if (this.pairMan != null)
  1410. {
  1411. this.pairMan.AllProcPropSeqIn();
  1412. }
  1413. }
  1414. private void AllProcPropSeqIn()
  1415. {
  1416. if (this.AllProcProp2Fase == 0)
  1417. {
  1418. while (this.AllProcProp2Fase == 0)
  1419. {
  1420. MaidProp maidProp = this.m_aryMaidProp[this.AllProcProp2Cnt];
  1421. this.AllProcProp2Cnt++;
  1422. if (this.m_aryMaidProp.Length == this.AllProcProp2Cnt)
  1423. {
  1424. this.AllProcProp2Cnt = 0;
  1425. if (Array.Find<MaidProp>(this.m_aryMaidProp, (MaidProp m) => m.type == 3 && (m.boDut || m.boTempDut)) == null)
  1426. {
  1427. this.AllProcProp2Fase++;
  1428. }
  1429. }
  1430. if (maidProp == null)
  1431. {
  1432. string str = "AllProcProp2_Proc MPNがNULLです。";
  1433. MPN allProcProp2Cnt = (MPN)this.AllProcProp2Cnt;
  1434. NDebug.Assert(str + allProcProp2Cnt.ToString(), false);
  1435. }
  1436. if (maidProp.type == 3 && this.ProcItem(this.m_dicMaidProp[maidProp.name]))
  1437. {
  1438. if (!this.boModelChg)
  1439. {
  1440. this.body0.FixVisibleFlag(true);
  1441. this.boModelChg = true;
  1442. }
  1443. if (maidProp.idx == 139)
  1444. {
  1445. for (int i = 140; i <= 201; i++)
  1446. {
  1447. this.GetProp((MPN)i).boDut = true;
  1448. }
  1449. for (int j = 1; j <= 78; j++)
  1450. {
  1451. this.GetProp((MPN)j).boDut = true;
  1452. }
  1453. this.GetProp(MPN.moza).boDut = true;
  1454. this.bodyReloaded = true;
  1455. }
  1456. else if (maidProp.idx == 146 || maidProp.idx == 142 || maidProp.idx == 143 || maidProp.idx == 145 || maidProp.idx == 144)
  1457. {
  1458. this.GetProp(MPN.haircolor).boDut = true;
  1459. }
  1460. else if (maidProp.idx == 141)
  1461. {
  1462. MPN[] array = new MPN[]
  1463. {
  1464. MPN.skin,
  1465. MPN.eye,
  1466. MPN.mayu,
  1467. MPN.eye_hi,
  1468. MPN.eye_hi_r,
  1469. MPN.EyeClose,
  1470. MPN.EarNone,
  1471. MPN.EarElf,
  1472. MPN.EarRot,
  1473. MPN.EarScl,
  1474. MPN.NosePos,
  1475. MPN.NoseScl,
  1476. MPN.FaceShape,
  1477. MPN.FaceShapeSlim,
  1478. MPN.MayuShapeIn,
  1479. MPN.MayuShapeOut,
  1480. MPN.MayuX,
  1481. MPN.MayuY,
  1482. MPN.MayuRot,
  1483. MPN.eye_hi_r,
  1484. MPN.eyewhite,
  1485. MPN.nose,
  1486. MPN.facegloss,
  1487. MPN.lip,
  1488. MPN.MayuThick,
  1489. MPN.MayuLong,
  1490. MPN.Yorime,
  1491. MPN.MabutaUpIn,
  1492. MPN.MabutaUpIn2,
  1493. MPN.MabutaUpMiddle,
  1494. MPN.MabutaUpOut,
  1495. MPN.MabutaUpOut2,
  1496. MPN.MabutaLowIn,
  1497. MPN.MabutaLowUpMiddle,
  1498. MPN.MabutaLowUpOut,
  1499. MPN.HeadX,
  1500. MPN.HeadY
  1501. };
  1502. foreach (MPN mpn in array)
  1503. {
  1504. this.GetProp(mpn).boDut = true;
  1505. }
  1506. }
  1507. else if (maidProp.idx == 148)
  1508. {
  1509. MaidProp prop = this.GetProp(MPN.acctatoo);
  1510. prop.boDut = true;
  1511. if (prop.listSubProp != null)
  1512. {
  1513. for (int l = 0; l < prop.listSubProp.Count; l++)
  1514. {
  1515. if (prop.listSubProp[l] != null)
  1516. {
  1517. prop.listSubProp[l].bDut = true;
  1518. }
  1519. }
  1520. }
  1521. prop = this.GetProp(MPN.hokuro);
  1522. prop.boDut = true;
  1523. if (prop.listSubProp != null)
  1524. {
  1525. for (int n = 0; n < prop.listSubProp.Count; n++)
  1526. {
  1527. if (prop.listSubProp[n] != null)
  1528. {
  1529. prop.listSubProp[n].bDut = true;
  1530. }
  1531. }
  1532. }
  1533. this.GetProp(MPN.lip).boDut = true;
  1534. this.GetProp(MPN.nose).boDut = true;
  1535. this.GetProp(MPN.facegloss).boDut = true;
  1536. this.GetProp(MPN.matsuge_up).boDut = true;
  1537. this.GetProp(MPN.matsuge_low).boDut = true;
  1538. this.GetProp(MPN.futae).boDut = true;
  1539. }
  1540. else if (167 <= maidProp.idx && maidProp.idx <= 201)
  1541. {
  1542. this.GetProp(MPN.WearSuso).boDut = true;
  1543. this.GetProp(MPN.KuikomiPants).boDut = true;
  1544. this.GetProp(MPN.KuikomiStkg).boDut = true;
  1545. this.GetProp(MPN.ChikubiWearTotsu).boDut = true;
  1546. }
  1547. break;
  1548. }
  1549. }
  1550. }
  1551. else if (this.AllProcProp2Fase == 1)
  1552. {
  1553. this.AllProcProp2Fase++;
  1554. }
  1555. else if (this.AllProcProp2Fase == 2)
  1556. {
  1557. bool flag = false;
  1558. foreach (MaidProp maidProp2 in this.m_dicMaidProp.Values)
  1559. {
  1560. if (maidProp2.type != 3)
  1561. {
  1562. flag |= this.ProcItem(maidProp2);
  1563. }
  1564. }
  1565. if (flag)
  1566. {
  1567. this.body0.ItemScaleReset();
  1568. if (this.body0.IsCrcBody)
  1569. {
  1570. ((TMorphBone)this.body0.bonemorph).UpdateBoneDistanceToSkin();
  1571. }
  1572. }
  1573. this.AllProcProp2Fase++;
  1574. }
  1575. else if (this.AllProcProp2Fase == 3)
  1576. {
  1577. if (this.boModelChg)
  1578. {
  1579. this.body0.MulTexProc();
  1580. this.body0.FixMaskFlag();
  1581. this.body0.FixVisibleFlag(false);
  1582. }
  1583. this.AllProcProp2Fase++;
  1584. }
  1585. else if (this.AllProcProp2Fase == 4)
  1586. {
  1587. this.ProcSSParam();
  1588. this.AllProcProp2Fase++;
  1589. }
  1590. else if (this.AllProcProp2Fase == 5)
  1591. {
  1592. this.boAllProcPropBUSY = false;
  1593. if (this.bodyReloaded)
  1594. {
  1595. this.body0.ReloadAnimation();
  1596. this.bodyReloaded = false;
  1597. }
  1598. }
  1599. }
  1600. public void AllProcProp()
  1601. {
  1602. this.AllProcPropIn();
  1603. if (this.pairMan != null)
  1604. {
  1605. this.pairMan.AllProcPropIn();
  1606. }
  1607. }
  1608. private void AllProcPropIn()
  1609. {
  1610. if (Product.isPublic)
  1611. {
  1612. this.AllProcPropSeqStart();
  1613. if (this.boAllProcPropBUSY || (!(this.pairMan == null) && this.pairMan.boAllProcPropBUSY))
  1614. {
  1615. this.AllProcPropSeq();
  1616. }
  1617. return;
  1618. }
  1619. this.boModelChg = false;
  1620. this.bodyReloaded = false;
  1621. float realtimeSinceStartup = Time.realtimeSinceStartup;
  1622. for (;;)
  1623. {
  1624. if (Array.Find<MaidProp>(this.m_aryMaidProp, (MaidProp m) => m.type == 3 && (m.boDut || m.boTempDut)) == null)
  1625. {
  1626. break;
  1627. }
  1628. for (int i = 0; i < this.m_aryMaidProp.Length; i++)
  1629. {
  1630. MaidProp maidProp = this.m_aryMaidProp[i];
  1631. string name = maidProp.name;
  1632. if (maidProp.type == 3 && this.ProcItem(this.m_dicMaidProp[name]))
  1633. {
  1634. if (!this.boModelChg)
  1635. {
  1636. this.body0.FixVisibleFlag(true);
  1637. this.boModelChg = true;
  1638. }
  1639. if (maidProp.idx == 139)
  1640. {
  1641. for (int j = 140; j <= 201; j++)
  1642. {
  1643. this.GetProp((MPN)j).boDut = true;
  1644. }
  1645. for (int k = 1; k <= 78; k++)
  1646. {
  1647. this.GetProp((MPN)k).boDut = true;
  1648. }
  1649. this.GetProp(MPN.moza).boDut = true;
  1650. this.bodyReloaded = true;
  1651. }
  1652. else if (maidProp.idx == 146 || maidProp.idx == 142 || maidProp.idx == 143 || maidProp.idx == 145 || maidProp.idx == 144)
  1653. {
  1654. this.GetProp(MPN.haircolor).boDut = true;
  1655. }
  1656. else if (maidProp.idx == 141)
  1657. {
  1658. MPN[] array = new MPN[]
  1659. {
  1660. MPN.skin,
  1661. MPN.eye,
  1662. MPN.mayu,
  1663. MPN.eye_hi,
  1664. MPN.eye_hi_r,
  1665. MPN.EyeClose,
  1666. MPN.EarNone,
  1667. MPN.EarElf,
  1668. MPN.EarRot,
  1669. MPN.EarScl,
  1670. MPN.NosePos,
  1671. MPN.NoseScl,
  1672. MPN.FaceShape,
  1673. MPN.FaceShapeSlim,
  1674. MPN.MayuShapeIn,
  1675. MPN.MayuShapeOut,
  1676. MPN.MayuX,
  1677. MPN.MayuY,
  1678. MPN.MayuRot,
  1679. MPN.eye_hi_r,
  1680. MPN.eyewhite,
  1681. MPN.nose,
  1682. MPN.facegloss,
  1683. MPN.lip,
  1684. MPN.MayuThick,
  1685. MPN.MayuLong,
  1686. MPN.Yorime,
  1687. MPN.MabutaUpIn,
  1688. MPN.MabutaUpIn2,
  1689. MPN.MabutaUpMiddle,
  1690. MPN.MabutaUpOut,
  1691. MPN.MabutaUpOut2,
  1692. MPN.MabutaLowIn,
  1693. MPN.MabutaLowUpMiddle,
  1694. MPN.MabutaLowUpOut,
  1695. MPN.HeadX,
  1696. MPN.HeadY
  1697. };
  1698. foreach (MPN mpn in array)
  1699. {
  1700. this.GetProp(mpn).boDut = true;
  1701. }
  1702. }
  1703. else if (maidProp.idx == 148)
  1704. {
  1705. MaidProp prop = this.GetProp(MPN.acctatoo);
  1706. prop.boDut = true;
  1707. if (prop.listSubProp != null)
  1708. {
  1709. for (int m2 = 0; m2 < prop.listSubProp.Count; m2++)
  1710. {
  1711. if (prop.listSubProp[m2] != null)
  1712. {
  1713. prop.listSubProp[m2].bDut = true;
  1714. }
  1715. }
  1716. }
  1717. prop = this.GetProp(MPN.hokuro);
  1718. prop.boDut = true;
  1719. if (prop.listSubProp != null)
  1720. {
  1721. for (int n = 0; n < prop.listSubProp.Count; n++)
  1722. {
  1723. if (prop.listSubProp[n] != null)
  1724. {
  1725. prop.listSubProp[n].bDut = true;
  1726. }
  1727. }
  1728. }
  1729. this.GetProp(MPN.lip).boDut = true;
  1730. this.GetProp(MPN.nose).boDut = true;
  1731. this.GetProp(MPN.facegloss).boDut = true;
  1732. this.GetProp(MPN.matsuge_up).boDut = true;
  1733. this.GetProp(MPN.matsuge_low).boDut = true;
  1734. this.GetProp(MPN.futae).boDut = true;
  1735. }
  1736. else if (167 <= maidProp.idx && maidProp.idx <= 201)
  1737. {
  1738. this.GetProp(MPN.WearSuso).boDut = true;
  1739. this.GetProp(MPN.KuikomiPants).boDut = true;
  1740. this.GetProp(MPN.KuikomiStkg).boDut = true;
  1741. this.GetProp(MPN.ChikubiWearTotsu).boDut = true;
  1742. }
  1743. }
  1744. }
  1745. }
  1746. realtimeSinceStartup = Time.realtimeSinceStartup;
  1747. bool flag = false;
  1748. foreach (MaidProp maidProp2 in this.m_dicMaidProp.Values)
  1749. {
  1750. if (maidProp2.type != 3)
  1751. {
  1752. flag |= this.ProcItem(maidProp2);
  1753. }
  1754. }
  1755. if (flag)
  1756. {
  1757. this.body0.ItemScaleReset();
  1758. }
  1759. realtimeSinceStartup = Time.realtimeSinceStartup;
  1760. if (this.boModelChg)
  1761. {
  1762. this.body0.MulTexProc();
  1763. this.body0.FixMaskFlag();
  1764. this.body0.FixVisibleFlag(false);
  1765. }
  1766. realtimeSinceStartup = Time.realtimeSinceStartup;
  1767. this.ProcSSParam();
  1768. if (this.bodyReloaded)
  1769. {
  1770. this.body0.ReloadAnimation();
  1771. this.bodyReloaded = false;
  1772. }
  1773. }
  1774. private bool ProcItem(MaidProp mp)
  1775. {
  1776. bool result = false;
  1777. string name = mp.name;
  1778. if (mp.type == 1)
  1779. {
  1780. if (mp.boTempDut)
  1781. {
  1782. mp.boTempDut = false;
  1783. this.body0.VertexMorph_FromProcItem(name, (float)mp.temp_value / 100f);
  1784. result = true;
  1785. }
  1786. if (mp.boDut)
  1787. {
  1788. mp.boDut = false;
  1789. this.body0.VertexMorph_FromProcItem(name, (float)mp.value / 100f);
  1790. result = true;
  1791. }
  1792. }
  1793. else if (mp.type == 2)
  1794. {
  1795. if (mp.boTempDut)
  1796. {
  1797. mp.boTempDut = false;
  1798. this.body0.BoneMorph_FromProcItem(name, (float)mp.temp_value / 100f);
  1799. result = true;
  1800. }
  1801. if (mp.boDut)
  1802. {
  1803. mp.boDut = false;
  1804. this.body0.BoneMorph_FromProcItem(name, (float)mp.value / 100f);
  1805. result = true;
  1806. }
  1807. }
  1808. else if (mp.type == 3)
  1809. {
  1810. if (Product.isPublic && (mp.boTempDut || mp.boDut) && (mp.idx == 140 || mp.idx == 151 || mp.idx == 152 || mp.idx == 156 || mp.idx == 157 || mp.idx == 140 || mp.idx == 186 || mp.idx == 195 || mp.idx == 196 || mp.idx == 198))
  1811. {
  1812. mp.boDut = false;
  1813. mp.boTempDut = false;
  1814. }
  1815. if (mp.boTempDut && mp.boDut)
  1816. {
  1817. string[] array = new string[6];
  1818. array[0] = "Item実行を、本元とTempを同時に更新しようとしました。";
  1819. int num = 1;
  1820. MPN idx = (MPN)mp.idx;
  1821. array[num] = idx.ToString();
  1822. array[2] = " 元=";
  1823. array[3] = mp.strFileName;
  1824. array[4] = " Temp=";
  1825. array[5] = mp.strTempFileName;
  1826. Debug.LogWarning(string.Concat(array));
  1827. }
  1828. if (mp.boTempDut)
  1829. {
  1830. if (!string.IsNullOrEmpty(mp.strTempFileName) && !Menu.ProcScript(this, mp, true, null))
  1831. {
  1832. Debug.LogWarning("メニューファイル " + mp.strFileName + " が開けませんでした。");
  1833. mp.nTempFileNameRID = 0;
  1834. mp.strTempFileName = string.Empty;
  1835. }
  1836. result = true;
  1837. mp.boTempDut = false;
  1838. if (202 <= mp.idx && mp.idx <= 205)
  1839. {
  1840. mp.nTempFileNameRID = 0;
  1841. mp.strTempFileName = string.Empty;
  1842. }
  1843. }
  1844. if (mp.boDut)
  1845. {
  1846. if (!string.IsNullOrEmpty(mp.strFileName) && !Menu.ProcScript(this, mp, false, null))
  1847. {
  1848. Debug.LogWarning("メニューファイル " + mp.strFileName + " が開けませんでした。");
  1849. if (this.DelProp((MPN)mp.idx, false))
  1850. {
  1851. Menu.ProcScript(this, mp, false, null);
  1852. }
  1853. }
  1854. result = true;
  1855. mp.boDut = false;
  1856. if (202 <= mp.idx && mp.idx <= 205)
  1857. {
  1858. mp.nFileNameRID = 0;
  1859. mp.strFileName = string.Empty;
  1860. }
  1861. }
  1862. if (mp.listSubProp != null)
  1863. {
  1864. for (int i = 0; i < mp.listSubProp.Count; i++)
  1865. {
  1866. SubProp subProp = mp.listSubProp[i];
  1867. if (subProp != null && subProp.bDut)
  1868. {
  1869. if (!Menu.ProcScript(this, subProp.strFileName, false, subProp))
  1870. {
  1871. Debug.LogWarning("サブメニューファイル " + subProp.strFileName + " が開けませんでした。");
  1872. mp.listSubProp[i] = null;
  1873. }
  1874. result = true;
  1875. subProp.bDut = false;
  1876. }
  1877. }
  1878. }
  1879. if (mp.boAdjustDut)
  1880. {
  1881. if (this.body0.isLoadedBody)
  1882. {
  1883. foreach (KeyValuePair<TBody.SlotID, Dictionary<string, KeyValuePair<int, VtxAttachPos>>> keyValuePair in mp.m_dicTBodyAttachPos)
  1884. {
  1885. TBodySkin tbodySkin = this.body0.goSlot[(int)keyValuePair.Key];
  1886. if (tbodySkin.morph != null)
  1887. {
  1888. foreach (KeyValuePair<string, KeyValuePair<int, VtxAttachPos>> keyValuePair2 in keyValuePair.Value)
  1889. {
  1890. tbodySkin.morph.SetAttachPointOffsetLocal(keyValuePair2.Key, keyValuePair2.Value.Value);
  1891. result = true;
  1892. }
  1893. }
  1894. }
  1895. }
  1896. mp.boAdjustDut = false;
  1897. }
  1898. }
  1899. return result;
  1900. }
  1901. public bool MayuDrawPriority
  1902. {
  1903. get
  1904. {
  1905. string materialProperty = this.body0.GetMaterialProperty("head", 3, "_ZTest2", "AUTO");
  1906. if (!string.IsNullOrEmpty(materialProperty))
  1907. {
  1908. float num = 0f;
  1909. if (float.TryParse(materialProperty, out num))
  1910. {
  1911. if ((int)(num + 0.5f) == 1)
  1912. {
  1913. return false;
  1914. }
  1915. if ((int)(num + 0.5f) == 7)
  1916. {
  1917. return true;
  1918. }
  1919. }
  1920. }
  1921. return false;
  1922. }
  1923. set
  1924. {
  1925. this.body0.SetMaterialProperty("mayu", "head", 3, "_ZTest2", "UnityEngine.Rendering.CompareFunction", (!value) ? "1" : "7", true);
  1926. }
  1927. }
  1928. public int MayuAlpha
  1929. {
  1930. get
  1931. {
  1932. string materialProperty = this.body0.GetMaterialProperty("head", 3, "_Color", "Color");
  1933. if (string.IsNullOrEmpty(materialProperty))
  1934. {
  1935. return 0;
  1936. }
  1937. string[] array = materialProperty.Split(new char[]
  1938. {
  1939. ':'
  1940. });
  1941. if (array == null || array.Length != 4)
  1942. {
  1943. return 0;
  1944. }
  1945. return (int)(float.Parse(array[3]) * 100f);
  1946. }
  1947. set
  1948. {
  1949. this.body0.SetMaterialProperty("mayu", "head", 3, "_Color", "Color", "1.0:1.0:1.0:" + ((float)value / 100f).ToString(), true);
  1950. }
  1951. }
  1952. public void SubPropAlpha(MPN f_mpn, int f_nSubNo, float f_fTexMulAlpha)
  1953. {
  1954. MaidProp maidProp = this.m_aryMaidProp[(int)f_mpn];
  1955. if (maidProp.listSubProp.Count <= f_nSubNo)
  1956. {
  1957. Debug.LogError("listSubProp の範囲を超えています。");
  1958. return;
  1959. }
  1960. SubProp subProp = maidProp.listSubProp[f_nSubNo];
  1961. if (subProp == null)
  1962. {
  1963. Debug.LogError("listSubProp に " + f_nSubNo + " 番はありません。");
  1964. return;
  1965. }
  1966. subProp.fTexMulAlpha = f_fTexMulAlpha;
  1967. }
  1968. public bool SerializeProp(BinaryWriter f_bwWrite)
  1969. {
  1970. f_bwWrite.Write("CM3D2_MPROP_LIST");
  1971. f_bwWrite.Write(2001);
  1972. f_bwWrite.Write(this.m_dicMaidProp.Count);
  1973. int num = 0;
  1974. foreach (KeyValuePair<string, MaidProp> keyValuePair in this.m_dicMaidProp)
  1975. {
  1976. f_bwWrite.Write(keyValuePair.Key);
  1977. keyValuePair.Value.Serialize(f_bwWrite);
  1978. num++;
  1979. }
  1980. f_bwWrite.Write((this.m_maidPropOther != null) ? this.m_maidPropOther.Length : 0);
  1981. if (this.m_maidPropOther != null)
  1982. {
  1983. foreach (MaidProp maidProp in this.m_maidPropOther)
  1984. {
  1985. f_bwWrite.Write(maidProp.name);
  1986. maidProp.Serialize(f_bwWrite);
  1987. }
  1988. }
  1989. f_bwWrite.Write((this.m_partsColorOtherBin != null) ? this.m_partsColorOtherBin.Length : 0);
  1990. if (this.m_partsColorOtherBin != null && this.m_partsColorOtherBin.Length != 0)
  1991. {
  1992. f_bwWrite.Write(this.m_partsColorOtherBin);
  1993. }
  1994. f_bwWrite.Write((this.m_crcPresetBin != null) ? this.m_crcPresetBin.Length : 0);
  1995. if (this.m_crcPresetBin != null && this.m_crcPresetBin.Length != 0)
  1996. {
  1997. f_bwWrite.Write(this.m_crcPresetBin);
  1998. }
  1999. return true;
  2000. }
  2001. public bool SerializePropLowCapacity(BinaryWriter writer)
  2002. {
  2003. NDebug.Assert(this.m_dicMaidProp.Count < 65535, "容量over");
  2004. writer.Write((char)this.m_dicMaidProp.Count);
  2005. NDebug.Assert(true, "MPN容量over");
  2006. foreach (KeyValuePair<string, MaidProp> keyValuePair in this.m_dicMaidProp)
  2007. {
  2008. MPN mpn = (MPN)Enum.Parse(typeof(MPN), keyValuePair.Key);
  2009. writer.Write((char)mpn);
  2010. keyValuePair.Value.SerializeLowCapacity(writer);
  2011. }
  2012. return true;
  2013. }
  2014. public bool SerializeMultiColor(BinaryWriter f_bwWrite)
  2015. {
  2016. return this.m_Parts.Serialize(f_bwWrite);
  2017. }
  2018. public bool SerializeMisc(BinaryWriter f_bwWrite)
  2019. {
  2020. f_bwWrite.Write("CM3D2_MAID_MISC");
  2021. f_bwWrite.Write(2001);
  2022. f_bwWrite.Write(this.m_nActiveSlotNo);
  2023. f_bwWrite.Write(this.m_isCrcManBody);
  2024. if (this.m_texIcon != null)
  2025. {
  2026. byte[] array = this.m_texIcon.EncodeToPNG();
  2027. f_bwWrite.Write(array.Length);
  2028. f_bwWrite.Write(array);
  2029. }
  2030. else
  2031. {
  2032. f_bwWrite.Write(0);
  2033. }
  2034. f_bwWrite.Write(this.m_strThumCardTime);
  2035. f_bwWrite.Write(this.m_colMan.r);
  2036. f_bwWrite.Write(this.m_colMan.g);
  2037. f_bwWrite.Write(this.m_colMan.b);
  2038. f_bwWrite.Write(this.m_colMan.a);
  2039. f_bwWrite.Write(this.m_nVoicePitch);
  2040. this.FixThumCard();
  2041. return true;
  2042. }
  2043. public bool SerializeBody(BinaryWriter f_bwWrite)
  2044. {
  2045. f_bwWrite.Write("CM3D2_MAID_BODY");
  2046. f_bwWrite.Write(1570);
  2047. return true;
  2048. }
  2049. public bool DeserializeProp(BinaryReader f_brRead)
  2050. {
  2051. string a = f_brRead.ReadString();
  2052. NDebug.Assert(a == "CM3D2_MPROP_LIST", "メイドプロパティリストのヘッダーが不正です。");
  2053. int num = f_brRead.ReadInt32();
  2054. int num2 = f_brRead.ReadInt32();
  2055. for (int i = 0; i < num2; i++)
  2056. {
  2057. string tag = f_brRead.ReadString();
  2058. MaidProp prop = this.GetProp(tag);
  2059. prop.Deserialize(f_brRead);
  2060. if (num <= 135 && prop.idx == 187 && Path.GetFileNameWithoutExtension(prop.strFileName.ToLower()) == "acckubi007_i_")
  2061. {
  2062. prop.boDut = true;
  2063. prop.strFileName = CM3.dicDelItem[MPN.acckubi];
  2064. prop.nFileNameRID = prop.strFileName.ToLower().GetHashCode();
  2065. prop.strTempFileName = string.Empty;
  2066. prop.nTempFileNameRID = 0;
  2067. }
  2068. }
  2069. if (num <= 110)
  2070. {
  2071. MaidProp prop2 = this.GetProp(MPN.EyeScl);
  2072. MaidProp prop3 = this.GetProp(MPN.EyeSclX);
  2073. prop3.value = prop2.value;
  2074. MaidProp prop4 = this.GetProp(MPN.EyeSclY);
  2075. prop4.value = prop2.value;
  2076. }
  2077. if (!this.boMAN && Product.isPublic)
  2078. {
  2079. this.SetProp(MPN.bra, "bra030_i_.menu", 0, false, false);
  2080. this.SetProp(MPN.panz, "Pants030_i_.menu", 0, false, false);
  2081. }
  2082. this.m_maidPropOther = null;
  2083. this.m_partsColorOtherBin = null;
  2084. this.m_crcPresetBin = null;
  2085. if (2001 <= num)
  2086. {
  2087. num2 = f_brRead.ReadInt32();
  2088. if (num2 != 0)
  2089. {
  2090. this.m_maidPropOther = new MaidProp[num2];
  2091. for (int j = 0; j < num2; j++)
  2092. {
  2093. string text = f_brRead.ReadString();
  2094. MaidProp maidProp = new MaidProp();
  2095. maidProp.Deserialize(f_brRead);
  2096. this.m_maidPropOther[j] = maidProp;
  2097. }
  2098. }
  2099. int num3 = f_brRead.ReadInt32();
  2100. if (num3 != 0)
  2101. {
  2102. this.m_partsColorOtherBin = f_brRead.ReadBytes(num3);
  2103. }
  2104. int num4 = f_brRead.ReadInt32();
  2105. if (num4 != 0)
  2106. {
  2107. this.m_crcPresetBin = f_brRead.ReadBytes(num4);
  2108. }
  2109. }
  2110. this.AllProcPropSeqStart();
  2111. return true;
  2112. }
  2113. public void DeserializeOldData(OldDataConverter.MaidData data, bool statusOnly = false)
  2114. {
  2115. NDebug.AssertNull(data != null);
  2116. this.status.Deserialize(data.statusReader, true);
  2117. using (MemoryStream memoryStream = new MemoryStream(data.ReadAppearanceByte()))
  2118. {
  2119. using (BinaryReader binaryReader = new BinaryReader(memoryStream))
  2120. {
  2121. this.DeserializeProp(binaryReader);
  2122. this.DeserializeMultiColor(binaryReader);
  2123. }
  2124. }
  2125. if (!statusOnly)
  2126. {
  2127. Texture2D texture2D = new Texture2D(1, 1, TextureFormat.ARGB32, false);
  2128. texture2D.LoadImage(data.ReadThumbnailByte());
  2129. byte[] array = data.ReadAppearanceByte();
  2130. this.SetThumIcon(texture2D);
  2131. string text = GameMain.Instance.CMSystem.CM3D2Path + "\\Thumb\\" + this.status.guid + ".png";
  2132. if (File.Exists(text))
  2133. {
  2134. string text2 = Path.Combine(Maid.ThumbnailDictionary, this.status.guid + ".png");
  2135. if (!File.Exists(text2))
  2136. {
  2137. File.Copy(text, text2);
  2138. }
  2139. }
  2140. }
  2141. }
  2142. public static List<MaidProp> DeserializePropPre(BinaryReader f_brRead)
  2143. {
  2144. List<MaidProp> list = new List<MaidProp>();
  2145. string a = f_brRead.ReadString();
  2146. NDebug.Assert(a == "CM3D2_MPROP_LIST", "メイドプロパティリストのヘッダーが不正です。");
  2147. int num = f_brRead.ReadInt32();
  2148. int num2 = f_brRead.ReadInt32();
  2149. HashSet<MPN> hashSet = new HashSet<MPN>();
  2150. for (int i = 0; i < num2; i++)
  2151. {
  2152. if (4 <= num)
  2153. {
  2154. string text = f_brRead.ReadString();
  2155. }
  2156. MaidProp maidProp = new MaidProp();
  2157. maidProp.Deserialize(f_brRead);
  2158. hashSet.Add((MPN)maidProp.idx);
  2159. list.Add(maidProp);
  2160. if (num <= 110 && maidProp.idx == 84)
  2161. {
  2162. list.Add(new MaidProp
  2163. {
  2164. type = maidProp.type,
  2165. idx = 85,
  2166. name = MPN.EyeSclX.ToString(),
  2167. value = maidProp.value,
  2168. min = maidProp.min,
  2169. max = maidProp.max,
  2170. boDut = true
  2171. });
  2172. list.Add(new MaidProp
  2173. {
  2174. type = maidProp.type,
  2175. idx = 86,
  2176. name = MPN.EyeSclY.ToString(),
  2177. value = maidProp.value,
  2178. min = maidProp.min,
  2179. max = maidProp.max,
  2180. boDut = true
  2181. });
  2182. }
  2183. }
  2184. if (num < 200)
  2185. {
  2186. list.Add(Maid.CreateProp(0, 100, 0, MPN.EyeClose, 2));
  2187. list.Add(Maid.CreateProp(0, 100, 0, MPN.FaceShape, 2));
  2188. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuX, 2));
  2189. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuY, 2));
  2190. }
  2191. if (num < 210)
  2192. {
  2193. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallPosX, 2));
  2194. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallPosY, 2));
  2195. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallSclX, 2));
  2196. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallSclY, 2));
  2197. }
  2198. if (!hashSet.Contains(MPN.FaceShapeSlim))
  2199. {
  2200. list.Add(Maid.CreateProp(0, 100, 0, MPN.FaceShapeSlim, 2));
  2201. }
  2202. if (!hashSet.Contains(MPN.EarNone))
  2203. {
  2204. list.Add(Maid.CreateProp(0, 1, 0, MPN.EarNone, 2));
  2205. }
  2206. if (!hashSet.Contains(MPN.EarElf))
  2207. {
  2208. list.Add(Maid.CreateProp(0, 100, 0, MPN.EarElf, 2));
  2209. }
  2210. if (!hashSet.Contains(MPN.EarRot))
  2211. {
  2212. list.Add(Maid.CreateProp(0, 100, 50, MPN.EarRot, 2));
  2213. }
  2214. if (!hashSet.Contains(MPN.EarScl))
  2215. {
  2216. list.Add(Maid.CreateProp(0, 100, 50, MPN.EarScl, 2));
  2217. }
  2218. if (!hashSet.Contains(MPN.NosePos))
  2219. {
  2220. list.Add(Maid.CreateProp(0, 100, 50, MPN.NosePos, 2));
  2221. }
  2222. if (!hashSet.Contains(MPN.NoseScl))
  2223. {
  2224. list.Add(Maid.CreateProp(0, 100, 50, MPN.NoseScl, 2));
  2225. }
  2226. if (!hashSet.Contains(MPN.MayuShapeIn))
  2227. {
  2228. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuShapeIn, 2));
  2229. }
  2230. if (!hashSet.Contains(MPN.MayuShapeOut))
  2231. {
  2232. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuShapeOut, 2));
  2233. }
  2234. if (!hashSet.Contains(MPN.MayuRot))
  2235. {
  2236. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuRot, 2));
  2237. }
  2238. if (2001 <= num)
  2239. {
  2240. num2 = f_brRead.ReadInt32();
  2241. if (num2 != 0)
  2242. {
  2243. MaidProp[] array = new MaidProp[num2];
  2244. for (int j = 0; j < num2; j++)
  2245. {
  2246. string text2 = f_brRead.ReadString();
  2247. MaidProp maidProp2 = new MaidProp();
  2248. maidProp2.Deserialize(f_brRead);
  2249. array[j] = maidProp2;
  2250. }
  2251. }
  2252. int num3 = f_brRead.ReadInt32();
  2253. if (num3 != 0)
  2254. {
  2255. byte[] array2 = f_brRead.ReadBytes(num3);
  2256. }
  2257. int num4 = f_brRead.ReadInt32();
  2258. if (num4 != 0)
  2259. {
  2260. byte[] array3 = f_brRead.ReadBytes(num4);
  2261. }
  2262. }
  2263. return list;
  2264. }
  2265. [Obsolete("GameUty.RidMenuDic廃止により使用不可", true)]
  2266. public static List<MaidProp> DeserializePropLowCapacity(BinaryReader reader)
  2267. {
  2268. List<MaidProp> list = Maid.CreateInitMaidPropList();
  2269. Dictionary<int, MaidProp> dictionary = new Dictionary<int, MaidProp>();
  2270. for (int i = 0; i < list.Count; i++)
  2271. {
  2272. dictionary.Add(list[i].idx, list[i]);
  2273. }
  2274. int num = (int)reader.ReadChar();
  2275. for (int j = 0; j < num; j++)
  2276. {
  2277. int key = (int)reader.ReadChar();
  2278. MaidProp maidProp = dictionary[key];
  2279. maidProp.DeserializeLowCapacity(reader);
  2280. }
  2281. return list;
  2282. }
  2283. public static MaidParts.PartsColor[] DeserializeMultiColorPre(BinaryReader f_brRead)
  2284. {
  2285. return MaidParts.DeserializePre(f_brRead);
  2286. }
  2287. public bool DeserializeMultiColor(BinaryReader f_brRead)
  2288. {
  2289. MaidParts.PartsColor[] array = MaidParts.DeserializePre(f_brRead);
  2290. for (int i = 0; i < array.Length; i++)
  2291. {
  2292. this.Parts.SetPartsColor((MaidParts.PARTS_COLOR)i, array[i]);
  2293. }
  2294. return true;
  2295. }
  2296. public bool DeserializeMisc(BinaryReader f_brRead)
  2297. {
  2298. string a = f_brRead.ReadString();
  2299. NDebug.Assert(a == "CM3D2_MAID_MISC", "メイドその他のヘッダーが不正です。");
  2300. int num = f_brRead.ReadInt32();
  2301. this.m_nActiveSlotNo = f_brRead.ReadInt32();
  2302. if (2001 <= num)
  2303. {
  2304. this.m_isCrcManBody = f_brRead.ReadBoolean();
  2305. }
  2306. int num2 = f_brRead.ReadInt32();
  2307. if (num2 != 0)
  2308. {
  2309. byte[] data = f_brRead.ReadBytes(num2);
  2310. UnityEngine.Object.Destroy(this.m_texIcon);
  2311. this.m_texIcon = new Texture2D(1, 1, TextureFormat.ARGB32, false);
  2312. this.m_texIcon.LoadImage(data);
  2313. }
  2314. if (8 <= num)
  2315. {
  2316. this.m_strThumCardTime = f_brRead.ReadString();
  2317. }
  2318. this.m_colMan.r = f_brRead.ReadSingle();
  2319. this.m_colMan.g = f_brRead.ReadSingle();
  2320. this.m_colMan.b = f_brRead.ReadSingle();
  2321. this.m_colMan.a = f_brRead.ReadSingle();
  2322. if (202 <= num)
  2323. {
  2324. this.m_nVoicePitch = f_brRead.ReadInt32();
  2325. }
  2326. this.CheckOldThumCard();
  2327. return true;
  2328. }
  2329. public static bool DeserializeBodyPre(BinaryReader f_brRead)
  2330. {
  2331. return Maid.DeserializeBodyRead(f_brRead);
  2332. }
  2333. public bool DeserializeBody(BinaryReader f_brRead)
  2334. {
  2335. return Maid.DeserializeBodyRead(f_brRead);
  2336. }
  2337. public static bool DeserializeBodyRead(BinaryReader f_brRead)
  2338. {
  2339. string a = f_brRead.ReadString();
  2340. NDebug.Assert(a == "CM3D2_MAID_BODY", "メイドBodyヘッダーが不正です。");
  2341. int num = f_brRead.ReadInt32();
  2342. return true;
  2343. }
  2344. public void SetTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot, Vector3 f_vPosLocal, Quaternion f_qRotLocal, Vector3 f_vScaleRate, bool f_bEnable)
  2345. {
  2346. MaidProp prop = this.GetProp(m_mpn);
  2347. BoneAttachPos boneAttachPos = new BoneAttachPos();
  2348. boneAttachPos.bEnable = f_bEnable;
  2349. boneAttachPos.pss.position = f_vPosLocal;
  2350. boneAttachPos.pss.rotation = f_qRotLocal;
  2351. boneAttachPos.pss.scale = f_vScaleRate;
  2352. prop.m_dicTBodySkinPos[f_slot] = new KeyValuePair<int, BoneAttachPos>(prop.nFileNameRID, boneAttachPos);
  2353. }
  2354. public BoneAttachPos GetTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot)
  2355. {
  2356. BoneAttachPos result = null;
  2357. MaidProp prop = this.GetProp(m_mpn);
  2358. KeyValuePair<int, BoneAttachPos> keyValuePair;
  2359. if (prop.m_dicTBodySkinPos.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID)
  2360. {
  2361. result = keyValuePair.Value;
  2362. }
  2363. return result;
  2364. }
  2365. public void ClearTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot)
  2366. {
  2367. MaidProp prop = this.GetProp(m_mpn);
  2368. prop.m_dicTBodySkinPos.Remove(f_slot);
  2369. }
  2370. public void SetAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, int f_vtxcount, string f_apname, int f_vidx, Vector3 f_vPosLocal, Quaternion f_qRotLocal, Vector3 f_vScaleRate, bool f_bEnable)
  2371. {
  2372. MaidProp prop = this.GetProp(m_mpn);
  2373. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
  2374. if (!prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary))
  2375. {
  2376. dictionary = (prop.m_dicTBodyAttachPos[f_slot] = new Dictionary<string, KeyValuePair<int, VtxAttachPos>>());
  2377. }
  2378. VtxAttachPos vtxAttachPos = new VtxAttachPos();
  2379. vtxAttachPos.vtxcount = f_vtxcount;
  2380. vtxAttachPos.vidx = f_vidx;
  2381. vtxAttachPos.prs.position = f_vPosLocal;
  2382. vtxAttachPos.prs.rotation = f_qRotLocal;
  2383. vtxAttachPos.prs.scale = f_vScaleRate;
  2384. vtxAttachPos.bEnable = f_bEnable;
  2385. dictionary[f_apname] = new KeyValuePair<int, VtxAttachPos>(prop.nFileNameRID, vtxAttachPos);
  2386. }
  2387. public VtxAttachPos GetAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, int f_vtxcount, string f_apname)
  2388. {
  2389. VtxAttachPos result = null;
  2390. MaidProp prop = this.GetProp(m_mpn);
  2391. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
  2392. KeyValuePair<int, VtxAttachPos> keyValuePair;
  2393. if (prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary) && dictionary.TryGetValue(f_apname, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID && keyValuePair.Value.vtxcount == f_vtxcount)
  2394. {
  2395. result = keyValuePair.Value;
  2396. }
  2397. return result;
  2398. }
  2399. public void ClearAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, string f_apname)
  2400. {
  2401. MaidProp prop = this.GetProp(m_mpn);
  2402. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
  2403. if (prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary))
  2404. {
  2405. dictionary.Remove(f_apname);
  2406. }
  2407. }
  2408. public void SetMaterialProperty(MPN m_mpn, TBody.SlotID f_slot, int f_nMatNo, string f_strPropName, string f_strTypeName, string f_strValue)
  2409. {
  2410. MaidProp prop = this.GetProp(m_mpn);
  2411. prop.m_dicMaterialProp[f_slot] = new KeyValuePair<int, MatPropSave>(prop.nFileNameRID, new MatPropSave(f_nMatNo, f_strPropName, f_strTypeName, f_strValue));
  2412. }
  2413. public MatPropSave GetMaterialProperty(MPN m_mpn, TBody.SlotID f_slot)
  2414. {
  2415. MaidProp prop = this.GetProp(m_mpn);
  2416. KeyValuePair<int, MatPropSave> keyValuePair;
  2417. if (prop.m_dicMaterialProp.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID)
  2418. {
  2419. return keyValuePair.Value;
  2420. }
  2421. return null;
  2422. }
  2423. public void SetHairLengthSaveToMP(MPN f_mpn, TBody.SlotID f_slot, string f_strName, float f_fValue)
  2424. {
  2425. MaidProp prop = this.GetProp(f_mpn);
  2426. KeyValuePair<int, Dictionary<string, float>> value;
  2427. if (!prop.m_dicBoneLength.TryGetValue(f_slot, out value))
  2428. {
  2429. Dictionary<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> dicBoneLength = prop.m_dicBoneLength;
  2430. value = new KeyValuePair<int, Dictionary<string, float>>(prop.nFileNameRID, new Dictionary<string, float>());
  2431. dicBoneLength[f_slot] = value;
  2432. }
  2433. value.Value[f_strName] = f_fValue;
  2434. }
  2435. public bool GetHairLengthFromMP(MPN f_mpn, TBody.SlotID f_slot, string f_strName, out float f_fOutValue)
  2436. {
  2437. MaidProp prop = this.GetProp(f_mpn);
  2438. KeyValuePair<int, Dictionary<string, float>> keyValuePair;
  2439. if (prop.m_dicBoneLength.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID && keyValuePair.Value.TryGetValue(f_strName, out f_fOutValue))
  2440. {
  2441. return true;
  2442. }
  2443. f_fOutValue = 0.5f;
  2444. return false;
  2445. }
  2446. public void ClearHairLengthMP(MPN f_mpn, TBody.SlotID f_slot)
  2447. {
  2448. MaidProp prop = this.GetProp(f_mpn);
  2449. if (prop.m_dicBoneLength != null && prop.m_dicBoneLength.ContainsKey(f_slot))
  2450. {
  2451. prop.m_dicBoneLength.Remove(f_slot);
  2452. }
  2453. }
  2454. public bool NotExistThenClearHairLengthMP(MPN f_mpn, TBody.SlotID f_slot)
  2455. {
  2456. MaidProp prop = this.GetProp(f_mpn);
  2457. KeyValuePair<int, Dictionary<string, float>> keyValuePair;
  2458. if (prop.m_dicBoneLength.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key != prop.nFileNameRID)
  2459. {
  2460. prop.m_dicBoneLength.Remove(f_slot);
  2461. return true;
  2462. }
  2463. return false;
  2464. }
  2465. public void ThumShotCamMove()
  2466. {
  2467. GameMain.Instance.ThumCamera.GetComponent<ThumShot>().MoveTargetCard(this);
  2468. GameMain.Instance.ThumCamera.GetComponent<ThumShot>().MoveTargetThum(this);
  2469. }
  2470. public void ThumShot()
  2471. {
  2472. UnityEngine.Object.Destroy(this.m_texIcon);
  2473. this.m_texIcon = GameMain.Instance.ThumCamera.GetComponent<ThumShot>().ShotThumIcon(this);
  2474. this.SetThumCard(GameMain.Instance.ThumCamera.GetComponent<ThumShot>().ShotThumCard(this));
  2475. }
  2476. public void ThumShotCustom(string saveFileName, bool adjustmentCameraTransform)
  2477. {
  2478. ThumShot component = GameMain.Instance.ThumCamera.GetComponent<ThumShot>();
  2479. Texture2D texture2D;
  2480. if (adjustmentCameraTransform)
  2481. {
  2482. texture2D = component.ShotThumCard(this);
  2483. }
  2484. else
  2485. {
  2486. texture2D = component.ShotThumCardOriginal();
  2487. }
  2488. string text = Maid.ThumbnailDictionary;
  2489. if (!Directory.Exists(text))
  2490. {
  2491. Directory.CreateDirectory(text);
  2492. }
  2493. text = text + "/" + saveFileName;
  2494. UTY.SaveImage(texture2D, text);
  2495. UnityEngine.Object.Destroy(texture2D);
  2496. }
  2497. public void SetThumCard(Texture2D tex)
  2498. {
  2499. string thumbnailDictionary = Maid.ThumbnailDictionary;
  2500. if (!Directory.Exists(thumbnailDictionary))
  2501. {
  2502. Directory.CreateDirectory(thumbnailDictionary);
  2503. }
  2504. string f_strFileName = string.Empty;
  2505. this.m_strThumCardTime = DateTime.Now.ToString("yyyyMMddHHmmssfff");
  2506. f_strFileName = thumbnailDictionary + "/_tmp_thum_" + this.status.guid + ".png";
  2507. UTY.SaveImage(tex, f_strFileName);
  2508. UnityEngine.Object.Destroy(tex);
  2509. Texture2D thumIcon = this.GetThumIcon();
  2510. f_strFileName = thumbnailDictionary + "/icon_thum_" + this.status.guid + ".png";
  2511. UTY.SaveImage(thumIcon, f_strFileName);
  2512. }
  2513. public void SetThumIcon(Texture2D icon_tex)
  2514. {
  2515. this.m_texIcon = icon_tex;
  2516. }
  2517. public Texture2D GetThumIcon()
  2518. {
  2519. return this.m_texIcon;
  2520. }
  2521. public Texture2D GetThumCard()
  2522. {
  2523. Texture2D result = null;
  2524. string thumbnailDictionary = Maid.ThumbnailDictionary;
  2525. if (!Directory.Exists(thumbnailDictionary))
  2526. {
  2527. Directory.CreateDirectory(thumbnailDictionary);
  2528. }
  2529. string text = thumbnailDictionary + "/_tmp_thum_" + this.status.guid + ".png";
  2530. if (File.Exists(text))
  2531. {
  2532. result = UTY.LoadTexture(text);
  2533. }
  2534. else
  2535. {
  2536. text = thumbnailDictionary + "/" + this.status.guid + ".png";
  2537. if (File.Exists(text))
  2538. {
  2539. result = UTY.LoadTexture(text);
  2540. }
  2541. }
  2542. return result;
  2543. }
  2544. public static void DeletedTmpThumCards()
  2545. {
  2546. string thumbnailDictionary = Maid.ThumbnailDictionary;
  2547. if (!Directory.Exists(thumbnailDictionary))
  2548. {
  2549. return;
  2550. }
  2551. string[] files = Directory.GetFiles(thumbnailDictionary, "*", SearchOption.TopDirectoryOnly);
  2552. for (int i = 0; i < files.Length; i++)
  2553. {
  2554. string text = thumbnailDictionary + "\\";
  2555. int num = files[i].IndexOf(text);
  2556. if (num != 0)
  2557. {
  2558. files[i] = string.Empty;
  2559. }
  2560. else
  2561. {
  2562. string text2 = string.Empty;
  2563. try
  2564. {
  2565. text2 = files[i].Substring(text.Length, files[i].Length - text.Length);
  2566. }
  2567. catch
  2568. {
  2569. }
  2570. if (string.IsNullOrEmpty(text2))
  2571. {
  2572. files[i] = string.Empty;
  2573. }
  2574. else if (0 > text2.IndexOf(".png") || text2.IndexOf("_tmp_thum_") != 0)
  2575. {
  2576. files[i] = string.Empty;
  2577. }
  2578. }
  2579. }
  2580. for (int j = 0; j < files.Length; j++)
  2581. {
  2582. if (!string.IsNullOrEmpty(files[j]))
  2583. {
  2584. try
  2585. {
  2586. File.Delete(files[j]);
  2587. }
  2588. catch
  2589. {
  2590. }
  2591. }
  2592. }
  2593. }
  2594. private void FixThumCard()
  2595. {
  2596. string thumbnailDictionary = Maid.ThumbnailDictionary;
  2597. if (!Directory.Exists(thumbnailDictionary))
  2598. {
  2599. return;
  2600. }
  2601. string text = thumbnailDictionary + "/_tmp_thum_" + this.status.guid + ".png";
  2602. if (!File.Exists(text))
  2603. {
  2604. return;
  2605. }
  2606. string text2 = thumbnailDictionary + "/" + this.status.guid + ".png";
  2607. try
  2608. {
  2609. if (File.Exists(text2))
  2610. {
  2611. File.Delete(text2);
  2612. }
  2613. File.Move(text, text2);
  2614. }
  2615. catch
  2616. {
  2617. }
  2618. }
  2619. private void CheckOldThumCard()
  2620. {
  2621. string thumbnailDictionary = Maid.ThumbnailDictionary;
  2622. if (!Directory.Exists(thumbnailDictionary))
  2623. {
  2624. return;
  2625. }
  2626. string text = string.Concat(new string[]
  2627. {
  2628. thumbnailDictionary,
  2629. "/",
  2630. this.status.guid,
  2631. this.m_strThumCardTime,
  2632. ".png"
  2633. });
  2634. if (!File.Exists(text))
  2635. {
  2636. return;
  2637. }
  2638. File.Move(text, thumbnailDictionary + "/" + this.status.guid + ".png");
  2639. }
  2640. public void ProcSSParam()
  2641. {
  2642. this.boBallGAG = (this.body0.GetSlotUserParam("accHa", "口枷") > 0);
  2643. this.boNoseFook = (this.body0.GetSlotUserParam("accHana", "鼻フック") > 0);
  2644. }
  2645. public void StopAnime(string fn = "")
  2646. {
  2647. this.body0.StopAnime(fn);
  2648. }
  2649. public string CrossFade(string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  2650. {
  2651. return this.CrossFade(fn, GameUty.FileSystem, additive, loop, boAddQue, val, weight);
  2652. }
  2653. public string CrossFade(string fn, AFileSystemBase fileSystem, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  2654. {
  2655. return this.body0.CrossFade(fn, fileSystem, additive, loop, boAddQue, val, weight);
  2656. }
  2657. public string CrossFadeAbsolute(string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  2658. {
  2659. return this.CrossFadeAbsolute(fn, GameUty.FileSystem, additive, loop, boAddQue, val, weight);
  2660. }
  2661. public string CrossFadeAbsolute(string fn, AFileSystemBase fileSystem, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  2662. {
  2663. return this.body0.CrossFadeAbsolute(fn, fileSystem, additive, loop, boAddQue, val, weight);
  2664. }
  2665. public void CacheAnime(string fn, bool loadMuneL = false, bool loadMuneR = false)
  2666. {
  2667. this.body0.CacheLoadAnime(GameUty.FileSystem, Path.ChangeExtension(fn, ".anm"), loadMuneL, loadMuneR);
  2668. }
  2669. public Animation GetAnimation()
  2670. {
  2671. return this.body0.GetAnimation();
  2672. }
  2673. private void Start()
  2674. {
  2675. }
  2676. public void ResetAll()
  2677. {
  2678. this.FaceAnime("通常", 0f, 0);
  2679. this.FaceBlend("無し");
  2680. this.OpenMouth(false);
  2681. this.EyeToReset(0f);
  2682. this.DelPrefabAll();
  2683. string[] array = new string[]
  2684. {
  2685. "handitem",
  2686. "kousoku_upper",
  2687. "kousoku_lower",
  2688. "eye_hi",
  2689. "skirt",
  2690. "panz",
  2691. "mizugi",
  2692. "onepiece",
  2693. "accanl",
  2694. "accvag",
  2695. "KubiScl",
  2696. "UdeScl",
  2697. "DouPer",
  2698. "sintyou",
  2699. "kata",
  2700. "seieki_naka"
  2701. };
  2702. for (int i = 0; i < array.Length; i++)
  2703. {
  2704. this.ResetProp(array[i], false);
  2705. }
  2706. if (this.body0 != null && this.body0.isLoadedBody)
  2707. {
  2708. this.body0.SetMaskMode(TBody.MaskMode.None);
  2709. for (int j = 10; j <= 20; j++)
  2710. {
  2711. this.body0.MulTexRemove("body", 0, "_MainTex", j);
  2712. this.body0.MulTexRemove("body", 0, "_ShadowTex", j);
  2713. this.body0.MulTexRemove("head", 5, "_MainTex", j);
  2714. this.body0.MulTexRemove("head", 5, "_ShadowTex", j);
  2715. }
  2716. this.body0.MulTexProc("body");
  2717. this.body0.MulTexProc("head");
  2718. this.SetModeHairR(TBody.ModeHirR.Normal);
  2719. if (this.body0.isLoadedBody)
  2720. {
  2721. this.body0.MuneYureL(1f);
  2722. this.body0.MuneYureR(1f);
  2723. this.fullBodyIK.AllIKDetach(0f);
  2724. }
  2725. }
  2726. }
  2727. public void Lipsync(bool f_bEnable)
  2728. {
  2729. this.boLipsync = f_bEnable;
  2730. }
  2731. public void LipSyncEnabled(bool enabled)
  2732. {
  2733. this.lipSyncEnabled = enabled;
  2734. }
  2735. public bool MicLipSync
  2736. {
  2737. get
  2738. {
  2739. return this.m_MicLipSync;
  2740. }
  2741. }
  2742. public void SetMicLipSync(bool is_start)
  2743. {
  2744. if (!this.AudioMan)
  2745. {
  2746. Debug.LogError("AudioManが見つかりません");
  2747. return;
  2748. }
  2749. this.m_MicLipSync = is_start;
  2750. this.m_bFoceKuchipakuSelfUpdateTime = is_start;
  2751. if (is_start)
  2752. {
  2753. if (!this.MicLipData.Context)
  2754. {
  2755. this.MicLipData.Context = this.AudioMan.gameObject.AddComponent<LowLatencyLipSyncContext>();
  2756. }
  2757. if (!this.MicLipData.MorphTarget)
  2758. {
  2759. this.MicLipData.MorphTarget = this.AudioMan.gameObject.AddComponent<OVRLipSyncContextMorphTarget>();
  2760. }
  2761. if (!this.MicLipData.MicInput)
  2762. {
  2763. this.MicLipData.MicInput = this.AudioMan.gameObject.AddComponent<OVRLipSyncMicInput>();
  2764. }
  2765. this.MicLipData.Context.Init();
  2766. this.MicLipData.MorphTarget.Init(this);
  2767. this.MicLipData.MicInput.Init(this);
  2768. this.MicLipData.MicInput.StartMicrophone();
  2769. }
  2770. else
  2771. {
  2772. if (this.MicLipData.MicInput)
  2773. {
  2774. this.MicLipData.MicInput.StopMicrophone();
  2775. }
  2776. this.AudioMan.audiosource.clip = null;
  2777. UnityEngine.Object.Destroy(this.MicLipData.Context);
  2778. UnityEngine.Object.Destroy(this.MicLipData.MorphTarget);
  2779. UnityEngine.Object.Destroy(this.MicLipData.MicInput);
  2780. }
  2781. }
  2782. public void StartKuchipakuPattern(float f_fOffsetTime, string f_strPattern, bool f_bSelfUpdateTime = false)
  2783. {
  2784. this.m_fKuchipakuPatternOffsetTime = f_fOffsetTime;
  2785. this.m_baKuchipakuPattern = Convert.FromBase64String(f_strPattern);
  2786. this.m_bFoceKuchipakuSelfUpdateTime = f_bSelfUpdateTime;
  2787. }
  2788. public void StopKuchipakuPattern()
  2789. {
  2790. this.m_fKuchipakuPatternOffsetTime = 0f;
  2791. this.m_baKuchipakuPattern = null;
  2792. this.m_bFoceKuchipakuSelfUpdateTime = false;
  2793. }
  2794. public void OpenMouth(bool f_bOpen)
  2795. {
  2796. this.boMouthOpen = f_bOpen;
  2797. }
  2798. public void OpenMouthLookTooth(bool f_bOpen)
  2799. {
  2800. this.boLookTooth = f_bOpen;
  2801. }
  2802. public void EyeToPosition(Vector3 f_vecTargetPos, float f_fFadeTime = 0f)
  2803. {
  2804. if (f_fFadeTime <= 0f)
  2805. {
  2806. f_fFadeTime = 0.001f;
  2807. }
  2808. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2809. this.body0.trsLookTarget = null;
  2810. this.body0.offsetLookTarget = f_vecTargetPos;
  2811. this.body0.boHeadToCam = true;
  2812. this.body0.boEyeToCam = true;
  2813. this.body0.boEyeSorashi = false;
  2814. }
  2815. public void EyeToTargetObject(Transform target_trans, float f_fFadeTime = 0f)
  2816. {
  2817. this.body0.trsLookTarget = target_trans;
  2818. if (this.body0.trsLookTarget == null)
  2819. {
  2820. this.body0.offsetLookTarget = new Vector3(0f, 1f, 0f);
  2821. }
  2822. if (f_fFadeTime <= 0f)
  2823. {
  2824. f_fFadeTime = 0.001f;
  2825. }
  2826. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2827. this.body0.boHeadToCam = true;
  2828. this.body0.boEyeToCam = true;
  2829. this.body0.boEyeSorashi = false;
  2830. }
  2831. public void EyeToTarget(Maid f_maidTarget, float f_fFadeTime = 0f, string f_strBoneName = "Bip01 Head")
  2832. {
  2833. Transform transform = CMT.SearchObjName(f_maidTarget.body0.m_trBones, f_strBoneName, true);
  2834. this.body0.trsLookTarget = transform;
  2835. if (transform == null)
  2836. {
  2837. this.body0.offsetLookTarget = new Vector3(0f, 1f, 0f);
  2838. }
  2839. if (f_fFadeTime <= 0f)
  2840. {
  2841. f_fFadeTime = 0.001f;
  2842. }
  2843. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2844. this.body0.boHeadToCam = true;
  2845. this.body0.boEyeToCam = true;
  2846. this.body0.boEyeSorashi = false;
  2847. }
  2848. public void EyeToCamera(Maid.EyeMoveType f_eType, float f_fFadeTime = 0f)
  2849. {
  2850. this.body0.boHeadToCam = false;
  2851. this.body0.boEyeToCam = true;
  2852. this.body0.boEyeSorashi = false;
  2853. if (f_fFadeTime <= 0f)
  2854. {
  2855. f_fFadeTime = 0.001f;
  2856. }
  2857. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2858. if (GameMain.Instance.VRMode)
  2859. {
  2860. if (GameMain.Instance.OvrMgr != null)
  2861. {
  2862. this.body0.trsLookTarget = GameMain.Instance.OvrMgr.EyeAnchor;
  2863. }
  2864. if (GameMain.Instance.OvrIK != null && OvrIK.IsVRIKMode && GameMain.Instance.OvrIK.NowMaid == this)
  2865. {
  2866. this.body0.trsLookTarget = GameMain.Instance.OvrIK.EyeTargetTrs;
  2867. }
  2868. }
  2869. else if (GameMain.Instance.MainCamera != null)
  2870. {
  2871. this.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
  2872. }
  2873. if (f_eType == Maid.EyeMoveType.無し)
  2874. {
  2875. this.body0.boEyeToCam = false;
  2876. }
  2877. if (f_eType == Maid.EyeMoveType.無視する)
  2878. {
  2879. this.body0.boEyeToCam = false;
  2880. }
  2881. if (f_eType == Maid.EyeMoveType.顔を向ける)
  2882. {
  2883. this.body0.boHeadToCam = true;
  2884. }
  2885. if (f_eType == Maid.EyeMoveType.顔だけ動かす)
  2886. {
  2887. this.body0.boHeadToCam = true;
  2888. this.body0.boEyeToCam = false;
  2889. }
  2890. if (f_eType == Maid.EyeMoveType.顔をそらす)
  2891. {
  2892. this.body0.trsLookTarget = null;
  2893. this.body0.boEyeSorashi = true;
  2894. this.body0.boEyeToCam = true;
  2895. this.body0.boHeadToCam = true;
  2896. }
  2897. if (f_eType == Maid.EyeMoveType.目と顔を向ける)
  2898. {
  2899. this.body0.boHeadToCam = true;
  2900. this.body0.boEyeToCam = true;
  2901. }
  2902. if (f_eType == Maid.EyeMoveType.目だけ向ける)
  2903. {
  2904. this.body0.boHeadToCam = false;
  2905. this.body0.boEyeToCam = true;
  2906. }
  2907. if (f_eType == Maid.EyeMoveType.目だけそらす)
  2908. {
  2909. this.body0.trsLookTarget = null;
  2910. this.body0.boEyeSorashi = true;
  2911. this.body0.boEyeToCam = true;
  2912. this.body0.boHeadToCam = false;
  2913. }
  2914. }
  2915. public void EyeToReset(float f_fFadeTime = 0f)
  2916. {
  2917. this.EyeToCamera(Maid.EyeMoveType.無し, f_fFadeTime);
  2918. }
  2919. public void LockHeadAndEye(bool toLock)
  2920. {
  2921. this.body0.boLockHeadAndEye = toLock;
  2922. }
  2923. public bool GetLockHeadAndEye()
  2924. {
  2925. return this.body0.boLockHeadAndEye;
  2926. }
  2927. public void SetModeHairR(TBody.ModeHirR f_eMode)
  2928. {
  2929. this.body0.Mode_HairR = f_eMode;
  2930. }
  2931. public void SetAutoTwist(Maid.AutoTwist f_eType, bool f_bEnable)
  2932. {
  2933. switch (f_eType)
  2934. {
  2935. case Maid.AutoTwist.ShoulderL:
  2936. this.body0.boAutoTwistShoulderL = f_bEnable;
  2937. break;
  2938. case Maid.AutoTwist.ShoulderR:
  2939. this.body0.boAutoTwistShoulderR = f_bEnable;
  2940. break;
  2941. case Maid.AutoTwist.WristL:
  2942. this.body0.boAutoTwistWristL = f_bEnable;
  2943. break;
  2944. case Maid.AutoTwist.WristR:
  2945. this.body0.boAutoTwistWristR = f_bEnable;
  2946. break;
  2947. case Maid.AutoTwist.ThighL:
  2948. this.body0.boAutoTwistThighL = f_bEnable;
  2949. break;
  2950. case Maid.AutoTwist.ThighR:
  2951. this.body0.boAutoTwistThighR = f_bEnable;
  2952. break;
  2953. }
  2954. }
  2955. public void SetAutoTwistAll(bool f_bEnable)
  2956. {
  2957. this.body0.boAutoTwistShoulderL = f_bEnable;
  2958. this.body0.boAutoTwistShoulderR = f_bEnable;
  2959. this.body0.boAutoTwistWristL = f_bEnable;
  2960. this.body0.boAutoTwistWristR = f_bEnable;
  2961. this.body0.boAutoTwistThighL = f_bEnable;
  2962. this.body0.boAutoTwistThighR = f_bEnable;
  2963. }
  2964. public void FaceAnime(string tag, float t = 1f, int chkcode = 0)
  2965. {
  2966. this.FaceAnimeChkCode = chkcode;
  2967. this.ActiveFace = tag;
  2968. if (this.body0 != null && this.body0.Face != null && this.body0.Face.morph != null && this.body0.Face.morph.dicBlendSet != null && this.body0.Face.morph.dicBlendSet.ContainsKey(tag + "〓通常"))
  2969. {
  2970. tag += "〓通常";
  2971. }
  2972. if (t == 0f)
  2973. {
  2974. this.boFaceAnime = false;
  2975. this.FaceName = tag;
  2976. this.FaceName2 = string.Empty;
  2977. return;
  2978. }
  2979. this.boFaceAnime = true;
  2980. if (this.FaceName2 != string.Empty)
  2981. {
  2982. this.FaceName = this.FaceName2;
  2983. this.FaceName2 = string.Empty;
  2984. }
  2985. if (this.FaceName == string.Empty)
  2986. {
  2987. this.FaceName = "デフォ";
  2988. }
  2989. this.FaceName2 = tag;
  2990. this.FacePlus = 1f / t;
  2991. this.FaceTime = this.FacePlus * 0.016666668f;
  2992. }
  2993. public void FaceBlend(string tag)
  2994. {
  2995. if (this.body0 == null)
  2996. {
  2997. Debug.LogError("Bodyが読み込まれる前に、表情ブレンドが呼ばれました。" + tag);
  2998. return;
  2999. }
  3000. if (tag == "無し")
  3001. {
  3002. tag = string.Empty;
  3003. }
  3004. this.FaceName3 = tag;
  3005. }
  3006. public void ChangeAutoFace(bool bo)
  3007. {
  3008. if (this.boAutoFace != bo)
  3009. {
  3010. this.AutoFaceLV_old = 0;
  3011. this.Hazukashi = 0f;
  3012. }
  3013. this.boAutoFace = bo;
  3014. }
  3015. public void AddPrefab(string f_strPrefab, string f_strName, string f_strDestBone, Vector3 f_vOffsetLocalPos, Vector3 f_vOffsetLocalRot)
  3016. {
  3017. UnityEngine.Object @object = Resources.Load("Prefab/" + f_strPrefab);
  3018. if (@object != null)
  3019. {
  3020. Transform transform = null;
  3021. if (this.body0 != null && this.body0.isLoadedBody)
  3022. {
  3023. transform = CMT.SearchObjName(this.body0.m_trBones, f_strDestBone, true);
  3024. }
  3025. if (transform != null)
  3026. {
  3027. GameObject goItem = UnityEngine.Object.Instantiate(@object) as GameObject;
  3028. goItem.AddComponent<AttachPrefab>();
  3029. goItem.name = goItem.name.Replace("(Clone)", string.Empty);
  3030. if (!string.IsNullOrEmpty(f_strName))
  3031. {
  3032. goItem.name = f_strName;
  3033. }
  3034. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  3035. AttachPrefab[] array = (from a in componentsInChildren
  3036. where a.name == goItem.name
  3037. select a).ToArray<AttachPrefab>();
  3038. for (int i = 0; i < array.Length; i++)
  3039. {
  3040. UnityEngine.Object.DestroyImmediate(array[i].gameObject);
  3041. }
  3042. goItem.transform.SetParent(transform, false);
  3043. goItem.transform.localPosition = f_vOffsetLocalPos;
  3044. goItem.transform.localRotation = Quaternion.Euler(f_vOffsetLocalRot);
  3045. }
  3046. else
  3047. {
  3048. Debug.LogError("人物にプレハブ追加で、ボーン名が見つかりません。" + f_strDestBone);
  3049. }
  3050. }
  3051. else
  3052. {
  3053. Debug.LogError("人物にプレハブ追加で、プレハブが見つかりません。Prefab/" + f_strPrefab);
  3054. }
  3055. }
  3056. public void DelPrefab(string f_strName)
  3057. {
  3058. if (this.body0 == null || !this.body0.isLoadedBody)
  3059. {
  3060. return;
  3061. }
  3062. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  3063. AttachPrefab[] array = (from a in componentsInChildren
  3064. where a.name == f_strName
  3065. select a).ToArray<AttachPrefab>();
  3066. for (int i = 0; i < array.Length; i++)
  3067. {
  3068. UnityEngine.Object.DestroyImmediate(array[i].gameObject);
  3069. }
  3070. }
  3071. public void DelPrefabAll()
  3072. {
  3073. if (this.body0 == null || !this.body0.isLoadedBody)
  3074. {
  3075. return;
  3076. }
  3077. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  3078. for (int i = 0; i < componentsInChildren.Length; i++)
  3079. {
  3080. UnityEngine.Object.DestroyImmediate(componentsInChildren[i].gameObject);
  3081. }
  3082. }
  3083. public GameObject GetPrefab(string f_strName)
  3084. {
  3085. if (this.body0 == null || !this.body0.isLoadedBody)
  3086. {
  3087. return null;
  3088. }
  3089. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  3090. AttachPrefab[] array = (from a in componentsInChildren
  3091. where a.name == f_strName
  3092. select a).ToArray<AttachPrefab>();
  3093. return (0 >= array.Length) ? null : array[0].gameObject;
  3094. }
  3095. public void AnimationObject(string f_strName, string f_strAnimName, bool f_bNowPlay, bool f_bLoop)
  3096. {
  3097. Transform transform;
  3098. if ((transform = CMT.SearchObjName(this.body0.m_trBones, f_strName, false)) != null)
  3099. {
  3100. Animation animation = transform.gameObject.GetComponent<Animation>();
  3101. if (animation == null)
  3102. {
  3103. animation = transform.gameObject.AddComponent<Animation>();
  3104. }
  3105. AnimationClip animationClip = ImportCM.LoadAniClipNative(GameUty.FileSystem, f_strAnimName, true, true, true);
  3106. if (animationClip == null)
  3107. {
  3108. NDebug.Assert("アニメーション " + f_strAnimName + " が見つかりません。", false);
  3109. }
  3110. animation.AddClip(animationClip, f_strAnimName);
  3111. animation.clip = animationClip;
  3112. animation.playAutomatically = true;
  3113. animation.wrapMode = ((!f_bLoop) ? WrapMode.Once : WrapMode.Loop);
  3114. if (f_bNowPlay)
  3115. {
  3116. animation.PlayQueued(f_strAnimName, QueueMode.PlayNow);
  3117. }
  3118. this.m_goTestAnim = transform.gameObject;
  3119. }
  3120. else
  3121. {
  3122. NDebug.Assert("人物に追加した " + f_strName + " は見つかりませんでした。", false);
  3123. }
  3124. }
  3125. public void SetPos(Vector3 f_vecLocalPos)
  3126. {
  3127. base.gameObject.transform.localPosition = f_vecLocalPos;
  3128. }
  3129. public void SetRot(Vector3 f_vecLocalRot)
  3130. {
  3131. base.gameObject.transform.localRotation = Quaternion.Euler(f_vecLocalRot);
  3132. }
  3133. public Vector3 GetPos()
  3134. {
  3135. return base.gameObject.transform.localPosition;
  3136. }
  3137. public Vector3 GetRot()
  3138. {
  3139. return base.gameObject.transform.localRotation.eulerAngles;
  3140. }
  3141. public Vector3 GetWorldRot()
  3142. {
  3143. return base.gameObject.transform.rotation.eulerAngles;
  3144. }
  3145. public void SetPosOffset(Vector3 f_vecLocalPos)
  3146. {
  3147. this.m_vOffsetPostion = f_vecLocalPos;
  3148. }
  3149. public Vector3 GetPosOffset()
  3150. {
  3151. return this.m_goOffset.transform.localPosition;
  3152. }
  3153. public void SetPosOffsetDirect(Vector3 offset)
  3154. {
  3155. this.m_goOffset.transform.localPosition = offset;
  3156. }
  3157. public void AddPosOffset(Vector3 offset)
  3158. {
  3159. Vector3 posOffset = this.GetPosOffset();
  3160. this.SetPosOffsetDirect(posOffset + offset);
  3161. }
  3162. public void UpdateTransformData()
  3163. {
  3164. this.SetPos(this.baseOffset + this.motionOffset);
  3165. if (this.boMAN)
  3166. {
  3167. if (!string.IsNullOrEmpty(this.rotateLinkMaid))
  3168. {
  3169. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  3170. {
  3171. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
  3172. if (maid != null && maid.status.guid == this.rotateLinkMaid)
  3173. {
  3174. maid.UpdateTransformData();
  3175. break;
  3176. }
  3177. }
  3178. }
  3179. return;
  3180. }
  3181. Vector3 position = base.transform.position;
  3182. base.transform.localRotation = Quaternion.identity;
  3183. if (!Mathf.Approximately(0f, this.baseEulerAngles.x))
  3184. {
  3185. base.transform.RotateAround(position, Vector3.right, this.baseEulerAngles.x);
  3186. }
  3187. if (!Mathf.Approximately(0f, this.baseEulerAngles.y))
  3188. {
  3189. base.transform.RotateAround(position, Vector3.up, this.baseEulerAngles.y);
  3190. }
  3191. if (!Mathf.Approximately(0f, this.baseEulerAngles.z))
  3192. {
  3193. base.transform.RotateAround(position, Vector3.forward, this.baseEulerAngles.z);
  3194. }
  3195. for (int j = 0; j < GameMain.Instance.CharacterMgr.GetManCount(); j++)
  3196. {
  3197. Maid man = GameMain.Instance.CharacterMgr.GetMan(j);
  3198. if (man != null && man.status.guid == this.rotateLinkMaid)
  3199. {
  3200. man.SetPos(man.baseOffset + man.motionOffset);
  3201. man.transform.localRotation = Quaternion.identity;
  3202. if (!Mathf.Approximately(0f, this.baseEulerAngles.x))
  3203. {
  3204. man.transform.RotateAround(position, Vector3.right, this.baseEulerAngles.x);
  3205. }
  3206. if (!Mathf.Approximately(0f, this.baseEulerAngles.y))
  3207. {
  3208. man.transform.RotateAround(position, Vector3.up, this.baseEulerAngles.y);
  3209. }
  3210. if (!Mathf.Approximately(0f, this.baseEulerAngles.z))
  3211. {
  3212. man.transform.RotateAround(position, Vector3.forward, this.baseEulerAngles.z);
  3213. }
  3214. break;
  3215. }
  3216. }
  3217. }
  3218. public void SetPosOffsetFromUdeSclX(string category, float val)
  3219. {
  3220. this.m_vOffsetPostion.x = ((float)this.GetProp(category).value - 50f) * (val / 50f);
  3221. }
  3222. public void SetPosOffsetFromUdeSclY(string category, float val)
  3223. {
  3224. this.m_vOffsetPostion.y = ((float)this.GetProp(category).value - 50f) * (val / 50f);
  3225. }
  3226. public void SetPosOffsetFromUdeSclZ(string category, float val)
  3227. {
  3228. this.m_vOffsetPostion.z = ((float)this.GetProp(category).value - 50f) * (val / 50f);
  3229. }
  3230. public void ExportModBaseMenu(MPN f_mpn)
  3231. {
  3232. MaidProp prop = this.GetProp(f_mpn);
  3233. if (string.IsNullOrEmpty(prop.strFileName))
  3234. {
  3235. NUty.WinMessageBox(NUty.GetWindowHandle(), "現在このスロットにはパーツが設定されていません。", "MOD Export Error", 0);
  3236. return;
  3237. }
  3238. Menu.ExportModScript(this, prop.strFileName, false);
  3239. }
  3240. public void ExportModBaseMqo(MPN f_mpn, string f_strOutFileName)
  3241. {
  3242. MaidProp prop = this.GetProp(f_mpn);
  3243. if (string.IsNullOrEmpty(prop.strFileName))
  3244. {
  3245. NUty.WinMessageBox(NUty.GetWindowHandle(), "現在このスロットにはパーツが設定されていません。", "MQO Export Error", 0);
  3246. return;
  3247. }
  3248. }
  3249. public void FoceKuchipakuUpdate(float f_fNowTime)
  3250. {
  3251. if (this.m_baKuchipakuPattern != null)
  3252. {
  3253. int num = (int)((this.m_fKuchipakuPatternOffsetTime + f_fNowTime) * 30f);
  3254. int num2 = this.m_baKuchipakuPattern.Length / 3;
  3255. if (0 < num && num < num2)
  3256. {
  3257. this.body0.Face.morph.boLipSync = true;
  3258. this.body0.Face.morph.LipSync1 = this.body0.Face.morph.LipSync1 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3] / 255f * 0.85f * 3f;
  3259. this.body0.Face.morph.LipSync2 = this.body0.Face.morph.LipSync2 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3 + 1] / 255f * 0.85f * 3f;
  3260. this.body0.Face.morph.LipSync3 = this.body0.Face.morph.LipSync3 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3 + 2] / 255f * 0.85f * 3f;
  3261. }
  3262. else
  3263. {
  3264. this.body0.Face.morph.boLipSync = false;
  3265. }
  3266. }
  3267. }
  3268. private void Update()
  3269. {
  3270. if (!this.isOffsetUpdateEnd)
  3271. {
  3272. this.OffsetUpdate();
  3273. }
  3274. this.isOffsetUpdateEnd = false;
  3275. if (this.boAllProcPropBUSY || (!(this.pairMan == null) && this.pairMan.boAllProcPropBUSY))
  3276. {
  3277. this.AllProcPropSeq();
  3278. return;
  3279. }
  3280. if (!this.body0.IsCrcBody && this.boMAN)
  3281. {
  3282. this.m_goOffset.transform.localPosition = this.m_vOffsetPostion;
  3283. return;
  3284. }
  3285. if (!this.body0.isLoadedBody)
  3286. {
  3287. return;
  3288. }
  3289. if (this.body0.IsCrcBody && this.boMAN)
  3290. {
  3291. return;
  3292. }
  3293. this.body0.Face.morph.boLookTooth = this.boLookTooth;
  3294. this.body0.Face.morph.boBallGAG = (this.boBallGAG | this.boMouthOpen);
  3295. this.body0.Face.morph.boNoseFook = this.boNoseFook;
  3296. if (this.AudioMan != null && !this.m_bFoceKuchipakuSelfUpdateTime)
  3297. {
  3298. this.body0.Face.morph.boLipSync = this.AudioMan.audiosource.isPlaying;
  3299. if (!this.lipSyncEnabled)
  3300. {
  3301. this.body0.Face.morph.boLipSync = false;
  3302. }
  3303. float voicePara_ = this.VoicePara_1;
  3304. float voicePara_2 = this.VoicePara_3;
  3305. float vol = this.AudioMan.GetVol();
  3306. this.voice_avg1 = this.voice_avg1 * (1f - voicePara_) + vol * voicePara_;
  3307. this.voice_avg2 = this.voice_avg2 * (1f - voicePara_) + this.AudioMan.VAvgMax * voicePara_;
  3308. this.voice_avg1D = this.voice_avg1D * (1f - voicePara_2) + (vol - this.voice_avg1_old) * voicePara_2;
  3309. this.voice_avg2D = this.voice_avg2D * (1f - voicePara_2) + (this.AudioMan.VAvgMax - this.voice_avg2_old) * voicePara_2;
  3310. this.voice_avg1_old = vol;
  3311. this.voice_avg2_old = this.AudioMan.VAvgMax;
  3312. this.voice_ao_time -= Time.deltaTime;
  3313. if (this.voice_ao_time < 0f && this.voice_avg1D > 0f && this.voice_ao_chk0 < -0.05f && this.voice_ao_chk1 > 0.1f)
  3314. {
  3315. this.voice_ao_time = 0.05f;
  3316. this.voice_ao = (this.voice_ao + 1) % 8;
  3317. this.voice_ao_chk0 = 0f;
  3318. this.voice_ao_chk1 = 0f;
  3319. }
  3320. if (this.voice_ao_chk1 < this.voice_avg1D)
  3321. {
  3322. this.voice_ao_chk1 = this.voice_avg1D;
  3323. }
  3324. if (0.1f < this.voice_avg1D)
  3325. {
  3326. this.voice_ao_chk0 = 0f;
  3327. }
  3328. if (this.voice_ao_chk0 > this.voice_avg1D)
  3329. {
  3330. this.voice_ao_chk0 = this.voice_avg1D;
  3331. }
  3332. float num = Mathf.Pow(this.voice_avg1, 1f) * 10f * this.VoicePara_2;
  3333. if (this.voice_ao % 2 == 0)
  3334. {
  3335. this.voice_ao_f *= 0.5f;
  3336. }
  3337. else
  3338. {
  3339. this.voice_ao_f = this.voice_ao_f * 0.5f + 0.5f;
  3340. }
  3341. this.voice_lf2 = num * this.voice_ao_f;
  3342. this.voice_lf3 = num * (1f - this.voice_ao_f);
  3343. this.body0.Face.morph.LipSync2 = this.voice_lf2;
  3344. this.body0.Face.morph.LipSync3 = this.voice_lf3;
  3345. float num2 = Mathf.Pow(this.voice_avg2, 0.5f) * (this.voice_avg2D * 30f * this.VoicePara_4 + 0.5f);
  3346. this.voice_lf1 = num2;
  3347. this.body0.Face.morph.LipSync1 = this.voice_lf1;
  3348. if (this.voice_ao % 4 < 2)
  3349. {
  3350. this.voice_ao_f2 *= 0.5f;
  3351. }
  3352. else
  3353. {
  3354. this.voice_ao_f2 = this.voice_ao_f2 * 0.5f + 0.5f;
  3355. }
  3356. this.body0.Face.morph.LipSync1 *= this.voice_ao_f2;
  3357. this.body0.Face.morph.LipSync2 *= 1f - this.voice_ao_f2;
  3358. this.body0.Face.morph.LipSync3 *= 1f - this.voice_ao_f2;
  3359. this.body0.Face.morph.LipSync1 = Mathf.Clamp01(this.body0.Face.morph.LipSync1 * 0.5f);
  3360. this.body0.Face.morph.LipSync2 = Mathf.Clamp01(this.body0.Face.morph.LipSync2 * 0.5f);
  3361. this.body0.Face.morph.LipSync3 = Mathf.Clamp01(this.body0.Face.morph.LipSync3 * 0.5f);
  3362. }
  3363. if (this.m_baKuchipakuPattern != null && this.lipSyncEnabled && !this.m_bFoceKuchipakuSelfUpdateTime && this.AudioMan != null)
  3364. {
  3365. this.FoceKuchipakuUpdate(this.AudioMan.audiosource.time);
  3366. }
  3367. if (this.boLipsync && this.lipSyncEnabled)
  3368. {
  3369. this.body0.Face.morph.boLipSync = true;
  3370. this.LipsyncT1 += Mathf.Sin(Time.time * 10f) * 0.5f + Mathf.Cos(Time.time * 5.55f) * 0.1f * 0.2f;
  3371. this.LipsyncT2 += Mathf.Sin(Time.time * 5f) * 0.1f + Mathf.Cos(Time.time * 5.55f) * 0.1f * 0.2f;
  3372. float num3 = (1f + Mathf.Sin(Time.time * 4f + this.LipsyncT1)) * 0.5f * 0.98f + 0.1f;
  3373. float num4 = (Mathf.Sin(this.LipsyncT1) + 1f) * 0.5f;
  3374. float num5 = (Mathf.Sin(this.LipsyncT2) + 1f) * 0.5f;
  3375. this.body0.Face.morph.LipSync1 = num3 * num4 * num5 * 0.5f;
  3376. this.body0.Face.morph.LipSync3 = num3 * (1f - num4) * num5 * 0.5f;
  3377. this.body0.Face.morph.LipSync2 = num3 * (1f - num5) * 0.5f;
  3378. }
  3379. else if (this.boLipsync_old)
  3380. {
  3381. this.body0.Face.morph.LipSync1 = 0f;
  3382. this.body0.Face.morph.LipSync3 = 0f;
  3383. this.body0.Face.morph.LipSync2 = 0f;
  3384. }
  3385. this.boLipsync_old = this.boLipsync;
  3386. if (this.boMabataki)
  3387. {
  3388. this.body0.Face.morph.ClearBlendValues();
  3389. if (this.FaceName != string.Empty)
  3390. {
  3391. this.body0.Face.morph.MulBlendValues(this.FaceName, 1f);
  3392. }
  3393. if (this.FaceName2 != string.Empty)
  3394. {
  3395. this.body0.Face.morph.MulBlendValues(this.FaceName2, UTY.COSS2(Mathf.Pow(this.FaceTime, 0.4f), 4f));
  3396. this.FaceTime += Time.deltaTime * this.FacePlus;
  3397. if (this.FaceTime >= 1f)
  3398. {
  3399. this.boFaceAnime = false;
  3400. this.FaceName = this.FaceName2;
  3401. this.FaceName2 = string.Empty;
  3402. }
  3403. }
  3404. if (this.FaceName3 != string.Empty)
  3405. {
  3406. this.body0.Face.morph.AddBlendValues(this.FaceName3, 1f);
  3407. }
  3408. if (this.MabatakiVal > 0f)
  3409. {
  3410. float num6 = this.MabatakiVal * this.MabatakiVal;
  3411. num6 = Mathf.Sin(num6 * 3.1415927f);
  3412. this.body0.Face.morph.EyeMabataki = num6;
  3413. }
  3414. else
  3415. {
  3416. this.body0.Face.morph.EyeMabataki = 0f;
  3417. }
  3418. if (!this.MabatakiUpdateStop)
  3419. {
  3420. this.MabatakiVal -= Time.deltaTime * 2f;
  3421. }
  3422. this.body0.Face.morph.FixBlendValues_Face();
  3423. if (!this.boFaceAnime && this.NextMabatakiTime < Time.time && !this.MabatakiUpdateStop)
  3424. {
  3425. float num7 = 0.5f + (float)UTY.GetRnd(80) * 0.1f;
  3426. this.NextMabatakiTime = Time.time + num7;
  3427. this.MabatakiVal = 1f;
  3428. }
  3429. }
  3430. else if (this.FaceName2 != string.Empty)
  3431. {
  3432. this.body0.Face.morph.ClearBlendValues();
  3433. if (this.FaceName != string.Empty)
  3434. {
  3435. this.body0.Face.morph.MulBlendValues(this.FaceName, 1f);
  3436. }
  3437. this.body0.Face.morph.MulBlendValues(this.FaceName2, UTY.COSS2(Mathf.Pow(this.FaceTime, 0.4f), 4f));
  3438. this.FaceTime += Time.deltaTime * this.FacePlus;
  3439. if (this.FaceTime >= 1f)
  3440. {
  3441. this.boFaceAnime = false;
  3442. this.FaceName = this.FaceName2;
  3443. this.FaceName2 = string.Empty;
  3444. }
  3445. this.MabatakiVal = 0f;
  3446. this.body0.Face.morph.FixBlendValues_Face();
  3447. }
  3448. }
  3449. public bool isOffsetUpdateEnd { get; private set; }
  3450. public void OffsetUpdate()
  3451. {
  3452. if (this.body0.IsCrcBody)
  3453. {
  3454. this.SetPosOffsetDirect(this.motionOffsetGP03);
  3455. }
  3456. if (this.boOffsetY && this.body0.ToeL)
  3457. {
  3458. float num = this.body0.ToeL.position.y;
  3459. if (this.body0.ToeR.position.y < num)
  3460. {
  3461. num = this.body0.ToeR.position.y;
  3462. }
  3463. num = this.body0.CenterBone.position.y;
  3464. num *= 0.8f;
  3465. float num2 = this.body0.Pelvis.position.y - this.body0.CenterBone.position.y;
  3466. Vector3 vector = Vector3.up * (-num2 + num2 * this.body0.bonemorph.SnityouOutScale) + this.m_vOffsetPostion;
  3467. if (this.body0.IsCrcBody)
  3468. {
  3469. this.AddPosOffset(vector);
  3470. }
  3471. else
  3472. {
  3473. this.SetPosOffsetDirect(vector);
  3474. }
  3475. }
  3476. if (this.body0.IsHiheel)
  3477. {
  3478. Transform bone = this.body0.GetBone("Bip01 L Foot");
  3479. Transform bone2 = this.body0.GetBone("Bip01 R Foot");
  3480. float num3 = Mathf.Max(Vector3.Dot(Vector3.up, bone.right), Vector3.Dot(Vector3.up, bone2.right));
  3481. num3 = Mathf.Clamp01(num3);
  3482. if (num3 > 0f)
  3483. {
  3484. float num4 = Vector3.Dot(Vector3.up, -this.body0.Pelvis.right);
  3485. float num5 = Vector3.Dot(Vector3.up, this.body0.Thigh_L.right);
  3486. float num6 = Vector3.Dot(Vector3.up, this.body0.Thigh_R.right);
  3487. float num7 = num3 * Mathf.Max(new float[]
  3488. {
  3489. num4,
  3490. num5,
  3491. num6
  3492. });
  3493. num7 = Mathf.Clamp01(num7);
  3494. this.AddPosOffset(Vector3.up * 0.03f * num7);
  3495. }
  3496. }
  3497. this.isOffsetUpdateEnd = true;
  3498. }
  3499. private void LateUpdate()
  3500. {
  3501. if (this.boAllProcPropBUSY)
  3502. {
  3503. return;
  3504. }
  3505. if (!this.body0.isLoadedBody)
  3506. {
  3507. return;
  3508. }
  3509. if (this.m_MotionLoad == 1)
  3510. {
  3511. this.m_MotionLoad = 0;
  3512. if (!this.boMAN)
  3513. {
  3514. this.CrossFade("maid_stand01.anm", false, true, false, 0.5f, 1f);
  3515. this.FaceAnime("通常", 1f, 0);
  3516. if (GameMain.Instance.VRMode)
  3517. {
  3518. if (GameMain.Instance.OvrMgr != null)
  3519. {
  3520. this.body0.trsLookTarget = GameMain.Instance.OvrMgr.EyeAnchor;
  3521. }
  3522. }
  3523. else if (GameMain.Instance.MainCamera != null)
  3524. {
  3525. this.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
  3526. }
  3527. }
  3528. }
  3529. }
  3530. public const int MAID_VERSION = 2001;
  3531. private const float HIGHHEEL_YOFFSET = 0.03f;
  3532. public GameObject m_goOffset;
  3533. private Status m_Status;
  3534. private MaidParts m_Parts;
  3535. private bool m_visible;
  3536. public Action<Maid> onMouseUpEvent;
  3537. public string TypeName = string.Empty;
  3538. public TBody body0;
  3539. public bool boMAN;
  3540. public bool boNPC;
  3541. public bool boOffsetY = true;
  3542. public Vector3 baseOffset = Vector3.zero;
  3543. public Vector3 motionOffset = Vector3.zero;
  3544. public Vector3 baseEulerAngles = Vector3.zero;
  3545. public Vector3 motionOffsetGP03 = Vector3.zero;
  3546. public string rotateLinkMaid = string.Empty;
  3547. private Dictionary<string, MaidProp> m_dicMaidProp = new Dictionary<string, MaidProp>();
  3548. private MaidProp[] m_aryMaidProp;
  3549. private Hashtable m_hashMaidPropLower = new Hashtable();
  3550. private MaidProp[] m_maidPropOther;
  3551. private byte[] m_partsColorOtherBin;
  3552. private byte[] m_crcPresetBin;
  3553. private int m_nActiveSlotNo = -1;
  3554. private string m_strThumCardTime = string.Empty;
  3555. private Texture2D m_texIcon;
  3556. private Color m_colMan = new Color(0f, 0.09f, 1f, 1f);
  3557. private int m_nVoicePitch = 50;
  3558. private bool m_isCrcManBody;
  3559. public Maid pairMan;
  3560. private string m_strBefOnepiceFileName;
  3561. private int m_nBefOnepiceRID;
  3562. private string m_strBefWearFileName;
  3563. private int m_nBefWearRID;
  3564. private string m_strBefSkirtFileName;
  3565. private int m_nBefSkirtRID;
  3566. private bool boModelChg;
  3567. public bool boAllProcPropBUSY;
  3568. private int AllProcProp2Fase;
  3569. private int AllProcProp2Cnt;
  3570. private bool bodyReloaded;
  3571. public bool boLookTooth;
  3572. public bool boBallGAG;
  3573. public bool boMouthOpen;
  3574. public bool boNoseFook;
  3575. private float m_fKuchipakuPatternOffsetTime;
  3576. public byte[] m_baKuchipakuPattern;
  3577. private bool m_bFoceKuchipakuSelfUpdateTime;
  3578. [Header("音声入力用コンポーネント")]
  3579. public Maid.LipSyncComp MicLipData = new Maid.LipSyncComp();
  3580. private bool m_MicLipSync;
  3581. private bool boAutoFace;
  3582. private float NextMabatakiTime;
  3583. private float MabatakiVal;
  3584. private string FaceName = string.Empty;
  3585. private string FaceName2 = string.Empty;
  3586. public string FaceName3 = string.Empty;
  3587. private float FaceTime;
  3588. private float FacePlus;
  3589. public string ActiveFace = string.Empty;
  3590. public int FaceAnimeChkCode;
  3591. public bool boFaceAnime;
  3592. public int OldFaceAtr;
  3593. public bool boShitakaraNozoku;
  3594. public bool boVisibleBottom;
  3595. public int AutoFaceLV_old;
  3596. public float Hazukashi;
  3597. public bool boChkEye_old;
  3598. public GameObject m_goTestAnim;
  3599. public float voice_time;
  3600. public float voice_avg1;
  3601. public float voice_avg2;
  3602. public float voice_avg1_old;
  3603. public float voice_avg2_old;
  3604. public float voice_avg1D;
  3605. public float voice_avg2D;
  3606. public int voice_ao;
  3607. public float voice_ao_f;
  3608. public float voice_ao_f2;
  3609. public float voice_ao_time;
  3610. public float voice_ao_chk0;
  3611. public float voice_ao_chk1;
  3612. public float voice_lf1;
  3613. public float voice_lf2;
  3614. public float voice_lf3;
  3615. public float VoicePara_1 = 0.5f;
  3616. public float VoicePara_2 = 0.074f;
  3617. public float VoicePara_3 = 0.5f;
  3618. public float VoicePara_4 = 0.05f;
  3619. private bool lipSyncEnabled = true;
  3620. private bool boLipsync;
  3621. private bool boLipsync_old;
  3622. private float LipsyncT1;
  3623. private float LipsyncT2;
  3624. public bool boMabataki = true;
  3625. public bool MabatakiUpdateStop;
  3626. private Vector3 m_vOffsetPostion = Vector3.zero;
  3627. public static int changetest;
  3628. private int m_MotionLoad = 1;
  3629. [Serializable]
  3630. public class LipSyncComp
  3631. {
  3632. [HideInInspector]
  3633. public bool IsInit = true;
  3634. public LowLatencyLipSyncContext Context;
  3635. public OVRLipSyncContextMorphTarget MorphTarget;
  3636. public OVRLipSyncMicInput MicInput;
  3637. }
  3638. public enum EyeMoveType
  3639. {
  3640. 無し,
  3641. 無視する,
  3642. 顔を向ける,
  3643. 顔だけ動かす,
  3644. 顔をそらす,
  3645. 目と顔を向ける,
  3646. 目だけ向ける,
  3647. 目だけそらす
  3648. }
  3649. public enum AutoTwist
  3650. {
  3651. ShoulderL,
  3652. ShoulderR,
  3653. WristL,
  3654. WristR,
  3655. ThighL,
  3656. ThighR,
  3657. AnkleL,
  3658. AnkleR
  3659. }
  3660. }