Maid.cs 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using MaidStatus;
  7. using UnityEngine;
  8. using XVI.AniLipSync;
  9. public class Maid : MonoBehaviour
  10. {
  11. public bool Visible
  12. {
  13. get
  14. {
  15. return this.m_visible;
  16. }
  17. set
  18. {
  19. GameObject gameObject = base.gameObject;
  20. this.m_visible = value;
  21. gameObject.SetActive(value);
  22. }
  23. }
  24. public MaidParts Parts
  25. {
  26. get
  27. {
  28. return this.m_Parts;
  29. }
  30. }
  31. public Status status
  32. {
  33. get
  34. {
  35. return this.m_Status;
  36. }
  37. }
  38. public AudioSourceMgr AudioMan
  39. {
  40. get
  41. {
  42. return (!(this.body0 != null)) ? null : this.body0.AudioMan;
  43. }
  44. }
  45. public bool IsBusy
  46. {
  47. get
  48. {
  49. return this.IsAllProcPropBusy && this.Visible;
  50. }
  51. }
  52. public bool IsAllProcPropBusy
  53. {
  54. get
  55. {
  56. return this.boAllProcPropBUSY;
  57. }
  58. }
  59. public FullBodyIKCtrl IKCtrl
  60. {
  61. get
  62. {
  63. return this.body0.IKCtrl;
  64. }
  65. }
  66. public int ActiveSlotNo
  67. {
  68. get
  69. {
  70. return this.m_nActiveSlotNo;
  71. }
  72. set
  73. {
  74. this.m_nActiveSlotNo = value;
  75. }
  76. }
  77. public Color ManColor
  78. {
  79. get
  80. {
  81. return this.m_colMan;
  82. }
  83. set
  84. {
  85. this.m_colMan = value;
  86. }
  87. }
  88. public int VoicePitch
  89. {
  90. get
  91. {
  92. return this.m_nVoicePitch;
  93. }
  94. set
  95. {
  96. if (this.body0 != null)
  97. {
  98. TBody tbody = this.body0;
  99. this.m_nVoicePitch = value;
  100. tbody.SetVoicePitch(value);
  101. }
  102. }
  103. }
  104. public static void UpdateMaidRanking()
  105. {
  106. if (!GameMain.Instance.CharacterMgr.status.isAvailableRanking)
  107. {
  108. Debug.Log("メイドランキングは未開放なので更新されませんでした");
  109. return;
  110. }
  111. List<KeyValuePair<long, Maid>> list = new List<KeyValuePair<long, Maid>>();
  112. CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
  113. for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
  114. {
  115. Maid stockMaid = characterMgr.GetStockMaid(i);
  116. if (!(stockMaid == null))
  117. {
  118. stockMaid.status.popularRank = 0;
  119. long key = (long)stockMaid.status.evaluation + stockMaid.status.sales;
  120. list.Add(new KeyValuePair<long, Maid>(key, stockMaid));
  121. }
  122. }
  123. list.Sort(delegate(KeyValuePair<long, Maid> a, KeyValuePair<long, Maid> b)
  124. {
  125. long num3 = b.Key - a.Key;
  126. return (num3 != 0L) ? ((0L >= num3) ? -1 : 1) : 0;
  127. });
  128. long num = -1L;
  129. int num2 = 0;
  130. foreach (KeyValuePair<long, Maid> keyValuePair in list)
  131. {
  132. if (keyValuePair.Key == 0L)
  133. {
  134. break;
  135. }
  136. if (keyValuePair.Key != num)
  137. {
  138. num2++;
  139. }
  140. keyValuePair.Value.status.popularRank = num2;
  141. num = keyValuePair.Key;
  142. }
  143. }
  144. private void Awake()
  145. {
  146. }
  147. public void OnMouseUp()
  148. {
  149. if (this.IsBusy || this.body0 == null || this.onMouseUpEvent == null)
  150. {
  151. return;
  152. }
  153. this.onMouseUpEvent(this);
  154. }
  155. public void Initialize(string f_strTypeName, bool f_bMan)
  156. {
  157. this.m_Parts = base.gameObject.AddComponent<MaidParts>();
  158. this.m_goOffset = new GameObject("Offset");
  159. this.m_goOffset.transform.parent = base.gameObject.transform;
  160. this.TypeName = f_strTypeName;
  161. this.boMAN = f_bMan;
  162. this.boOffsetY = true;
  163. this.body0 = base.gameObject.AddComponent<TBody>();
  164. this.body0.Init(this, f_bMan);
  165. int length = Enum.GetValues(typeof(MPN)).Length;
  166. this.m_aryMaidProp = new MaidProp[length];
  167. List<MaidProp> list = Maid.CreateInitMaidPropList();
  168. foreach (MaidProp mp in list)
  169. {
  170. this.AddProp(mp);
  171. }
  172. this.InitializeStatus();
  173. this.m_Parts.Initialize(base.gameObject, this);
  174. this.DelPrefabAll();
  175. if (this.boMAN)
  176. {
  177. this.SetUpModel("_I_man.menu");
  178. }
  179. else
  180. {
  181. this.SetUpModel("_I_default.menu");
  182. if (Product.isPublic)
  183. {
  184. this.SetProp(MPN.bra, "bra030_i_.menu", 0, false, false);
  185. this.SetProp(MPN.panz, "Pants030_i_.menu", 0, false, false);
  186. }
  187. }
  188. }
  189. public void InitializeStatus()
  190. {
  191. if (this.m_Status == null)
  192. {
  193. this.m_Status = new Status();
  194. this.m_Status.Initialize(this);
  195. }
  196. }
  197. public static List<MaidProp> CreateInitMaidPropList()
  198. {
  199. return new List<MaidProp>
  200. {
  201. Maid.CreateProp(0, int.MaxValue, 0, MPN.null_mpn, 0),
  202. Maid.CreateProp(0, 130, 10, MPN.MuneL, 1),
  203. Maid.CreateProp(0, 100, 0, MPN.MuneS, 1),
  204. Maid.CreateProp(0, 130, 10, MPN.MuneTare, 1),
  205. Maid.CreateProp(0, 100, 40, MPN.RegFat, 1),
  206. Maid.CreateProp(0, 100, 20, MPN.ArmL, 1),
  207. Maid.CreateProp(0, 100, 20, MPN.Hara, 1),
  208. Maid.CreateProp(0, 100, 40, MPN.RegMeet, 1),
  209. Maid.CreateProp(20, 80, 50, MPN.KubiScl, 2),
  210. Maid.CreateProp(0, 100, 50, MPN.UdeScl, 2),
  211. Maid.CreateProp(0, 100, 50, MPN.EyeScl, 2),
  212. Maid.CreateProp(0, 100, 50, MPN.EyeSclX, 2),
  213. Maid.CreateProp(0, 100, 50, MPN.EyeSclY, 2),
  214. Maid.CreateProp(0, 100, 50, MPN.EyePosX, 2),
  215. Maid.CreateProp(0, 100, 50, MPN.EyePosY, 2),
  216. Maid.CreateProp(0, 100, 0, MPN.EyeClose, 2),
  217. Maid.CreateProp(0, 100, 50, MPN.EyeBallPosX, 2),
  218. Maid.CreateProp(0, 100, 50, MPN.EyeBallPosY, 2),
  219. Maid.CreateProp(0, 100, 50, MPN.EyeBallSclX, 2),
  220. Maid.CreateProp(0, 100, 50, MPN.EyeBallSclY, 2),
  221. Maid.CreateProp(0, 1, 0, MPN.EarNone, 2),
  222. Maid.CreateProp(0, 100, 0, MPN.EarElf, 2),
  223. Maid.CreateProp(0, 100, 50, MPN.EarRot, 2),
  224. Maid.CreateProp(0, 100, 50, MPN.EarScl, 2),
  225. Maid.CreateProp(0, 100, 50, MPN.NosePos, 2),
  226. Maid.CreateProp(0, 100, 50, MPN.NoseScl, 2),
  227. Maid.CreateProp(0, 100, 0, MPN.FaceShape, 2),
  228. Maid.CreateProp(0, 100, 0, MPN.FaceShapeSlim, 2),
  229. Maid.CreateProp(0, 100, 50, MPN.MayuShapeIn, 2),
  230. Maid.CreateProp(0, 100, 50, MPN.MayuShapeOut, 2),
  231. Maid.CreateProp(0, 100, 50, MPN.MayuX, 2),
  232. Maid.CreateProp(0, 100, 50, MPN.MayuY, 2),
  233. Maid.CreateProp(0, 100, 50, MPN.MayuRot, 2),
  234. Maid.CreateProp(0, 100, 50, MPN.HeadX, 2),
  235. Maid.CreateProp(0, 100, 50, MPN.HeadY, 2),
  236. Maid.CreateProp(20, 80, 50, MPN.DouPer, 2),
  237. Maid.CreateProp(20, 80, 50, MPN.sintyou, 2),
  238. Maid.CreateProp(0, 100, 50, MPN.koshi, 2),
  239. Maid.CreateProp(0, 100, 50, MPN.kata, 2),
  240. Maid.CreateProp(0, 100, 50, MPN.west, 2),
  241. Maid.CreateProp(0, 100, 10, MPN.MuneUpDown, 2),
  242. Maid.CreateProp(0, 100, 40, MPN.MuneYori, 2),
  243. Maid.CreateProp(0, 100, 50, MPN.MuneYawaraka, 2),
  244. Maid.CreateProp(string.Empty, MPN.body, 3),
  245. Maid.CreateProp(string.Empty, MPN.head, 3),
  246. Maid.CreateProp(string.Empty, MPN.hairf, 3),
  247. Maid.CreateProp(string.Empty, MPN.hairr, 3),
  248. Maid.CreateProp(string.Empty, MPN.hairt, 3),
  249. Maid.CreateProp(string.Empty, MPN.hairs, 3),
  250. Maid.CreateProp(string.Empty, MPN.wear, 3),
  251. Maid.CreateProp(string.Empty, MPN.skirt, 3),
  252. Maid.CreateProp(string.Empty, MPN.mizugi, 3),
  253. Maid.CreateProp(string.Empty, MPN.bra, 3),
  254. Maid.CreateProp(string.Empty, MPN.panz, 3),
  255. Maid.CreateProp(string.Empty, MPN.stkg, 3),
  256. Maid.CreateProp(string.Empty, MPN.shoes, 3),
  257. Maid.CreateProp(string.Empty, MPN.headset, 3),
  258. Maid.CreateProp(string.Empty, MPN.glove, 3),
  259. Maid.CreateProp(string.Empty, MPN.acchead, 3),
  260. Maid.CreateProp(string.Empty, MPN.hairaho, 3),
  261. Maid.CreateProp(string.Empty, MPN.accha, 3),
  262. Maid.CreateProp(string.Empty, MPN.acchana, 3),
  263. Maid.CreateProp(string.Empty, MPN.acckamisub, 3),
  264. Maid.CreateProp(string.Empty, MPN.acckami, 3),
  265. Maid.CreateProp(string.Empty, MPN.accmimi, 3),
  266. Maid.CreateProp(string.Empty, MPN.accnip, 3),
  267. Maid.CreateProp(string.Empty, MPN.acckubi, 3),
  268. Maid.CreateProp(string.Empty, MPN.acckubiwa, 3),
  269. Maid.CreateProp(string.Empty, MPN.accheso, 3),
  270. Maid.CreateProp(string.Empty, MPN.accude, 3),
  271. Maid.CreateProp(string.Empty, MPN.accashi, 3),
  272. Maid.CreateProp(string.Empty, MPN.accsenaka, 3),
  273. Maid.CreateProp(string.Empty, MPN.accshippo, 3),
  274. Maid.CreateProp(string.Empty, MPN.accanl, 3),
  275. Maid.CreateProp(string.Empty, MPN.accvag, 3),
  276. Maid.CreateProp(string.Empty, MPN.megane, 3),
  277. Maid.CreateProp(string.Empty, MPN.accxxx, 3),
  278. Maid.CreateProp(string.Empty, MPN.handitem, 3),
  279. Maid.CreateProp(string.Empty, MPN.acchat, 3),
  280. Maid.CreateProp(string.Empty, MPN.haircolor, 3),
  281. Maid.CreateProp(string.Empty, MPN.skin, 3),
  282. Maid.CreateProp(string.Empty, MPN.acctatoo, 3),
  283. Maid.CreateProp(string.Empty, MPN.accnail, 3),
  284. Maid.CreateProp(string.Empty, MPN.underhair, 3),
  285. Maid.CreateProp(string.Empty, MPN.hokuro, 3),
  286. Maid.CreateProp(string.Empty, MPN.mayu, 3),
  287. Maid.CreateProp(string.Empty, MPN.lip, 3),
  288. Maid.CreateProp(string.Empty, MPN.eye, 3),
  289. Maid.CreateProp(string.Empty, MPN.eye_hi, 3),
  290. Maid.CreateProp(string.Empty, MPN.eye_hi_r, 3),
  291. Maid.CreateProp(string.Empty, MPN.chikubi, 3),
  292. Maid.CreateProp(string.Empty, MPN.chikubicolor, 3),
  293. Maid.CreateProp(string.Empty, MPN.eyewhite, 3),
  294. Maid.CreateProp(string.Empty, MPN.nose, 3),
  295. Maid.CreateProp(string.Empty, MPN.facegloss, 3),
  296. Maid.CreateProp(string.Empty, MPN.moza, 3),
  297. Maid.CreateProp(string.Empty, MPN.onepiece, 3),
  298. Maid.CreateProp(string.Empty, MPN.set_maidwear, 3),
  299. Maid.CreateProp(string.Empty, MPN.set_mywear, 3),
  300. Maid.CreateProp(string.Empty, MPN.set_underwear, 3),
  301. Maid.CreateProp(string.Empty, MPN.set_body, 3),
  302. Maid.CreateProp(string.Empty, MPN.folder_eye, 3),
  303. Maid.CreateProp(string.Empty, MPN.folder_mayu, 3),
  304. Maid.CreateProp(string.Empty, MPN.folder_underhair, 3),
  305. Maid.CreateProp(string.Empty, MPN.folder_skin, 3),
  306. Maid.CreateProp(string.Empty, MPN.folder_eyewhite, 3),
  307. Maid.CreateProp(string.Empty, MPN.kousoku_upper, 3),
  308. Maid.CreateProp(string.Empty, MPN.kousoku_lower, 3),
  309. Maid.CreateProp(string.Empty, MPN.seieki_naka, 3),
  310. Maid.CreateProp(string.Empty, MPN.seieki_hara, 3),
  311. Maid.CreateProp(string.Empty, MPN.seieki_face, 3),
  312. Maid.CreateProp(string.Empty, MPN.seieki_mune, 3),
  313. Maid.CreateProp(string.Empty, MPN.seieki_hip, 3),
  314. Maid.CreateProp(string.Empty, MPN.seieki_ude, 3),
  315. Maid.CreateProp(string.Empty, MPN.seieki_ashi, 3)
  316. };
  317. }
  318. public void Uninit()
  319. {
  320. this.Visible = false;
  321. this.boOffsetY = true;
  322. this.DelPrefabAll();
  323. Debug.Log("Uninit " + this.status.firstName);
  324. this.body0.UnInit();
  325. }
  326. private void OnDestroy()
  327. {
  328. this.DelPrefabAll();
  329. this.Uninit();
  330. }
  331. public void ManColorUpdate()
  332. {
  333. if (this.body0 != null)
  334. {
  335. this.body0.ManColorUpdate();
  336. }
  337. }
  338. public void ClearPropValueDefault()
  339. {
  340. foreach (MaidProp maidProp in this.m_aryMaidProp)
  341. {
  342. if (!(maidProp.name == "body"))
  343. {
  344. maidProp.temp_value = (maidProp.value = maidProp.value_Default);
  345. }
  346. }
  347. }
  348. public MaidProp GetProp(string tag)
  349. {
  350. return this.m_dicMaidProp[tag];
  351. }
  352. public MaidProp GetPropLower(string tagLower)
  353. {
  354. return (MaidProp)this.m_hashMaidPropLower[tagLower];
  355. }
  356. public MaidProp GetProp(MPN mpn)
  357. {
  358. return this.m_aryMaidProp[(int)mpn];
  359. }
  360. public static MaidProp CreateProp(string f_strDefFileName, MPN mpn, int type)
  361. {
  362. NDebug.Assert(type == 3, "プロパティオブジェクトのタイプが不正です。");
  363. MaidProp maidProp = new MaidProp();
  364. maidProp.name = mpn.ToString();
  365. maidProp.type = type;
  366. maidProp.listSubProp = null;
  367. maidProp.strFileName = f_strDefFileName;
  368. if (string.IsNullOrEmpty(maidProp.strFileName))
  369. {
  370. string strFileName = maidProp.strFileName;
  371. if (CM3.dicDelItem.TryGetValue(mpn, out strFileName))
  372. {
  373. maidProp.strFileName = strFileName;
  374. }
  375. }
  376. maidProp.nFileNameRID = maidProp.strFileName.ToLower().GetHashCode();
  377. maidProp.boDut = true;
  378. maidProp.boTempDut = false;
  379. maidProp.idx = (int)mpn;
  380. return maidProp;
  381. }
  382. public static MaidProp CreateProp(int minval, int maxval, int defval, MPN mpn, int type)
  383. {
  384. NDebug.Assert(type == 0 || type == 1 || type == 2, "プロパティオブジェクトのタイプが不正です。");
  385. MaidProp maidProp = new MaidProp();
  386. maidProp.name = mpn.ToString();
  387. maidProp.type = type;
  388. maidProp.min = minval;
  389. maidProp.max = maxval;
  390. if (defval < minval)
  391. {
  392. defval = minval;
  393. }
  394. if (defval > maxval)
  395. {
  396. defval = maxval;
  397. }
  398. maidProp.value_Default = defval;
  399. maidProp.listSubProp = null;
  400. maidProp.strFileName = string.Empty;
  401. maidProp.temp_value = (maidProp.value = defval);
  402. maidProp.idx = (int)mpn;
  403. maidProp.boDut = true;
  404. maidProp.boTempDut = false;
  405. return maidProp;
  406. }
  407. private void AddProp(MaidProp mp)
  408. {
  409. MPN idx = (MPN)mp.idx;
  410. this.m_dicMaidProp[idx.ToString()] = mp;
  411. this.m_aryMaidProp[(int)idx] = mp;
  412. this.m_hashMaidPropLower[idx.ToString().ToLower()] = mp;
  413. }
  414. private void AddProp(string f_strDefFileName, MPN mpn, int type)
  415. {
  416. this.AddProp(Maid.CreateProp(f_strDefFileName, mpn, type));
  417. }
  418. private void AddProp(int minval, int maxval, int defval, MPN mpn, int type)
  419. {
  420. this.AddProp(Maid.CreateProp(minval, maxval, defval, mpn, type));
  421. }
  422. public void Prop_AddValue(string tag, int val)
  423. {
  424. NDebug.Assert(this.m_dicMaidProp.ContainsKey(tag), "指定されたプロパティ名がありません。");
  425. this.Prop_AddValue(this.m_dicMaidProp[tag].idx, val);
  426. }
  427. public void Prop_AddValue(int idx, int val)
  428. {
  429. val += this.m_aryMaidProp[idx].value;
  430. if (this.m_aryMaidProp[idx].min > val)
  431. {
  432. val = this.m_aryMaidProp[idx].min;
  433. }
  434. if (this.m_aryMaidProp[idx].max < val)
  435. {
  436. val = this.m_aryMaidProp[idx].max;
  437. }
  438. if (this.m_aryMaidProp[idx].value_LinkMAX != 0 && this.m_aryMaidProp[this.m_aryMaidProp[idx].value_LinkMAX].value < val)
  439. {
  440. val = this.m_aryMaidProp[this.m_aryMaidProp[idx].value_LinkMAX].value;
  441. }
  442. if (this.m_aryMaidProp[idx].value != val)
  443. {
  444. this.m_aryMaidProp[idx].value = val;
  445. }
  446. this.m_aryMaidProp[idx].boDut = true;
  447. this.m_aryMaidProp[idx].boTempDut = false;
  448. }
  449. public void SetProp(string tag, int val, bool f_bTemp = false)
  450. {
  451. MPN idx = MPN.null_mpn;
  452. try
  453. {
  454. idx = (MPN)Enum.Parse(typeof(MPN), tag);
  455. }
  456. catch
  457. {
  458. NDebug.Assert("指定されたプロパティ名がありません。" + tag, false);
  459. }
  460. this.SetProp(idx, val, f_bTemp);
  461. }
  462. public void SetProp(MPN idx, int val, bool f_bTemp = false)
  463. {
  464. NDebug.Assert(idx != MPN.null_mpn, "指定されたプロパティ名がありません。" + base.tag);
  465. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  466. if (maidProp.min > val)
  467. {
  468. val = maidProp.min;
  469. }
  470. if (maidProp.max < val)
  471. {
  472. val = maidProp.max;
  473. }
  474. if (f_bTemp)
  475. {
  476. maidProp.temp_value = val;
  477. maidProp.boTempDut = true;
  478. }
  479. else
  480. {
  481. maidProp.value = val;
  482. maidProp.boDut = true;
  483. maidProp.boTempDut = false;
  484. }
  485. }
  486. public void SetProp(string tag, string filename, int f_nFileNameRID, bool f_bTemp = false, bool f_bNoScale = false)
  487. {
  488. NDebug.Assert(this.m_dicMaidProp.ContainsKey(tag), "指定されたプロパティ名がありません。" + tag);
  489. MaidProp mp = this.m_dicMaidProp[tag];
  490. this.SetProp(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
  491. }
  492. public void SetProp(MPN idx, string filename, int f_nFileNameRID, bool f_bTemp = false, bool f_bNoScale = false)
  493. {
  494. MaidProp mp = this.m_aryMaidProp[(int)idx];
  495. this.SetProp(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
  496. }
  497. public void SetProp(MaidProp mps)
  498. {
  499. bool flag = false;
  500. bool flag2 = false;
  501. bool flag3 = false;
  502. MaidProp prop = this.GetProp((MPN)mps.idx);
  503. bool flag4 = prop.m_dicTBodySkinPos.Count != 0;
  504. flag = (prop.m_dicTBodyAttachPos.Count != 0);
  505. flag2 = (prop.m_dicMaterialProp.Count != 0);
  506. flag3 = (prop.m_dicBoneLength.Count != 0);
  507. if (mps.idx != 43)
  508. {
  509. this.SetProp((MPN)mps.idx, mps.strFileName, mps.nFileNameRID, false, false);
  510. }
  511. if (flag4 || mps.m_dicTBodySkinPos.Count != 0)
  512. {
  513. MaidProp prop2 = this.GetProp((MPN)mps.idx);
  514. prop2.m_dicTBodySkinPos.Clear();
  515. foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, BoneAttachPos>> keyValuePair in mps.m_dicTBodySkinPos)
  516. {
  517. prop2.m_dicTBodySkinPos[keyValuePair.Key] = new KeyValuePair<int, BoneAttachPos>(keyValuePair.Value.Key, new BoneAttachPos(keyValuePair.Value.Value));
  518. }
  519. if (mps.idx != 43)
  520. {
  521. prop2.boDut = true;
  522. }
  523. prop2.boAdjustDut = true;
  524. }
  525. if (flag || mps.m_dicTBodyAttachPos.Count != 0)
  526. {
  527. MaidProp prop3 = this.GetProp((MPN)mps.idx);
  528. prop3.m_dicTBodyAttachPos.Clear();
  529. foreach (KeyValuePair<TBody.SlotID, Dictionary<string, KeyValuePair<int, VtxAttachPos>>> keyValuePair2 in mps.m_dicTBodyAttachPos)
  530. {
  531. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary = new Dictionary<string, KeyValuePair<int, VtxAttachPos>>();
  532. foreach (KeyValuePair<string, KeyValuePair<int, VtxAttachPos>> keyValuePair3 in keyValuePair2.Value)
  533. {
  534. dictionary[keyValuePair3.Key] = new KeyValuePair<int, VtxAttachPos>(keyValuePair3.Value.Key, new VtxAttachPos(keyValuePair3.Value.Value));
  535. }
  536. prop3.m_dicTBodyAttachPos[keyValuePair2.Key] = dictionary;
  537. }
  538. if (mps.idx != 43)
  539. {
  540. prop3.boDut = true;
  541. }
  542. prop3.boAdjustDut = true;
  543. }
  544. if (flag2 || mps.m_dicMaterialProp.Count != 0)
  545. {
  546. MaidProp prop4 = this.GetProp((MPN)mps.idx);
  547. prop4.m_dicMaterialProp.Clear();
  548. foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, MatPropSave>> keyValuePair4 in mps.m_dicMaterialProp)
  549. {
  550. prop4.m_dicMaterialProp[keyValuePair4.Key] = new KeyValuePair<int, MatPropSave>(keyValuePair4.Value.Key, new MatPropSave(keyValuePair4.Value.Value));
  551. }
  552. if (mps.idx != 43)
  553. {
  554. prop4.boDut = true;
  555. }
  556. prop4.boAdjustDut = true;
  557. }
  558. if (flag3 || mps.m_dicBoneLength.Count != 0)
  559. {
  560. MaidProp prop5 = this.GetProp((MPN)mps.idx);
  561. prop5.m_dicBoneLength.Clear();
  562. foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> keyValuePair5 in mps.m_dicBoneLength)
  563. {
  564. Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
  565. foreach (KeyValuePair<string, float> keyValuePair6 in keyValuePair5.Value.Value)
  566. {
  567. dictionary2[keyValuePair6.Key] = keyValuePair6.Value;
  568. }
  569. prop5.m_dicBoneLength[keyValuePair5.Key] = new KeyValuePair<int, Dictionary<string, float>>(keyValuePair5.Value.Key, dictionary2);
  570. }
  571. if (mps.idx != 43)
  572. {
  573. prop5.boDut = true;
  574. }
  575. prop5.boAdjustDut = true;
  576. }
  577. }
  578. private void SetProp(MaidProp mp, string filename, int f_nFileNameRID, bool f_bTemp, bool f_bNoScale = false)
  579. {
  580. if (f_bTemp)
  581. {
  582. if (filename != mp.strTempFileName)
  583. {
  584. mp.boTempDut = true;
  585. mp.strTempFileName = filename;
  586. mp.bNoScale = f_bNoScale;
  587. if (f_nFileNameRID == 0)
  588. {
  589. mp.nTempFileNameRID = filename.ToLower().GetHashCode();
  590. }
  591. else
  592. {
  593. mp.nTempFileNameRID = f_nFileNameRID;
  594. }
  595. if (Product.isPublic)
  596. {
  597. if (mp.idx == 71 && filename.ToLower() != "pants030_i_.menu")
  598. {
  599. this.SetProp(mp, "pants030_i_.menu", 0, f_bTemp, f_bNoScale);
  600. return;
  601. }
  602. if (mp.idx == 70 && filename.ToLower() != "bra030_i_.menu")
  603. {
  604. this.SetProp(mp, "bra030_i_.menu", 0, f_bTemp, f_bNoScale);
  605. return;
  606. }
  607. }
  608. }
  609. }
  610. else
  611. {
  612. if (mp.strFileName != filename || mp.bSubDut || (97 <= mp.idx && mp.idx <= 100))
  613. {
  614. mp.boDut = true;
  615. }
  616. mp.strFileName = filename;
  617. mp.bNoScale = f_bNoScale;
  618. if (f_nFileNameRID == 0)
  619. {
  620. mp.nFileNameRID = filename.ToLower().GetHashCode();
  621. }
  622. else
  623. {
  624. mp.nFileNameRID = f_nFileNameRID;
  625. }
  626. mp.strTempFileName = string.Empty;
  627. mp.nTempFileNameRID = 0;
  628. if (mp.listSubProp != null)
  629. {
  630. mp.listSubProp.Clear();
  631. }
  632. mp.bSubDut = false;
  633. mp.m_dicTBodySkinPos.Clear();
  634. mp.m_dicTBodyAttachPos.Clear();
  635. mp.m_dicMaterialProp.Clear();
  636. mp.m_dicBoneLength.Clear();
  637. if (Product.isPublic)
  638. {
  639. f_nFileNameRID = mp.nFileNameRID;
  640. if (filename.Contains("_del"))
  641. {
  642. f_nFileNameRID = 0;
  643. }
  644. if (mp.idx == 96)
  645. {
  646. this.m_strBefOnepiceFileName = filename;
  647. this.m_nBefOnepiceRID = f_nFileNameRID;
  648. if (f_nFileNameRID != 0)
  649. {
  650. MaidProp prop = this.GetProp(MPN.wear);
  651. if (!prop.strFileName.Contains("_del"))
  652. {
  653. this.m_strBefWearFileName = prop.strFileName;
  654. this.m_nBefWearRID = prop.nFileNameRID;
  655. }
  656. MaidProp prop2 = this.GetProp(MPN.skirt);
  657. if (!prop2.strFileName.Contains("_del"))
  658. {
  659. this.m_strBefSkirtFileName = prop2.strFileName;
  660. this.m_nBefSkirtRID = prop2.nFileNameRID;
  661. }
  662. }
  663. }
  664. else if (mp.idx == 67)
  665. {
  666. this.m_strBefWearFileName = filename;
  667. this.m_nBefWearRID = f_nFileNameRID;
  668. if (f_nFileNameRID != 0 && this.m_nBefOnepiceRID != 0)
  669. {
  670. this.m_nBefOnepiceRID = 0;
  671. if (this.m_nBefSkirtRID != 0)
  672. {
  673. this.SetProp(MPN.skirt, this.m_strBefSkirtFileName, this.m_nBefSkirtRID, false, false);
  674. }
  675. }
  676. }
  677. else if (mp.idx == 68)
  678. {
  679. this.m_strBefSkirtFileName = filename;
  680. this.m_nBefSkirtRID = f_nFileNameRID;
  681. if (f_nFileNameRID != 0 && this.m_nBefOnepiceRID != 0)
  682. {
  683. this.m_nBefOnepiceRID = 0;
  684. if (this.m_nBefWearRID != 0)
  685. {
  686. this.SetProp(MPN.wear, this.m_strBefWearFileName, this.m_nBefWearRID, false, false);
  687. }
  688. }
  689. }
  690. else
  691. {
  692. if (mp.idx == 71 && filename.ToLower() != "pants030_i_.menu")
  693. {
  694. this.SetProp(mp, "pants030_i_.menu", 0, f_bTemp, f_bNoScale);
  695. return;
  696. }
  697. if (mp.idx == 70 && filename.ToLower() != "bra030_i_.menu")
  698. {
  699. this.SetProp(mp, "bra030_i_.menu", 0, f_bTemp, f_bNoScale);
  700. return;
  701. }
  702. }
  703. }
  704. }
  705. if (mp.boTempDut && mp.boDut)
  706. {
  707. string[] array = new string[6];
  708. array[0] = "SetProp:本元とTempのどうちらにも更新フラグが付いています。";
  709. int num = 1;
  710. MPN idx = (MPN)mp.idx;
  711. array[num] = idx.ToString();
  712. array[2] = " 元=";
  713. array[3] = mp.strFileName;
  714. array[4] = " Temp=";
  715. array[5] = mp.strTempFileName;
  716. Debug.LogWarning(string.Concat(array));
  717. }
  718. }
  719. public bool DelProp(MPN idx, bool f_bTemp = false)
  720. {
  721. string empty = string.Empty;
  722. if (CM3.dicDelItem.TryGetValue(idx, out empty))
  723. {
  724. this.SetProp(idx, empty, 0, f_bTemp, false);
  725. return true;
  726. }
  727. return false;
  728. }
  729. public void SetSubProp(MPN idx, int subno, string filename, int f_nFileNameRID = 0)
  730. {
  731. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  732. if (maidProp.listSubProp == null)
  733. {
  734. maidProp.listSubProp = new List<SubProp>();
  735. }
  736. if (maidProp.listSubProp.Count<SubProp>() < subno + 1)
  737. {
  738. int num = maidProp.listSubProp.Count<SubProp>();
  739. for (int i = num; i < subno + 1; i++)
  740. {
  741. maidProp.listSubProp.Add(null);
  742. }
  743. }
  744. SubProp subProp = maidProp.listSubProp[subno];
  745. if (subProp == null)
  746. {
  747. SubProp subProp2 = new SubProp();
  748. maidProp.listSubProp[subno] = subProp2;
  749. subProp = subProp2;
  750. }
  751. subProp.bDut = true;
  752. subProp.strFileName = filename;
  753. if (f_nFileNameRID == 0)
  754. {
  755. subProp.nFileNameRID = filename.ToLower().GetHashCode();
  756. }
  757. else
  758. {
  759. subProp.nFileNameRID = f_nFileNameRID;
  760. }
  761. maidProp.bSubDut = true;
  762. }
  763. public SubProp GetSubProp(MPN idx, int subno)
  764. {
  765. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  766. SubProp result = null;
  767. if (maidProp.listSubProp != null && subno < maidProp.listSubProp.Count)
  768. {
  769. result = maidProp.listSubProp[subno];
  770. }
  771. return result;
  772. }
  773. public void DelSubProp(MPN idx, int subno = -1)
  774. {
  775. MaidProp maidProp = this.m_aryMaidProp[(int)idx];
  776. if (maidProp.listSubProp != null)
  777. {
  778. if (subno == -1)
  779. {
  780. maidProp.listSubProp.Clear();
  781. }
  782. else if (maidProp.listSubProp.Count > subno)
  783. {
  784. SubProp subProp = maidProp.listSubProp[subno];
  785. if (subProp != null)
  786. {
  787. subProp.strFileName = string.Empty;
  788. subProp.nFileNameRID = 0;
  789. subProp.bDut = false;
  790. }
  791. }
  792. }
  793. maidProp.bSubDut = true;
  794. }
  795. public void ResetProp(string mpn, bool force_reset = false)
  796. {
  797. NDebug.Assert(this.m_dicMaidProp.ContainsKey(mpn), "指定されたプロパティ名がありません。" + base.tag);
  798. MaidProp mp = this.m_dicMaidProp[mpn];
  799. this.ResetProp(mp, force_reset);
  800. }
  801. public void ResetProp(MPN idx, bool force_reset = false)
  802. {
  803. MaidProp mp = this.m_aryMaidProp[(int)idx];
  804. this.ResetProp(mp, force_reset);
  805. }
  806. public void ResetProp(MaidProp mp, bool force_reset = false)
  807. {
  808. if ((mp.nTempFileNameRID != 0 && mp.nFileNameRID != mp.nTempFileNameRID) || mp.temp_value != mp.value || force_reset)
  809. {
  810. mp.boDut = true;
  811. mp.strTempFileName = string.Empty;
  812. mp.nTempFileNameRID = 0;
  813. mp.temp_value = 0;
  814. mp.boTempDut = false;
  815. }
  816. }
  817. public void ItemChangeTemp(string mpn, string name)
  818. {
  819. MaidProp prop = this.GetProp(mpn);
  820. SortedDictionary<string, string> sortedDictionary;
  821. string filename;
  822. if (prop.nFileNameRID != 0 && Menu.m_dicResourceRef.TryGetValue(prop.nFileNameRID, out sortedDictionary) && sortedDictionary.TryGetValue(name, out filename))
  823. {
  824. this.SetProp(mpn, filename, 0, true, false);
  825. }
  826. }
  827. public bool IsItemChange(string mpn, string name)
  828. {
  829. MaidProp prop = this.GetProp(mpn);
  830. return prop.nFileNameRID != 0 && Menu.m_dicResourceRef.ContainsKey(prop.nFileNameRID) && Menu.m_dicResourceRef[prop.nFileNameRID].ContainsKey(name) && this.GetProp(mpn).strTempFileName == Menu.m_dicResourceRef[prop.nFileNameRID][name];
  831. }
  832. public bool IsItemChangeEnabled(string mpn, string name)
  833. {
  834. MaidProp prop = this.GetProp(mpn);
  835. return prop.nFileNameRID != 0 && Menu.m_dicResourceRef.ContainsKey(prop.nFileNameRID) && Menu.m_dicResourceRef[prop.nFileNameRID].ContainsKey(name);
  836. }
  837. public void DutPropAll()
  838. {
  839. for (int i = 0; i < this.m_aryMaidProp.Length; i++)
  840. {
  841. MaidProp maidProp = this.m_aryMaidProp[i];
  842. maidProp.boDut = true;
  843. if (maidProp.listSubProp != null)
  844. {
  845. for (int j = 0; j < maidProp.listSubProp.Count; j++)
  846. {
  847. if (maidProp.listSubProp[j] != null)
  848. {
  849. maidProp.listSubProp[j].bDut = true;
  850. }
  851. }
  852. }
  853. }
  854. }
  855. public void SetUpModel(string f_strPresetMenuFileName)
  856. {
  857. Menu.ProcScript(this, f_strPresetMenuFileName, false, null);
  858. this.body0.FixMaskFlag();
  859. this.body0.FixVisibleFlag(false);
  860. this.AllProcPropSeqStart();
  861. if (!this.boMAN)
  862. {
  863. }
  864. }
  865. public void AllProcPropSeqStart()
  866. {
  867. this.boAllProcPropBUSY = true;
  868. this.boModelChg = false;
  869. this.AllProcProp2Fase = 0;
  870. this.AllProcProp2Cnt = 0;
  871. }
  872. private void AllProcPropSeq()
  873. {
  874. if (this.AllProcProp2Fase == 0)
  875. {
  876. while (this.AllProcProp2Fase == 0)
  877. {
  878. MaidProp maidProp = this.m_aryMaidProp[this.AllProcProp2Cnt];
  879. this.AllProcProp2Cnt++;
  880. if (this.m_aryMaidProp.Length == this.AllProcProp2Cnt)
  881. {
  882. this.AllProcProp2Cnt = 0;
  883. if (Array.Find<MaidProp>(this.m_aryMaidProp, (MaidProp m) => m.type == 3 && (m.boDut || m.boTempDut)) == null)
  884. {
  885. this.AllProcProp2Fase++;
  886. }
  887. }
  888. if (maidProp == null)
  889. {
  890. string str = "AllProcProp2_Proc MPNがNULLです。";
  891. MPN allProcProp2Cnt = (MPN)this.AllProcProp2Cnt;
  892. NDebug.Assert(str + allProcProp2Cnt.ToString(), false);
  893. }
  894. if (maidProp.type == 3 && this.ProcItem(this.m_dicMaidProp[maidProp.name]))
  895. {
  896. if (!this.boModelChg)
  897. {
  898. this.body0.FixVisibleFlag(true);
  899. this.boModelChg = true;
  900. }
  901. if (this.boMAN && maidProp.idx == 43)
  902. {
  903. for (int i = 44; i <= 100; i++)
  904. {
  905. this.GetProp((MPN)i).boDut = true;
  906. }
  907. this.GetProp(MPN.moza).boDut = true;
  908. }
  909. else if (maidProp.idx == 50 || maidProp.idx == 46 || maidProp.idx == 47 || maidProp.idx == 49 || maidProp.idx == 48)
  910. {
  911. this.GetProp(MPN.haircolor).boDut = true;
  912. }
  913. else if (maidProp.idx == 45)
  914. {
  915. MPN[] array = new MPN[]
  916. {
  917. MPN.skin,
  918. MPN.eye,
  919. MPN.mayu,
  920. MPN.eye_hi,
  921. MPN.eye_hi_r,
  922. MPN.EyeClose,
  923. MPN.EarNone,
  924. MPN.EarElf,
  925. MPN.EarRot,
  926. MPN.EarScl,
  927. MPN.NosePos,
  928. MPN.NoseScl,
  929. MPN.FaceShape,
  930. MPN.FaceShapeSlim,
  931. MPN.MayuShapeIn,
  932. MPN.MayuShapeOut,
  933. MPN.MayuX,
  934. MPN.MayuY,
  935. MPN.MayuRot,
  936. MPN.eye_hi_r,
  937. MPN.eyewhite,
  938. MPN.nose,
  939. MPN.facegloss,
  940. MPN.lip
  941. };
  942. foreach (MPN mpn in array)
  943. {
  944. this.GetProp(mpn).boDut = true;
  945. }
  946. }
  947. else if (maidProp.idx == 52)
  948. {
  949. MaidProp prop = this.GetProp(MPN.acctatoo);
  950. prop.boDut = true;
  951. if (prop.listSubProp != null)
  952. {
  953. for (int k = 0; k < prop.listSubProp.Count; k++)
  954. {
  955. if (prop.listSubProp[k] != null)
  956. {
  957. prop.listSubProp[k].bDut = true;
  958. }
  959. }
  960. }
  961. prop = this.GetProp(MPN.hokuro);
  962. prop.boDut = true;
  963. if (prop.listSubProp != null)
  964. {
  965. for (int l = 0; l < prop.listSubProp.Count; l++)
  966. {
  967. if (prop.listSubProp[l] != null)
  968. {
  969. prop.listSubProp[l].bDut = true;
  970. }
  971. }
  972. }
  973. this.GetProp(MPN.lip).boDut = true;
  974. this.GetProp(MPN.nose).boDut = true;
  975. this.GetProp(MPN.facegloss).boDut = true;
  976. }
  977. break;
  978. }
  979. }
  980. }
  981. else if (this.AllProcProp2Fase == 1)
  982. {
  983. this.AllProcProp2Fase++;
  984. }
  985. else if (this.AllProcProp2Fase == 2)
  986. {
  987. bool flag = false;
  988. foreach (MaidProp maidProp2 in this.m_dicMaidProp.Values)
  989. {
  990. if (maidProp2.type != 3)
  991. {
  992. flag |= this.ProcItem(maidProp2);
  993. }
  994. }
  995. if (flag)
  996. {
  997. this.body0.ItemScaleReset();
  998. }
  999. this.AllProcProp2Fase++;
  1000. }
  1001. else if (this.AllProcProp2Fase == 3)
  1002. {
  1003. if (this.boModelChg)
  1004. {
  1005. this.body0.MulTexProc();
  1006. this.body0.FixMaskFlag();
  1007. this.body0.FixVisibleFlag(false);
  1008. }
  1009. this.AllProcProp2Fase++;
  1010. }
  1011. else if (this.AllProcProp2Fase == 4)
  1012. {
  1013. this.ProcSSParam();
  1014. this.AllProcProp2Fase++;
  1015. }
  1016. else if (this.AllProcProp2Fase == 5)
  1017. {
  1018. this.boAllProcPropBUSY = false;
  1019. }
  1020. }
  1021. public void AllProcProp()
  1022. {
  1023. if (Product.isPublic)
  1024. {
  1025. this.AllProcPropSeqStart();
  1026. while (this.boAllProcPropBUSY)
  1027. {
  1028. this.AllProcPropSeq();
  1029. }
  1030. return;
  1031. }
  1032. this.boModelChg = false;
  1033. float realtimeSinceStartup = Time.realtimeSinceStartup;
  1034. for (;;)
  1035. {
  1036. if (Array.Find<MaidProp>(this.m_aryMaidProp, (MaidProp m) => m.type == 3 && (m.boDut || m.boTempDut)) == null)
  1037. {
  1038. break;
  1039. }
  1040. for (int i = 0; i < this.m_aryMaidProp.Length; i++)
  1041. {
  1042. MaidProp maidProp = this.m_aryMaidProp[i];
  1043. string name = maidProp.name;
  1044. if (maidProp.type == 3 && this.ProcItem(this.m_dicMaidProp[name]))
  1045. {
  1046. if (!this.boModelChg)
  1047. {
  1048. this.body0.FixVisibleFlag(true);
  1049. this.boModelChg = true;
  1050. }
  1051. if (this.boMAN && maidProp.idx == 43)
  1052. {
  1053. for (int j = 44; j <= 100; j++)
  1054. {
  1055. this.GetProp((MPN)j).boDut = true;
  1056. }
  1057. this.GetProp(MPN.moza).boDut = true;
  1058. }
  1059. else if (maidProp.idx == 50 || maidProp.idx == 46 || maidProp.idx == 47 || maidProp.idx == 49 || maidProp.idx == 48)
  1060. {
  1061. this.GetProp(MPN.haircolor).boDut = true;
  1062. }
  1063. else if (maidProp.idx == 45)
  1064. {
  1065. MPN[] array = new MPN[]
  1066. {
  1067. MPN.skin,
  1068. MPN.eye,
  1069. MPN.mayu,
  1070. MPN.eye_hi,
  1071. MPN.eye_hi_r,
  1072. MPN.EyeClose,
  1073. MPN.EarNone,
  1074. MPN.EarElf,
  1075. MPN.EarRot,
  1076. MPN.EarScl,
  1077. MPN.NosePos,
  1078. MPN.NoseScl,
  1079. MPN.FaceShape,
  1080. MPN.FaceShapeSlim,
  1081. MPN.MayuShapeIn,
  1082. MPN.MayuShapeOut,
  1083. MPN.MayuX,
  1084. MPN.MayuY,
  1085. MPN.MayuRot,
  1086. MPN.eye_hi_r,
  1087. MPN.eyewhite,
  1088. MPN.nose,
  1089. MPN.facegloss,
  1090. MPN.lip
  1091. };
  1092. foreach (MPN mpn in array)
  1093. {
  1094. this.GetProp(mpn).boDut = true;
  1095. }
  1096. }
  1097. else if (maidProp.idx == 52)
  1098. {
  1099. MaidProp prop = this.GetProp(MPN.acctatoo);
  1100. prop.boDut = true;
  1101. if (prop.listSubProp != null)
  1102. {
  1103. for (int l = 0; l < prop.listSubProp.Count; l++)
  1104. {
  1105. if (prop.listSubProp[l] != null)
  1106. {
  1107. prop.listSubProp[l].bDut = true;
  1108. }
  1109. }
  1110. }
  1111. prop = this.GetProp(MPN.hokuro);
  1112. prop.boDut = true;
  1113. if (prop.listSubProp != null)
  1114. {
  1115. for (int n = 0; n < prop.listSubProp.Count; n++)
  1116. {
  1117. if (prop.listSubProp[n] != null)
  1118. {
  1119. prop.listSubProp[n].bDut = true;
  1120. }
  1121. }
  1122. }
  1123. this.GetProp(MPN.lip).boDut = true;
  1124. this.GetProp(MPN.nose).boDut = true;
  1125. this.GetProp(MPN.facegloss).boDut = true;
  1126. }
  1127. }
  1128. }
  1129. }
  1130. realtimeSinceStartup = Time.realtimeSinceStartup;
  1131. bool flag = false;
  1132. foreach (MaidProp maidProp2 in this.m_dicMaidProp.Values)
  1133. {
  1134. if (maidProp2.type != 3)
  1135. {
  1136. flag |= this.ProcItem(maidProp2);
  1137. }
  1138. }
  1139. if (flag)
  1140. {
  1141. this.body0.ItemScaleReset();
  1142. }
  1143. realtimeSinceStartup = Time.realtimeSinceStartup;
  1144. if (this.boModelChg)
  1145. {
  1146. this.body0.MulTexProc();
  1147. this.body0.FixMaskFlag();
  1148. this.body0.FixVisibleFlag(false);
  1149. }
  1150. realtimeSinceStartup = Time.realtimeSinceStartup;
  1151. this.ProcSSParam();
  1152. }
  1153. private bool ProcItem(MaidProp mp)
  1154. {
  1155. bool result = false;
  1156. string name = mp.name;
  1157. if (mp.type == 1)
  1158. {
  1159. if (mp.boTempDut)
  1160. {
  1161. mp.boTempDut = false;
  1162. this.body0.VertexMorph_FromProcItem(name, (float)mp.temp_value / 100f);
  1163. result = true;
  1164. }
  1165. if (mp.boDut)
  1166. {
  1167. mp.boDut = false;
  1168. this.body0.VertexMorph_FromProcItem(name, (float)mp.value / 100f);
  1169. result = true;
  1170. }
  1171. }
  1172. else if (mp.type == 2)
  1173. {
  1174. if (mp.boTempDut)
  1175. {
  1176. mp.boTempDut = false;
  1177. this.body0.BoneMorph_FromProcItem(name, (float)mp.temp_value / 100f);
  1178. result = true;
  1179. }
  1180. if (mp.boDut)
  1181. {
  1182. mp.boDut = false;
  1183. this.body0.BoneMorph_FromProcItem(name, (float)mp.value / 100f);
  1184. result = true;
  1185. }
  1186. }
  1187. else if (mp.type == 3)
  1188. {
  1189. if (Product.isPublic && (mp.boTempDut || mp.boDut) && (mp.idx == 44 || mp.idx == 55 || mp.idx == 62 || mp.idx == 63 || mp.idx == 44 || mp.idx == 82 || mp.idx == 90 || mp.idx == 91 || mp.idx == 93))
  1190. {
  1191. mp.boDut = false;
  1192. mp.boTempDut = false;
  1193. }
  1194. if (mp.boTempDut && mp.boDut)
  1195. {
  1196. string[] array = new string[6];
  1197. array[0] = "Item実行を、本元とTempを同時に更新しようとしました。";
  1198. int num = 1;
  1199. MPN idx = (MPN)mp.idx;
  1200. array[num] = idx.ToString();
  1201. array[2] = " 元=";
  1202. array[3] = mp.strFileName;
  1203. array[4] = " Temp=";
  1204. array[5] = mp.strTempFileName;
  1205. Debug.LogWarning(string.Concat(array));
  1206. }
  1207. if (mp.boTempDut)
  1208. {
  1209. if (!string.IsNullOrEmpty(mp.strTempFileName) && !Menu.ProcScript(this, mp, true, null))
  1210. {
  1211. Debug.LogWarning("メニューファイル " + mp.strFileName + " が開けませんでした。");
  1212. mp.nTempFileNameRID = 0;
  1213. mp.strTempFileName = string.Empty;
  1214. }
  1215. result = true;
  1216. mp.boTempDut = false;
  1217. if (97 <= mp.idx && mp.idx <= 100)
  1218. {
  1219. mp.nTempFileNameRID = 0;
  1220. mp.strTempFileName = string.Empty;
  1221. }
  1222. }
  1223. if (mp.boDut)
  1224. {
  1225. if (!string.IsNullOrEmpty(mp.strFileName) && !Menu.ProcScript(this, mp, false, null))
  1226. {
  1227. Debug.LogWarning("メニューファイル " + mp.strFileName + " が開けませんでした。");
  1228. if (this.DelProp((MPN)mp.idx, false))
  1229. {
  1230. Menu.ProcScript(this, mp, false, null);
  1231. }
  1232. }
  1233. result = true;
  1234. mp.boDut = false;
  1235. if (97 <= mp.idx && mp.idx <= 100)
  1236. {
  1237. mp.nFileNameRID = 0;
  1238. mp.strFileName = string.Empty;
  1239. }
  1240. }
  1241. if (mp.listSubProp != null)
  1242. {
  1243. for (int i = 0; i < mp.listSubProp.Count; i++)
  1244. {
  1245. SubProp subProp = mp.listSubProp[i];
  1246. if (subProp != null && subProp.bDut)
  1247. {
  1248. if (!Menu.ProcScript(this, subProp.strFileName, false, subProp))
  1249. {
  1250. Debug.LogWarning("サブメニューファイル " + subProp.strFileName + " が開けませんでした。");
  1251. mp.listSubProp[i] = null;
  1252. }
  1253. result = true;
  1254. subProp.bDut = false;
  1255. }
  1256. }
  1257. }
  1258. if (mp.boAdjustDut)
  1259. {
  1260. if (this.body0.isLoadedBody)
  1261. {
  1262. foreach (KeyValuePair<TBody.SlotID, Dictionary<string, KeyValuePair<int, VtxAttachPos>>> keyValuePair in mp.m_dicTBodyAttachPos)
  1263. {
  1264. TBodySkin tbodySkin = this.body0.goSlot[(int)keyValuePair.Key];
  1265. if (tbodySkin.morph != null)
  1266. {
  1267. foreach (KeyValuePair<string, KeyValuePair<int, VtxAttachPos>> keyValuePair2 in keyValuePair.Value)
  1268. {
  1269. tbodySkin.morph.SetAttachPointOffsetLocal(keyValuePair2.Key, keyValuePair2.Value.Value);
  1270. result = true;
  1271. }
  1272. }
  1273. }
  1274. }
  1275. mp.boAdjustDut = false;
  1276. }
  1277. }
  1278. return result;
  1279. }
  1280. public bool MayuDrawPriority
  1281. {
  1282. get
  1283. {
  1284. string materialProperty = this.body0.GetMaterialProperty("head", 3, "_ZTest2", "AUTO");
  1285. if (!string.IsNullOrEmpty(materialProperty))
  1286. {
  1287. float num = 0f;
  1288. if (float.TryParse(materialProperty, out num))
  1289. {
  1290. if ((int)(num + 0.5f) == 1)
  1291. {
  1292. return false;
  1293. }
  1294. if ((int)(num + 0.5f) == 7)
  1295. {
  1296. return true;
  1297. }
  1298. }
  1299. }
  1300. return false;
  1301. }
  1302. set
  1303. {
  1304. this.body0.SetMaterialProperty("mayu", "head", 3, "_ZTest2", "UnityEngine.Rendering.CompareFunction", (!value) ? "1" : "7", true);
  1305. }
  1306. }
  1307. public void SubPropAlpha(MPN f_mpn, int f_nSubNo, float f_fTexMulAlpha)
  1308. {
  1309. MaidProp maidProp = this.m_aryMaidProp[(int)f_mpn];
  1310. if (maidProp.listSubProp.Count <= f_nSubNo)
  1311. {
  1312. Debug.LogError("listSubProp の範囲を超えています。");
  1313. return;
  1314. }
  1315. SubProp subProp = maidProp.listSubProp[f_nSubNo];
  1316. if (subProp == null)
  1317. {
  1318. Debug.LogError("listSubProp に " + f_nSubNo + " 番はありません。");
  1319. return;
  1320. }
  1321. subProp.fTexMulAlpha = f_fTexMulAlpha;
  1322. }
  1323. public bool SerializeProp(BinaryWriter f_bwWrite)
  1324. {
  1325. f_bwWrite.Write("CM3D2_MPROP_LIST");
  1326. f_bwWrite.Write(1320);
  1327. f_bwWrite.Write(this.m_dicMaidProp.Count);
  1328. int num = 0;
  1329. foreach (KeyValuePair<string, MaidProp> keyValuePair in this.m_dicMaidProp)
  1330. {
  1331. f_bwWrite.Write(keyValuePair.Key);
  1332. keyValuePair.Value.Serialize(f_bwWrite);
  1333. num++;
  1334. }
  1335. return true;
  1336. }
  1337. public bool SerializePropLowCapacity(BinaryWriter writer)
  1338. {
  1339. NDebug.Assert(this.m_dicMaidProp.Count < 65535, "容量over");
  1340. writer.Write((char)this.m_dicMaidProp.Count);
  1341. NDebug.Assert(true, "MPN容量over");
  1342. foreach (KeyValuePair<string, MaidProp> keyValuePair in this.m_dicMaidProp)
  1343. {
  1344. MPN mpn = (MPN)Enum.Parse(typeof(MPN), keyValuePair.Key);
  1345. writer.Write((char)mpn);
  1346. keyValuePair.Value.SerializeLowCapacity(writer);
  1347. }
  1348. return true;
  1349. }
  1350. public bool SerializeMultiColor(BinaryWriter f_bwWrite)
  1351. {
  1352. return this.m_Parts.Serialize(f_bwWrite);
  1353. }
  1354. public bool SerializeMisc(BinaryWriter f_bwWrite)
  1355. {
  1356. f_bwWrite.Write("CM3D2_MAID_MISC");
  1357. f_bwWrite.Write(1320);
  1358. f_bwWrite.Write(this.m_nActiveSlotNo);
  1359. if (this.m_texIcon != null)
  1360. {
  1361. byte[] array = this.m_texIcon.EncodeToPNG();
  1362. f_bwWrite.Write(array.Length);
  1363. f_bwWrite.Write(array);
  1364. }
  1365. else
  1366. {
  1367. f_bwWrite.Write(0);
  1368. }
  1369. f_bwWrite.Write(this.m_strThumCardTime);
  1370. f_bwWrite.Write(this.m_colMan.r);
  1371. f_bwWrite.Write(this.m_colMan.g);
  1372. f_bwWrite.Write(this.m_colMan.b);
  1373. f_bwWrite.Write(this.m_colMan.a);
  1374. f_bwWrite.Write(this.m_nVoicePitch);
  1375. this.FixThumCard();
  1376. return true;
  1377. }
  1378. public bool SerializeBody(BinaryWriter f_bwWrite)
  1379. {
  1380. f_bwWrite.Write("CM3D2_MAID_BODY");
  1381. f_bwWrite.Write(1320);
  1382. return true;
  1383. }
  1384. public bool DeserializeProp(BinaryReader f_brRead)
  1385. {
  1386. string a = f_brRead.ReadString();
  1387. NDebug.Assert(a == "CM3D2_MPROP_LIST", "メイドプロパティリストのヘッダーが不正です。");
  1388. int num = f_brRead.ReadInt32();
  1389. int num2 = f_brRead.ReadInt32();
  1390. for (int i = 0; i < num2; i++)
  1391. {
  1392. string tag = f_brRead.ReadString();
  1393. MaidProp prop = this.GetProp(tag);
  1394. prop.Deserialize(f_brRead);
  1395. if (num <= 135 && prop.idx == 83 && Path.GetFileNameWithoutExtension(prop.strFileName.ToLower()) == "acckubi007_i_")
  1396. {
  1397. prop.boDut = true;
  1398. prop.strFileName = CM3.dicDelItem[MPN.acckubi];
  1399. prop.nFileNameRID = prop.strFileName.ToLower().GetHashCode();
  1400. prop.strTempFileName = string.Empty;
  1401. prop.nTempFileNameRID = 0;
  1402. }
  1403. }
  1404. if (num <= 110)
  1405. {
  1406. MaidProp prop2 = this.GetProp(MPN.EyeScl);
  1407. MaidProp prop3 = this.GetProp(MPN.EyeSclX);
  1408. prop3.value = prop2.value;
  1409. MaidProp prop4 = this.GetProp(MPN.EyeSclY);
  1410. prop4.value = prop2.value;
  1411. }
  1412. if (!this.boMAN && Product.isPublic)
  1413. {
  1414. this.SetProp(MPN.bra, "bra030_i_.menu", 0, false, false);
  1415. this.SetProp(MPN.panz, "Pants030_i_.menu", 0, false, false);
  1416. }
  1417. this.AllProcPropSeqStart();
  1418. return true;
  1419. }
  1420. public void DeserializeOldData(OldDataConverter.MaidData data, bool statusOnly = false)
  1421. {
  1422. NDebug.AssertNull(data != null);
  1423. this.status.Deserialize(data.statusReader, true);
  1424. using (MemoryStream memoryStream = new MemoryStream(data.ReadAppearanceByte()))
  1425. {
  1426. using (BinaryReader binaryReader = new BinaryReader(memoryStream))
  1427. {
  1428. this.DeserializeProp(binaryReader);
  1429. this.DeserializeMultiColor(binaryReader);
  1430. }
  1431. }
  1432. if (!statusOnly)
  1433. {
  1434. Texture2D texture2D = new Texture2D(1, 1, TextureFormat.ARGB32, false);
  1435. texture2D.LoadImage(data.ReadThumbnailByte());
  1436. byte[] array = data.ReadAppearanceByte();
  1437. this.SetThumIcon(texture2D);
  1438. string text = GameMain.Instance.CMSystem.CM3D2Path + "\\Thumb\\" + this.status.guid + ".png";
  1439. if (File.Exists(text))
  1440. {
  1441. string text2 = UTY.gameProjectPath + "\\Thumb\\" + this.status.guid + ".png";
  1442. if (!File.Exists(text2))
  1443. {
  1444. File.Copy(text, text2);
  1445. }
  1446. }
  1447. }
  1448. }
  1449. public static List<MaidProp> DeserializePropPre(BinaryReader f_brRead)
  1450. {
  1451. List<MaidProp> list = new List<MaidProp>();
  1452. string a = f_brRead.ReadString();
  1453. NDebug.Assert(a == "CM3D2_MPROP_LIST", "メイドプロパティリストのヘッダーが不正です。");
  1454. int num = f_brRead.ReadInt32();
  1455. int num2 = f_brRead.ReadInt32();
  1456. HashSet<MPN> hashSet = new HashSet<MPN>();
  1457. for (int i = 0; i < num2; i++)
  1458. {
  1459. if (4 <= num)
  1460. {
  1461. string text = f_brRead.ReadString();
  1462. }
  1463. MaidProp maidProp = new MaidProp();
  1464. maidProp.Deserialize(f_brRead);
  1465. hashSet.Add((MPN)maidProp.idx);
  1466. list.Add(maidProp);
  1467. if (num <= 110 && maidProp.idx == 10)
  1468. {
  1469. list.Add(new MaidProp
  1470. {
  1471. type = maidProp.type,
  1472. idx = 11,
  1473. name = MPN.EyeSclX.ToString(),
  1474. value = maidProp.value,
  1475. min = maidProp.min,
  1476. max = maidProp.max,
  1477. boDut = true
  1478. });
  1479. list.Add(new MaidProp
  1480. {
  1481. type = maidProp.type,
  1482. idx = 12,
  1483. name = MPN.EyeSclY.ToString(),
  1484. value = maidProp.value,
  1485. min = maidProp.min,
  1486. max = maidProp.max,
  1487. boDut = true
  1488. });
  1489. }
  1490. }
  1491. if (num < 200)
  1492. {
  1493. list.Add(Maid.CreateProp(0, 100, 0, MPN.EyeClose, 2));
  1494. list.Add(Maid.CreateProp(0, 100, 0, MPN.FaceShape, 2));
  1495. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuX, 2));
  1496. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuY, 2));
  1497. }
  1498. if (num < 210)
  1499. {
  1500. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallPosX, 2));
  1501. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallPosY, 2));
  1502. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallSclX, 2));
  1503. list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallSclY, 2));
  1504. }
  1505. if (!hashSet.Contains(MPN.FaceShapeSlim))
  1506. {
  1507. list.Add(Maid.CreateProp(0, 100, 0, MPN.FaceShapeSlim, 2));
  1508. }
  1509. if (!hashSet.Contains(MPN.EarNone))
  1510. {
  1511. list.Add(Maid.CreateProp(0, 1, 0, MPN.EarNone, 2));
  1512. }
  1513. if (!hashSet.Contains(MPN.EarElf))
  1514. {
  1515. list.Add(Maid.CreateProp(0, 100, 0, MPN.EarElf, 2));
  1516. }
  1517. if (!hashSet.Contains(MPN.EarRot))
  1518. {
  1519. list.Add(Maid.CreateProp(0, 100, 50, MPN.EarRot, 2));
  1520. }
  1521. if (!hashSet.Contains(MPN.EarScl))
  1522. {
  1523. list.Add(Maid.CreateProp(0, 100, 50, MPN.EarScl, 2));
  1524. }
  1525. if (!hashSet.Contains(MPN.NosePos))
  1526. {
  1527. list.Add(Maid.CreateProp(0, 100, 50, MPN.NosePos, 2));
  1528. }
  1529. if (!hashSet.Contains(MPN.NoseScl))
  1530. {
  1531. list.Add(Maid.CreateProp(0, 100, 50, MPN.NoseScl, 2));
  1532. }
  1533. if (!hashSet.Contains(MPN.MayuShapeIn))
  1534. {
  1535. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuShapeIn, 2));
  1536. }
  1537. if (!hashSet.Contains(MPN.MayuShapeOut))
  1538. {
  1539. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuShapeOut, 2));
  1540. }
  1541. if (!hashSet.Contains(MPN.MayuRot))
  1542. {
  1543. list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuRot, 2));
  1544. }
  1545. return list;
  1546. }
  1547. public static List<MaidProp> DeserializePropLowCapacity(BinaryReader reader)
  1548. {
  1549. List<MaidProp> list = Maid.CreateInitMaidPropList();
  1550. Dictionary<int, MaidProp> dictionary = new Dictionary<int, MaidProp>();
  1551. for (int i = 0; i < list.Count; i++)
  1552. {
  1553. dictionary.Add(list[i].idx, list[i]);
  1554. }
  1555. int num = (int)reader.ReadChar();
  1556. for (int j = 0; j < num; j++)
  1557. {
  1558. int key = (int)reader.ReadChar();
  1559. MaidProp maidProp = dictionary[key];
  1560. maidProp.DeserializeLowCapacity(reader);
  1561. }
  1562. return list;
  1563. }
  1564. public static MaidParts.PartsColor[] DeserializeMultiColorPre(BinaryReader f_brRead)
  1565. {
  1566. return MaidParts.DeserializePre(f_brRead);
  1567. }
  1568. public bool DeserializeMultiColor(BinaryReader f_brRead)
  1569. {
  1570. MaidParts.PartsColor[] array = MaidParts.DeserializePre(f_brRead);
  1571. for (int i = 0; i < array.Length; i++)
  1572. {
  1573. this.Parts.SetPartsColor((MaidParts.PARTS_COLOR)i, array[i]);
  1574. }
  1575. return true;
  1576. }
  1577. public bool DeserializeMisc(BinaryReader f_brRead)
  1578. {
  1579. string a = f_brRead.ReadString();
  1580. NDebug.Assert(a == "CM3D2_MAID_MISC", "メイドその他のヘッダーが不正です。");
  1581. int num = f_brRead.ReadInt32();
  1582. this.m_nActiveSlotNo = f_brRead.ReadInt32();
  1583. int num2 = f_brRead.ReadInt32();
  1584. if (num2 != 0)
  1585. {
  1586. byte[] data = f_brRead.ReadBytes(num2);
  1587. UnityEngine.Object.Destroy(this.m_texIcon);
  1588. this.m_texIcon = new Texture2D(1, 1, TextureFormat.ARGB32, false);
  1589. this.m_texIcon.LoadImage(data);
  1590. }
  1591. if (8 <= num)
  1592. {
  1593. this.m_strThumCardTime = f_brRead.ReadString();
  1594. }
  1595. this.m_colMan.r = f_brRead.ReadSingle();
  1596. this.m_colMan.g = f_brRead.ReadSingle();
  1597. this.m_colMan.b = f_brRead.ReadSingle();
  1598. this.m_colMan.a = f_brRead.ReadSingle();
  1599. if (202 <= num)
  1600. {
  1601. this.m_nVoicePitch = f_brRead.ReadInt32();
  1602. }
  1603. this.CheckOldThumCard();
  1604. return true;
  1605. }
  1606. public static bool DeserializeBodyPre(BinaryReader f_brRead)
  1607. {
  1608. return Maid.DeserializeBodyRead(f_brRead);
  1609. }
  1610. public bool DeserializeBody(BinaryReader f_brRead)
  1611. {
  1612. return Maid.DeserializeBodyRead(f_brRead);
  1613. }
  1614. public static bool DeserializeBodyRead(BinaryReader f_brRead)
  1615. {
  1616. string a = f_brRead.ReadString();
  1617. NDebug.Assert(a == "CM3D2_MAID_BODY", "メイドBodyヘッダーが不正です。");
  1618. int num = f_brRead.ReadInt32();
  1619. return true;
  1620. }
  1621. public void SetTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot, Vector3 f_vPosLocal, Quaternion f_qRotLocal, Vector3 f_vScaleRate, bool f_bEnable)
  1622. {
  1623. MaidProp prop = this.GetProp(m_mpn);
  1624. BoneAttachPos boneAttachPos = new BoneAttachPos();
  1625. boneAttachPos.bEnable = f_bEnable;
  1626. boneAttachPos.pss.position = f_vPosLocal;
  1627. boneAttachPos.pss.rotation = f_qRotLocal;
  1628. boneAttachPos.pss.scale = f_vScaleRate;
  1629. prop.m_dicTBodySkinPos[f_slot] = new KeyValuePair<int, BoneAttachPos>(prop.nFileNameRID, boneAttachPos);
  1630. }
  1631. public BoneAttachPos GetTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot)
  1632. {
  1633. BoneAttachPos result = null;
  1634. MaidProp prop = this.GetProp(m_mpn);
  1635. KeyValuePair<int, BoneAttachPos> keyValuePair;
  1636. if (prop.m_dicTBodySkinPos.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID)
  1637. {
  1638. result = keyValuePair.Value;
  1639. }
  1640. return result;
  1641. }
  1642. public void ClearTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot)
  1643. {
  1644. MaidProp prop = this.GetProp(m_mpn);
  1645. prop.m_dicTBodySkinPos.Remove(f_slot);
  1646. }
  1647. 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)
  1648. {
  1649. MaidProp prop = this.GetProp(m_mpn);
  1650. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
  1651. if (!prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary))
  1652. {
  1653. dictionary = (prop.m_dicTBodyAttachPos[f_slot] = new Dictionary<string, KeyValuePair<int, VtxAttachPos>>());
  1654. }
  1655. VtxAttachPos vtxAttachPos = new VtxAttachPos();
  1656. vtxAttachPos.vtxcount = f_vtxcount;
  1657. vtxAttachPos.vidx = f_vidx;
  1658. vtxAttachPos.prs.position = f_vPosLocal;
  1659. vtxAttachPos.prs.rotation = f_qRotLocal;
  1660. vtxAttachPos.prs.scale = f_vScaleRate;
  1661. vtxAttachPos.bEnable = f_bEnable;
  1662. dictionary[f_apname] = new KeyValuePair<int, VtxAttachPos>(prop.nFileNameRID, vtxAttachPos);
  1663. }
  1664. public VtxAttachPos GetAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, int f_vtxcount, string f_apname)
  1665. {
  1666. VtxAttachPos result = null;
  1667. MaidProp prop = this.GetProp(m_mpn);
  1668. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
  1669. KeyValuePair<int, VtxAttachPos> keyValuePair;
  1670. if (prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary) && dictionary.TryGetValue(f_apname, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID && keyValuePair.Value.vtxcount == f_vtxcount)
  1671. {
  1672. result = keyValuePair.Value;
  1673. }
  1674. return result;
  1675. }
  1676. public void ClearAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, string f_apname)
  1677. {
  1678. MaidProp prop = this.GetProp(m_mpn);
  1679. Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
  1680. if (prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary))
  1681. {
  1682. dictionary.Remove(f_apname);
  1683. }
  1684. }
  1685. public void SetMaterialProperty(MPN m_mpn, TBody.SlotID f_slot, int f_nMatNo, string f_strPropName, string f_strTypeName, string f_strValue)
  1686. {
  1687. MaidProp prop = this.GetProp(m_mpn);
  1688. prop.m_dicMaterialProp[f_slot] = new KeyValuePair<int, MatPropSave>(prop.nFileNameRID, new MatPropSave(f_nMatNo, f_strPropName, f_strTypeName, f_strValue));
  1689. }
  1690. public MatPropSave GetMaterialProperty(MPN m_mpn, TBody.SlotID f_slot)
  1691. {
  1692. MaidProp prop = this.GetProp(m_mpn);
  1693. KeyValuePair<int, MatPropSave> keyValuePair;
  1694. if (prop.m_dicMaterialProp.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID)
  1695. {
  1696. return keyValuePair.Value;
  1697. }
  1698. return null;
  1699. }
  1700. public void SetHairLengthSaveToMP(MPN f_mpn, TBody.SlotID f_slot, string f_strName, float f_fValue)
  1701. {
  1702. MaidProp prop = this.GetProp(f_mpn);
  1703. KeyValuePair<int, Dictionary<string, float>> value;
  1704. if (!prop.m_dicBoneLength.TryGetValue(f_slot, out value))
  1705. {
  1706. Dictionary<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> dicBoneLength = prop.m_dicBoneLength;
  1707. value = new KeyValuePair<int, Dictionary<string, float>>(prop.nFileNameRID, new Dictionary<string, float>());
  1708. dicBoneLength[f_slot] = value;
  1709. }
  1710. value.Value[f_strName] = f_fValue;
  1711. }
  1712. public bool GetHairLengthFromMP(MPN f_mpn, TBody.SlotID f_slot, string f_strName, out float f_fOutValue)
  1713. {
  1714. MaidProp prop = this.GetProp(f_mpn);
  1715. KeyValuePair<int, Dictionary<string, float>> keyValuePair;
  1716. if (prop.m_dicBoneLength.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID && keyValuePair.Value.TryGetValue(f_strName, out f_fOutValue))
  1717. {
  1718. return true;
  1719. }
  1720. f_fOutValue = 0.5f;
  1721. return false;
  1722. }
  1723. public void ClearHairLengthMP(MPN f_mpn, TBody.SlotID f_slot)
  1724. {
  1725. MaidProp prop = this.GetProp(f_mpn);
  1726. if (prop.m_dicBoneLength != null && prop.m_dicBoneLength.ContainsKey(f_slot))
  1727. {
  1728. prop.m_dicBoneLength.Remove(f_slot);
  1729. }
  1730. }
  1731. public bool NotExistThenClearHairLengthMP(MPN f_mpn, TBody.SlotID f_slot)
  1732. {
  1733. MaidProp prop = this.GetProp(f_mpn);
  1734. KeyValuePair<int, Dictionary<string, float>> keyValuePair;
  1735. if (prop.m_dicBoneLength.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key != prop.nFileNameRID)
  1736. {
  1737. prop.m_dicBoneLength.Remove(f_slot);
  1738. return true;
  1739. }
  1740. return false;
  1741. }
  1742. public void ThumShotCamMove()
  1743. {
  1744. GameMain.Instance.ThumCamera.GetComponent<ThumShot>().MoveTargetCard(this);
  1745. GameMain.Instance.ThumCamera.GetComponent<ThumShot>().MoveTargetThum(this);
  1746. }
  1747. public void ThumShot()
  1748. {
  1749. UnityEngine.Object.Destroy(this.m_texIcon);
  1750. this.m_texIcon = GameMain.Instance.ThumCamera.GetComponent<ThumShot>().ShotThumIcon(this);
  1751. this.SetThumCard(GameMain.Instance.ThumCamera.GetComponent<ThumShot>().ShotThumCard(this));
  1752. }
  1753. public void ThumShotCustom(string saveFileName, bool adjustmentCameraTransform)
  1754. {
  1755. ThumShot component = GameMain.Instance.ThumCamera.GetComponent<ThumShot>();
  1756. Texture2D texture2D;
  1757. if (adjustmentCameraTransform)
  1758. {
  1759. texture2D = component.ShotThumCard(this);
  1760. }
  1761. else
  1762. {
  1763. texture2D = component.ShotThumCardOriginal();
  1764. }
  1765. string str = UTY.gameProjectPath + "\\";
  1766. string text = str + "Thumb";
  1767. if (!Directory.Exists(text))
  1768. {
  1769. Directory.CreateDirectory(text);
  1770. }
  1771. text = text + "/" + saveFileName;
  1772. UTY.SaveImage(texture2D, text);
  1773. UnityEngine.Object.Destroy(texture2D);
  1774. }
  1775. public void SetThumCard(Texture2D tex)
  1776. {
  1777. string str = UTY.gameProjectPath + "\\";
  1778. string text = str + "Thumb";
  1779. if (!Directory.Exists(text))
  1780. {
  1781. Directory.CreateDirectory(text);
  1782. }
  1783. string f_strFileName = string.Empty;
  1784. this.m_strThumCardTime = DateTime.Now.ToString("yyyyMMddHHmmssfff");
  1785. f_strFileName = text + "/_tmp_thum_" + this.status.guid + ".png";
  1786. UTY.SaveImage(tex, f_strFileName);
  1787. UnityEngine.Object.Destroy(tex);
  1788. Texture2D thumIcon = this.GetThumIcon();
  1789. f_strFileName = text + "/icon_thum_" + this.status.guid + ".png";
  1790. UTY.SaveImage(thumIcon, f_strFileName);
  1791. }
  1792. public void SetThumIcon(Texture2D icon_tex)
  1793. {
  1794. this.m_texIcon = icon_tex;
  1795. }
  1796. public Texture2D GetThumIcon()
  1797. {
  1798. return this.m_texIcon;
  1799. }
  1800. public Texture2D GetThumCard()
  1801. {
  1802. Texture2D result = null;
  1803. string str = UTY.gameProjectPath + "\\";
  1804. string text = str + "Thumb";
  1805. if (!Directory.Exists(text))
  1806. {
  1807. Directory.CreateDirectory(text);
  1808. }
  1809. string text2 = text + "/_tmp_thum_" + this.status.guid + ".png";
  1810. if (File.Exists(text2))
  1811. {
  1812. result = UTY.LoadTexture(text2);
  1813. }
  1814. else
  1815. {
  1816. text2 = text + "/" + this.status.guid + ".png";
  1817. if (File.Exists(text2))
  1818. {
  1819. result = UTY.LoadTexture(text2);
  1820. }
  1821. }
  1822. return result;
  1823. }
  1824. public static void DeletedTmpThumCards()
  1825. {
  1826. string str = UTY.gameProjectPath + "\\";
  1827. string text = str + "Thumb";
  1828. if (!Directory.Exists(text))
  1829. {
  1830. return;
  1831. }
  1832. string[] files = Directory.GetFiles(text, "*", SearchOption.TopDirectoryOnly);
  1833. for (int i = 0; i < files.Length; i++)
  1834. {
  1835. string text2 = text + "\\";
  1836. int num = files[i].IndexOf(text2);
  1837. if (num != 0)
  1838. {
  1839. files[i] = string.Empty;
  1840. }
  1841. else
  1842. {
  1843. string text3 = string.Empty;
  1844. try
  1845. {
  1846. text3 = files[i].Substring(text2.Length, files[i].Length - text2.Length);
  1847. }
  1848. catch
  1849. {
  1850. }
  1851. if (string.IsNullOrEmpty(text3))
  1852. {
  1853. files[i] = string.Empty;
  1854. }
  1855. else if (0 > text3.IndexOf(".png") || text3.IndexOf("_tmp_thum_") != 0)
  1856. {
  1857. files[i] = string.Empty;
  1858. }
  1859. }
  1860. }
  1861. for (int j = 0; j < files.Length; j++)
  1862. {
  1863. if (!string.IsNullOrEmpty(files[j]))
  1864. {
  1865. try
  1866. {
  1867. File.Delete(files[j]);
  1868. }
  1869. catch
  1870. {
  1871. }
  1872. }
  1873. }
  1874. }
  1875. private void FixThumCard()
  1876. {
  1877. string str = UTY.gameProjectPath + "\\";
  1878. string text = str + "Thumb";
  1879. if (!Directory.Exists(text))
  1880. {
  1881. return;
  1882. }
  1883. string text2 = text + "/_tmp_thum_" + this.status.guid + ".png";
  1884. if (!File.Exists(text2))
  1885. {
  1886. return;
  1887. }
  1888. string text3 = text + "/" + this.status.guid + ".png";
  1889. try
  1890. {
  1891. if (File.Exists(text3))
  1892. {
  1893. File.Delete(text3);
  1894. }
  1895. File.Move(text2, text3);
  1896. }
  1897. catch
  1898. {
  1899. }
  1900. }
  1901. private void CheckOldThumCard()
  1902. {
  1903. string str = UTY.gameProjectPath + "\\";
  1904. string text = str + "Thumb";
  1905. if (!Directory.Exists(text))
  1906. {
  1907. return;
  1908. }
  1909. string text2 = string.Concat(new string[]
  1910. {
  1911. text,
  1912. "/",
  1913. this.status.guid,
  1914. this.m_strThumCardTime,
  1915. ".png"
  1916. });
  1917. if (!File.Exists(text2))
  1918. {
  1919. return;
  1920. }
  1921. File.Move(text2, text + "/" + this.status.guid + ".png");
  1922. }
  1923. public void ProcSSParam()
  1924. {
  1925. this.boBallGAG = (this.body0.GetSlotUserParam("accHa", "口枷") > 0);
  1926. this.boNoseFook = (this.body0.GetSlotUserParam("accHana", "鼻フック") > 0);
  1927. }
  1928. public void StopAnime(string fn = "")
  1929. {
  1930. this.body0.StopAnime(fn);
  1931. }
  1932. public string CrossFade(string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  1933. {
  1934. return this.CrossFade(fn, GameUty.FileSystem, additive, loop, boAddQue, val, weight);
  1935. }
  1936. public string CrossFade(string fn, AFileSystemBase fileSystem, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  1937. {
  1938. return this.body0.CrossFade(fn, fileSystem, additive, loop, boAddQue, val, weight);
  1939. }
  1940. public string CrossFadeAbsolute(string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  1941. {
  1942. return this.CrossFadeAbsolute(fn, GameUty.FileSystem, additive, loop, boAddQue, val, weight);
  1943. }
  1944. public string CrossFadeAbsolute(string fn, AFileSystemBase fileSystem, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
  1945. {
  1946. return this.body0.CrossFadeAbsolute(fn, fileSystem, additive, loop, boAddQue, val, weight);
  1947. }
  1948. public void CacheAnime(string fn, bool loadMuneL = false, bool loadMuneR = false)
  1949. {
  1950. this.body0.CacheLoadAnime(GameUty.FileSystem, Path.ChangeExtension(fn, ".anm"), loadMuneL, loadMuneR);
  1951. }
  1952. public Animation GetAnimation()
  1953. {
  1954. return this.body0.GetAnimation();
  1955. }
  1956. private void Start()
  1957. {
  1958. }
  1959. public void ResetAll()
  1960. {
  1961. this.FaceAnime("通常", 0f, 0);
  1962. this.FaceBlend("無し");
  1963. this.OpenMouth(false);
  1964. this.EyeToReset(0f);
  1965. this.DelPrefabAll();
  1966. string[] array = new string[]
  1967. {
  1968. "handitem",
  1969. "kousoku_upper",
  1970. "kousoku_lower",
  1971. "eye_hi",
  1972. "skirt",
  1973. "panz",
  1974. "mizugi",
  1975. "onepiece",
  1976. "accanl",
  1977. "accvag",
  1978. "KubiScl",
  1979. "UdeScl",
  1980. "DouPer",
  1981. "sintyou",
  1982. "kata",
  1983. "seieki_naka"
  1984. };
  1985. for (int i = 0; i < array.Length; i++)
  1986. {
  1987. this.ResetProp(array[i], false);
  1988. }
  1989. if (this.body0 != null && this.body0.isLoadedBody)
  1990. {
  1991. this.body0.SetMaskMode(TBody.MaskMode.None);
  1992. for (int j = 10; j <= 20; j++)
  1993. {
  1994. this.body0.MulTexRemove("body", 0, "_MainTex", j);
  1995. this.body0.MulTexRemove("body", 0, "_ShadowTex", j);
  1996. this.body0.MulTexRemove("head", 5, "_MainTex", j);
  1997. this.body0.MulTexRemove("head", 5, "_ShadowTex", j);
  1998. }
  1999. this.body0.MulTexProc("body");
  2000. this.body0.MulTexProc("head");
  2001. this.SetModeHairR(TBody.ModeHirR.Normal);
  2002. if (this.body0.isLoadedBody)
  2003. {
  2004. this.body0.MuneYureL(1f);
  2005. this.body0.MuneYureR(1f);
  2006. this.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  2007. this.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  2008. }
  2009. }
  2010. }
  2011. public void Lipsync(bool f_bEnable)
  2012. {
  2013. this.boLipsync = f_bEnable;
  2014. }
  2015. public void LipSyncEnabled(bool enabled)
  2016. {
  2017. this.lipSyncEnabled = enabled;
  2018. }
  2019. public bool MicLipSync
  2020. {
  2021. get
  2022. {
  2023. return this.m_MicLipSync;
  2024. }
  2025. }
  2026. public void SetMicLipSync(bool is_start)
  2027. {
  2028. if (!this.AudioMan)
  2029. {
  2030. Debug.LogError("AudioManが見つかりません");
  2031. return;
  2032. }
  2033. this.m_MicLipSync = is_start;
  2034. this.m_bFoceKuchipakuSelfUpdateTime = is_start;
  2035. if (is_start)
  2036. {
  2037. if (!this.MicLipData.Context)
  2038. {
  2039. this.MicLipData.Context = this.AudioMan.gameObject.AddComponent<LowLatencyLipSyncContext>();
  2040. }
  2041. if (!this.MicLipData.MorphTarget)
  2042. {
  2043. this.MicLipData.MorphTarget = this.AudioMan.gameObject.AddComponent<OVRLipSyncContextMorphTarget>();
  2044. }
  2045. if (!this.MicLipData.MicInput)
  2046. {
  2047. this.MicLipData.MicInput = this.AudioMan.gameObject.AddComponent<OVRLipSyncMicInput>();
  2048. }
  2049. this.MicLipData.Context.Init();
  2050. this.MicLipData.MorphTarget.Init(this);
  2051. this.MicLipData.MicInput.Init(this);
  2052. this.MicLipData.MicInput.StartMicrophone();
  2053. }
  2054. else
  2055. {
  2056. if (this.MicLipData.MicInput)
  2057. {
  2058. this.MicLipData.MicInput.StopMicrophone();
  2059. }
  2060. this.AudioMan.audiosource.clip = null;
  2061. UnityEngine.Object.Destroy(this.MicLipData.Context);
  2062. UnityEngine.Object.Destroy(this.MicLipData.MorphTarget);
  2063. UnityEngine.Object.Destroy(this.MicLipData.MicInput);
  2064. }
  2065. }
  2066. public void StartKuchipakuPattern(float f_fOffsetTime, string f_strPattern, bool f_bSelfUpdateTime = false)
  2067. {
  2068. this.m_fKuchipakuPatternOffsetTime = f_fOffsetTime;
  2069. this.m_baKuchipakuPattern = Convert.FromBase64String(f_strPattern);
  2070. this.m_bFoceKuchipakuSelfUpdateTime = f_bSelfUpdateTime;
  2071. }
  2072. public void StopKuchipakuPattern()
  2073. {
  2074. this.m_fKuchipakuPatternOffsetTime = 0f;
  2075. this.m_baKuchipakuPattern = null;
  2076. this.m_bFoceKuchipakuSelfUpdateTime = false;
  2077. }
  2078. public void IKTargetToAttachPoint(string tag, Maid tgt_maid, string tgt_name, string attachpoint_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, string axisbone = "", bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
  2079. {
  2080. IKCtrlData ikdata = this.body0.IKCtrl.GetIKData(tag);
  2081. Transform axis_bone = null;
  2082. if (attach_type != IKCtrlData.IKAttachType.Rotate && !string.IsNullOrEmpty(axisbone))
  2083. {
  2084. axis_bone = CMT.SearchObjName(tgt_maid.body0.m_trBones, axisbone, true);
  2085. }
  2086. ikdata.SetIKSetting(attach_type, timing, tgt_maid, this.body0.GetSlotNo(tgt_name), attachpoint_name, axis_bone, f_vecOffset, do_animation);
  2087. }
  2088. public void IKTargetToBone(string tag, Maid tgt_maid, string tgtbone_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, bool search_sm = false, bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
  2089. {
  2090. IKCtrlData ikdata = this.IKCtrl.GetIKData(tag);
  2091. if (tgtbone_name != "無し")
  2092. {
  2093. Transform target;
  2094. if (!search_sm)
  2095. {
  2096. target = CMT.SearchObjName(tgt_maid.body0.m_trBones, tgtbone_name, true);
  2097. }
  2098. else
  2099. {
  2100. target = CMT.SearchObjName(tgt_maid.body0.SmBody, tgtbone_name, false);
  2101. }
  2102. ikdata.SetIKSetting(attach_type, timing, tgt_maid, target, f_vecOffset, do_animation);
  2103. }
  2104. else
  2105. {
  2106. ikdata.Detach(IKCtrlData.IKAttachType.NewPoint);
  2107. ikdata.Detach(IKCtrlData.IKAttachType.Rotate);
  2108. }
  2109. }
  2110. public void IKTargetToOdogu(string tag, string odogu_name, string tgt_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
  2111. {
  2112. Transform transform = null;
  2113. GameObject prefabFromBg = GameMain.Instance.BgMgr.GetPrefabFromBg(odogu_name);
  2114. if (!prefabFromBg)
  2115. {
  2116. Debug.LogErrorFormat("現在の背景に大道具「{0}」は存在しません", new object[]
  2117. {
  2118. odogu_name
  2119. });
  2120. }
  2121. else if (prefabFromBg.transform.childCount == 0 || string.IsNullOrEmpty(tgt_name))
  2122. {
  2123. transform = prefabFromBg.transform;
  2124. }
  2125. else
  2126. {
  2127. for (int i = 0; i < prefabFromBg.transform.childCount; i++)
  2128. {
  2129. Transform child = prefabFromBg.transform.GetChild(i);
  2130. if (child && !(child.name != tgt_name))
  2131. {
  2132. transform = prefabFromBg.transform.GetChild(i);
  2133. break;
  2134. }
  2135. }
  2136. if (!transform)
  2137. {
  2138. Debug.LogErrorFormat("大道具「{0}」にターゲット「{1}」は存在しません", new object[]
  2139. {
  2140. odogu_name,
  2141. tgt_name
  2142. });
  2143. }
  2144. }
  2145. IKCtrlData ikdata = this.IKCtrl.GetIKData(tag);
  2146. ikdata.SetIKSetting(attach_type, timing, transform, f_vecOffset, do_animation);
  2147. }
  2148. public void IKTargetToIKBone(string my_tag, Maid f_maidTarget, string bone_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
  2149. {
  2150. IKCtrlData ikdata = f_maidTarget.IKCtrl.GetIKData(bone_name);
  2151. if (!ikdata)
  2152. {
  2153. return;
  2154. }
  2155. Transform targetBone = ikdata.TargetBone;
  2156. IKCtrlData ikdata2 = this.IKCtrl.GetIKData(my_tag);
  2157. ikdata2.SetIKSetting(attach_type, timing, f_maidTarget, bone_name, targetBone, f_vecOffset, do_animation);
  2158. }
  2159. public void IKDetach(string name)
  2160. {
  2161. this.IKTargetToBone(name, null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  2162. }
  2163. public void AllIKDetach(float blendtime = 0f)
  2164. {
  2165. this.IKCtrl.BlendTime = blendtime;
  2166. this.IKCtrl.IKActive = (blendtime > 0f);
  2167. this.IKCtrl.AllForceIK = false;
  2168. foreach (string tag in this.IKCtrl.strIKDataPair.Keys)
  2169. {
  2170. this.IKTargetToBone(tag, null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
  2171. }
  2172. }
  2173. public void OpenMouth(bool f_bOpen)
  2174. {
  2175. this.boMouthOpen = f_bOpen;
  2176. }
  2177. public void OpenMouthLookTooth(bool f_bOpen)
  2178. {
  2179. this.boLookTooth = f_bOpen;
  2180. }
  2181. public void EyeToPosition(Vector3 f_vecTargetPos, float f_fFadeTime = 0f)
  2182. {
  2183. if (f_fFadeTime <= 0f)
  2184. {
  2185. f_fFadeTime = 0.001f;
  2186. }
  2187. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2188. this.body0.trsLookTarget = null;
  2189. this.body0.offsetLookTarget = f_vecTargetPos;
  2190. this.body0.boHeadToCam = true;
  2191. this.body0.boEyeToCam = true;
  2192. this.body0.boEyeSorashi = false;
  2193. }
  2194. public void EyeToTargetObject(Transform target_trans, float f_fFadeTime = 0f)
  2195. {
  2196. this.body0.trsLookTarget = target_trans;
  2197. if (this.body0.trsLookTarget == null)
  2198. {
  2199. this.body0.offsetLookTarget = new Vector3(0f, 1f, 0f);
  2200. }
  2201. if (f_fFadeTime <= 0f)
  2202. {
  2203. f_fFadeTime = 0.001f;
  2204. }
  2205. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2206. this.body0.boHeadToCam = true;
  2207. this.body0.boEyeToCam = true;
  2208. this.body0.boEyeSorashi = false;
  2209. }
  2210. public void EyeToTarget(Maid f_maidTarget, float f_fFadeTime = 0f, string f_strBoneName = "Bip01 Head")
  2211. {
  2212. Transform transform = CMT.SearchObjName(f_maidTarget.body0.m_trBones, f_strBoneName, true);
  2213. this.body0.trsLookTarget = transform;
  2214. if (transform == null)
  2215. {
  2216. this.body0.offsetLookTarget = new Vector3(0f, 1f, 0f);
  2217. }
  2218. if (f_fFadeTime <= 0f)
  2219. {
  2220. f_fFadeTime = 0.001f;
  2221. }
  2222. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2223. this.body0.boHeadToCam = true;
  2224. this.body0.boEyeToCam = true;
  2225. this.body0.boEyeSorashi = false;
  2226. }
  2227. public void EyeToCamera(Maid.EyeMoveType f_eType, float f_fFadeTime = 0f)
  2228. {
  2229. this.body0.boHeadToCam = false;
  2230. this.body0.boEyeToCam = true;
  2231. this.body0.boEyeSorashi = false;
  2232. if (f_fFadeTime <= 0f)
  2233. {
  2234. f_fFadeTime = 0.001f;
  2235. }
  2236. this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
  2237. if (GameMain.Instance.VRMode)
  2238. {
  2239. if (GameMain.Instance.OvrMgr != null)
  2240. {
  2241. this.body0.trsLookTarget = GameMain.Instance.OvrMgr.EyeAnchor;
  2242. }
  2243. if (GameMain.Instance.OvrIK != null && OvrIK.IsVRIKMode && GameMain.Instance.OvrIK.NowMaid == this)
  2244. {
  2245. this.body0.trsLookTarget = GameMain.Instance.OvrIK.EyeTargetTrs;
  2246. }
  2247. }
  2248. else if (GameMain.Instance.MainCamera != null)
  2249. {
  2250. this.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
  2251. }
  2252. if (f_eType == Maid.EyeMoveType.無し)
  2253. {
  2254. this.body0.boEyeToCam = false;
  2255. }
  2256. if (f_eType == Maid.EyeMoveType.無視する)
  2257. {
  2258. this.body0.boEyeToCam = false;
  2259. }
  2260. if (f_eType == Maid.EyeMoveType.顔を向ける)
  2261. {
  2262. this.body0.boHeadToCam = true;
  2263. }
  2264. if (f_eType == Maid.EyeMoveType.顔だけ動かす)
  2265. {
  2266. this.body0.boHeadToCam = true;
  2267. this.body0.boEyeToCam = false;
  2268. }
  2269. if (f_eType == Maid.EyeMoveType.顔をそらす)
  2270. {
  2271. this.body0.trsLookTarget = null;
  2272. this.body0.boEyeSorashi = true;
  2273. this.body0.boEyeToCam = true;
  2274. this.body0.boHeadToCam = true;
  2275. }
  2276. if (f_eType == Maid.EyeMoveType.目と顔を向ける)
  2277. {
  2278. this.body0.boHeadToCam = true;
  2279. this.body0.boEyeToCam = true;
  2280. }
  2281. if (f_eType == Maid.EyeMoveType.目だけ向ける)
  2282. {
  2283. this.body0.boHeadToCam = false;
  2284. this.body0.boEyeToCam = true;
  2285. }
  2286. if (f_eType == Maid.EyeMoveType.目だけそらす)
  2287. {
  2288. this.body0.trsLookTarget = null;
  2289. this.body0.boEyeSorashi = true;
  2290. this.body0.boEyeToCam = true;
  2291. this.body0.boHeadToCam = false;
  2292. }
  2293. }
  2294. public void EyeToReset(float f_fFadeTime = 0f)
  2295. {
  2296. this.EyeToCamera(Maid.EyeMoveType.無し, f_fFadeTime);
  2297. }
  2298. public void LockHeadAndEye(bool toLock)
  2299. {
  2300. this.body0.boLockHeadAndEye = toLock;
  2301. }
  2302. public bool GetLockHeadAndEye()
  2303. {
  2304. return this.body0.boLockHeadAndEye;
  2305. }
  2306. public void SetModeHairR(TBody.ModeHirR f_eMode)
  2307. {
  2308. this.body0.Mode_HairR = f_eMode;
  2309. }
  2310. public void SetAutoTwist(Maid.AutoTwist f_eType, bool f_bEnable)
  2311. {
  2312. switch (f_eType)
  2313. {
  2314. case Maid.AutoTwist.ShoulderL:
  2315. this.body0.boAutoTwistShoulderL = f_bEnable;
  2316. break;
  2317. case Maid.AutoTwist.ShoulderR:
  2318. this.body0.boAutoTwistShoulderR = f_bEnable;
  2319. break;
  2320. case Maid.AutoTwist.WristL:
  2321. this.body0.boAutoTwistWristL = f_bEnable;
  2322. break;
  2323. case Maid.AutoTwist.WristR:
  2324. this.body0.boAutoTwistWristR = f_bEnable;
  2325. break;
  2326. case Maid.AutoTwist.ThighL:
  2327. this.body0.boAutoTwistThighL = f_bEnable;
  2328. break;
  2329. case Maid.AutoTwist.ThighR:
  2330. this.body0.boAutoTwistThighR = f_bEnable;
  2331. break;
  2332. }
  2333. }
  2334. public void SetAutoTwistAll(bool f_bEnable)
  2335. {
  2336. this.body0.boAutoTwistShoulderL = f_bEnable;
  2337. this.body0.boAutoTwistShoulderR = f_bEnable;
  2338. this.body0.boAutoTwistWristL = f_bEnable;
  2339. this.body0.boAutoTwistWristR = f_bEnable;
  2340. this.body0.boAutoTwistThighL = f_bEnable;
  2341. this.body0.boAutoTwistThighR = f_bEnable;
  2342. }
  2343. public void FaceAnime(string tag, float t = 1f, int chkcode = 0)
  2344. {
  2345. this.FaceAnimeChkCode = chkcode;
  2346. this.ActiveFace = tag;
  2347. 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 + "〓通常"))
  2348. {
  2349. tag += "〓通常";
  2350. }
  2351. if (t == 0f)
  2352. {
  2353. this.boFaceAnime = false;
  2354. this.FaceName = tag;
  2355. this.FaceName2 = string.Empty;
  2356. return;
  2357. }
  2358. this.boFaceAnime = true;
  2359. if (this.FaceName2 != string.Empty)
  2360. {
  2361. this.FaceName = this.FaceName2;
  2362. this.FaceName2 = string.Empty;
  2363. }
  2364. if (this.FaceName == string.Empty)
  2365. {
  2366. this.FaceName = "デフォ";
  2367. }
  2368. this.FaceName2 = tag;
  2369. this.FacePlus = 1f / t;
  2370. this.FaceTime = this.FacePlus * 0.0166666675f;
  2371. }
  2372. public void FaceBlend(string tag)
  2373. {
  2374. if (this.body0 == null)
  2375. {
  2376. Debug.LogError("Bodyが読み込まれる前に、表情ブレンドが呼ばれました。" + tag);
  2377. return;
  2378. }
  2379. if (tag == "無し")
  2380. {
  2381. tag = string.Empty;
  2382. }
  2383. this.FaceName3 = tag;
  2384. }
  2385. public void ChangeAutoFace(bool bo)
  2386. {
  2387. if (this.boAutoFace != bo)
  2388. {
  2389. this.AutoFaceLV_old = 0;
  2390. this.Hazukashi = 0f;
  2391. }
  2392. this.boAutoFace = bo;
  2393. }
  2394. public void AddPrefab(string f_strPrefab, string f_strName, string f_strDestBone, Vector3 f_vOffsetLocalPos, Vector3 f_vOffsetLocalRot)
  2395. {
  2396. UnityEngine.Object @object = Resources.Load("Prefab/" + f_strPrefab);
  2397. if (@object != null)
  2398. {
  2399. Transform transform = null;
  2400. if (this.body0 != null && this.body0.isLoadedBody)
  2401. {
  2402. transform = CMT.SearchObjName(this.body0.m_trBones, f_strDestBone, true);
  2403. }
  2404. if (transform != null)
  2405. {
  2406. GameObject goItem = UnityEngine.Object.Instantiate(@object) as GameObject;
  2407. goItem.AddComponent<AttachPrefab>();
  2408. goItem.name = goItem.name.Replace("(Clone)", string.Empty);
  2409. if (!string.IsNullOrEmpty(f_strName))
  2410. {
  2411. goItem.name = f_strName;
  2412. }
  2413. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  2414. AttachPrefab[] array = (from a in componentsInChildren
  2415. where a.name == goItem.name
  2416. select a).ToArray<AttachPrefab>();
  2417. for (int i = 0; i < array.Length; i++)
  2418. {
  2419. UnityEngine.Object.DestroyImmediate(array[i].gameObject);
  2420. }
  2421. goItem.transform.SetParent(transform, false);
  2422. goItem.transform.localPosition = f_vOffsetLocalPos;
  2423. goItem.transform.localRotation = Quaternion.Euler(f_vOffsetLocalRot);
  2424. }
  2425. else
  2426. {
  2427. Debug.LogError("人物にプレハブ追加で、ボーン名が見つかりません。" + f_strDestBone);
  2428. }
  2429. }
  2430. else
  2431. {
  2432. Debug.LogError("人物にプレハブ追加で、プレハブが見つかりません。Prefab/" + f_strPrefab);
  2433. }
  2434. }
  2435. public void DelPrefab(string f_strName)
  2436. {
  2437. if (this.body0 == null || !this.body0.isLoadedBody)
  2438. {
  2439. return;
  2440. }
  2441. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  2442. AttachPrefab[] array = (from a in componentsInChildren
  2443. where a.name == f_strName
  2444. select a).ToArray<AttachPrefab>();
  2445. for (int i = 0; i < array.Length; i++)
  2446. {
  2447. UnityEngine.Object.DestroyImmediate(array[i].gameObject);
  2448. }
  2449. }
  2450. public void DelPrefabAll()
  2451. {
  2452. if (this.body0 == null || !this.body0.isLoadedBody)
  2453. {
  2454. return;
  2455. }
  2456. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  2457. for (int i = 0; i < componentsInChildren.Length; i++)
  2458. {
  2459. UnityEngine.Object.DestroyImmediate(componentsInChildren[i].gameObject);
  2460. }
  2461. }
  2462. public GameObject GetPrefab(string f_strName)
  2463. {
  2464. if (this.body0 == null || !this.body0.isLoadedBody)
  2465. {
  2466. return null;
  2467. }
  2468. AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
  2469. AttachPrefab[] array = (from a in componentsInChildren
  2470. where a.name == f_strName
  2471. select a).ToArray<AttachPrefab>();
  2472. return (0 >= array.Length) ? null : array[0].gameObject;
  2473. }
  2474. public void AnimationObject(string f_strName, string f_strAnimName, bool f_bNowPlay, bool f_bLoop)
  2475. {
  2476. Transform transform;
  2477. if ((transform = CMT.SearchObjName(this.body0.m_trBones, f_strName, false)) != null)
  2478. {
  2479. Animation animation = transform.gameObject.GetComponent<Animation>();
  2480. if (animation == null)
  2481. {
  2482. animation = transform.gameObject.AddComponent<Animation>();
  2483. }
  2484. AnimationClip animationClip = ImportCM.LoadAniClipNative(GameUty.FileSystem, f_strAnimName, true, true, true);
  2485. if (animationClip == null)
  2486. {
  2487. NDebug.Assert("アニメーション " + f_strAnimName + " が見つかりません。", false);
  2488. }
  2489. animation.AddClip(animationClip, f_strAnimName);
  2490. animation.clip = animationClip;
  2491. animation.playAutomatically = true;
  2492. animation.wrapMode = ((!f_bLoop) ? WrapMode.Once : WrapMode.Loop);
  2493. if (f_bNowPlay)
  2494. {
  2495. animation.PlayQueued(f_strAnimName, QueueMode.PlayNow);
  2496. }
  2497. this.m_goTestAnim = transform.gameObject;
  2498. }
  2499. else
  2500. {
  2501. NDebug.Assert("人物に追加した " + f_strName + " は見つかりませんでした。", false);
  2502. }
  2503. }
  2504. public void SetPos(Vector3 f_vecLocalPos)
  2505. {
  2506. base.gameObject.transform.localPosition = f_vecLocalPos;
  2507. }
  2508. public void SetRot(Vector3 f_vecLocalRot)
  2509. {
  2510. base.gameObject.transform.localRotation = Quaternion.Euler(f_vecLocalRot);
  2511. }
  2512. public Vector3 GetPos()
  2513. {
  2514. return base.gameObject.transform.localPosition;
  2515. }
  2516. public Vector3 GetRot()
  2517. {
  2518. return base.gameObject.transform.localRotation.eulerAngles;
  2519. }
  2520. public Vector3 GetWorldRot()
  2521. {
  2522. return base.gameObject.transform.rotation.eulerAngles;
  2523. }
  2524. public void SetPosOffset(Vector3 f_vecLocalPos)
  2525. {
  2526. this.m_vOffsetPostion = f_vecLocalPos;
  2527. }
  2528. public void UpdateTransformData()
  2529. {
  2530. this.SetPos(this.baseOffset + this.motionOffset);
  2531. if (this.boMAN)
  2532. {
  2533. if (!string.IsNullOrEmpty(this.rotateLinkMaid))
  2534. {
  2535. for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
  2536. {
  2537. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
  2538. if (maid != null && maid.status.guid == this.rotateLinkMaid)
  2539. {
  2540. maid.UpdateTransformData();
  2541. break;
  2542. }
  2543. }
  2544. }
  2545. return;
  2546. }
  2547. Vector3 position = base.transform.position;
  2548. base.transform.localRotation = Quaternion.identity;
  2549. if (!Mathf.Approximately(0f, this.baseEulerAngles.x))
  2550. {
  2551. base.transform.RotateAround(position, Vector3.right, this.baseEulerAngles.x);
  2552. }
  2553. if (!Mathf.Approximately(0f, this.baseEulerAngles.y))
  2554. {
  2555. base.transform.RotateAround(position, Vector3.up, this.baseEulerAngles.y);
  2556. }
  2557. if (!Mathf.Approximately(0f, this.baseEulerAngles.z))
  2558. {
  2559. base.transform.RotateAround(position, Vector3.forward, this.baseEulerAngles.z);
  2560. }
  2561. for (int j = 0; j < GameMain.Instance.CharacterMgr.GetManCount(); j++)
  2562. {
  2563. Maid man = GameMain.Instance.CharacterMgr.GetMan(j);
  2564. if (man != null && man.status.guid == this.rotateLinkMaid)
  2565. {
  2566. man.SetPos(man.baseOffset + man.motionOffset);
  2567. man.transform.localRotation = Quaternion.identity;
  2568. if (!Mathf.Approximately(0f, this.baseEulerAngles.x))
  2569. {
  2570. man.transform.RotateAround(position, Vector3.right, this.baseEulerAngles.x);
  2571. }
  2572. if (!Mathf.Approximately(0f, this.baseEulerAngles.y))
  2573. {
  2574. man.transform.RotateAround(position, Vector3.up, this.baseEulerAngles.y);
  2575. }
  2576. if (!Mathf.Approximately(0f, this.baseEulerAngles.z))
  2577. {
  2578. man.transform.RotateAround(position, Vector3.forward, this.baseEulerAngles.z);
  2579. }
  2580. break;
  2581. }
  2582. }
  2583. }
  2584. public void SetPosOffsetFromUdeSclX(string category, float val)
  2585. {
  2586. this.m_vOffsetPostion.x = ((float)this.GetProp(category).value - 50f) * (val / 50f);
  2587. }
  2588. public void SetPosOffsetFromUdeSclY(string category, float val)
  2589. {
  2590. this.m_vOffsetPostion.y = ((float)this.GetProp(category).value - 50f) * (val / 50f);
  2591. }
  2592. public void SetPosOffsetFromUdeSclZ(string category, float val)
  2593. {
  2594. this.m_vOffsetPostion.z = ((float)this.GetProp(category).value - 50f) * (val / 50f);
  2595. }
  2596. public void ExportModBaseMenu(MPN f_mpn)
  2597. {
  2598. MaidProp prop = this.GetProp(f_mpn);
  2599. if (string.IsNullOrEmpty(prop.strFileName))
  2600. {
  2601. NUty.WinMessageBox(NUty.GetWindowHandle(), "現在このスロットにはパーツが設定されていません。", "MOD Export Error", 0);
  2602. return;
  2603. }
  2604. Menu.ExportModScript(this, prop.strFileName, false);
  2605. }
  2606. public void ExportModBaseMqo(MPN f_mpn, string f_strOutFileName)
  2607. {
  2608. MaidProp prop = this.GetProp(f_mpn);
  2609. if (string.IsNullOrEmpty(prop.strFileName))
  2610. {
  2611. NUty.WinMessageBox(NUty.GetWindowHandle(), "現在このスロットにはパーツが設定されていません。", "MQO Export Error", 0);
  2612. return;
  2613. }
  2614. }
  2615. public void FoceKuchipakuUpdate(float f_fNowTime)
  2616. {
  2617. if (this.m_baKuchipakuPattern != null)
  2618. {
  2619. int num = (int)((this.m_fKuchipakuPatternOffsetTime + f_fNowTime) * 30f);
  2620. int num2 = this.m_baKuchipakuPattern.Length / 3;
  2621. if (0 < num && num < num2)
  2622. {
  2623. this.body0.Face.morph.boLipSync = true;
  2624. this.body0.Face.morph.LipSync1 = this.body0.Face.morph.LipSync1 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3] / 255f * 0.85f * 3f;
  2625. this.body0.Face.morph.LipSync2 = this.body0.Face.morph.LipSync2 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3 + 1] / 255f * 0.85f * 3f;
  2626. this.body0.Face.morph.LipSync3 = this.body0.Face.morph.LipSync3 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3 + 2] / 255f * 0.85f * 3f;
  2627. }
  2628. else
  2629. {
  2630. this.body0.Face.morph.boLipSync = false;
  2631. }
  2632. }
  2633. }
  2634. private void Update()
  2635. {
  2636. if (this.boAllProcPropBUSY)
  2637. {
  2638. this.AllProcPropSeq();
  2639. return;
  2640. }
  2641. if (this.boMAN)
  2642. {
  2643. this.m_goOffset.transform.localPosition = this.m_vOffsetPostion;
  2644. return;
  2645. }
  2646. if (!this.body0.isLoadedBody)
  2647. {
  2648. return;
  2649. }
  2650. if (this.boOffsetY)
  2651. {
  2652. float num = this.body0.ToeL.position.y;
  2653. if (this.body0.ToeR.position.y < num)
  2654. {
  2655. num = this.body0.ToeR.position.y;
  2656. }
  2657. num = this.body0.CenterBone.position.y;
  2658. num *= 0.8f;
  2659. float num2 = this.body0.Pelvis.position.y - this.body0.CenterBone.position.y;
  2660. this.m_goOffset.transform.localPosition = new Vector3(0f, -num2 + num2 * this.body0.bonemorph.SnityouOutScale, 0f) + this.m_vOffsetPostion;
  2661. }
  2662. this.body0.Face.morph.boLookTooth = this.boLookTooth;
  2663. this.body0.Face.morph.boBallGAG = (this.boBallGAG | this.boMouthOpen);
  2664. this.body0.Face.morph.boNoseFook = this.boNoseFook;
  2665. if (this.AudioMan != null && !this.m_bFoceKuchipakuSelfUpdateTime)
  2666. {
  2667. this.body0.Face.morph.boLipSync = this.AudioMan.audiosource.isPlaying;
  2668. if (!this.lipSyncEnabled)
  2669. {
  2670. this.body0.Face.morph.boLipSync = false;
  2671. }
  2672. float voicePara_ = this.VoicePara_1;
  2673. float voicePara_2 = this.VoicePara_3;
  2674. float vol = this.AudioMan.GetVol();
  2675. this.voice_avg1 = this.voice_avg1 * (1f - voicePara_) + vol * voicePara_;
  2676. this.voice_avg2 = this.voice_avg2 * (1f - voicePara_) + this.AudioMan.VAvgMax * voicePara_;
  2677. this.voice_avg1D = this.voice_avg1D * (1f - voicePara_2) + (vol - this.voice_avg1_old) * voicePara_2;
  2678. this.voice_avg2D = this.voice_avg2D * (1f - voicePara_2) + (this.AudioMan.VAvgMax - this.voice_avg2_old) * voicePara_2;
  2679. this.voice_avg1_old = vol;
  2680. this.voice_avg2_old = this.AudioMan.VAvgMax;
  2681. this.voice_ao_time -= Time.deltaTime;
  2682. if (this.voice_ao_time < 0f && this.voice_avg1D > 0f && this.voice_ao_chk0 < -0.05f && this.voice_ao_chk1 > 0.1f)
  2683. {
  2684. this.voice_ao_time = 0.05f;
  2685. this.voice_ao = (this.voice_ao + 1) % 8;
  2686. this.voice_ao_chk0 = 0f;
  2687. this.voice_ao_chk1 = 0f;
  2688. }
  2689. if (this.voice_ao_chk1 < this.voice_avg1D)
  2690. {
  2691. this.voice_ao_chk1 = this.voice_avg1D;
  2692. }
  2693. if (0.1f < this.voice_avg1D)
  2694. {
  2695. this.voice_ao_chk0 = 0f;
  2696. }
  2697. if (this.voice_ao_chk0 > this.voice_avg1D)
  2698. {
  2699. this.voice_ao_chk0 = this.voice_avg1D;
  2700. }
  2701. float num3 = Mathf.Pow(this.voice_avg1, 1f) * 10f * this.VoicePara_2;
  2702. if (this.voice_ao % 2 == 0)
  2703. {
  2704. this.voice_ao_f *= 0.5f;
  2705. }
  2706. else
  2707. {
  2708. this.voice_ao_f = this.voice_ao_f * 0.5f + 0.5f;
  2709. }
  2710. this.voice_lf2 = num3 * this.voice_ao_f;
  2711. this.voice_lf3 = num3 * (1f - this.voice_ao_f);
  2712. this.body0.Face.morph.LipSync2 = this.voice_lf2;
  2713. this.body0.Face.morph.LipSync3 = this.voice_lf3;
  2714. float num4 = Mathf.Pow(this.voice_avg2, 0.5f) * (this.voice_avg2D * 30f * this.VoicePara_4 + 0.5f);
  2715. this.voice_lf1 = num4;
  2716. this.body0.Face.morph.LipSync1 = this.voice_lf1;
  2717. if (this.voice_ao % 4 < 2)
  2718. {
  2719. this.voice_ao_f2 *= 0.5f;
  2720. }
  2721. else
  2722. {
  2723. this.voice_ao_f2 = this.voice_ao_f2 * 0.5f + 0.5f;
  2724. }
  2725. this.body0.Face.morph.LipSync1 *= this.voice_ao_f2;
  2726. this.body0.Face.morph.LipSync2 *= 1f - this.voice_ao_f2;
  2727. this.body0.Face.morph.LipSync3 *= 1f - this.voice_ao_f2;
  2728. this.body0.Face.morph.LipSync1 = Mathf.Clamp01(this.body0.Face.morph.LipSync1 * 0.5f);
  2729. this.body0.Face.morph.LipSync2 = Mathf.Clamp01(this.body0.Face.morph.LipSync2 * 0.5f);
  2730. this.body0.Face.morph.LipSync3 = Mathf.Clamp01(this.body0.Face.morph.LipSync3 * 0.5f);
  2731. }
  2732. if (this.m_baKuchipakuPattern != null && this.lipSyncEnabled && !this.m_bFoceKuchipakuSelfUpdateTime && this.AudioMan != null)
  2733. {
  2734. this.FoceKuchipakuUpdate(this.AudioMan.audiosource.time);
  2735. }
  2736. if (this.boLipsync && this.lipSyncEnabled)
  2737. {
  2738. this.body0.Face.morph.boLipSync = true;
  2739. this.LipsyncT1 += Mathf.Sin(Time.time * 10f) * 0.5f + Mathf.Cos(Time.time * 5.55f) * 0.1f * 0.2f;
  2740. this.LipsyncT2 += Mathf.Sin(Time.time * 5f) * 0.1f + Mathf.Cos(Time.time * 5.55f) * 0.1f * 0.2f;
  2741. float num5 = (1f + Mathf.Sin(Time.time * 4f + this.LipsyncT1)) * 0.5f * 0.98f + 0.1f;
  2742. float num6 = (Mathf.Sin(this.LipsyncT1) + 1f) * 0.5f;
  2743. float num7 = (Mathf.Sin(this.LipsyncT2) + 1f) * 0.5f;
  2744. this.body0.Face.morph.LipSync1 = num5 * num6 * num7 * 0.5f;
  2745. this.body0.Face.morph.LipSync3 = num5 * (1f - num6) * num7 * 0.5f;
  2746. this.body0.Face.morph.LipSync2 = num5 * (1f - num7) * 0.5f;
  2747. }
  2748. else if (this.boLipsync_old)
  2749. {
  2750. this.body0.Face.morph.LipSync1 = 0f;
  2751. this.body0.Face.morph.LipSync3 = 0f;
  2752. this.body0.Face.morph.LipSync2 = 0f;
  2753. }
  2754. this.boLipsync_old = this.boLipsync;
  2755. if (this.boMabataki)
  2756. {
  2757. this.body0.Face.morph.ClearBlendValues();
  2758. if (this.FaceName != string.Empty)
  2759. {
  2760. this.body0.Face.morph.MulBlendValues(this.FaceName, 1f);
  2761. }
  2762. if (this.FaceName2 != string.Empty)
  2763. {
  2764. this.body0.Face.morph.MulBlendValues(this.FaceName2, UTY.COSS2(Mathf.Pow(this.FaceTime, 0.4f), 4f));
  2765. this.FaceTime += Time.deltaTime * this.FacePlus;
  2766. if (this.FaceTime >= 1f)
  2767. {
  2768. this.boFaceAnime = false;
  2769. this.FaceName = this.FaceName2;
  2770. this.FaceName2 = string.Empty;
  2771. }
  2772. }
  2773. if (this.FaceName3 != string.Empty)
  2774. {
  2775. this.body0.Face.morph.AddBlendValues(this.FaceName3, 1f);
  2776. }
  2777. if (this.MabatakiVal > 0f)
  2778. {
  2779. float num8 = this.MabatakiVal * this.MabatakiVal;
  2780. num8 = Mathf.Sin(num8 * 3.14159274f);
  2781. this.body0.Face.morph.EyeMabataki = num8;
  2782. }
  2783. else
  2784. {
  2785. this.body0.Face.morph.EyeMabataki = 0f;
  2786. }
  2787. if (!this.MabatakiUpdateStop)
  2788. {
  2789. this.MabatakiVal -= Time.deltaTime * 2f;
  2790. }
  2791. this.body0.Face.morph.FixBlendValues_Face();
  2792. if (!this.boFaceAnime && this.NextMabatakiTime < Time.time && !this.MabatakiUpdateStop)
  2793. {
  2794. float num9 = 0.5f + (float)UTY.GetRnd(80) * 0.1f;
  2795. this.NextMabatakiTime = Time.time + num9;
  2796. this.MabatakiVal = 1f;
  2797. }
  2798. }
  2799. else if (this.FaceName2 != string.Empty)
  2800. {
  2801. this.body0.Face.morph.ClearBlendValues();
  2802. if (this.FaceName != string.Empty)
  2803. {
  2804. this.body0.Face.morph.MulBlendValues(this.FaceName, 1f);
  2805. }
  2806. this.body0.Face.morph.MulBlendValues(this.FaceName2, UTY.COSS2(Mathf.Pow(this.FaceTime, 0.4f), 4f));
  2807. this.FaceTime += Time.deltaTime * this.FacePlus;
  2808. if (this.FaceTime >= 1f)
  2809. {
  2810. this.boFaceAnime = false;
  2811. this.FaceName = this.FaceName2;
  2812. this.FaceName2 = string.Empty;
  2813. }
  2814. this.MabatakiVal = 0f;
  2815. this.body0.Face.morph.FixBlendValues_Face();
  2816. }
  2817. }
  2818. private void LateUpdate()
  2819. {
  2820. if (this.boAllProcPropBUSY)
  2821. {
  2822. return;
  2823. }
  2824. if (!this.body0.isLoadedBody)
  2825. {
  2826. return;
  2827. }
  2828. if (this.m_MotionLoad == 1)
  2829. {
  2830. this.m_MotionLoad = 0;
  2831. if (!this.boMAN)
  2832. {
  2833. this.CrossFade("maid_stand01.anm", false, true, false, 0.5f, 1f);
  2834. this.FaceAnime("通常", 1f, 0);
  2835. if (GameMain.Instance.VRMode)
  2836. {
  2837. if (GameMain.Instance.OvrMgr != null)
  2838. {
  2839. this.body0.trsLookTarget = GameMain.Instance.OvrMgr.EyeAnchor;
  2840. }
  2841. }
  2842. else if (GameMain.Instance.MainCamera != null)
  2843. {
  2844. this.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
  2845. }
  2846. }
  2847. }
  2848. }
  2849. public GameObject m_goOffset;
  2850. private Status m_Status;
  2851. private MaidParts m_Parts;
  2852. private bool m_visible;
  2853. public Action<Maid> onMouseUpEvent;
  2854. public string TypeName = string.Empty;
  2855. public TBody body0;
  2856. public bool boMAN;
  2857. public bool boNPC;
  2858. public bool boOffsetY = true;
  2859. public Vector3 baseOffset = Vector3.zero;
  2860. public Vector3 motionOffset = Vector3.zero;
  2861. public Vector3 baseEulerAngles = Vector3.zero;
  2862. public string rotateLinkMaid = string.Empty;
  2863. private Dictionary<string, MaidProp> m_dicMaidProp = new Dictionary<string, MaidProp>();
  2864. private MaidProp[] m_aryMaidProp;
  2865. private Hashtable m_hashMaidPropLower = new Hashtable();
  2866. private int m_nActiveSlotNo = -1;
  2867. private string m_strThumCardTime = string.Empty;
  2868. private Texture2D m_texIcon;
  2869. private Color m_colMan = new Color(0f, 0.09f, 1f, 1f);
  2870. private int m_nVoicePitch = 50;
  2871. private string m_strBefOnepiceFileName;
  2872. private int m_nBefOnepiceRID;
  2873. private string m_strBefWearFileName;
  2874. private int m_nBefWearRID;
  2875. private string m_strBefSkirtFileName;
  2876. private int m_nBefSkirtRID;
  2877. private bool boModelChg;
  2878. public bool boAllProcPropBUSY;
  2879. private int AllProcProp2Fase;
  2880. private int AllProcProp2Cnt;
  2881. public bool boLookTooth;
  2882. public bool boBallGAG;
  2883. public bool boMouthOpen;
  2884. public bool boNoseFook;
  2885. private float m_fKuchipakuPatternOffsetTime;
  2886. public byte[] m_baKuchipakuPattern;
  2887. private bool m_bFoceKuchipakuSelfUpdateTime;
  2888. [Header("音声入力用コンポーネント")]
  2889. public Maid.LipSyncComp MicLipData = new Maid.LipSyncComp();
  2890. private bool m_MicLipSync;
  2891. private bool boAutoFace;
  2892. private float NextMabatakiTime;
  2893. private float MabatakiVal;
  2894. private string FaceName = string.Empty;
  2895. private string FaceName2 = string.Empty;
  2896. public string FaceName3 = string.Empty;
  2897. private float FaceTime;
  2898. private float FacePlus;
  2899. public string ActiveFace = string.Empty;
  2900. public int FaceAnimeChkCode;
  2901. public bool boFaceAnime;
  2902. public int OldFaceAtr;
  2903. public bool boShitakaraNozoku;
  2904. public bool boVisibleBottom;
  2905. public int AutoFaceLV_old;
  2906. public float Hazukashi;
  2907. public bool boChkEye_old;
  2908. public GameObject m_goTestAnim;
  2909. public float voice_time;
  2910. public float voice_avg1;
  2911. public float voice_avg2;
  2912. public float voice_avg1_old;
  2913. public float voice_avg2_old;
  2914. public float voice_avg1D;
  2915. public float voice_avg2D;
  2916. public int voice_ao;
  2917. public float voice_ao_f;
  2918. public float voice_ao_f2;
  2919. public float voice_ao_time;
  2920. public float voice_ao_chk0;
  2921. public float voice_ao_chk1;
  2922. public float voice_lf1;
  2923. public float voice_lf2;
  2924. public float voice_lf3;
  2925. public float VoicePara_1 = 0.5f;
  2926. public float VoicePara_2 = 0.074f;
  2927. public float VoicePara_3 = 0.5f;
  2928. public float VoicePara_4 = 0.05f;
  2929. private bool lipSyncEnabled = true;
  2930. private bool boLipsync;
  2931. private bool boLipsync_old;
  2932. private float LipsyncT1;
  2933. private float LipsyncT2;
  2934. public bool boMabataki = true;
  2935. public bool MabatakiUpdateStop;
  2936. private Vector3 m_vOffsetPostion = Vector3.zero;
  2937. public static int changetest;
  2938. private int m_MotionLoad = 1;
  2939. [Serializable]
  2940. public class LipSyncComp
  2941. {
  2942. [HideInInspector]
  2943. public bool IsInit = true;
  2944. public LowLatencyLipSyncContext Context;
  2945. public OVRLipSyncContextMorphTarget MorphTarget;
  2946. public OVRLipSyncMicInput MicInput;
  2947. }
  2948. public enum EyeMoveType
  2949. {
  2950. 無し,
  2951. 無視する,
  2952. 顔を向ける,
  2953. 顔だけ動かす,
  2954. 顔をそらす,
  2955. 目と顔を向ける,
  2956. 目だけ向ける,
  2957. 目だけそらす
  2958. }
  2959. public enum AutoTwist
  2960. {
  2961. ShoulderL,
  2962. ShoulderR,
  2963. WristL,
  2964. WristR,
  2965. ThighL,
  2966. ThighR
  2967. }
  2968. }