Maid.cs 79 KB

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