Maid.cs 79 KB

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