1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using MaidStatus;
- using UnityEngine;
- using XVI.AniLipSync;
- public class Maid : MonoBehaviour
- {
- public bool Visible
- {
- get
- {
- return this.m_visible;
- }
- set
- {
- GameObject gameObject = base.gameObject;
- this.m_visible = value;
- gameObject.SetActive(value);
- }
- }
- public MaidParts Parts
- {
- get
- {
- return this.m_Parts;
- }
- }
- public Status status
- {
- get
- {
- return this.m_Status;
- }
- }
- public AudioSourceMgr AudioMan
- {
- get
- {
- return (!(this.body0 != null)) ? null : this.body0.AudioMan;
- }
- }
- public bool IsBusy
- {
- get
- {
- return this.IsAllProcPropBusy && this.Visible;
- }
- }
- public bool IsAllProcPropBusy
- {
- get
- {
- return this.boAllProcPropBUSY;
- }
- }
- public FullBodyIKCtrl IKCtrl
- {
- get
- {
- return this.body0.IKCtrl;
- }
- }
- public int ActiveSlotNo
- {
- get
- {
- return this.m_nActiveSlotNo;
- }
- set
- {
- this.m_nActiveSlotNo = value;
- }
- }
- public Color ManColor
- {
- get
- {
- return this.m_colMan;
- }
- set
- {
- this.m_colMan = value;
- }
- }
- public int VoicePitch
- {
- get
- {
- return this.m_nVoicePitch;
- }
- set
- {
- if (this.body0 != null)
- {
- TBody tbody = this.body0;
- this.m_nVoicePitch = value;
- tbody.SetVoicePitch(value);
- }
- }
- }
- public static void UpdateMaidRanking()
- {
- if (!GameMain.Instance.CharacterMgr.status.isAvailableRanking)
- {
- Debug.Log("メイドランキングは未開放なので更新されませんでした");
- return;
- }
- List<KeyValuePair<long, Maid>> list = new List<KeyValuePair<long, Maid>>();
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- for (int i = 0; i < characterMgr.GetStockMaidCount(); i++)
- {
- Maid stockMaid = characterMgr.GetStockMaid(i);
- if (!(stockMaid == null))
- {
- stockMaid.status.popularRank = 0;
- long key = (long)stockMaid.status.evaluation + stockMaid.status.sales;
- list.Add(new KeyValuePair<long, Maid>(key, stockMaid));
- }
- }
- list.Sort(delegate(KeyValuePair<long, Maid> a, KeyValuePair<long, Maid> b)
- {
- long num3 = b.Key - a.Key;
- return (num3 != 0L) ? ((0L >= num3) ? -1 : 1) : 0;
- });
- long num = -1L;
- int num2 = 0;
- foreach (KeyValuePair<long, Maid> keyValuePair in list)
- {
- if (keyValuePair.Key == 0L)
- {
- break;
- }
- if (keyValuePair.Key != num)
- {
- num2++;
- }
- keyValuePair.Value.status.popularRank = num2;
- num = keyValuePair.Key;
- }
- }
- private void Awake()
- {
- }
- public void OnMouseUp()
- {
- if (this.IsBusy || this.body0 == null || this.onMouseUpEvent == null)
- {
- return;
- }
- this.onMouseUpEvent(this);
- }
- public void Initialize(string f_strTypeName, bool f_bMan)
- {
- this.m_Parts = base.gameObject.AddComponent<MaidParts>();
- this.m_goOffset = new GameObject("Offset");
- this.m_goOffset.transform.parent = base.gameObject.transform;
- this.TypeName = f_strTypeName;
- this.boMAN = f_bMan;
- this.boOffsetY = true;
- this.body0 = base.gameObject.AddComponent<TBody>();
- this.body0.Init(this, f_bMan);
- int length = Enum.GetValues(typeof(MPN)).Length;
- this.m_aryMaidProp = new MaidProp[length];
- List<MaidProp> list = Maid.CreateInitMaidPropList();
- foreach (MaidProp mp in list)
- {
- this.AddProp(mp);
- }
- this.InitializeStatus();
- this.m_Parts.Initialize(base.gameObject, this);
- this.DelPrefabAll();
- if (this.boMAN)
- {
- this.SetUpModel("_I_man.menu");
- }
- else
- {
- this.SetUpModel("_I_default.menu");
- if (Product.isPublic)
- {
- this.SetProp(MPN.bra, "bra030_i_.menu", 0, false, false);
- this.SetProp(MPN.panz, "Pants030_i_.menu", 0, false, false);
- }
- }
- }
- public void InitializeStatus()
- {
- if (this.m_Status == null)
- {
- this.m_Status = new Status();
- this.m_Status.Initialize(this);
- }
- }
- public static List<MaidProp> CreateInitMaidPropList()
- {
- return new List<MaidProp>
- {
- Maid.CreateProp(0, int.MaxValue, 0, MPN.null_mpn, 0),
- Maid.CreateProp(0, 130, 10, MPN.MuneL, 1),
- Maid.CreateProp(0, 100, 0, MPN.MuneS, 1),
- Maid.CreateProp(0, 130, 10, MPN.MuneTare, 1),
- Maid.CreateProp(0, 100, 40, MPN.RegFat, 1),
- Maid.CreateProp(0, 100, 20, MPN.ArmL, 1),
- Maid.CreateProp(0, 100, 20, MPN.Hara, 1),
- Maid.CreateProp(0, 100, 40, MPN.RegMeet, 1),
- Maid.CreateProp(20, 80, 50, MPN.KubiScl, 2),
- Maid.CreateProp(0, 100, 50, MPN.UdeScl, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeScl, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeSclX, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeSclY, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyePosX, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyePosY, 2),
- Maid.CreateProp(0, 100, 0, MPN.EyeClose, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeBallPosX, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeBallPosY, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeBallSclX, 2),
- Maid.CreateProp(0, 100, 50, MPN.EyeBallSclY, 2),
- Maid.CreateProp(0, 1, 0, MPN.EarNone, 2),
- Maid.CreateProp(0, 100, 0, MPN.EarElf, 2),
- Maid.CreateProp(0, 100, 50, MPN.EarRot, 2),
- Maid.CreateProp(0, 100, 50, MPN.EarScl, 2),
- Maid.CreateProp(0, 100, 50, MPN.NosePos, 2),
- Maid.CreateProp(0, 100, 50, MPN.NoseScl, 2),
- Maid.CreateProp(0, 100, 0, MPN.FaceShape, 2),
- Maid.CreateProp(0, 100, 0, MPN.FaceShapeSlim, 2),
- Maid.CreateProp(0, 100, 50, MPN.MayuShapeIn, 2),
- Maid.CreateProp(0, 100, 50, MPN.MayuShapeOut, 2),
- Maid.CreateProp(0, 100, 50, MPN.MayuX, 2),
- Maid.CreateProp(0, 100, 50, MPN.MayuY, 2),
- Maid.CreateProp(0, 100, 50, MPN.MayuRot, 2),
- Maid.CreateProp(0, 100, 50, MPN.HeadX, 2),
- Maid.CreateProp(0, 100, 50, MPN.HeadY, 2),
- Maid.CreateProp(20, 80, 50, MPN.DouPer, 2),
- Maid.CreateProp(20, 80, 50, MPN.sintyou, 2),
- Maid.CreateProp(0, 100, 50, MPN.koshi, 2),
- Maid.CreateProp(0, 100, 50, MPN.kata, 2),
- Maid.CreateProp(0, 100, 50, MPN.west, 2),
- Maid.CreateProp(0, 100, 10, MPN.MuneUpDown, 2),
- Maid.CreateProp(0, 100, 40, MPN.MuneYori, 2),
- Maid.CreateProp(0, 100, 50, MPN.MuneYawaraka, 2),
- Maid.CreateProp(string.Empty, MPN.body, 3),
- Maid.CreateProp(string.Empty, MPN.head, 3),
- Maid.CreateProp(string.Empty, MPN.hairf, 3),
- Maid.CreateProp(string.Empty, MPN.hairr, 3),
- Maid.CreateProp(string.Empty, MPN.hairt, 3),
- Maid.CreateProp(string.Empty, MPN.hairs, 3),
- Maid.CreateProp(string.Empty, MPN.wear, 3),
- Maid.CreateProp(string.Empty, MPN.skirt, 3),
- Maid.CreateProp(string.Empty, MPN.mizugi, 3),
- Maid.CreateProp(string.Empty, MPN.bra, 3),
- Maid.CreateProp(string.Empty, MPN.panz, 3),
- Maid.CreateProp(string.Empty, MPN.stkg, 3),
- Maid.CreateProp(string.Empty, MPN.shoes, 3),
- Maid.CreateProp(string.Empty, MPN.headset, 3),
- Maid.CreateProp(string.Empty, MPN.glove, 3),
- Maid.CreateProp(string.Empty, MPN.acchead, 3),
- Maid.CreateProp(string.Empty, MPN.hairaho, 3),
- Maid.CreateProp(string.Empty, MPN.accha, 3),
- Maid.CreateProp(string.Empty, MPN.acchana, 3),
- Maid.CreateProp(string.Empty, MPN.acckamisub, 3),
- Maid.CreateProp(string.Empty, MPN.acckami, 3),
- Maid.CreateProp(string.Empty, MPN.accmimi, 3),
- Maid.CreateProp(string.Empty, MPN.accnip, 3),
- Maid.CreateProp(string.Empty, MPN.acckubi, 3),
- Maid.CreateProp(string.Empty, MPN.acckubiwa, 3),
- Maid.CreateProp(string.Empty, MPN.accheso, 3),
- Maid.CreateProp(string.Empty, MPN.accude, 3),
- Maid.CreateProp(string.Empty, MPN.accashi, 3),
- Maid.CreateProp(string.Empty, MPN.accsenaka, 3),
- Maid.CreateProp(string.Empty, MPN.accshippo, 3),
- Maid.CreateProp(string.Empty, MPN.accanl, 3),
- Maid.CreateProp(string.Empty, MPN.accvag, 3),
- Maid.CreateProp(string.Empty, MPN.megane, 3),
- Maid.CreateProp(string.Empty, MPN.accxxx, 3),
- Maid.CreateProp(string.Empty, MPN.handitem, 3),
- Maid.CreateProp(string.Empty, MPN.acchat, 3),
- Maid.CreateProp(string.Empty, MPN.haircolor, 3),
- Maid.CreateProp(string.Empty, MPN.skin, 3),
- Maid.CreateProp(string.Empty, MPN.acctatoo, 3),
- Maid.CreateProp(string.Empty, MPN.accnail, 3),
- Maid.CreateProp(string.Empty, MPN.underhair, 3),
- Maid.CreateProp(string.Empty, MPN.hokuro, 3),
- Maid.CreateProp(string.Empty, MPN.mayu, 3),
- Maid.CreateProp(string.Empty, MPN.lip, 3),
- Maid.CreateProp(string.Empty, MPN.eye, 3),
- Maid.CreateProp(string.Empty, MPN.eye_hi, 3),
- Maid.CreateProp(string.Empty, MPN.eye_hi_r, 3),
- Maid.CreateProp(string.Empty, MPN.chikubi, 3),
- Maid.CreateProp(string.Empty, MPN.chikubicolor, 3),
- Maid.CreateProp(string.Empty, MPN.eyewhite, 3),
- Maid.CreateProp(string.Empty, MPN.nose, 3),
- Maid.CreateProp(string.Empty, MPN.facegloss, 3),
- Maid.CreateProp(string.Empty, MPN.moza, 3),
- Maid.CreateProp(string.Empty, MPN.onepiece, 3),
- Maid.CreateProp(string.Empty, MPN.set_maidwear, 3),
- Maid.CreateProp(string.Empty, MPN.set_mywear, 3),
- Maid.CreateProp(string.Empty, MPN.set_underwear, 3),
- Maid.CreateProp(string.Empty, MPN.set_body, 3),
- Maid.CreateProp(string.Empty, MPN.folder_eye, 3),
- Maid.CreateProp(string.Empty, MPN.folder_mayu, 3),
- Maid.CreateProp(string.Empty, MPN.folder_underhair, 3),
- Maid.CreateProp(string.Empty, MPN.folder_skin, 3),
- Maid.CreateProp(string.Empty, MPN.folder_eyewhite, 3),
- Maid.CreateProp(string.Empty, MPN.kousoku_upper, 3),
- Maid.CreateProp(string.Empty, MPN.kousoku_lower, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_naka, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_hara, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_face, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_mune, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_hip, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_ude, 3),
- Maid.CreateProp(string.Empty, MPN.seieki_ashi, 3)
- };
- }
- public void Uninit()
- {
- this.Visible = false;
- this.boOffsetY = true;
- this.DelPrefabAll();
- Debug.Log("Uninit " + this.status.firstName);
- this.body0.UnInit();
- }
- private void OnDestroy()
- {
- this.DelPrefabAll();
- this.Uninit();
- }
- public void ManColorUpdate()
- {
- if (this.body0 != null)
- {
- this.body0.ManColorUpdate();
- }
- }
- public void ClearPropValueDefault()
- {
- foreach (MaidProp maidProp in this.m_aryMaidProp)
- {
- if (!(maidProp.name == "body"))
- {
- maidProp.temp_value = (maidProp.value = maidProp.value_Default);
- }
- }
- }
- public MaidProp GetProp(string tag)
- {
- return this.m_dicMaidProp[tag];
- }
- public MaidProp GetPropLower(string tagLower)
- {
- return (MaidProp)this.m_hashMaidPropLower[tagLower];
- }
- public MaidProp GetProp(MPN mpn)
- {
- return this.m_aryMaidProp[(int)mpn];
- }
- public static MaidProp CreateProp(string f_strDefFileName, MPN mpn, int type)
- {
- NDebug.Assert(type == 3, "プロパティオブジェクトのタイプが不正です。");
- MaidProp maidProp = new MaidProp();
- maidProp.name = mpn.ToString();
- maidProp.type = type;
- maidProp.listSubProp = null;
- maidProp.strFileName = f_strDefFileName;
- if (string.IsNullOrEmpty(maidProp.strFileName))
- {
- string strFileName = maidProp.strFileName;
- if (CM3.dicDelItem.TryGetValue(mpn, out strFileName))
- {
- maidProp.strFileName = strFileName;
- }
- }
- maidProp.nFileNameRID = maidProp.strFileName.ToLower().GetHashCode();
- maidProp.boDut = true;
- maidProp.boTempDut = false;
- maidProp.idx = (int)mpn;
- return maidProp;
- }
- public static MaidProp CreateProp(int minval, int maxval, int defval, MPN mpn, int type)
- {
- NDebug.Assert(type == 0 || type == 1 || type == 2, "プロパティオブジェクトのタイプが不正です。");
- MaidProp maidProp = new MaidProp();
- maidProp.name = mpn.ToString();
- maidProp.type = type;
- maidProp.min = minval;
- maidProp.max = maxval;
- if (defval < minval)
- {
- defval = minval;
- }
- if (defval > maxval)
- {
- defval = maxval;
- }
- maidProp.value_Default = defval;
- maidProp.listSubProp = null;
- maidProp.strFileName = string.Empty;
- maidProp.temp_value = (maidProp.value = defval);
- maidProp.idx = (int)mpn;
- maidProp.boDut = true;
- maidProp.boTempDut = false;
- return maidProp;
- }
- private void AddProp(MaidProp mp)
- {
- MPN idx = (MPN)mp.idx;
- this.m_dicMaidProp[idx.ToString()] = mp;
- this.m_aryMaidProp[(int)idx] = mp;
- this.m_hashMaidPropLower[idx.ToString().ToLower()] = mp;
- }
- private void AddProp(string f_strDefFileName, MPN mpn, int type)
- {
- this.AddProp(Maid.CreateProp(f_strDefFileName, mpn, type));
- }
- private void AddProp(int minval, int maxval, int defval, MPN mpn, int type)
- {
- this.AddProp(Maid.CreateProp(minval, maxval, defval, mpn, type));
- }
- public void Prop_AddValue(string tag, int val)
- {
- NDebug.Assert(this.m_dicMaidProp.ContainsKey(tag), "指定されたプロパティ名がありません。");
- this.Prop_AddValue(this.m_dicMaidProp[tag].idx, val);
- }
- public void Prop_AddValue(int idx, int val)
- {
- val += this.m_aryMaidProp[idx].value;
- if (this.m_aryMaidProp[idx].min > val)
- {
- val = this.m_aryMaidProp[idx].min;
- }
- if (this.m_aryMaidProp[idx].max < val)
- {
- val = this.m_aryMaidProp[idx].max;
- }
- if (this.m_aryMaidProp[idx].value_LinkMAX != 0 && this.m_aryMaidProp[this.m_aryMaidProp[idx].value_LinkMAX].value < val)
- {
- val = this.m_aryMaidProp[this.m_aryMaidProp[idx].value_LinkMAX].value;
- }
- if (this.m_aryMaidProp[idx].value != val)
- {
- this.m_aryMaidProp[idx].value = val;
- }
- this.m_aryMaidProp[idx].boDut = true;
- this.m_aryMaidProp[idx].boTempDut = false;
- }
- public void SetProp(string tag, int val, bool f_bTemp = false)
- {
- MPN idx = MPN.null_mpn;
- try
- {
- idx = (MPN)Enum.Parse(typeof(MPN), tag);
- }
- catch
- {
- NDebug.Assert("指定されたプロパティ名がありません。" + tag, false);
- }
- this.SetProp(idx, val, f_bTemp);
- }
- public void SetProp(MPN idx, int val, bool f_bTemp = false)
- {
- NDebug.Assert(idx != MPN.null_mpn, "指定されたプロパティ名がありません。" + base.tag);
- MaidProp maidProp = this.m_aryMaidProp[(int)idx];
- if (maidProp.min > val)
- {
- val = maidProp.min;
- }
- if (maidProp.max < val)
- {
- val = maidProp.max;
- }
- if (f_bTemp)
- {
- maidProp.temp_value = val;
- maidProp.boTempDut = true;
- }
- else
- {
- maidProp.value = val;
- maidProp.boDut = true;
- maidProp.boTempDut = false;
- }
- }
- public void SetProp(string tag, string filename, int f_nFileNameRID, bool f_bTemp = false, bool f_bNoScale = false)
- {
- NDebug.Assert(this.m_dicMaidProp.ContainsKey(tag), "指定されたプロパティ名がありません。" + tag);
- MaidProp mp = this.m_dicMaidProp[tag];
- this.SetProp(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
- }
- public void SetProp(MPN idx, string filename, int f_nFileNameRID, bool f_bTemp = false, bool f_bNoScale = false)
- {
- MaidProp mp = this.m_aryMaidProp[(int)idx];
- this.SetProp(mp, filename, f_nFileNameRID, f_bTemp, f_bNoScale);
- }
- public void SetProp(MaidProp mps)
- {
- bool flag = false;
- bool flag2 = false;
- bool flag3 = false;
- MaidProp prop = this.GetProp((MPN)mps.idx);
- bool flag4 = prop.m_dicTBodySkinPos.Count != 0;
- flag = (prop.m_dicTBodyAttachPos.Count != 0);
- flag2 = (prop.m_dicMaterialProp.Count != 0);
- flag3 = (prop.m_dicBoneLength.Count != 0);
- if (mps.idx != 43)
- {
- this.SetProp((MPN)mps.idx, mps.strFileName, mps.nFileNameRID, false, false);
- }
- if (flag4 || mps.m_dicTBodySkinPos.Count != 0)
- {
- MaidProp prop2 = this.GetProp((MPN)mps.idx);
- prop2.m_dicTBodySkinPos.Clear();
- foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, BoneAttachPos>> keyValuePair in mps.m_dicTBodySkinPos)
- {
- prop2.m_dicTBodySkinPos[keyValuePair.Key] = new KeyValuePair<int, BoneAttachPos>(keyValuePair.Value.Key, new BoneAttachPos(keyValuePair.Value.Value));
- }
- if (mps.idx != 43)
- {
- prop2.boDut = true;
- }
- prop2.boAdjustDut = true;
- }
- if (flag || mps.m_dicTBodyAttachPos.Count != 0)
- {
- MaidProp prop3 = this.GetProp((MPN)mps.idx);
- prop3.m_dicTBodyAttachPos.Clear();
- foreach (KeyValuePair<TBody.SlotID, Dictionary<string, KeyValuePair<int, VtxAttachPos>>> keyValuePair2 in mps.m_dicTBodyAttachPos)
- {
- Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary = new Dictionary<string, KeyValuePair<int, VtxAttachPos>>();
- foreach (KeyValuePair<string, KeyValuePair<int, VtxAttachPos>> keyValuePair3 in keyValuePair2.Value)
- {
- dictionary[keyValuePair3.Key] = new KeyValuePair<int, VtxAttachPos>(keyValuePair3.Value.Key, new VtxAttachPos(keyValuePair3.Value.Value));
- }
- prop3.m_dicTBodyAttachPos[keyValuePair2.Key] = dictionary;
- }
- if (mps.idx != 43)
- {
- prop3.boDut = true;
- }
- prop3.boAdjustDut = true;
- }
- if (flag2 || mps.m_dicMaterialProp.Count != 0)
- {
- MaidProp prop4 = this.GetProp((MPN)mps.idx);
- prop4.m_dicMaterialProp.Clear();
- foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, MatPropSave>> keyValuePair4 in mps.m_dicMaterialProp)
- {
- prop4.m_dicMaterialProp[keyValuePair4.Key] = new KeyValuePair<int, MatPropSave>(keyValuePair4.Value.Key, new MatPropSave(keyValuePair4.Value.Value));
- }
- if (mps.idx != 43)
- {
- prop4.boDut = true;
- }
- prop4.boAdjustDut = true;
- }
- if (flag3 || mps.m_dicBoneLength.Count != 0)
- {
- MaidProp prop5 = this.GetProp((MPN)mps.idx);
- prop5.m_dicBoneLength.Clear();
- foreach (KeyValuePair<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> keyValuePair5 in mps.m_dicBoneLength)
- {
- Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
- foreach (KeyValuePair<string, float> keyValuePair6 in keyValuePair5.Value.Value)
- {
- dictionary2[keyValuePair6.Key] = keyValuePair6.Value;
- }
- prop5.m_dicBoneLength[keyValuePair5.Key] = new KeyValuePair<int, Dictionary<string, float>>(keyValuePair5.Value.Key, dictionary2);
- }
- if (mps.idx != 43)
- {
- prop5.boDut = true;
- }
- prop5.boAdjustDut = true;
- }
- }
- private void SetProp(MaidProp mp, string filename, int f_nFileNameRID, bool f_bTemp, bool f_bNoScale = false)
- {
- if (f_bTemp)
- {
- if (filename != mp.strTempFileName)
- {
- mp.boTempDut = true;
- mp.strTempFileName = filename;
- mp.bNoScale = f_bNoScale;
- if (f_nFileNameRID == 0)
- {
- mp.nTempFileNameRID = filename.ToLower().GetHashCode();
- }
- else
- {
- mp.nTempFileNameRID = f_nFileNameRID;
- }
- if (Product.isPublic)
- {
- if (mp.idx == 71 && filename.ToLower() != "pants030_i_.menu")
- {
- this.SetProp(mp, "pants030_i_.menu", 0, f_bTemp, f_bNoScale);
- return;
- }
- if (mp.idx == 70 && filename.ToLower() != "bra030_i_.menu")
- {
- this.SetProp(mp, "bra030_i_.menu", 0, f_bTemp, f_bNoScale);
- return;
- }
- }
- }
- }
- else
- {
- if (mp.strFileName != filename || mp.bSubDut || (97 <= mp.idx && mp.idx <= 100))
- {
- mp.boDut = true;
- }
- mp.strFileName = filename;
- mp.bNoScale = f_bNoScale;
- if (f_nFileNameRID == 0)
- {
- mp.nFileNameRID = filename.ToLower().GetHashCode();
- }
- else
- {
- mp.nFileNameRID = f_nFileNameRID;
- }
- mp.strTempFileName = string.Empty;
- mp.nTempFileNameRID = 0;
- if (mp.listSubProp != null)
- {
- mp.listSubProp.Clear();
- }
- mp.bSubDut = false;
- mp.m_dicTBodySkinPos.Clear();
- mp.m_dicTBodyAttachPos.Clear();
- mp.m_dicMaterialProp.Clear();
- mp.m_dicBoneLength.Clear();
- if (Product.isPublic)
- {
- f_nFileNameRID = mp.nFileNameRID;
- if (filename.Contains("_del"))
- {
- f_nFileNameRID = 0;
- }
- if (mp.idx == 96)
- {
- this.m_strBefOnepiceFileName = filename;
- this.m_nBefOnepiceRID = f_nFileNameRID;
- if (f_nFileNameRID != 0)
- {
- MaidProp prop = this.GetProp(MPN.wear);
- if (!prop.strFileName.Contains("_del"))
- {
- this.m_strBefWearFileName = prop.strFileName;
- this.m_nBefWearRID = prop.nFileNameRID;
- }
- MaidProp prop2 = this.GetProp(MPN.skirt);
- if (!prop2.strFileName.Contains("_del"))
- {
- this.m_strBefSkirtFileName = prop2.strFileName;
- this.m_nBefSkirtRID = prop2.nFileNameRID;
- }
- }
- }
- else if (mp.idx == 67)
- {
- this.m_strBefWearFileName = filename;
- this.m_nBefWearRID = f_nFileNameRID;
- if (f_nFileNameRID != 0 && this.m_nBefOnepiceRID != 0)
- {
- this.m_nBefOnepiceRID = 0;
- if (this.m_nBefSkirtRID != 0)
- {
- this.SetProp(MPN.skirt, this.m_strBefSkirtFileName, this.m_nBefSkirtRID, false, false);
- }
- }
- }
- else if (mp.idx == 68)
- {
- this.m_strBefSkirtFileName = filename;
- this.m_nBefSkirtRID = f_nFileNameRID;
- if (f_nFileNameRID != 0 && this.m_nBefOnepiceRID != 0)
- {
- this.m_nBefOnepiceRID = 0;
- if (this.m_nBefWearRID != 0)
- {
- this.SetProp(MPN.wear, this.m_strBefWearFileName, this.m_nBefWearRID, false, false);
- }
- }
- }
- else
- {
- if (mp.idx == 71 && filename.ToLower() != "pants030_i_.menu")
- {
- this.SetProp(mp, "pants030_i_.menu", 0, f_bTemp, f_bNoScale);
- return;
- }
- if (mp.idx == 70 && filename.ToLower() != "bra030_i_.menu")
- {
- this.SetProp(mp, "bra030_i_.menu", 0, f_bTemp, f_bNoScale);
- return;
- }
- }
- }
- }
- if (mp.boTempDut && mp.boDut)
- {
- string[] array = new string[6];
- array[0] = "SetProp:本元とTempのどうちらにも更新フラグが付いています。";
- int num = 1;
- MPN idx = (MPN)mp.idx;
- array[num] = idx.ToString();
- array[2] = " 元=";
- array[3] = mp.strFileName;
- array[4] = " Temp=";
- array[5] = mp.strTempFileName;
- Debug.LogWarning(string.Concat(array));
- }
- }
- public bool DelProp(MPN idx, bool f_bTemp = false)
- {
- string empty = string.Empty;
- if (CM3.dicDelItem.TryGetValue(idx, out empty))
- {
- this.SetProp(idx, empty, 0, f_bTemp, false);
- return true;
- }
- return false;
- }
- public void SetSubProp(MPN idx, int subno, string filename, int f_nFileNameRID = 0)
- {
- MaidProp maidProp = this.m_aryMaidProp[(int)idx];
- if (maidProp.listSubProp == null)
- {
- maidProp.listSubProp = new List<SubProp>();
- }
- if (maidProp.listSubProp.Count<SubProp>() < subno + 1)
- {
- int num = maidProp.listSubProp.Count<SubProp>();
- for (int i = num; i < subno + 1; i++)
- {
- maidProp.listSubProp.Add(null);
- }
- }
- SubProp subProp = maidProp.listSubProp[subno];
- if (subProp == null)
- {
- SubProp subProp2 = new SubProp();
- maidProp.listSubProp[subno] = subProp2;
- subProp = subProp2;
- }
- subProp.bDut = true;
- subProp.strFileName = filename;
- if (f_nFileNameRID == 0)
- {
- subProp.nFileNameRID = filename.ToLower().GetHashCode();
- }
- else
- {
- subProp.nFileNameRID = f_nFileNameRID;
- }
- maidProp.bSubDut = true;
- }
- public SubProp GetSubProp(MPN idx, int subno)
- {
- MaidProp maidProp = this.m_aryMaidProp[(int)idx];
- SubProp result = null;
- if (maidProp.listSubProp != null && subno < maidProp.listSubProp.Count)
- {
- result = maidProp.listSubProp[subno];
- }
- return result;
- }
- public void DelSubProp(MPN idx, int subno = -1)
- {
- MaidProp maidProp = this.m_aryMaidProp[(int)idx];
- if (maidProp.listSubProp != null)
- {
- if (subno == -1)
- {
- maidProp.listSubProp.Clear();
- }
- else if (maidProp.listSubProp.Count > subno)
- {
- SubProp subProp = maidProp.listSubProp[subno];
- if (subProp != null)
- {
- subProp.strFileName = string.Empty;
- subProp.nFileNameRID = 0;
- subProp.bDut = false;
- }
- }
- }
- maidProp.bSubDut = true;
- }
- public void ResetProp(string mpn, bool force_reset = false)
- {
- NDebug.Assert(this.m_dicMaidProp.ContainsKey(mpn), "指定されたプロパティ名がありません。" + base.tag);
- MaidProp mp = this.m_dicMaidProp[mpn];
- this.ResetProp(mp, force_reset);
- }
- public void ResetProp(MPN idx, bool force_reset = false)
- {
- MaidProp mp = this.m_aryMaidProp[(int)idx];
- this.ResetProp(mp, force_reset);
- }
- public void ResetProp(MaidProp mp, bool force_reset = false)
- {
- if ((mp.nTempFileNameRID != 0 && mp.nFileNameRID != mp.nTempFileNameRID) || mp.temp_value != mp.value || force_reset)
- {
- mp.boDut = true;
- mp.strTempFileName = string.Empty;
- mp.nTempFileNameRID = 0;
- mp.temp_value = 0;
- mp.boTempDut = false;
- }
- }
- public void ItemChangeTemp(string mpn, string name)
- {
- MaidProp prop = this.GetProp(mpn);
- SortedDictionary<string, string> sortedDictionary;
- string filename;
- if (prop.nFileNameRID != 0 && Menu.m_dicResourceRef.TryGetValue(prop.nFileNameRID, out sortedDictionary) && sortedDictionary.TryGetValue(name, out filename))
- {
- this.SetProp(mpn, filename, 0, true, false);
- }
- }
- public bool IsItemChange(string mpn, string name)
- {
- MaidProp prop = this.GetProp(mpn);
- 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];
- }
- public bool IsItemChangeEnabled(string mpn, string name)
- {
- MaidProp prop = this.GetProp(mpn);
- return prop.nFileNameRID != 0 && Menu.m_dicResourceRef.ContainsKey(prop.nFileNameRID) && Menu.m_dicResourceRef[prop.nFileNameRID].ContainsKey(name);
- }
- public void DutPropAll()
- {
- for (int i = 0; i < this.m_aryMaidProp.Length; i++)
- {
- MaidProp maidProp = this.m_aryMaidProp[i];
- maidProp.boDut = true;
- if (maidProp.listSubProp != null)
- {
- for (int j = 0; j < maidProp.listSubProp.Count; j++)
- {
- if (maidProp.listSubProp[j] != null)
- {
- maidProp.listSubProp[j].bDut = true;
- }
- }
- }
- }
- }
- public void SetUpModel(string f_strPresetMenuFileName)
- {
- Menu.ProcScript(this, f_strPresetMenuFileName, false, null);
- this.body0.FixMaskFlag();
- this.body0.FixVisibleFlag(false);
- this.AllProcPropSeqStart();
- if (!this.boMAN)
- {
- }
- }
- public void AllProcPropSeqStart()
- {
- this.boAllProcPropBUSY = true;
- this.boModelChg = false;
- this.AllProcProp2Fase = 0;
- this.AllProcProp2Cnt = 0;
- }
- private void AllProcPropSeq()
- {
- if (this.AllProcProp2Fase == 0)
- {
- while (this.AllProcProp2Fase == 0)
- {
- MaidProp maidProp = this.m_aryMaidProp[this.AllProcProp2Cnt];
- this.AllProcProp2Cnt++;
- if (this.m_aryMaidProp.Length == this.AllProcProp2Cnt)
- {
- this.AllProcProp2Cnt = 0;
- if (Array.Find<MaidProp>(this.m_aryMaidProp, (MaidProp m) => m.type == 3 && (m.boDut || m.boTempDut)) == null)
- {
- this.AllProcProp2Fase++;
- }
- }
- if (maidProp == null)
- {
- string str = "AllProcProp2_Proc MPNがNULLです。";
- MPN allProcProp2Cnt = (MPN)this.AllProcProp2Cnt;
- NDebug.Assert(str + allProcProp2Cnt.ToString(), false);
- }
- if (maidProp.type == 3 && this.ProcItem(this.m_dicMaidProp[maidProp.name]))
- {
- if (!this.boModelChg)
- {
- this.body0.FixVisibleFlag(true);
- this.boModelChg = true;
- }
- if (this.boMAN && maidProp.idx == 43)
- {
- for (int i = 44; i <= 100; i++)
- {
- this.GetProp((MPN)i).boDut = true;
- }
- this.GetProp(MPN.moza).boDut = true;
- }
- else if (maidProp.idx == 50 || maidProp.idx == 46 || maidProp.idx == 47 || maidProp.idx == 49 || maidProp.idx == 48)
- {
- this.GetProp(MPN.haircolor).boDut = true;
- }
- else if (maidProp.idx == 45)
- {
- MPN[] array = new MPN[]
- {
- MPN.skin,
- MPN.eye,
- MPN.mayu,
- MPN.eye_hi,
- MPN.eye_hi_r,
- MPN.EyeClose,
- MPN.EarNone,
- MPN.EarElf,
- MPN.EarRot,
- MPN.EarScl,
- MPN.NosePos,
- MPN.NoseScl,
- MPN.FaceShape,
- MPN.FaceShapeSlim,
- MPN.MayuShapeIn,
- MPN.MayuShapeOut,
- MPN.MayuX,
- MPN.MayuY,
- MPN.MayuRot,
- MPN.eye_hi_r,
- MPN.eyewhite,
- MPN.nose,
- MPN.facegloss,
- MPN.lip
- };
- foreach (MPN mpn in array)
- {
- this.GetProp(mpn).boDut = true;
- }
- }
- else if (maidProp.idx == 52)
- {
- MaidProp prop = this.GetProp(MPN.acctatoo);
- prop.boDut = true;
- if (prop.listSubProp != null)
- {
- for (int k = 0; k < prop.listSubProp.Count; k++)
- {
- if (prop.listSubProp[k] != null)
- {
- prop.listSubProp[k].bDut = true;
- }
- }
- }
- prop = this.GetProp(MPN.hokuro);
- prop.boDut = true;
- if (prop.listSubProp != null)
- {
- for (int l = 0; l < prop.listSubProp.Count; l++)
- {
- if (prop.listSubProp[l] != null)
- {
- prop.listSubProp[l].bDut = true;
- }
- }
- }
- this.GetProp(MPN.lip).boDut = true;
- this.GetProp(MPN.nose).boDut = true;
- this.GetProp(MPN.facegloss).boDut = true;
- }
- break;
- }
- }
- }
- else if (this.AllProcProp2Fase == 1)
- {
- this.AllProcProp2Fase++;
- }
- else if (this.AllProcProp2Fase == 2)
- {
- bool flag = false;
- foreach (MaidProp maidProp2 in this.m_dicMaidProp.Values)
- {
- if (maidProp2.type != 3)
- {
- flag |= this.ProcItem(maidProp2);
- }
- }
- if (flag)
- {
- this.body0.ItemScaleReset();
- }
- this.AllProcProp2Fase++;
- }
- else if (this.AllProcProp2Fase == 3)
- {
- if (this.boModelChg)
- {
- this.body0.MulTexProc();
- this.body0.FixMaskFlag();
- this.body0.FixVisibleFlag(false);
- }
- this.AllProcProp2Fase++;
- }
- else if (this.AllProcProp2Fase == 4)
- {
- this.ProcSSParam();
- this.AllProcProp2Fase++;
- }
- else if (this.AllProcProp2Fase == 5)
- {
- this.boAllProcPropBUSY = false;
- }
- }
- public void AllProcProp()
- {
- if (Product.isPublic)
- {
- this.AllProcPropSeqStart();
- while (this.boAllProcPropBUSY)
- {
- this.AllProcPropSeq();
- }
- return;
- }
- this.boModelChg = false;
- float realtimeSinceStartup = Time.realtimeSinceStartup;
- for (;;)
- {
- if (Array.Find<MaidProp>(this.m_aryMaidProp, (MaidProp m) => m.type == 3 && (m.boDut || m.boTempDut)) == null)
- {
- break;
- }
- for (int i = 0; i < this.m_aryMaidProp.Length; i++)
- {
- MaidProp maidProp = this.m_aryMaidProp[i];
- string name = maidProp.name;
- if (maidProp.type == 3 && this.ProcItem(this.m_dicMaidProp[name]))
- {
- if (!this.boModelChg)
- {
- this.body0.FixVisibleFlag(true);
- this.boModelChg = true;
- }
- if (this.boMAN && maidProp.idx == 43)
- {
- for (int j = 44; j <= 100; j++)
- {
- this.GetProp((MPN)j).boDut = true;
- }
- this.GetProp(MPN.moza).boDut = true;
- }
- else if (maidProp.idx == 50 || maidProp.idx == 46 || maidProp.idx == 47 || maidProp.idx == 49 || maidProp.idx == 48)
- {
- this.GetProp(MPN.haircolor).boDut = true;
- }
- else if (maidProp.idx == 45)
- {
- MPN[] array = new MPN[]
- {
- MPN.skin,
- MPN.eye,
- MPN.mayu,
- MPN.eye_hi,
- MPN.eye_hi_r,
- MPN.EyeClose,
- MPN.EarNone,
- MPN.EarElf,
- MPN.EarRot,
- MPN.EarScl,
- MPN.NosePos,
- MPN.NoseScl,
- MPN.FaceShape,
- MPN.FaceShapeSlim,
- MPN.MayuShapeIn,
- MPN.MayuShapeOut,
- MPN.MayuX,
- MPN.MayuY,
- MPN.MayuRot,
- MPN.eye_hi_r,
- MPN.eyewhite,
- MPN.nose,
- MPN.facegloss,
- MPN.lip
- };
- foreach (MPN mpn in array)
- {
- this.GetProp(mpn).boDut = true;
- }
- }
- else if (maidProp.idx == 52)
- {
- MaidProp prop = this.GetProp(MPN.acctatoo);
- prop.boDut = true;
- if (prop.listSubProp != null)
- {
- for (int l = 0; l < prop.listSubProp.Count; l++)
- {
- if (prop.listSubProp[l] != null)
- {
- prop.listSubProp[l].bDut = true;
- }
- }
- }
- prop = this.GetProp(MPN.hokuro);
- prop.boDut = true;
- if (prop.listSubProp != null)
- {
- for (int n = 0; n < prop.listSubProp.Count; n++)
- {
- if (prop.listSubProp[n] != null)
- {
- prop.listSubProp[n].bDut = true;
- }
- }
- }
- this.GetProp(MPN.lip).boDut = true;
- this.GetProp(MPN.nose).boDut = true;
- this.GetProp(MPN.facegloss).boDut = true;
- }
- }
- }
- }
- realtimeSinceStartup = Time.realtimeSinceStartup;
- bool flag = false;
- foreach (MaidProp maidProp2 in this.m_dicMaidProp.Values)
- {
- if (maidProp2.type != 3)
- {
- flag |= this.ProcItem(maidProp2);
- }
- }
- if (flag)
- {
- this.body0.ItemScaleReset();
- }
- realtimeSinceStartup = Time.realtimeSinceStartup;
- if (this.boModelChg)
- {
- this.body0.MulTexProc();
- this.body0.FixMaskFlag();
- this.body0.FixVisibleFlag(false);
- }
- realtimeSinceStartup = Time.realtimeSinceStartup;
- this.ProcSSParam();
- }
- private bool ProcItem(MaidProp mp)
- {
- bool result = false;
- string name = mp.name;
- if (mp.type == 1)
- {
- if (mp.boTempDut)
- {
- mp.boTempDut = false;
- this.body0.VertexMorph_FromProcItem(name, (float)mp.temp_value / 100f);
- result = true;
- }
- if (mp.boDut)
- {
- mp.boDut = false;
- this.body0.VertexMorph_FromProcItem(name, (float)mp.value / 100f);
- result = true;
- }
- }
- else if (mp.type == 2)
- {
- if (mp.boTempDut)
- {
- mp.boTempDut = false;
- this.body0.BoneMorph_FromProcItem(name, (float)mp.temp_value / 100f);
- result = true;
- }
- if (mp.boDut)
- {
- mp.boDut = false;
- this.body0.BoneMorph_FromProcItem(name, (float)mp.value / 100f);
- result = true;
- }
- }
- else if (mp.type == 3)
- {
- if (Product.isPublic && (mp.boTempDut || mp.boDut) && (mp.idx == 44 || mp.idx == 55 || mp.idx == 62 || mp.idx == 63 || mp.idx == 44 || mp.idx == 82 || mp.idx == 90 || mp.idx == 91 || mp.idx == 93))
- {
- mp.boDut = false;
- mp.boTempDut = false;
- }
- if (mp.boTempDut && mp.boDut)
- {
- string[] array = new string[6];
- array[0] = "Item実行を、本元とTempを同時に更新しようとしました。";
- int num = 1;
- MPN idx = (MPN)mp.idx;
- array[num] = idx.ToString();
- array[2] = " 元=";
- array[3] = mp.strFileName;
- array[4] = " Temp=";
- array[5] = mp.strTempFileName;
- Debug.LogWarning(string.Concat(array));
- }
- if (mp.boTempDut)
- {
- if (!string.IsNullOrEmpty(mp.strTempFileName) && !Menu.ProcScript(this, mp, true, null))
- {
- Debug.LogWarning("メニューファイル " + mp.strFileName + " が開けませんでした。");
- mp.nTempFileNameRID = 0;
- mp.strTempFileName = string.Empty;
- }
- result = true;
- mp.boTempDut = false;
- if (97 <= mp.idx && mp.idx <= 100)
- {
- mp.nTempFileNameRID = 0;
- mp.strTempFileName = string.Empty;
- }
- }
- if (mp.boDut)
- {
- if (!string.IsNullOrEmpty(mp.strFileName) && !Menu.ProcScript(this, mp, false, null))
- {
- Debug.LogWarning("メニューファイル " + mp.strFileName + " が開けませんでした。");
- if (this.DelProp((MPN)mp.idx, false))
- {
- Menu.ProcScript(this, mp, false, null);
- }
- }
- result = true;
- mp.boDut = false;
- if (97 <= mp.idx && mp.idx <= 100)
- {
- mp.nFileNameRID = 0;
- mp.strFileName = string.Empty;
- }
- }
- if (mp.listSubProp != null)
- {
- for (int i = 0; i < mp.listSubProp.Count; i++)
- {
- SubProp subProp = mp.listSubProp[i];
- if (subProp != null && subProp.bDut)
- {
- if (!Menu.ProcScript(this, subProp.strFileName, false, subProp))
- {
- Debug.LogWarning("サブメニューファイル " + subProp.strFileName + " が開けませんでした。");
- mp.listSubProp[i] = null;
- }
- result = true;
- subProp.bDut = false;
- }
- }
- }
- if (mp.boAdjustDut)
- {
- if (this.body0.isLoadedBody)
- {
- foreach (KeyValuePair<TBody.SlotID, Dictionary<string, KeyValuePair<int, VtxAttachPos>>> keyValuePair in mp.m_dicTBodyAttachPos)
- {
- TBodySkin tbodySkin = this.body0.goSlot[(int)keyValuePair.Key];
- if (tbodySkin.morph != null)
- {
- foreach (KeyValuePair<string, KeyValuePair<int, VtxAttachPos>> keyValuePair2 in keyValuePair.Value)
- {
- tbodySkin.morph.SetAttachPointOffsetLocal(keyValuePair2.Key, keyValuePair2.Value.Value);
- result = true;
- }
- }
- }
- }
- mp.boAdjustDut = false;
- }
- }
- return result;
- }
- public bool MayuDrawPriority
- {
- get
- {
- string materialProperty = this.body0.GetMaterialProperty("head", 3, "_ZTest2", "AUTO");
- if (!string.IsNullOrEmpty(materialProperty))
- {
- float num = 0f;
- if (float.TryParse(materialProperty, out num))
- {
- if ((int)(num + 0.5f) == 1)
- {
- return false;
- }
- if ((int)(num + 0.5f) == 7)
- {
- return true;
- }
- }
- }
- return false;
- }
- set
- {
- this.body0.SetMaterialProperty("mayu", "head", 3, "_ZTest2", "UnityEngine.Rendering.CompareFunction", (!value) ? "1" : "7", true);
- }
- }
- public void SubPropAlpha(MPN f_mpn, int f_nSubNo, float f_fTexMulAlpha)
- {
- MaidProp maidProp = this.m_aryMaidProp[(int)f_mpn];
- if (maidProp.listSubProp.Count <= f_nSubNo)
- {
- Debug.LogError("listSubProp の範囲を超えています。");
- return;
- }
- SubProp subProp = maidProp.listSubProp[f_nSubNo];
- if (subProp == null)
- {
- Debug.LogError("listSubProp に " + f_nSubNo + " 番はありません。");
- return;
- }
- subProp.fTexMulAlpha = f_fTexMulAlpha;
- }
- public bool SerializeProp(BinaryWriter f_bwWrite)
- {
- f_bwWrite.Write("CM3D2_MPROP_LIST");
- f_bwWrite.Write(1430);
- f_bwWrite.Write(this.m_dicMaidProp.Count);
- int num = 0;
- foreach (KeyValuePair<string, MaidProp> keyValuePair in this.m_dicMaidProp)
- {
- f_bwWrite.Write(keyValuePair.Key);
- keyValuePair.Value.Serialize(f_bwWrite);
- num++;
- }
- return true;
- }
- public bool SerializePropLowCapacity(BinaryWriter writer)
- {
- NDebug.Assert(this.m_dicMaidProp.Count < 65535, "容量over");
- writer.Write((char)this.m_dicMaidProp.Count);
- NDebug.Assert(true, "MPN容量over");
- foreach (KeyValuePair<string, MaidProp> keyValuePair in this.m_dicMaidProp)
- {
- MPN mpn = (MPN)Enum.Parse(typeof(MPN), keyValuePair.Key);
- writer.Write((char)mpn);
- keyValuePair.Value.SerializeLowCapacity(writer);
- }
- return true;
- }
- public bool SerializeMultiColor(BinaryWriter f_bwWrite)
- {
- return this.m_Parts.Serialize(f_bwWrite);
- }
- public bool SerializeMisc(BinaryWriter f_bwWrite)
- {
- f_bwWrite.Write("CM3D2_MAID_MISC");
- f_bwWrite.Write(1430);
- f_bwWrite.Write(this.m_nActiveSlotNo);
- if (this.m_texIcon != null)
- {
- byte[] array = this.m_texIcon.EncodeToPNG();
- f_bwWrite.Write(array.Length);
- f_bwWrite.Write(array);
- }
- else
- {
- f_bwWrite.Write(0);
- }
- f_bwWrite.Write(this.m_strThumCardTime);
- f_bwWrite.Write(this.m_colMan.r);
- f_bwWrite.Write(this.m_colMan.g);
- f_bwWrite.Write(this.m_colMan.b);
- f_bwWrite.Write(this.m_colMan.a);
- f_bwWrite.Write(this.m_nVoicePitch);
- this.FixThumCard();
- return true;
- }
- public bool SerializeBody(BinaryWriter f_bwWrite)
- {
- f_bwWrite.Write("CM3D2_MAID_BODY");
- f_bwWrite.Write(1430);
- return true;
- }
- public bool DeserializeProp(BinaryReader f_brRead)
- {
- string a = f_brRead.ReadString();
- NDebug.Assert(a == "CM3D2_MPROP_LIST", "メイドプロパティリストのヘッダーが不正です。");
- int num = f_brRead.ReadInt32();
- int num2 = f_brRead.ReadInt32();
- for (int i = 0; i < num2; i++)
- {
- string tag = f_brRead.ReadString();
- MaidProp prop = this.GetProp(tag);
- prop.Deserialize(f_brRead);
- if (num <= 135 && prop.idx == 83 && Path.GetFileNameWithoutExtension(prop.strFileName.ToLower()) == "acckubi007_i_")
- {
- prop.boDut = true;
- prop.strFileName = CM3.dicDelItem[MPN.acckubi];
- prop.nFileNameRID = prop.strFileName.ToLower().GetHashCode();
- prop.strTempFileName = string.Empty;
- prop.nTempFileNameRID = 0;
- }
- }
- if (num <= 110)
- {
- MaidProp prop2 = this.GetProp(MPN.EyeScl);
- MaidProp prop3 = this.GetProp(MPN.EyeSclX);
- prop3.value = prop2.value;
- MaidProp prop4 = this.GetProp(MPN.EyeSclY);
- prop4.value = prop2.value;
- }
- if (!this.boMAN && Product.isPublic)
- {
- this.SetProp(MPN.bra, "bra030_i_.menu", 0, false, false);
- this.SetProp(MPN.panz, "Pants030_i_.menu", 0, false, false);
- }
- this.AllProcPropSeqStart();
- return true;
- }
- public void DeserializeOldData(OldDataConverter.MaidData data, bool statusOnly = false)
- {
- NDebug.AssertNull(data != null);
- this.status.Deserialize(data.statusReader, true);
- using (MemoryStream memoryStream = new MemoryStream(data.ReadAppearanceByte()))
- {
- using (BinaryReader binaryReader = new BinaryReader(memoryStream))
- {
- this.DeserializeProp(binaryReader);
- this.DeserializeMultiColor(binaryReader);
- }
- }
- if (!statusOnly)
- {
- Texture2D texture2D = new Texture2D(1, 1, TextureFormat.ARGB32, false);
- texture2D.LoadImage(data.ReadThumbnailByte());
- byte[] array = data.ReadAppearanceByte();
- this.SetThumIcon(texture2D);
- string text = GameMain.Instance.CMSystem.CM3D2Path + "\\Thumb\\" + this.status.guid + ".png";
- if (File.Exists(text))
- {
- string text2 = UTY.gameProjectPath + "\\Thumb\\" + this.status.guid + ".png";
- if (!File.Exists(text2))
- {
- File.Copy(text, text2);
- }
- }
- }
- }
- public static List<MaidProp> DeserializePropPre(BinaryReader f_brRead)
- {
- List<MaidProp> list = new List<MaidProp>();
- string a = f_brRead.ReadString();
- NDebug.Assert(a == "CM3D2_MPROP_LIST", "メイドプロパティリストのヘッダーが不正です。");
- int num = f_brRead.ReadInt32();
- int num2 = f_brRead.ReadInt32();
- HashSet<MPN> hashSet = new HashSet<MPN>();
- for (int i = 0; i < num2; i++)
- {
- if (4 <= num)
- {
- string text = f_brRead.ReadString();
- }
- MaidProp maidProp = new MaidProp();
- maidProp.Deserialize(f_brRead);
- hashSet.Add((MPN)maidProp.idx);
- list.Add(maidProp);
- if (num <= 110 && maidProp.idx == 10)
- {
- list.Add(new MaidProp
- {
- type = maidProp.type,
- idx = 11,
- name = MPN.EyeSclX.ToString(),
- value = maidProp.value,
- min = maidProp.min,
- max = maidProp.max,
- boDut = true
- });
- list.Add(new MaidProp
- {
- type = maidProp.type,
- idx = 12,
- name = MPN.EyeSclY.ToString(),
- value = maidProp.value,
- min = maidProp.min,
- max = maidProp.max,
- boDut = true
- });
- }
- }
- if (num < 200)
- {
- list.Add(Maid.CreateProp(0, 100, 0, MPN.EyeClose, 2));
- list.Add(Maid.CreateProp(0, 100, 0, MPN.FaceShape, 2));
- list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuX, 2));
- list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuY, 2));
- }
- if (num < 210)
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallPosX, 2));
- list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallPosY, 2));
- list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallSclX, 2));
- list.Add(Maid.CreateProp(0, 100, 50, MPN.EyeBallSclY, 2));
- }
- if (!hashSet.Contains(MPN.FaceShapeSlim))
- {
- list.Add(Maid.CreateProp(0, 100, 0, MPN.FaceShapeSlim, 2));
- }
- if (!hashSet.Contains(MPN.EarNone))
- {
- list.Add(Maid.CreateProp(0, 1, 0, MPN.EarNone, 2));
- }
- if (!hashSet.Contains(MPN.EarElf))
- {
- list.Add(Maid.CreateProp(0, 100, 0, MPN.EarElf, 2));
- }
- if (!hashSet.Contains(MPN.EarRot))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.EarRot, 2));
- }
- if (!hashSet.Contains(MPN.EarScl))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.EarScl, 2));
- }
- if (!hashSet.Contains(MPN.NosePos))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.NosePos, 2));
- }
- if (!hashSet.Contains(MPN.NoseScl))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.NoseScl, 2));
- }
- if (!hashSet.Contains(MPN.MayuShapeIn))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuShapeIn, 2));
- }
- if (!hashSet.Contains(MPN.MayuShapeOut))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuShapeOut, 2));
- }
- if (!hashSet.Contains(MPN.MayuRot))
- {
- list.Add(Maid.CreateProp(0, 100, 50, MPN.MayuRot, 2));
- }
- return list;
- }
- public static List<MaidProp> DeserializePropLowCapacity(BinaryReader reader)
- {
- List<MaidProp> list = Maid.CreateInitMaidPropList();
- Dictionary<int, MaidProp> dictionary = new Dictionary<int, MaidProp>();
- for (int i = 0; i < list.Count; i++)
- {
- dictionary.Add(list[i].idx, list[i]);
- }
- int num = (int)reader.ReadChar();
- for (int j = 0; j < num; j++)
- {
- int key = (int)reader.ReadChar();
- MaidProp maidProp = dictionary[key];
- maidProp.DeserializeLowCapacity(reader);
- }
- return list;
- }
- public static MaidParts.PartsColor[] DeserializeMultiColorPre(BinaryReader f_brRead)
- {
- return MaidParts.DeserializePre(f_brRead);
- }
- public bool DeserializeMultiColor(BinaryReader f_brRead)
- {
- MaidParts.PartsColor[] array = MaidParts.DeserializePre(f_brRead);
- for (int i = 0; i < array.Length; i++)
- {
- this.Parts.SetPartsColor((MaidParts.PARTS_COLOR)i, array[i]);
- }
- return true;
- }
- public bool DeserializeMisc(BinaryReader f_brRead)
- {
- string a = f_brRead.ReadString();
- NDebug.Assert(a == "CM3D2_MAID_MISC", "メイドその他のヘッダーが不正です。");
- int num = f_brRead.ReadInt32();
- this.m_nActiveSlotNo = f_brRead.ReadInt32();
- int num2 = f_brRead.ReadInt32();
- if (num2 != 0)
- {
- byte[] data = f_brRead.ReadBytes(num2);
- UnityEngine.Object.Destroy(this.m_texIcon);
- this.m_texIcon = new Texture2D(1, 1, TextureFormat.ARGB32, false);
- this.m_texIcon.LoadImage(data);
- }
- if (8 <= num)
- {
- this.m_strThumCardTime = f_brRead.ReadString();
- }
- this.m_colMan.r = f_brRead.ReadSingle();
- this.m_colMan.g = f_brRead.ReadSingle();
- this.m_colMan.b = f_brRead.ReadSingle();
- this.m_colMan.a = f_brRead.ReadSingle();
- if (202 <= num)
- {
- this.m_nVoicePitch = f_brRead.ReadInt32();
- }
- this.CheckOldThumCard();
- return true;
- }
- public static bool DeserializeBodyPre(BinaryReader f_brRead)
- {
- return Maid.DeserializeBodyRead(f_brRead);
- }
- public bool DeserializeBody(BinaryReader f_brRead)
- {
- return Maid.DeserializeBodyRead(f_brRead);
- }
- public static bool DeserializeBodyRead(BinaryReader f_brRead)
- {
- string a = f_brRead.ReadString();
- NDebug.Assert(a == "CM3D2_MAID_BODY", "メイドBodyヘッダーが不正です。");
- int num = f_brRead.ReadInt32();
- return true;
- }
- public void SetTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot, Vector3 f_vPosLocal, Quaternion f_qRotLocal, Vector3 f_vScaleRate, bool f_bEnable)
- {
- MaidProp prop = this.GetProp(m_mpn);
- BoneAttachPos boneAttachPos = new BoneAttachPos();
- boneAttachPos.bEnable = f_bEnable;
- boneAttachPos.pss.position = f_vPosLocal;
- boneAttachPos.pss.rotation = f_qRotLocal;
- boneAttachPos.pss.scale = f_vScaleRate;
- prop.m_dicTBodySkinPos[f_slot] = new KeyValuePair<int, BoneAttachPos>(prop.nFileNameRID, boneAttachPos);
- }
- public BoneAttachPos GetTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot)
- {
- BoneAttachPos result = null;
- MaidProp prop = this.GetProp(m_mpn);
- KeyValuePair<int, BoneAttachPos> keyValuePair;
- if (prop.m_dicTBodySkinPos.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID)
- {
- result = keyValuePair.Value;
- }
- return result;
- }
- public void ClearTBodySkinPos(MPN m_mpn, TBody.SlotID f_slot)
- {
- MaidProp prop = this.GetProp(m_mpn);
- prop.m_dicTBodySkinPos.Remove(f_slot);
- }
- 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)
- {
- MaidProp prop = this.GetProp(m_mpn);
- Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
- if (!prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary))
- {
- dictionary = (prop.m_dicTBodyAttachPos[f_slot] = new Dictionary<string, KeyValuePair<int, VtxAttachPos>>());
- }
- VtxAttachPos vtxAttachPos = new VtxAttachPos();
- vtxAttachPos.vtxcount = f_vtxcount;
- vtxAttachPos.vidx = f_vidx;
- vtxAttachPos.prs.position = f_vPosLocal;
- vtxAttachPos.prs.rotation = f_qRotLocal;
- vtxAttachPos.prs.scale = f_vScaleRate;
- vtxAttachPos.bEnable = f_bEnable;
- dictionary[f_apname] = new KeyValuePair<int, VtxAttachPos>(prop.nFileNameRID, vtxAttachPos);
- }
- public VtxAttachPos GetAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, int f_vtxcount, string f_apname)
- {
- VtxAttachPos result = null;
- MaidProp prop = this.GetProp(m_mpn);
- Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
- KeyValuePair<int, VtxAttachPos> keyValuePair;
- if (prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary) && dictionary.TryGetValue(f_apname, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID && keyValuePair.Value.vtxcount == f_vtxcount)
- {
- result = keyValuePair.Value;
- }
- return result;
- }
- public void ClearAttachPointPos(MPN m_mpn, TBody.SlotID f_slot, string f_apname)
- {
- MaidProp prop = this.GetProp(m_mpn);
- Dictionary<string, KeyValuePair<int, VtxAttachPos>> dictionary;
- if (prop.m_dicTBodyAttachPos.TryGetValue(f_slot, out dictionary))
- {
- dictionary.Remove(f_apname);
- }
- }
- public void SetMaterialProperty(MPN m_mpn, TBody.SlotID f_slot, int f_nMatNo, string f_strPropName, string f_strTypeName, string f_strValue)
- {
- MaidProp prop = this.GetProp(m_mpn);
- prop.m_dicMaterialProp[f_slot] = new KeyValuePair<int, MatPropSave>(prop.nFileNameRID, new MatPropSave(f_nMatNo, f_strPropName, f_strTypeName, f_strValue));
- }
- public MatPropSave GetMaterialProperty(MPN m_mpn, TBody.SlotID f_slot)
- {
- MaidProp prop = this.GetProp(m_mpn);
- KeyValuePair<int, MatPropSave> keyValuePair;
- if (prop.m_dicMaterialProp.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID)
- {
- return keyValuePair.Value;
- }
- return null;
- }
- public void SetHairLengthSaveToMP(MPN f_mpn, TBody.SlotID f_slot, string f_strName, float f_fValue)
- {
- MaidProp prop = this.GetProp(f_mpn);
- KeyValuePair<int, Dictionary<string, float>> value;
- if (!prop.m_dicBoneLength.TryGetValue(f_slot, out value))
- {
- Dictionary<TBody.SlotID, KeyValuePair<int, Dictionary<string, float>>> dicBoneLength = prop.m_dicBoneLength;
- value = new KeyValuePair<int, Dictionary<string, float>>(prop.nFileNameRID, new Dictionary<string, float>());
- dicBoneLength[f_slot] = value;
- }
- value.Value[f_strName] = f_fValue;
- }
- public bool GetHairLengthFromMP(MPN f_mpn, TBody.SlotID f_slot, string f_strName, out float f_fOutValue)
- {
- MaidProp prop = this.GetProp(f_mpn);
- KeyValuePair<int, Dictionary<string, float>> keyValuePair;
- if (prop.m_dicBoneLength.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key == prop.nFileNameRID && keyValuePair.Value.TryGetValue(f_strName, out f_fOutValue))
- {
- return true;
- }
- f_fOutValue = 0.5f;
- return false;
- }
- public void ClearHairLengthMP(MPN f_mpn, TBody.SlotID f_slot)
- {
- MaidProp prop = this.GetProp(f_mpn);
- if (prop.m_dicBoneLength != null && prop.m_dicBoneLength.ContainsKey(f_slot))
- {
- prop.m_dicBoneLength.Remove(f_slot);
- }
- }
- public bool NotExistThenClearHairLengthMP(MPN f_mpn, TBody.SlotID f_slot)
- {
- MaidProp prop = this.GetProp(f_mpn);
- KeyValuePair<int, Dictionary<string, float>> keyValuePair;
- if (prop.m_dicBoneLength.TryGetValue(f_slot, out keyValuePair) && keyValuePair.Key != prop.nFileNameRID)
- {
- prop.m_dicBoneLength.Remove(f_slot);
- return true;
- }
- return false;
- }
- public void ThumShotCamMove()
- {
- GameMain.Instance.ThumCamera.GetComponent<ThumShot>().MoveTargetCard(this);
- GameMain.Instance.ThumCamera.GetComponent<ThumShot>().MoveTargetThum(this);
- }
- public void ThumShot()
- {
- UnityEngine.Object.Destroy(this.m_texIcon);
- this.m_texIcon = GameMain.Instance.ThumCamera.GetComponent<ThumShot>().ShotThumIcon(this);
- this.SetThumCard(GameMain.Instance.ThumCamera.GetComponent<ThumShot>().ShotThumCard(this));
- }
- public void ThumShotCustom(string saveFileName, bool adjustmentCameraTransform)
- {
- ThumShot component = GameMain.Instance.ThumCamera.GetComponent<ThumShot>();
- Texture2D texture2D;
- if (adjustmentCameraTransform)
- {
- texture2D = component.ShotThumCard(this);
- }
- else
- {
- texture2D = component.ShotThumCardOriginal();
- }
- string str = UTY.gameProjectPath + "\\";
- string text = str + "Thumb";
- if (!Directory.Exists(text))
- {
- Directory.CreateDirectory(text);
- }
- text = text + "/" + saveFileName;
- UTY.SaveImage(texture2D, text);
- UnityEngine.Object.Destroy(texture2D);
- }
- public void SetThumCard(Texture2D tex)
- {
- string str = UTY.gameProjectPath + "\\";
- string text = str + "Thumb";
- if (!Directory.Exists(text))
- {
- Directory.CreateDirectory(text);
- }
- string f_strFileName = string.Empty;
- this.m_strThumCardTime = DateTime.Now.ToString("yyyyMMddHHmmssfff");
- f_strFileName = text + "/_tmp_thum_" + this.status.guid + ".png";
- UTY.SaveImage(tex, f_strFileName);
- UnityEngine.Object.Destroy(tex);
- Texture2D thumIcon = this.GetThumIcon();
- f_strFileName = text + "/icon_thum_" + this.status.guid + ".png";
- UTY.SaveImage(thumIcon, f_strFileName);
- }
- public void SetThumIcon(Texture2D icon_tex)
- {
- this.m_texIcon = icon_tex;
- }
- public Texture2D GetThumIcon()
- {
- return this.m_texIcon;
- }
- public Texture2D GetThumCard()
- {
- Texture2D result = null;
- string str = UTY.gameProjectPath + "\\";
- string text = str + "Thumb";
- if (!Directory.Exists(text))
- {
- Directory.CreateDirectory(text);
- }
- string text2 = text + "/_tmp_thum_" + this.status.guid + ".png";
- if (File.Exists(text2))
- {
- result = UTY.LoadTexture(text2);
- }
- else
- {
- text2 = text + "/" + this.status.guid + ".png";
- if (File.Exists(text2))
- {
- result = UTY.LoadTexture(text2);
- }
- }
- return result;
- }
- public static void DeletedTmpThumCards()
- {
- string str = UTY.gameProjectPath + "\\";
- string text = str + "Thumb";
- if (!Directory.Exists(text))
- {
- return;
- }
- string[] files = Directory.GetFiles(text, "*", SearchOption.TopDirectoryOnly);
- for (int i = 0; i < files.Length; i++)
- {
- string text2 = text + "\\";
- int num = files[i].IndexOf(text2);
- if (num != 0)
- {
- files[i] = string.Empty;
- }
- else
- {
- string text3 = string.Empty;
- try
- {
- text3 = files[i].Substring(text2.Length, files[i].Length - text2.Length);
- }
- catch
- {
- }
- if (string.IsNullOrEmpty(text3))
- {
- files[i] = string.Empty;
- }
- else if (0 > text3.IndexOf(".png") || text3.IndexOf("_tmp_thum_") != 0)
- {
- files[i] = string.Empty;
- }
- }
- }
- for (int j = 0; j < files.Length; j++)
- {
- if (!string.IsNullOrEmpty(files[j]))
- {
- try
- {
- File.Delete(files[j]);
- }
- catch
- {
- }
- }
- }
- }
- private void FixThumCard()
- {
- string str = UTY.gameProjectPath + "\\";
- string text = str + "Thumb";
- if (!Directory.Exists(text))
- {
- return;
- }
- string text2 = text + "/_tmp_thum_" + this.status.guid + ".png";
- if (!File.Exists(text2))
- {
- return;
- }
- string text3 = text + "/" + this.status.guid + ".png";
- try
- {
- if (File.Exists(text3))
- {
- File.Delete(text3);
- }
- File.Move(text2, text3);
- }
- catch
- {
- }
- }
- private void CheckOldThumCard()
- {
- string str = UTY.gameProjectPath + "\\";
- string text = str + "Thumb";
- if (!Directory.Exists(text))
- {
- return;
- }
- string text2 = string.Concat(new string[]
- {
- text,
- "/",
- this.status.guid,
- this.m_strThumCardTime,
- ".png"
- });
- if (!File.Exists(text2))
- {
- return;
- }
- File.Move(text2, text + "/" + this.status.guid + ".png");
- }
- public void ProcSSParam()
- {
- this.boBallGAG = (this.body0.GetSlotUserParam("accHa", "口枷") > 0);
- this.boNoseFook = (this.body0.GetSlotUserParam("accHana", "鼻フック") > 0);
- }
- public void StopAnime(string fn = "")
- {
- this.body0.StopAnime(fn);
- }
- public string CrossFade(string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
- {
- return this.CrossFade(fn, GameUty.FileSystem, additive, loop, boAddQue, val, weight);
- }
- public string CrossFade(string fn, AFileSystemBase fileSystem, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
- {
- return this.body0.CrossFade(fn, fileSystem, additive, loop, boAddQue, val, weight);
- }
- public string CrossFadeAbsolute(string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
- {
- return this.CrossFadeAbsolute(fn, GameUty.FileSystem, additive, loop, boAddQue, val, weight);
- }
- public string CrossFadeAbsolute(string fn, AFileSystemBase fileSystem, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f, float weight = 1f)
- {
- return this.body0.CrossFadeAbsolute(fn, fileSystem, additive, loop, boAddQue, val, weight);
- }
- public void CacheAnime(string fn, bool loadMuneL = false, bool loadMuneR = false)
- {
- this.body0.CacheLoadAnime(GameUty.FileSystem, Path.ChangeExtension(fn, ".anm"), loadMuneL, loadMuneR);
- }
- public Animation GetAnimation()
- {
- return this.body0.GetAnimation();
- }
- private void Start()
- {
- }
- public void ResetAll()
- {
- this.FaceAnime("通常", 0f, 0);
- this.FaceBlend("無し");
- this.OpenMouth(false);
- this.EyeToReset(0f);
- this.DelPrefabAll();
- string[] array = new string[]
- {
- "handitem",
- "kousoku_upper",
- "kousoku_lower",
- "eye_hi",
- "skirt",
- "panz",
- "mizugi",
- "onepiece",
- "accanl",
- "accvag",
- "KubiScl",
- "UdeScl",
- "DouPer",
- "sintyou",
- "kata",
- "seieki_naka"
- };
- for (int i = 0; i < array.Length; i++)
- {
- this.ResetProp(array[i], false);
- }
- if (this.body0 != null && this.body0.isLoadedBody)
- {
- this.body0.SetMaskMode(TBody.MaskMode.None);
- for (int j = 10; j <= 20; j++)
- {
- this.body0.MulTexRemove("body", 0, "_MainTex", j);
- this.body0.MulTexRemove("body", 0, "_ShadowTex", j);
- this.body0.MulTexRemove("head", 5, "_MainTex", j);
- this.body0.MulTexRemove("head", 5, "_ShadowTex", j);
- }
- this.body0.MulTexProc("body");
- this.body0.MulTexProc("head");
- this.SetModeHairR(TBody.ModeHirR.Normal);
- if (this.body0.isLoadedBody)
- {
- this.body0.MuneYureL(1f);
- this.body0.MuneYureR(1f);
- this.IKTargetToBone("左手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
- this.IKTargetToBone("右手", null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
- }
- }
- }
- public void Lipsync(bool f_bEnable)
- {
- this.boLipsync = f_bEnable;
- }
- public void LipSyncEnabled(bool enabled)
- {
- this.lipSyncEnabled = enabled;
- }
- public bool MicLipSync
- {
- get
- {
- return this.m_MicLipSync;
- }
- }
- public void SetMicLipSync(bool is_start)
- {
- if (!this.AudioMan)
- {
- Debug.LogError("AudioManが見つかりません");
- return;
- }
- this.m_MicLipSync = is_start;
- this.m_bFoceKuchipakuSelfUpdateTime = is_start;
- if (is_start)
- {
- if (!this.MicLipData.Context)
- {
- this.MicLipData.Context = this.AudioMan.gameObject.AddComponent<LowLatencyLipSyncContext>();
- }
- if (!this.MicLipData.MorphTarget)
- {
- this.MicLipData.MorphTarget = this.AudioMan.gameObject.AddComponent<OVRLipSyncContextMorphTarget>();
- }
- if (!this.MicLipData.MicInput)
- {
- this.MicLipData.MicInput = this.AudioMan.gameObject.AddComponent<OVRLipSyncMicInput>();
- }
- this.MicLipData.Context.Init();
- this.MicLipData.MorphTarget.Init(this);
- this.MicLipData.MicInput.Init(this);
- this.MicLipData.MicInput.StartMicrophone();
- }
- else
- {
- if (this.MicLipData.MicInput)
- {
- this.MicLipData.MicInput.StopMicrophone();
- }
- this.AudioMan.audiosource.clip = null;
- UnityEngine.Object.Destroy(this.MicLipData.Context);
- UnityEngine.Object.Destroy(this.MicLipData.MorphTarget);
- UnityEngine.Object.Destroy(this.MicLipData.MicInput);
- }
- }
- public void StartKuchipakuPattern(float f_fOffsetTime, string f_strPattern, bool f_bSelfUpdateTime = false)
- {
- this.m_fKuchipakuPatternOffsetTime = f_fOffsetTime;
- this.m_baKuchipakuPattern = Convert.FromBase64String(f_strPattern);
- this.m_bFoceKuchipakuSelfUpdateTime = f_bSelfUpdateTime;
- }
- public void StopKuchipakuPattern()
- {
- this.m_fKuchipakuPatternOffsetTime = 0f;
- this.m_baKuchipakuPattern = null;
- this.m_bFoceKuchipakuSelfUpdateTime = false;
- }
- public void IKTargetToAttachPoint(string tag, Maid tgt_maid, string tgt_name, string attachpoint_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, string axisbone = "", bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
- {
- IKCtrlData ikdata = this.body0.IKCtrl.GetIKData(tag);
- Transform axis_bone = null;
- if (attach_type != IKCtrlData.IKAttachType.Rotate && !string.IsNullOrEmpty(axisbone))
- {
- axis_bone = CMT.SearchObjName(tgt_maid.body0.m_trBones, axisbone, true);
- }
- ikdata.SetIKSetting(attach_type, timing, tgt_maid, this.body0.GetSlotNo(tgt_name), attachpoint_name, axis_bone, f_vecOffset, do_animation);
- }
- public void IKTargetToBone(string tag, Maid tgt_maid, string tgtbone_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, bool search_sm = false, bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
- {
- IKCtrlData ikdata = this.IKCtrl.GetIKData(tag);
- if (tgtbone_name != "無し")
- {
- Transform target;
- if (!search_sm)
- {
- target = CMT.SearchObjName(tgt_maid.body0.m_trBones, tgtbone_name, true);
- }
- else
- {
- target = CMT.SearchObjName(tgt_maid.body0.SmBody, tgtbone_name, false);
- }
- ikdata.SetIKSetting(attach_type, timing, tgt_maid, target, f_vecOffset, do_animation);
- }
- else
- {
- ikdata.Detach(IKCtrlData.IKAttachType.NewPoint);
- ikdata.Detach(IKCtrlData.IKAttachType.Rotate);
- }
- }
- public void IKTargetToOdogu(string tag, string odogu_name, string tgt_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
- {
- Transform transform = null;
- GameObject prefabFromBg = GameMain.Instance.BgMgr.GetPrefabFromBg(odogu_name);
- if (!prefabFromBg)
- {
- Debug.LogErrorFormat("現在の背景に大道具「{0}」は存在しません", new object[]
- {
- odogu_name
- });
- }
- else if (prefabFromBg.transform.childCount == 0 || string.IsNullOrEmpty(tgt_name))
- {
- transform = prefabFromBg.transform;
- }
- else
- {
- for (int i = 0; i < prefabFromBg.transform.childCount; i++)
- {
- Transform child = prefabFromBg.transform.GetChild(i);
- if (child && !(child.name != tgt_name))
- {
- transform = prefabFromBg.transform.GetChild(i);
- break;
- }
- }
- if (!transform)
- {
- Debug.LogErrorFormat("大道具「{0}」にターゲット「{1}」は存在しません", new object[]
- {
- odogu_name,
- tgt_name
- });
- }
- }
- IKCtrlData ikdata = this.IKCtrl.GetIKData(tag);
- ikdata.SetIKSetting(attach_type, timing, transform, f_vecOffset, do_animation);
- }
- public void IKTargetToIKBone(string my_tag, Maid f_maidTarget, string bone_name, Vector3 f_vecOffset, IKCtrlData.IKAttachType attach_type = IKCtrlData.IKAttachType.Point, bool do_animation = false, IKCtrlData.IKExecTiming timing = IKCtrlData.IKExecTiming.Normal)
- {
- IKCtrlData ikdata = f_maidTarget.IKCtrl.GetIKData(bone_name);
- if (!ikdata)
- {
- return;
- }
- Transform targetBone = ikdata.TargetBone;
- IKCtrlData ikdata2 = this.IKCtrl.GetIKData(my_tag);
- ikdata2.SetIKSetting(attach_type, timing, f_maidTarget, bone_name, targetBone, f_vecOffset, do_animation);
- }
- public void IKDetach(string name)
- {
- this.IKTargetToBone(name, null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
- }
- public void AllIKDetach(float blendtime = 0f)
- {
- this.IKCtrl.BlendTime = blendtime;
- this.IKCtrl.IKActive = (blendtime > 0f);
- this.IKCtrl.AllForceIK = false;
- foreach (string tag in this.IKCtrl.strIKDataPair.Keys)
- {
- this.IKTargetToBone(tag, null, "無し", Vector3.zero, IKCtrlData.IKAttachType.Point, false, false, IKCtrlData.IKExecTiming.Normal);
- }
- }
- public void OpenMouth(bool f_bOpen)
- {
- this.boMouthOpen = f_bOpen;
- }
- public void OpenMouthLookTooth(bool f_bOpen)
- {
- this.boLookTooth = f_bOpen;
- }
- public void EyeToPosition(Vector3 f_vecTargetPos, float f_fFadeTime = 0f)
- {
- if (f_fFadeTime <= 0f)
- {
- f_fFadeTime = 0.001f;
- }
- this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
- this.body0.trsLookTarget = null;
- this.body0.offsetLookTarget = f_vecTargetPos;
- this.body0.boHeadToCam = true;
- this.body0.boEyeToCam = true;
- this.body0.boEyeSorashi = false;
- }
- public void EyeToTargetObject(Transform target_trans, float f_fFadeTime = 0f)
- {
- this.body0.trsLookTarget = target_trans;
- if (this.body0.trsLookTarget == null)
- {
- this.body0.offsetLookTarget = new Vector3(0f, 1f, 0f);
- }
- if (f_fFadeTime <= 0f)
- {
- f_fFadeTime = 0.001f;
- }
- this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
- this.body0.boHeadToCam = true;
- this.body0.boEyeToCam = true;
- this.body0.boEyeSorashi = false;
- }
- public void EyeToTarget(Maid f_maidTarget, float f_fFadeTime = 0f, string f_strBoneName = "Bip01 Head")
- {
- Transform transform = CMT.SearchObjName(f_maidTarget.body0.m_trBones, f_strBoneName, true);
- this.body0.trsLookTarget = transform;
- if (transform == null)
- {
- this.body0.offsetLookTarget = new Vector3(0f, 1f, 0f);
- }
- if (f_fFadeTime <= 0f)
- {
- f_fFadeTime = 0.001f;
- }
- this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
- this.body0.boHeadToCam = true;
- this.body0.boEyeToCam = true;
- this.body0.boEyeSorashi = false;
- }
- public void EyeToCamera(Maid.EyeMoveType f_eType, float f_fFadeTime = 0f)
- {
- this.body0.boHeadToCam = false;
- this.body0.boEyeToCam = true;
- this.body0.boEyeSorashi = false;
- if (f_fFadeTime <= 0f)
- {
- f_fFadeTime = 0.001f;
- }
- this.body0.HeadToCamFadeSpeed = 1f / f_fFadeTime;
- if (GameMain.Instance.VRMode)
- {
- if (GameMain.Instance.OvrMgr != null)
- {
- this.body0.trsLookTarget = GameMain.Instance.OvrMgr.EyeAnchor;
- }
- if (GameMain.Instance.OvrIK != null && OvrIK.IsVRIKMode && GameMain.Instance.OvrIK.NowMaid == this)
- {
- this.body0.trsLookTarget = GameMain.Instance.OvrIK.EyeTargetTrs;
- }
- }
- else if (GameMain.Instance.MainCamera != null)
- {
- this.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
- }
- if (f_eType == Maid.EyeMoveType.無し)
- {
- this.body0.boEyeToCam = false;
- }
- if (f_eType == Maid.EyeMoveType.無視する)
- {
- this.body0.boEyeToCam = false;
- }
- if (f_eType == Maid.EyeMoveType.顔を向ける)
- {
- this.body0.boHeadToCam = true;
- }
- if (f_eType == Maid.EyeMoveType.顔だけ動かす)
- {
- this.body0.boHeadToCam = true;
- this.body0.boEyeToCam = false;
- }
- if (f_eType == Maid.EyeMoveType.顔をそらす)
- {
- this.body0.trsLookTarget = null;
- this.body0.boEyeSorashi = true;
- this.body0.boEyeToCam = true;
- this.body0.boHeadToCam = true;
- }
- if (f_eType == Maid.EyeMoveType.目と顔を向ける)
- {
- this.body0.boHeadToCam = true;
- this.body0.boEyeToCam = true;
- }
- if (f_eType == Maid.EyeMoveType.目だけ向ける)
- {
- this.body0.boHeadToCam = false;
- this.body0.boEyeToCam = true;
- }
- if (f_eType == Maid.EyeMoveType.目だけそらす)
- {
- this.body0.trsLookTarget = null;
- this.body0.boEyeSorashi = true;
- this.body0.boEyeToCam = true;
- this.body0.boHeadToCam = false;
- }
- }
- public void EyeToReset(float f_fFadeTime = 0f)
- {
- this.EyeToCamera(Maid.EyeMoveType.無し, f_fFadeTime);
- }
- public void LockHeadAndEye(bool toLock)
- {
- this.body0.boLockHeadAndEye = toLock;
- }
- public bool GetLockHeadAndEye()
- {
- return this.body0.boLockHeadAndEye;
- }
- public void SetModeHairR(TBody.ModeHirR f_eMode)
- {
- this.body0.Mode_HairR = f_eMode;
- }
- public void SetAutoTwist(Maid.AutoTwist f_eType, bool f_bEnable)
- {
- switch (f_eType)
- {
- case Maid.AutoTwist.ShoulderL:
- this.body0.boAutoTwistShoulderL = f_bEnable;
- break;
- case Maid.AutoTwist.ShoulderR:
- this.body0.boAutoTwistShoulderR = f_bEnable;
- break;
- case Maid.AutoTwist.WristL:
- this.body0.boAutoTwistWristL = f_bEnable;
- break;
- case Maid.AutoTwist.WristR:
- this.body0.boAutoTwistWristR = f_bEnable;
- break;
- case Maid.AutoTwist.ThighL:
- this.body0.boAutoTwistThighL = f_bEnable;
- break;
- case Maid.AutoTwist.ThighR:
- this.body0.boAutoTwistThighR = f_bEnable;
- break;
- }
- }
- public void SetAutoTwistAll(bool f_bEnable)
- {
- this.body0.boAutoTwistShoulderL = f_bEnable;
- this.body0.boAutoTwistShoulderR = f_bEnable;
- this.body0.boAutoTwistWristL = f_bEnable;
- this.body0.boAutoTwistWristR = f_bEnable;
- this.body0.boAutoTwistThighL = f_bEnable;
- this.body0.boAutoTwistThighR = f_bEnable;
- }
- public void FaceAnime(string tag, float t = 1f, int chkcode = 0)
- {
- this.FaceAnimeChkCode = chkcode;
- this.ActiveFace = tag;
- 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 + "〓通常"))
- {
- tag += "〓通常";
- }
- if (t == 0f)
- {
- this.boFaceAnime = false;
- this.FaceName = tag;
- this.FaceName2 = string.Empty;
- return;
- }
- this.boFaceAnime = true;
- if (this.FaceName2 != string.Empty)
- {
- this.FaceName = this.FaceName2;
- this.FaceName2 = string.Empty;
- }
- if (this.FaceName == string.Empty)
- {
- this.FaceName = "デフォ";
- }
- this.FaceName2 = tag;
- this.FacePlus = 1f / t;
- this.FaceTime = this.FacePlus * 0.0166666675f;
- }
- public void FaceBlend(string tag)
- {
- if (this.body0 == null)
- {
- Debug.LogError("Bodyが読み込まれる前に、表情ブレンドが呼ばれました。" + tag);
- return;
- }
- if (tag == "無し")
- {
- tag = string.Empty;
- }
- this.FaceName3 = tag;
- }
- public void ChangeAutoFace(bool bo)
- {
- if (this.boAutoFace != bo)
- {
- this.AutoFaceLV_old = 0;
- this.Hazukashi = 0f;
- }
- this.boAutoFace = bo;
- }
- public void AddPrefab(string f_strPrefab, string f_strName, string f_strDestBone, Vector3 f_vOffsetLocalPos, Vector3 f_vOffsetLocalRot)
- {
- UnityEngine.Object @object = Resources.Load("Prefab/" + f_strPrefab);
- if (@object != null)
- {
- Transform transform = null;
- if (this.body0 != null && this.body0.isLoadedBody)
- {
- transform = CMT.SearchObjName(this.body0.m_trBones, f_strDestBone, true);
- }
- if (transform != null)
- {
- GameObject goItem = UnityEngine.Object.Instantiate(@object) as GameObject;
- goItem.AddComponent<AttachPrefab>();
- goItem.name = goItem.name.Replace("(Clone)", string.Empty);
- if (!string.IsNullOrEmpty(f_strName))
- {
- goItem.name = f_strName;
- }
- AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
- AttachPrefab[] array = (from a in componentsInChildren
- where a.name == goItem.name
- select a).ToArray<AttachPrefab>();
- for (int i = 0; i < array.Length; i++)
- {
- UnityEngine.Object.DestroyImmediate(array[i].gameObject);
- }
- goItem.transform.SetParent(transform, false);
- goItem.transform.localPosition = f_vOffsetLocalPos;
- goItem.transform.localRotation = Quaternion.Euler(f_vOffsetLocalRot);
- }
- else
- {
- Debug.LogError("人物にプレハブ追加で、ボーン名が見つかりません。" + f_strDestBone);
- }
- }
- else
- {
- Debug.LogError("人物にプレハブ追加で、プレハブが見つかりません。Prefab/" + f_strPrefab);
- }
- }
- public void DelPrefab(string f_strName)
- {
- if (this.body0 == null || !this.body0.isLoadedBody)
- {
- return;
- }
- AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
- AttachPrefab[] array = (from a in componentsInChildren
- where a.name == f_strName
- select a).ToArray<AttachPrefab>();
- for (int i = 0; i < array.Length; i++)
- {
- UnityEngine.Object.DestroyImmediate(array[i].gameObject);
- }
- }
- public void DelPrefabAll()
- {
- if (this.body0 == null || !this.body0.isLoadedBody)
- {
- return;
- }
- AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
- for (int i = 0; i < componentsInChildren.Length; i++)
- {
- UnityEngine.Object.DestroyImmediate(componentsInChildren[i].gameObject);
- }
- }
- public GameObject GetPrefab(string f_strName)
- {
- if (this.body0 == null || !this.body0.isLoadedBody)
- {
- return null;
- }
- AttachPrefab[] componentsInChildren = this.body0.m_Bones.GetComponentsInChildren<AttachPrefab>(true);
- AttachPrefab[] array = (from a in componentsInChildren
- where a.name == f_strName
- select a).ToArray<AttachPrefab>();
- return (0 >= array.Length) ? null : array[0].gameObject;
- }
- public void AnimationObject(string f_strName, string f_strAnimName, bool f_bNowPlay, bool f_bLoop)
- {
- Transform transform;
- if ((transform = CMT.SearchObjName(this.body0.m_trBones, f_strName, false)) != null)
- {
- Animation animation = transform.gameObject.GetComponent<Animation>();
- if (animation == null)
- {
- animation = transform.gameObject.AddComponent<Animation>();
- }
- AnimationClip animationClip = ImportCM.LoadAniClipNative(GameUty.FileSystem, f_strAnimName, true, true, true);
- if (animationClip == null)
- {
- NDebug.Assert("アニメーション " + f_strAnimName + " が見つかりません。", false);
- }
- animation.AddClip(animationClip, f_strAnimName);
- animation.clip = animationClip;
- animation.playAutomatically = true;
- animation.wrapMode = ((!f_bLoop) ? WrapMode.Once : WrapMode.Loop);
- if (f_bNowPlay)
- {
- animation.PlayQueued(f_strAnimName, QueueMode.PlayNow);
- }
- this.m_goTestAnim = transform.gameObject;
- }
- else
- {
- NDebug.Assert("人物に追加した " + f_strName + " は見つかりませんでした。", false);
- }
- }
- public void SetPos(Vector3 f_vecLocalPos)
- {
- base.gameObject.transform.localPosition = f_vecLocalPos;
- }
- public void SetRot(Vector3 f_vecLocalRot)
- {
- base.gameObject.transform.localRotation = Quaternion.Euler(f_vecLocalRot);
- }
- public Vector3 GetPos()
- {
- return base.gameObject.transform.localPosition;
- }
- public Vector3 GetRot()
- {
- return base.gameObject.transform.localRotation.eulerAngles;
- }
- public Vector3 GetWorldRot()
- {
- return base.gameObject.transform.rotation.eulerAngles;
- }
- public void SetPosOffset(Vector3 f_vecLocalPos)
- {
- this.m_vOffsetPostion = f_vecLocalPos;
- }
- public void UpdateTransformData()
- {
- this.SetPos(this.baseOffset + this.motionOffset);
- if (this.boMAN)
- {
- if (!string.IsNullOrEmpty(this.rotateLinkMaid))
- {
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
- if (maid != null && maid.status.guid == this.rotateLinkMaid)
- {
- maid.UpdateTransformData();
- break;
- }
- }
- }
- return;
- }
- Vector3 position = base.transform.position;
- base.transform.localRotation = Quaternion.identity;
- if (!Mathf.Approximately(0f, this.baseEulerAngles.x))
- {
- base.transform.RotateAround(position, Vector3.right, this.baseEulerAngles.x);
- }
- if (!Mathf.Approximately(0f, this.baseEulerAngles.y))
- {
- base.transform.RotateAround(position, Vector3.up, this.baseEulerAngles.y);
- }
- if (!Mathf.Approximately(0f, this.baseEulerAngles.z))
- {
- base.transform.RotateAround(position, Vector3.forward, this.baseEulerAngles.z);
- }
- for (int j = 0; j < GameMain.Instance.CharacterMgr.GetManCount(); j++)
- {
- Maid man = GameMain.Instance.CharacterMgr.GetMan(j);
- if (man != null && man.status.guid == this.rotateLinkMaid)
- {
- man.SetPos(man.baseOffset + man.motionOffset);
- man.transform.localRotation = Quaternion.identity;
- if (!Mathf.Approximately(0f, this.baseEulerAngles.x))
- {
- man.transform.RotateAround(position, Vector3.right, this.baseEulerAngles.x);
- }
- if (!Mathf.Approximately(0f, this.baseEulerAngles.y))
- {
- man.transform.RotateAround(position, Vector3.up, this.baseEulerAngles.y);
- }
- if (!Mathf.Approximately(0f, this.baseEulerAngles.z))
- {
- man.transform.RotateAround(position, Vector3.forward, this.baseEulerAngles.z);
- }
- break;
- }
- }
- }
- public void SetPosOffsetFromUdeSclX(string category, float val)
- {
- this.m_vOffsetPostion.x = ((float)this.GetProp(category).value - 50f) * (val / 50f);
- }
- public void SetPosOffsetFromUdeSclY(string category, float val)
- {
- this.m_vOffsetPostion.y = ((float)this.GetProp(category).value - 50f) * (val / 50f);
- }
- public void SetPosOffsetFromUdeSclZ(string category, float val)
- {
- this.m_vOffsetPostion.z = ((float)this.GetProp(category).value - 50f) * (val / 50f);
- }
- public void ExportModBaseMenu(MPN f_mpn)
- {
- MaidProp prop = this.GetProp(f_mpn);
- if (string.IsNullOrEmpty(prop.strFileName))
- {
- NUty.WinMessageBox(NUty.GetWindowHandle(), "現在このスロットにはパーツが設定されていません。", "MOD Export Error", 0);
- return;
- }
- Menu.ExportModScript(this, prop.strFileName, false);
- }
- public void ExportModBaseMqo(MPN f_mpn, string f_strOutFileName)
- {
- MaidProp prop = this.GetProp(f_mpn);
- if (string.IsNullOrEmpty(prop.strFileName))
- {
- NUty.WinMessageBox(NUty.GetWindowHandle(), "現在このスロットにはパーツが設定されていません。", "MQO Export Error", 0);
- return;
- }
- }
- public void FoceKuchipakuUpdate(float f_fNowTime)
- {
- if (this.m_baKuchipakuPattern != null)
- {
- int num = (int)((this.m_fKuchipakuPatternOffsetTime + f_fNowTime) * 30f);
- int num2 = this.m_baKuchipakuPattern.Length / 3;
- if (0 < num && num < num2)
- {
- this.body0.Face.morph.boLipSync = true;
- this.body0.Face.morph.LipSync1 = this.body0.Face.morph.LipSync1 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3] / 255f * 0.85f * 3f;
- this.body0.Face.morph.LipSync2 = this.body0.Face.morph.LipSync2 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3 + 1] / 255f * 0.85f * 3f;
- this.body0.Face.morph.LipSync3 = this.body0.Face.morph.LipSync3 * 0.15f + (float)this.m_baKuchipakuPattern[num * 3 + 2] / 255f * 0.85f * 3f;
- }
- else
- {
- this.body0.Face.morph.boLipSync = false;
- }
- }
- }
- private void Update()
- {
- if (this.boAllProcPropBUSY)
- {
- this.AllProcPropSeq();
- return;
- }
- if (this.boMAN)
- {
- this.m_goOffset.transform.localPosition = this.m_vOffsetPostion;
- return;
- }
- if (!this.body0.isLoadedBody)
- {
- return;
- }
- if (this.boOffsetY)
- {
- float num = this.body0.ToeL.position.y;
- if (this.body0.ToeR.position.y < num)
- {
- num = this.body0.ToeR.position.y;
- }
- num = this.body0.CenterBone.position.y;
- num *= 0.8f;
- float num2 = this.body0.Pelvis.position.y - this.body0.CenterBone.position.y;
- this.m_goOffset.transform.localPosition = new Vector3(0f, -num2 + num2 * this.body0.bonemorph.SnityouOutScale, 0f) + this.m_vOffsetPostion;
- }
- this.body0.Face.morph.boLookTooth = this.boLookTooth;
- this.body0.Face.morph.boBallGAG = (this.boBallGAG | this.boMouthOpen);
- this.body0.Face.morph.boNoseFook = this.boNoseFook;
- if (this.AudioMan != null && !this.m_bFoceKuchipakuSelfUpdateTime)
- {
- this.body0.Face.morph.boLipSync = this.AudioMan.audiosource.isPlaying;
- if (!this.lipSyncEnabled)
- {
- this.body0.Face.morph.boLipSync = false;
- }
- float voicePara_ = this.VoicePara_1;
- float voicePara_2 = this.VoicePara_3;
- float vol = this.AudioMan.GetVol();
- this.voice_avg1 = this.voice_avg1 * (1f - voicePara_) + vol * voicePara_;
- this.voice_avg2 = this.voice_avg2 * (1f - voicePara_) + this.AudioMan.VAvgMax * voicePara_;
- this.voice_avg1D = this.voice_avg1D * (1f - voicePara_2) + (vol - this.voice_avg1_old) * voicePara_2;
- this.voice_avg2D = this.voice_avg2D * (1f - voicePara_2) + (this.AudioMan.VAvgMax - this.voice_avg2_old) * voicePara_2;
- this.voice_avg1_old = vol;
- this.voice_avg2_old = this.AudioMan.VAvgMax;
- this.voice_ao_time -= Time.deltaTime;
- if (this.voice_ao_time < 0f && this.voice_avg1D > 0f && this.voice_ao_chk0 < -0.05f && this.voice_ao_chk1 > 0.1f)
- {
- this.voice_ao_time = 0.05f;
- this.voice_ao = (this.voice_ao + 1) % 8;
- this.voice_ao_chk0 = 0f;
- this.voice_ao_chk1 = 0f;
- }
- if (this.voice_ao_chk1 < this.voice_avg1D)
- {
- this.voice_ao_chk1 = this.voice_avg1D;
- }
- if (0.1f < this.voice_avg1D)
- {
- this.voice_ao_chk0 = 0f;
- }
- if (this.voice_ao_chk0 > this.voice_avg1D)
- {
- this.voice_ao_chk0 = this.voice_avg1D;
- }
- float num3 = Mathf.Pow(this.voice_avg1, 1f) * 10f * this.VoicePara_2;
- if (this.voice_ao % 2 == 0)
- {
- this.voice_ao_f *= 0.5f;
- }
- else
- {
- this.voice_ao_f = this.voice_ao_f * 0.5f + 0.5f;
- }
- this.voice_lf2 = num3 * this.voice_ao_f;
- this.voice_lf3 = num3 * (1f - this.voice_ao_f);
- this.body0.Face.morph.LipSync2 = this.voice_lf2;
- this.body0.Face.morph.LipSync3 = this.voice_lf3;
- float num4 = Mathf.Pow(this.voice_avg2, 0.5f) * (this.voice_avg2D * 30f * this.VoicePara_4 + 0.5f);
- this.voice_lf1 = num4;
- this.body0.Face.morph.LipSync1 = this.voice_lf1;
- if (this.voice_ao % 4 < 2)
- {
- this.voice_ao_f2 *= 0.5f;
- }
- else
- {
- this.voice_ao_f2 = this.voice_ao_f2 * 0.5f + 0.5f;
- }
- this.body0.Face.morph.LipSync1 *= this.voice_ao_f2;
- this.body0.Face.morph.LipSync2 *= 1f - this.voice_ao_f2;
- this.body0.Face.morph.LipSync3 *= 1f - this.voice_ao_f2;
- this.body0.Face.morph.LipSync1 = Mathf.Clamp01(this.body0.Face.morph.LipSync1 * 0.5f);
- this.body0.Face.morph.LipSync2 = Mathf.Clamp01(this.body0.Face.morph.LipSync2 * 0.5f);
- this.body0.Face.morph.LipSync3 = Mathf.Clamp01(this.body0.Face.morph.LipSync3 * 0.5f);
- }
- if (this.m_baKuchipakuPattern != null && this.lipSyncEnabled && !this.m_bFoceKuchipakuSelfUpdateTime && this.AudioMan != null)
- {
- this.FoceKuchipakuUpdate(this.AudioMan.audiosource.time);
- }
- if (this.boLipsync && this.lipSyncEnabled)
- {
- this.body0.Face.morph.boLipSync = true;
- this.LipsyncT1 += Mathf.Sin(Time.time * 10f) * 0.5f + Mathf.Cos(Time.time * 5.55f) * 0.1f * 0.2f;
- this.LipsyncT2 += Mathf.Sin(Time.time * 5f) * 0.1f + Mathf.Cos(Time.time * 5.55f) * 0.1f * 0.2f;
- float num5 = (1f + Mathf.Sin(Time.time * 4f + this.LipsyncT1)) * 0.5f * 0.98f + 0.1f;
- float num6 = (Mathf.Sin(this.LipsyncT1) + 1f) * 0.5f;
- float num7 = (Mathf.Sin(this.LipsyncT2) + 1f) * 0.5f;
- this.body0.Face.morph.LipSync1 = num5 * num6 * num7 * 0.5f;
- this.body0.Face.morph.LipSync3 = num5 * (1f - num6) * num7 * 0.5f;
- this.body0.Face.morph.LipSync2 = num5 * (1f - num7) * 0.5f;
- }
- else if (this.boLipsync_old)
- {
- this.body0.Face.morph.LipSync1 = 0f;
- this.body0.Face.morph.LipSync3 = 0f;
- this.body0.Face.morph.LipSync2 = 0f;
- }
- this.boLipsync_old = this.boLipsync;
- if (this.boMabataki)
- {
- this.body0.Face.morph.ClearBlendValues();
- if (this.FaceName != string.Empty)
- {
- this.body0.Face.morph.MulBlendValues(this.FaceName, 1f);
- }
- if (this.FaceName2 != string.Empty)
- {
- this.body0.Face.morph.MulBlendValues(this.FaceName2, UTY.COSS2(Mathf.Pow(this.FaceTime, 0.4f), 4f));
- this.FaceTime += Time.deltaTime * this.FacePlus;
- if (this.FaceTime >= 1f)
- {
- this.boFaceAnime = false;
- this.FaceName = this.FaceName2;
- this.FaceName2 = string.Empty;
- }
- }
- if (this.FaceName3 != string.Empty)
- {
- this.body0.Face.morph.AddBlendValues(this.FaceName3, 1f);
- }
- if (this.MabatakiVal > 0f)
- {
- float num8 = this.MabatakiVal * this.MabatakiVal;
- num8 = Mathf.Sin(num8 * 3.14159274f);
- this.body0.Face.morph.EyeMabataki = num8;
- }
- else
- {
- this.body0.Face.morph.EyeMabataki = 0f;
- }
- if (!this.MabatakiUpdateStop)
- {
- this.MabatakiVal -= Time.deltaTime * 2f;
- }
- this.body0.Face.morph.FixBlendValues_Face();
- if (!this.boFaceAnime && this.NextMabatakiTime < Time.time && !this.MabatakiUpdateStop)
- {
- float num9 = 0.5f + (float)UTY.GetRnd(80) * 0.1f;
- this.NextMabatakiTime = Time.time + num9;
- this.MabatakiVal = 1f;
- }
- }
- else if (this.FaceName2 != string.Empty)
- {
- this.body0.Face.morph.ClearBlendValues();
- if (this.FaceName != string.Empty)
- {
- this.body0.Face.morph.MulBlendValues(this.FaceName, 1f);
- }
- this.body0.Face.morph.MulBlendValues(this.FaceName2, UTY.COSS2(Mathf.Pow(this.FaceTime, 0.4f), 4f));
- this.FaceTime += Time.deltaTime * this.FacePlus;
- if (this.FaceTime >= 1f)
- {
- this.boFaceAnime = false;
- this.FaceName = this.FaceName2;
- this.FaceName2 = string.Empty;
- }
- this.MabatakiVal = 0f;
- this.body0.Face.morph.FixBlendValues_Face();
- }
- }
- private void LateUpdate()
- {
- if (this.boAllProcPropBUSY)
- {
- return;
- }
- if (!this.body0.isLoadedBody)
- {
- return;
- }
- if (this.m_MotionLoad == 1)
- {
- this.m_MotionLoad = 0;
- if (!this.boMAN)
- {
- this.CrossFade("maid_stand01.anm", false, true, false, 0.5f, 1f);
- this.FaceAnime("通常", 1f, 0);
- if (GameMain.Instance.VRMode)
- {
- if (GameMain.Instance.OvrMgr != null)
- {
- this.body0.trsLookTarget = GameMain.Instance.OvrMgr.EyeAnchor;
- }
- }
- else if (GameMain.Instance.MainCamera != null)
- {
- this.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
- }
- }
- }
- }
- public GameObject m_goOffset;
- private Status m_Status;
- private MaidParts m_Parts;
- private bool m_visible;
- public Action<Maid> onMouseUpEvent;
- public string TypeName = string.Empty;
- public TBody body0;
- public bool boMAN;
- public bool boNPC;
- public bool boOffsetY = true;
- public Vector3 baseOffset = Vector3.zero;
- public Vector3 motionOffset = Vector3.zero;
- public Vector3 baseEulerAngles = Vector3.zero;
- public string rotateLinkMaid = string.Empty;
- private Dictionary<string, MaidProp> m_dicMaidProp = new Dictionary<string, MaidProp>();
- private MaidProp[] m_aryMaidProp;
- private Hashtable m_hashMaidPropLower = new Hashtable();
- private int m_nActiveSlotNo = -1;
- private string m_strThumCardTime = string.Empty;
- private Texture2D m_texIcon;
- private Color m_colMan = new Color(0f, 0.09f, 1f, 1f);
- private int m_nVoicePitch = 50;
- private string m_strBefOnepiceFileName;
- private int m_nBefOnepiceRID;
- private string m_strBefWearFileName;
- private int m_nBefWearRID;
- private string m_strBefSkirtFileName;
- private int m_nBefSkirtRID;
- private bool boModelChg;
- public bool boAllProcPropBUSY;
- private int AllProcProp2Fase;
- private int AllProcProp2Cnt;
- public bool boLookTooth;
- public bool boBallGAG;
- public bool boMouthOpen;
- public bool boNoseFook;
- private float m_fKuchipakuPatternOffsetTime;
- public byte[] m_baKuchipakuPattern;
- private bool m_bFoceKuchipakuSelfUpdateTime;
- [Header("音声入力用コンポーネント")]
- public Maid.LipSyncComp MicLipData = new Maid.LipSyncComp();
- private bool m_MicLipSync;
- private bool boAutoFace;
- private float NextMabatakiTime;
- private float MabatakiVal;
- private string FaceName = string.Empty;
- private string FaceName2 = string.Empty;
- public string FaceName3 = string.Empty;
- private float FaceTime;
- private float FacePlus;
- public string ActiveFace = string.Empty;
- public int FaceAnimeChkCode;
- public bool boFaceAnime;
- public int OldFaceAtr;
- public bool boShitakaraNozoku;
- public bool boVisibleBottom;
- public int AutoFaceLV_old;
- public float Hazukashi;
- public bool boChkEye_old;
- public GameObject m_goTestAnim;
- public float voice_time;
- public float voice_avg1;
- public float voice_avg2;
- public float voice_avg1_old;
- public float voice_avg2_old;
- public float voice_avg1D;
- public float voice_avg2D;
- public int voice_ao;
- public float voice_ao_f;
- public float voice_ao_f2;
- public float voice_ao_time;
- public float voice_ao_chk0;
- public float voice_ao_chk1;
- public float voice_lf1;
- public float voice_lf2;
- public float voice_lf3;
- public float VoicePara_1 = 0.5f;
- public float VoicePara_2 = 0.074f;
- public float VoicePara_3 = 0.5f;
- public float VoicePara_4 = 0.05f;
- private bool lipSyncEnabled = true;
- private bool boLipsync;
- private bool boLipsync_old;
- private float LipsyncT1;
- private float LipsyncT2;
- public bool boMabataki = true;
- public bool MabatakiUpdateStop;
- private Vector3 m_vOffsetPostion = Vector3.zero;
- public static int changetest;
- private int m_MotionLoad = 1;
- [Serializable]
- public class LipSyncComp
- {
- [HideInInspector]
- public bool IsInit = true;
- public LowLatencyLipSyncContext Context;
- public OVRLipSyncContextMorphTarget MorphTarget;
- public OVRLipSyncMicInput MicInput;
- }
- public enum EyeMoveType
- {
- 無し,
- 無視する,
- 顔を向ける,
- 顔だけ動かす,
- 顔をそらす,
- 目と顔を向ける,
- 目だけ向ける,
- 目だけそらす
- }
- public enum AutoTwist
- {
- ShoulderL,
- ShoulderR,
- WristL,
- WristR,
- ThighL,
- ThighR
- }
- }
|