1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using kt.ik;
- using kt.Physics;
- using kt.Utility;
- using script;
- using UnityEngine;
- public class MotionKagManager : BaseKagManager
- {
- public MotionKagManager(TJSScript tjs, ScriptManager script_mgr) : base(tjs, script_mgr)
- {
- for (int i = 0; i < this.last_maid_motion_set_log_.Length; i++)
- {
- this.last_maid_motion_set_log_[i] = string.Empty;
- }
- for (int j = 0; j < this.last_man_motion_set_log_.Length; j++)
- {
- this.last_man_motion_set_log_[j] = string.Empty;
- }
- }
- public override void Initialize()
- {
- base.Initialize();
- this.LoadMotionScriptMeta();
- this.kag_.RemoveTagCallBack("motionscript");
- this.kag_.RemoveTagCallBack("allprocpropseqstart");
- this.kag_.AddTagCallBack("allprocpropseqstart", new KagScript.KagTagCallBack(this.TagMotAllProcPropSeqStart));
- this.kag_.RemoveTagCallBack("setmaidoffsetmultipos");
- this.kag_.AddTagCallBack("setmaidoffsetmultipos", new KagScript.KagTagCallBack(this.TagSetMaidOffsetMultiPos2));
- this.kag_.RemoveTagCallBack("face");
- this.kag_.AddTagCallBack("face", new KagScript.KagTagCallBack(this.TagMotFace));
- this.kag_.RemoveTagCallBack("faceblend");
- this.kag_.AddTagCallBack("faceblend", new KagScript.KagTagCallBack(this.TagMotFaceBlend));
- base.kag.AddTagCallBack("penisikattach", new KagScript.KagTagCallBack(this.TagPenisIKAttach));
- base.kag.AddTagCallBack("ikplanecolider", new KagScript.KagTagCallBack(this.TagIKPlaneColider));
- base.kag.AddTagCallBack("ikcoliderborder", new KagScript.KagTagCallBack(this.TagIKColiderBorder));
- base.kag.AddTagCallBack("ikcolidercorrect", new KagScript.KagTagCallBack(this.TagIKColiderCorrect));
- base.kag.AddTagCallBack("ikcoliderenable", new KagScript.KagTagCallBack(this.TagIKColiderEnable));
- base.kag.AddTagCallBack("ikcolidertarget", new KagScript.KagTagCallBack(this.TagIKColiderTarget));
- base.kag.AddTagCallBack("ikcrosscolider", new KagScript.KagTagCallBack(this.TagIKCrossColider));
- base.kag.AddTagCallBack("setpartner", new KagScript.KagTagCallBack(this.TagSetPartner));
- base.kag.AddTagCallBack("iksetpelvispull", new KagScript.KagTagCallBack(base.TagIKSetPelvisPull));
- base.kag.AddTagCallBack("kupatimer", new KagScript.KagTagCallBack(this.TagKupaTimer));
- base.kag.AddTagCallBack("kupainsert", new KagScript.KagTagCallBack(this.TagKupaInsert));
- base.kag.AddTagCallBack("shouldertwistcalc", new KagScript.KagTagCallBack(this.TagShoulderTwistCalc));
- base.kag.AddTagCallBack("motionoffset", new KagScript.KagTagCallBack(this.TagMotionOffset));
- base.kag.AddTagCallBack("autooffset", new KagScript.KagTagCallBack(this.TagAutoOffset));
- base.kag.AddTagCallBack("inverseoffset", new KagScript.KagTagCallBack(this.TagInverseOffset));
- base.kag.AddTagCallBack("setikorder", new KagScript.KagTagCallBack(this.TagSetIKOrder));
- base.kag.AddTagCallBack("setberomorph", new KagScript.KagTagCallBack(this.TagSetBeroMorph));
- }
- private void LoadMotionScriptMeta()
- {
- if (!GameUty.FileSystem.IsExistentFile("motionscript.msmeta"))
- {
- return;
- }
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen("motionscript.msmeta"))
- {
- if (afileBase.IsValid())
- {
- byte[] buffer = afileBase.ReadAll();
- this.MotionScriptMetaDic.Clear();
- using (MemoryStream memoryStream = new MemoryStream(buffer))
- {
- using (StreamReader streamReader = new StreamReader(memoryStream))
- {
- string json = streamReader.ReadToEnd();
- MotionKagManager.MotionScriptMetaPackage motionScriptMetaPackage = JsonUtility.FromJson<MotionKagManager.MotionScriptMetaPackage>(json);
- foreach (MotionKagManager.MotionScriptMeta motionScriptMeta in motionScriptMetaPackage.metaList)
- {
- this.MotionScriptMetaDic[motionScriptMeta.scriptName] = motionScriptMeta;
- }
- }
- }
- }
- else
- {
- Debug.LogErrorFormat("{0}はありませんでした", new object[]
- {
- "motionscript.msmeta"
- });
- }
- }
- }
- public Maid SetMainMaid(Maid maid)
- {
- this.main_maid_ = maid;
- return this.main_maid_;
- }
- public Maid SetMainMaid(string maid_guid)
- {
- if (string.IsNullOrEmpty(maid_guid))
- {
- this.main_maid_ = null;
- return null;
- }
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
- if (maid != null && maid.status.guid == maid_guid)
- {
- this.main_maid_ = maid;
- break;
- }
- }
- return this.main_maid_;
- }
- public Maid SetMainMan(Maid man)
- {
- this.main_man_ = man;
- return this.main_man_;
- }
- public Maid SetMainMan(string man_guid)
- {
- if (string.IsNullOrEmpty(man_guid))
- {
- this.main_man_ = null;
- return null;
- }
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetManCount(); i++)
- {
- Maid man = GameMain.Instance.CharacterMgr.GetMan(i);
- if (man != null && man.status.guid == man_guid)
- {
- this.main_man_ = man;
- break;
- }
- }
- return this.main_man_;
- }
- public override void LoadScriptFile(string fileName, string labelName = "")
- {
- string currentFileName = base.kag.GetCurrentFileName();
- string currentLabel = base.kag.GetCurrentLabel();
- bool flag = fileName != currentFileName;
- bool flag2 = labelName != currentLabel;
- this.CurrentScriptMeta = this.GetMotionScriptMeta(fileName);
- if (flag)
- {
- this.LoadActiveChara();
- }
- else if (this.main_maid || this.main_man)
- {
- if (this.main_man && (!this.ActiveManList.Contains(this.main_man) || this.ActiveManList.Count > 1))
- {
- this.ActiveManList.Clear();
- this.ActiveManList.Add(this.main_man);
- }
- if (this.main_maid && (!this.ActiveMaidList.Contains(this.main_maid) || this.ActiveMaidList.Count > 1))
- {
- this.ActiveMaidList.Clear();
- this.ActiveMaidList.Add(this.main_maid);
- }
- }
- else
- {
- if (this.ActiveMaidList.Any((Maid ch) => !ch.Visible))
- {
- for (int i = 0; i < this.ActiveMaidList.Count; i++)
- {
- Maid maid6 = this.ActiveMaidList[i];
- if (!maid6.Visible)
- {
- this.ActiveMaidList.Remove(maid6);
- }
- }
- }
- if (this.ActiveManList.Any((Maid ch) => !ch.Visible))
- {
- for (int j = 0; j < this.ActiveManList.Count; j++)
- {
- Maid maid2 = this.ActiveManList[j];
- if (!maid2.Visible)
- {
- this.ActiveManList.Remove(maid2);
- }
- }
- }
- }
- MotionKagManager.MotionScriptMeta currentScriptMeta = this.CurrentScriptMeta;
- if (currentScriptMeta != null)
- {
- if (!this.main_maid && currentScriptMeta.maidCount == 1)
- {
- Debug.LogFormat("{0}にメイドの指定がなかったのでメイド0番を自動的に割り振りました", new object[]
- {
- fileName
- });
- this.main_maid_ = GameMain.Instance.CharacterMgr.GetMaid(0);
- this.ActiveMaidList.Clear();
- this.ActiveMaidList.Add(this.main_maid);
- }
- if (!this.main_man && currentScriptMeta.manCount == 1)
- {
- Debug.LogFormat("{0}に男の指定がなかったので男0番を自動的に割り振りました", new object[]
- {
- fileName
- });
- this.main_man_ = GameMain.Instance.CharacterMgr.GetMan(0);
- this.ActiveManList.Clear();
- this.ActiveManList.Add(this.main_man);
- }
- }
- bool flag3;
- if (this.main_maid)
- {
- flag3 = this.main_maid.IsCrcBody;
- }
- else if (this.ActiveMaidList.Count > 0)
- {
- flag3 = this.ActiveMaidList.Any((Maid ch) => ch.IsCrcBody);
- }
- else if (this.main_man)
- {
- flag3 = this.main_man.IsCrcBody;
- }
- else
- {
- flag3 = this.ActiveManList.Any((Maid ch) => ch.IsCrcBody);
- }
- if (!flag3)
- {
- for (int k = 0; k < this.ActiveManList.Count; k++)
- {
- Maid maid3 = this.ActiveManList[k];
- if (maid3.IsCrcBody)
- {
- int activeSlotNo = maid3.ActiveSlotNo;
- GameMain.Instance.CharacterMgr.SwapNewManBody(activeSlotNo, false);
- Maid man = GameMain.Instance.CharacterMgr.GetMan(activeSlotNo);
- this.ActiveManList[k] = man;
- maid3 = man;
- maid3.AllProcProp();
- if (this.main_man)
- {
- this.main_man_ = maid3;
- }
- }
- }
- base.LoadScriptFile(fileName, labelName);
- return;
- }
- if (fileName.IndexOf("crc_") != 0)
- {
- fileName = "crc_" + fileName;
- }
- if (!GameUty.IsExistFile(fileName, null))
- {
- Debug.LogWarningFormat("{0}が見つからなかったので{1}を読み込みました。", new object[]
- {
- fileName,
- fileName.Replace("crc_", string.Empty)
- });
- base.LoadScriptFile(fileName.Replace("crc_", string.Empty), labelName);
- return;
- }
- if (this.main_maid || this.main_man)
- {
- if (this.main_maid && this.main_maid.body0.isMotionScriptSet && !this.main_maid.body0.IsMotionScritChange(fileName, labelName))
- {
- Debug.LogWarningFormat("Maid{0}に同フレーム内で同じモーションスクリプトが読み込まれました", new object[]
- {
- this.main_maid.ActiveSlotNo
- });
- return;
- }
- if (this.main_man && this.main_man.body0.isMotionScriptSet && !this.main_man.body0.IsMotionScritChange(fileName, labelName))
- {
- Debug.LogWarningFormat("Man{0}に同フレーム内で同じモーションスクリプトが読み込まれました", new object[]
- {
- this.main_man.ActiveSlotNo
- });
- return;
- }
- }
- for (int l = 0; l < this.ActiveMaidList.Count; l++)
- {
- Maid maid4 = this.ActiveMaidList[l];
- if (maid4.body0.isMotionScriptSet && !maid4.body0.IsMotionScritChange(fileName, labelName))
- {
- Debug.LogWarningFormat("Maid{0}に同フレーム内で同じモーションスクリプトが読み込まれました", new object[]
- {
- maid4.ActiveSlotNo
- });
- this.ActiveMaidList.Remove(maid4);
- }
- else if (!this.isBodyMixOK && !maid4.IsCrcBody && fileName != "crc_workFF_001.ks")
- {
- NDebug.Assert("新ボディと旧ボディのキャラが混在しています。旧ボディキャラ:" + maid4.name, false);
- return;
- }
- }
- for (int m = 0; m < this.ActiveManList.Count; m++)
- {
- Maid maid5 = this.ActiveManList[m];
- if (maid5.body0.isMotionScriptSet && !maid5.body0.IsMotionScritChange(fileName, labelName))
- {
- Debug.LogWarningFormat("Man{0}に同フレーム内で同じモーションスクリプトが読み込まれました", new object[]
- {
- maid5.ActiveSlotNo
- });
- this.ActiveManList.Remove(maid5);
- }
- else if (!maid5.IsCrcBody)
- {
- int activeSlotNo2 = maid5.ActiveSlotNo;
- GameMain.Instance.CharacterMgr.SwapNewManBody(activeSlotNo2, true);
- Maid man = GameMain.Instance.CharacterMgr.GetMan(activeSlotNo2);
- this.ActiveManList[m] = man;
- maid5 = man;
- maid5.AllProcProp();
- if (this.main_man)
- {
- this.main_man_ = maid5;
- }
- }
- }
- if (this.ActiveMaidList.Count == 0 && this.ActiveManList.Count == 0)
- {
- Debug.LogWarning("モーションを再生できるキャラが1人もいません");
- return;
- }
- if (this.isBodyMixOK)
- {
- bool flag4 = this.ActiveMaidList.Any((Maid maid) => !maid.IsCrcBody);
- if (flag4)
- {
- this.isBodyMixOK = false;
- Action<List<Maid>> action = delegate(List<Maid> chara_list)
- {
- List<Maid> list = new List<Maid>(chara_list);
- for (int n = 0; n < list.Count; n++)
- {
- Maid maid7 = list[n];
- if (maid7.boMAN)
- {
- this.SetMainMan(maid7);
- }
- else
- {
- this.SetMainMaid(maid7);
- }
- string path = (!maid7.IsCrcBody) ? fileName.Replace("crc_", string.Empty) : fileName;
- this.LoadScriptFile(string.Format("{0}_{1}.ks", Path.GetFileNameWithoutExtension(path), maid7.ActiveSlotNo), labelName);
- if (n < list.Count - 1)
- {
- this.Exec();
- }
- }
- };
- action(this.ActiveManList);
- action(this.ActiveMaidList);
- this.isBodyMixOK = true;
- return;
- }
- }
- foreach (Maid chara in this.ActiveManList)
- {
- this.MotionSettingReset(chara, fileName, labelName);
- }
- foreach (Maid chara2 in this.ActiveMaidList)
- {
- this.MotionSettingReset(chara2, fileName, labelName);
- }
- base.LoadScriptFile(fileName, "*共通");
- this.Exec();
- base.LoadScriptFile(fileName, labelName);
- }
- private MotionKagManager.MotionScriptMeta GetMotionScriptMeta(string file_name)
- {
- if (this.MotionScriptMetaDic.ContainsKey(file_name))
- {
- return this.MotionScriptMetaDic[file_name];
- }
- file_name = file_name.Replace("crc_", string.Empty);
- if (this.MotionScriptMetaDic.ContainsKey(file_name))
- {
- return this.MotionScriptMetaDic[file_name];
- }
- return null;
- }
- private void LoadActiveChara()
- {
- CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
- this.ActiveMaidList.Clear();
- if (this.main_maid)
- {
- this.ActiveMaidList.Add(this.main_maid);
- }
- else
- {
- for (int i = 0; i < characterMgr.GetMaidCount(); i++)
- {
- if (this.CurrentScriptMeta != null && this.CurrentScriptMeta.maidCount == this.ActiveMaidList.Count)
- {
- break;
- }
- Maid maid = characterMgr.GetMaid(i);
- if (maid && maid.Visible)
- {
- this.ActiveMaidList.Add(maid);
- }
- }
- }
- this.ActiveManList.Clear();
- if (this.main_man)
- {
- this.ActiveManList.Add(this.main_man);
- }
- else
- {
- for (int j = 0; j < characterMgr.GetManCount(); j++)
- {
- if (this.CurrentScriptMeta != null && this.CurrentScriptMeta.manCount == this.ActiveManList.Count)
- {
- break;
- }
- Maid man = characterMgr.GetMan(j);
- if (man && man.Visible)
- {
- this.ActiveManList.Add(man);
- }
- }
- }
- }
- private void MotionSettingReset(Maid chara, string fileName, string labelName)
- {
- MotionKagManager.MotionSettingReset(chara);
- chara.body0.SetMotionScriptInfo(fileName, labelName);
- }
- public static void MotionSettingReset(Maid chara)
- {
- if (!chara.body0.IsCrcBody)
- {
- return;
- }
- if (!chara.boMAN)
- {
- chara.body0.SetMuneYureL(true);
- chara.body0.SetMuneYureR(true);
- chara.body0.KupaReset();
- }
- for (int i = 2; i <= 5; i++)
- {
- chara.body0.StopAnimeLayer(i);
- }
- chara.body0.SetShoulderTwistCalcType(true, ShoulderTwist.CalcType.Normal);
- chara.body0.SetShoulderTwistCalcType(false, ShoulderTwist.CalcType.Normal);
- chara.body0.fullBodyIK.IKReset();
- chara.motionOffsetGP03 = Vector3.zero;
- if (chara.body0.Face.tongueCtrl != null)
- {
- chara.body0.Face.tongueCtrl.TongueReset();
- }
- }
- public override bool TagMotion(KagTagSupport tag_data)
- {
- Maid maid = base.GetMaidAndMan(tag_data, true);
- if (maid == null)
- {
- return false;
- }
- base.CheckAbsolutelyNecessaryTag(tag_data, "motion", new string[]
- {
- "mot"
- });
- string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
- if (maid.body0.IsCrcBody && play_motion_name.IndexOf("crc_") != 0)
- {
- string text = "crc_" + play_motion_name;
- if (GameUty.IsExistFile(text, null))
- {
- play_motion_name = text;
- }
- }
- int blend = 500;
- if (tag_data.IsValid("blend"))
- {
- blend = tag_data.GetTagProperty("blend").AsInteger();
- }
- bool loop = false;
- if (tag_data.IsValid("loop"))
- {
- loop = tag_data.GetTagProperty("loop").AsBool();
- }
- int num = 0;
- if (tag_data.IsValid("wait"))
- {
- num = tag_data.GetTagProperty("wait").AsInteger();
- }
- WaitEventList waitEventList = base.GetWaitEventList("motion");
- if (num <= 0)
- {
- if (maid.Visible)
- {
- this.PlayMaidMotion(maid, play_motion_name, false, loop, false, GameUty.MillisecondToSecond(blend));
- }
- waitEventList.Clear();
- }
- else
- {
- waitEventList.Add(delegate
- {
- if (maid != null && maid.Visible && maid.body0 != null && maid.body0.isLoadedBody)
- {
- this.PlayMaidMotion(maid, play_motion_name, false, loop, false, GameUty.MillisecondToSecond(blend));
- }
- }, num);
- }
- return false;
- }
- public override bool TagMotionNext(KagTagSupport tag_data)
- {
- Maid maid = base.GetMaidAndMan(tag_data, true);
- if (maid == null)
- {
- return false;
- }
- base.CheckAbsolutelyNecessaryTag(tag_data, "motionnext", new string[]
- {
- "mot"
- });
- string play_motion_name = tag_data.GetTagProperty("mot").AsString() + ".anm";
- if (maid.body0.IsCrcBody && play_motion_name.IndexOf("crc_") != 0)
- {
- string text = "crc_" + play_motion_name;
- if (GameUty.IsExistFile(text, null))
- {
- play_motion_name = text;
- }
- }
- int blend = 500;
- if (tag_data.IsValid("blend"))
- {
- blend = tag_data.GetTagProperty("blend").AsInteger();
- }
- bool loop = false;
- if (tag_data.IsValid("loop"))
- {
- loop = tag_data.GetTagProperty("loop").AsBool();
- }
- WaitEventList waitEventList = base.GetWaitEventList("motion");
- if (waitEventList.list.Count <= 0)
- {
- if (maid.Visible)
- {
- this.PlayMaidMotion(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
- }
- waitEventList.Clear();
- }
- else
- {
- int wait_time = waitEventList.list[waitEventList.list.Count - 1].wait_time;
- waitEventList.Add(delegate
- {
- if (maid != null && maid.Visible)
- {
- this.PlayMaidMotion(maid, play_motion_name, false, loop, true, GameUty.MillisecondToSecond(blend));
- }
- }, wait_time);
- }
- return false;
- }
- private bool TagPenisIKAttach(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "penisikattach", new string[]
- {
- "man",
- "target",
- "targetbone",
- "insert_before",
- "insert_after"
- });
- Maid man = this.GetMan(tagData.GetTagProperty("man").AsInteger());
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("target").AsString());
- if (!man || !maidAndMan)
- {
- return false;
- }
- PenisIKParam penisIKParam = new PenisIKParam(man, maidAndMan);
- penisIKParam.targetBoneName = tagData.GetTagProperty("targetbone").AsString();
- IKScriptHelper.SetPenisIKPatam(penisIKParam, tagData);
- man.body0.fullBodyIK.IKAttach(FullBodyIKMgr.IKEffectorType.Penis, penisIKParam);
- return false;
- }
- public bool TagIKPlaneColider(KagTagSupport tagData)
- {
- bool flag = tagData.IsValid("on");
- if (tagData.IsValid("src"))
- {
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- if (!maidAndMan)
- {
- return false;
- }
- if (tagData.IsValid("colider"))
- {
- string a = tagData.GetTagProperty("colider").AsString();
- if (a == "floor")
- {
- maidAndMan.body0.fullBodyIK.floorColliderEnable = flag;
- }
- else
- {
- maidAndMan.body0.fullBodyIK.wallColliderEnable = flag;
- }
- }
- else
- {
- maidAndMan.body0.fullBodyIK.floorColliderEnable = flag;
- maidAndMan.body0.fullBodyIK.wallColliderEnable = flag;
- }
- }
- else
- {
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
- if (maid)
- {
- if (tagData.IsValid("colider"))
- {
- string a2 = tagData.GetTagProperty("colider").AsString();
- if (a2 == "floor")
- {
- maid.body0.fullBodyIK.floorColliderEnable = flag;
- }
- else
- {
- maid.body0.fullBodyIK.wallColliderEnable = flag;
- }
- }
- else
- {
- maid.body0.fullBodyIK.floorColliderEnable = flag;
- maid.body0.fullBodyIK.wallColliderEnable = flag;
- }
- }
- }
- for (int j = 0; j < GameMain.Instance.CharacterMgr.GetManCount(); j++)
- {
- Maid man = GameMain.Instance.CharacterMgr.GetMan(j);
- if (man)
- {
- if (tagData.IsValid("colider"))
- {
- string a3 = tagData.GetTagProperty("colider").AsString();
- if (a3 == "floor")
- {
- man.body0.fullBodyIK.floorColliderEnable = flag;
- }
- else
- {
- man.body0.fullBodyIK.wallColliderEnable = flag;
- }
- }
- else
- {
- man.body0.fullBodyIK.floorColliderEnable = flag;
- man.body0.fullBodyIK.wallColliderEnable = flag;
- }
- }
- }
- }
- return false;
- }
- public bool TagIKColiderBorder(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "ikcoliderborder", new string[]
- {
- "colider",
- "value"
- });
- string a = tagData.GetTagProperty("colider").AsString();
- float num = tagData.GetTagProperty("value").AsReal();
- string text = (!tagData.IsValid("srcbone")) ? string.Empty : tagData.GetTagProperty("srcbone").AsString();
- if (tagData.IsValid("src"))
- {
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- if (!maidAndMan)
- {
- return false;
- }
- if (a == "floor")
- {
- if (string.IsNullOrEmpty(text))
- {
- maidAndMan.body0.fullBodyIK.floorColliderEnable = true;
- maidAndMan.body0.fullBodyIK.floorColliderY = num;
- }
- else
- {
- NativePlaneCollider floorCollider = maidAndMan.body0.fullBodyIK.GetFloorCollider(text);
- if (floorCollider)
- {
- floorCollider.enabled = true;
- floorCollider.status.center.y = num;
- }
- }
- }
- else if (string.IsNullOrEmpty(text))
- {
- maidAndMan.body0.fullBodyIK.wallColliderEnable = true;
- maidAndMan.body0.fullBodyIK.wallColliderZ = num;
- maidAndMan.fullBodyIK.wallDirectionInverse = (a == "wallfront");
- }
- else
- {
- NativePlaneCollider wallCollider = maidAndMan.body0.fullBodyIK.GetWallCollider(text);
- if (wallCollider)
- {
- wallCollider.enabled = true;
- wallCollider.status.center.z = num;
- wallCollider.planeStatus.isDirectionInverse = (a == "wallfront");
- }
- }
- }
- else
- {
- for (int i = 0; i < GameMain.Instance.CharacterMgr.GetMaidCount(); i++)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(i);
- if (maid)
- {
- if (a == "floor")
- {
- if (string.IsNullOrEmpty(text))
- {
- maid.body0.fullBodyIK.floorColliderEnable = true;
- maid.body0.fullBodyIK.floorColliderY = num;
- }
- else
- {
- NativePlaneCollider floorCollider2 = maid.body0.fullBodyIK.GetFloorCollider(text);
- if (floorCollider2)
- {
- floorCollider2.enabled = true;
- floorCollider2.status.center.y = num;
- }
- }
- }
- else if (string.IsNullOrEmpty(text))
- {
- maid.body0.fullBodyIK.wallColliderEnable = true;
- maid.body0.fullBodyIK.wallColliderZ = num;
- maid.fullBodyIK.wallDirectionInverse = (a == "wallfront");
- }
- else
- {
- NativePlaneCollider wallCollider2 = maid.body0.fullBodyIK.GetWallCollider(text);
- if (wallCollider2)
- {
- wallCollider2.enabled = true;
- wallCollider2.status.center.z = num;
- wallCollider2.planeStatus.isDirectionInverse = (a == "wallfront");
- }
- }
- }
- }
- for (int j = 0; j < GameMain.Instance.CharacterMgr.GetManCount(); j++)
- {
- Maid man = GameMain.Instance.CharacterMgr.GetMan(j);
- if (man)
- {
- if (a == "floor")
- {
- if (string.IsNullOrEmpty(text))
- {
- man.body0.fullBodyIK.floorColliderEnable = true;
- man.body0.fullBodyIK.floorColliderY = num;
- }
- else
- {
- NativePlaneCollider floorCollider3 = man.body0.fullBodyIK.GetFloorCollider(text);
- if (floorCollider3)
- {
- floorCollider3.enabled = true;
- floorCollider3.status.center.y = num;
- }
- }
- }
- else if (string.IsNullOrEmpty(text))
- {
- man.body0.fullBodyIK.wallColliderEnable = true;
- man.body0.fullBodyIK.wallColliderZ = num;
- man.fullBodyIK.wallDirectionInverse = (a == "wallfront");
- }
- else
- {
- NativePlaneCollider wallCollider3 = man.body0.fullBodyIK.GetWallCollider(text);
- if (wallCollider3)
- {
- wallCollider3.enabled = true;
- wallCollider3.status.center.z = num;
- wallCollider3.planeStatus.isDirectionInverse = (a == "wallfront");
- }
- }
- }
- }
- }
- return false;
- }
- public bool TagIKColiderCorrect(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "ikcolidercorrect", new string[]
- {
- "src",
- "srcbone",
- "correcttype"
- });
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- if (!maidAndMan)
- {
- return false;
- }
- ALimbIKCtrl ikctrl = maidAndMan.body0.fullBodyIK.GetIKCtrl<ALimbIKCtrl>(tagData.GetTagProperty("srcbone").AsString());
- if (!ikctrl)
- {
- return false;
- }
- ikctrl.correctType = (ALimbIKCtrl.BorderCorrectType)Enum.Parse(typeof(ALimbIKCtrl.BorderCorrectType), tagData.GetTagProperty("correcttype").AsString());
- return false;
- }
- public bool TagIKColiderEnable(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "ikcoliderenable", new string[]
- {
- "src",
- "srcbone"
- });
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- if (!maidAndMan)
- {
- return false;
- }
- ALimbIKCtrl ikctrl = maidAndMan.body0.fullBodyIK.GetIKCtrl<ALimbIKCtrl>(tagData.GetTagProperty("srcbone").AsString());
- if (!ikctrl)
- {
- return false;
- }
- ikctrl.colliderEnable = tagData.IsValid("on");
- return false;
- }
- public bool TagIKColiderTarget(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "ikcolidertarget", new string[]
- {
- "src",
- "srcbone",
- "target",
- "targetbone"
- });
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- Maid maidAndMan2 = base.GetMaidAndMan(tagData.GetTagProperty("target").AsString());
- if (!maidAndMan || !maidAndMan2)
- {
- return false;
- }
- string tag_name = IKScriptHelper.ConvertColliderNameToIKName(tagData.GetTagProperty("srcbone").AsString());
- ALimbIKCtrl ikctrl = maidAndMan.fullBodyIK.GetIKCtrl<ALimbIKCtrl>(tag_name);
- string tag_name2 = IKScriptHelper.ConvertColliderNameToIKName(tagData.GetTagProperty("targetbone").AsString());
- ALimbIKCtrl ikctrl2 = maidAndMan2.fullBodyIK.GetIKCtrl<ALimbIKCtrl>(tag_name2);
- if (!ikctrl || !ikctrl2)
- {
- return false;
- }
- ikctrl.AddHitCheckLimb(ikctrl2);
- return false;
- }
- public bool TagIKCrossColider(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "ikcrosscolider", new string[]
- {
- "src",
- "body"
- });
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- if (!maidAndMan)
- {
- return false;
- }
- string a = tagData.GetTagProperty("body").AsString();
- if (a == "上半身")
- {
- maidAndMan.fullBodyIK.upperBorderEnable = true;
- }
- else if (a == "下半身")
- {
- maidAndMan.fullBodyIK.lowerBorderEnable = true;
- }
- return false;
- }
- public bool TagSetPartner(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "setpartner", new string[]
- {
- "partnerlist"
- });
- string[] array = tagData.GetTagProperty("partnerlist").AsString().Split(new char[]
- {
- ','
- });
- if (array.Length <= 1)
- {
- Debug.LogError("@setpartnerはキャラクターを2人以上指定してください");
- return false;
- }
- for (int i = 0; i < array.Length; i++)
- {
- Maid maidAndMan = base.GetMaidAndMan(array[i]);
- if (maidAndMan)
- {
- for (int j = i + 1; j < array.Length; j++)
- {
- Maid maidAndMan2 = base.GetMaidAndMan(array[j]);
- if (maidAndMan2)
- {
- maidAndMan.body0.fullBodyIK.AddPartner(maidAndMan2, true);
- }
- }
- }
- }
- return false;
- }
- private bool TagKupaTimer(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "kupatimer", new string[]
- {
- "maid",
- "morph",
- "move",
- "time"
- });
- Maid maid = this.GetMaid(tagData.GetTagProperty("maid").AsInteger());
- if (!maid)
- {
- return false;
- }
- AutoKupaCtrl.MorphType morph_type = (AutoKupaCtrl.MorphType)Enum.Parse(typeof(AutoKupaCtrl.MorphType), tagData.GetTagProperty("morph").AsString());
- AutoKupaCtrl kupaCtrl = maid.body0.GetKupaCtrl(morph_type);
- AutoKupaCtrl.KupaType kupa_type = (AutoKupaCtrl.KupaType)Enum.Parse(typeof(AutoKupaCtrl.KupaType), tagData.GetTagProperty("move").AsString());
- float kupa_time = MathUtility.MillisecondToSecond(tagData.GetTagProperty("time").AsInteger());
- float wait = 0f;
- if (tagData.IsValid("wait"))
- {
- wait = MathUtility.MillisecondToSecond(tagData.GetTagProperty("wait").AsInteger());
- }
- float kupaSpeed = (!tagData.IsValid("kupaspeed")) ? 1f : MathUtility.PercentageToRatio(tagData.GetTagProperty("kupaspeed").AsInteger(), false);
- float morphValueMax = (!tagData.IsValid("kupamax")) ? 1f : MathUtility.PercentageToRatio(tagData.GetTagProperty("kupamax").AsInteger(), false);
- kupaCtrl.kupaSpeed = kupaSpeed;
- kupaCtrl.morphValueMax = morphValueMax;
- kupaCtrl.SetKupaTimer(kupa_type, kupa_time, wait);
- return false;
- }
- private bool TagKupaInsert(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "kupainsert", new string[]
- {
- "maid",
- "morph",
- "target",
- "insert",
- "insertaxis"
- });
- Maid maid = this.GetMaid(tagData.GetTagProperty("maid").AsInteger());
- if (!maid)
- {
- return false;
- }
- AutoKupaCtrl.MorphType morph_type = (AutoKupaCtrl.MorphType)Enum.Parse(typeof(AutoKupaCtrl.MorphType), tagData.GetTagProperty("morph").AsString());
- AutoKupaCtrl kupaCtrl = maid.body0.GetKupaCtrl(morph_type);
- Vector3 insert_axis = MathUtility.Vec3Parse(tagData.GetTagProperty("insertaxis").AsString(), ',');
- kupaCtrl.morphInsert.kupaSpeedIn = (kupaCtrl.morphInsert.kupaSpeedOut = 1f);
- kupaCtrl.SetInsertParamFromScript(tagData);
- string text = tagData.GetTagProperty("target").AsString();
- if (text == "bgitem")
- {
- string item_name = tagData.GetTagProperty("insert").AsString();
- kupaCtrl.SetKupaInsertFromBgItem(item_name, insert_axis);
- }
- else
- {
- Maid maidAndMan = base.GetMaidAndMan(text);
- if (!maidAndMan)
- {
- return false;
- }
- AutoKupaCtrl.InsertObjType insert = (AutoKupaCtrl.InsertObjType)Enum.Parse(typeof(AutoKupaCtrl.InsertObjType), tagData.GetTagProperty("insert").AsString());
- kupaCtrl.SetKupaInsert(insert, maidAndMan.body0, insert_axis);
- }
- return false;
- }
- private bool TagShoulderTwistCalc(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "shouldertwistcalc", new string[]
- {
- "src",
- "calctype"
- });
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- ShoulderTwist.CalcType calc_mode = (ShoulderTwist.CalcType)Enum.Parse(typeof(ShoulderTwist.CalcType), tagData.GetTagProperty("calctype").AsString());
- if (tagData.IsValid("shoulder"))
- {
- bool is_left = tagData.GetTagProperty("shoulder").AsString() == "left";
- maidAndMan.body0.SetShoulderTwistCalcType(is_left, calc_mode);
- }
- else
- {
- maidAndMan.body0.SetShoulderTwistCalcType(true, calc_mode);
- maidAndMan.body0.SetShoulderTwistCalcType(false, calc_mode);
- }
- return false;
- }
- private bool TagMotionOffset(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "motionoffset", new string[]
- {
- "target"
- });
- if (!tagData.IsValid("set") && !tagData.IsValid("add"))
- {
- Debug.LogError("@motionoffset:数値指定がありません");
- return false;
- }
- Maid src_chara = null;
- if (tagData.IsValid("src"))
- {
- src_chara = base.GetMaidAndMan(tagData.GetTagProperty("src").AsString());
- }
- string[] array = tagData.GetTagProperty("target").AsString().Split(new char[]
- {
- ','
- });
- Func<string, Maid, Vector3> func = delegate(string tag, Maid chara)
- {
- Vector3 result = Vector3.zero;
- string text = tagData.GetTagProperty(tag).AsString();
- if (text.Contains("min") && text.Contains("max"))
- {
- string[] array3 = text.Split(new char[]
- {
- ':'
- });
- MaidProp maidProp = null;
- try
- {
- MPN mpn = (MPN)Enum.Parse(typeof(MPN), array3[0]);
- maidProp = ((!(src_chara != null)) ? chara.GetProp(mpn) : src_chara.GetProp(mpn));
- }
- catch
- {
- Debug.LogError("エディットのパラメータが指定されてません");
- return result;
- }
- Vector3 a = MathUtility.Vec3Parse(array3[1].Split(new char[]
- {
- '='
- })[1], ',');
- Vector3 b2 = MathUtility.Vec3Parse(array3[2].Split(new char[]
- {
- '='
- })[1], ',');
- if (maidProp.value > maidProp.value_Default)
- {
- float t = Mathf.InverseLerp((float)maidProp.value_Default, (float)maidProp.max, (float)maidProp.value);
- result = Vector3.Lerp(Vector3.zero, b2, t);
- }
- else if (maidProp.value < maidProp.value_Default)
- {
- float t2 = Mathf.InverseLerp((float)maidProp.min, (float)maidProp.value_Default, (float)maidProp.value);
- result = Vector3.Lerp(a, Vector3.zero, t2);
- }
- return result;
- }
- result = MathUtility.Vec3Parse(text, ',');
- return result;
- };
- foreach (string tag_str in array)
- {
- Maid maidAndMan = base.GetMaidAndMan(tag_str);
- if (maidAndMan)
- {
- Vector3 motionOffsetGP = Vector3.zero;
- Vector3 b = Vector3.zero;
- bool flag = tagData.IsValid("set");
- if (flag)
- {
- motionOffsetGP = func("set", maidAndMan);
- }
- if (tagData.IsValid("add"))
- {
- b = func("add", maidAndMan);
- }
- if (flag)
- {
- maidAndMan.motionOffsetGP03 = motionOffsetGP;
- }
- maidAndMan.motionOffsetGP03 += b;
- }
- }
- return false;
- }
- private bool TagAutoOffset(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "autooffset", new string[]
- {
- "target"
- });
- if (!tagData.IsValid("set") && !tagData.IsValid("add"))
- {
- Debug.LogError("@motionoffset:数値指定がありません");
- return false;
- }
- string[] array = tagData.GetTagProperty("target").AsString().Split(new char[]
- {
- ','
- });
- bool flag = GameMain.Instance.CMSystem.GetTmpGenericFlag("AddAllOffset_Ignore") == 1;
- Func<string, Maid, Vector3> func = delegate(string tag, Maid chara)
- {
- Vector3 result = Vector3.zero;
- string text = tagData.GetTagProperty(tag).AsString();
- if (text.Contains("min") && text.Contains("max"))
- {
- string[] array3 = text.Split(new char[]
- {
- ':'
- });
- MaidProp maidProp = null;
- try
- {
- MPN mpn = (MPN)Enum.Parse(typeof(MPN), array3[0]);
- maidProp = chara.GetProp(mpn);
- }
- catch
- {
- Debug.LogError("エディットのパラメータが指定されてません");
- return result;
- }
- Vector3 a = MathUtility.Vec3Parse(array3[1].Split(new char[]
- {
- '='
- })[1], ',');
- Vector3 b = MathUtility.Vec3Parse(array3[2].Split(new char[]
- {
- '='
- })[1], ',');
- if (maidProp.value > maidProp.value_Default)
- {
- float t = Mathf.InverseLerp((float)maidProp.value_Default, (float)maidProp.max, (float)maidProp.value);
- result = Vector3.Lerp(Vector3.zero, b, t);
- }
- else if (maidProp.value < maidProp.value_Default)
- {
- float t2 = Mathf.InverseLerp((float)maidProp.min, (float)maidProp.value_Default, (float)maidProp.value);
- result = Vector3.Lerp(a, Vector3.zero, t2);
- }
- return result;
- }
- result = MathUtility.Vec3Parse(text, ',');
- return result;
- };
- foreach (string tag_str in array)
- {
- Maid maidAndMan = base.GetMaidAndMan(tag_str);
- if (maidAndMan)
- {
- Vector3 vector = Vector3.zero;
- Vector3 vector2 = Vector3.zero;
- bool flag2 = tagData.IsValid("set");
- if (flag2)
- {
- vector = func("set", maidAndMan);
- }
- if (tagData.IsValid("add"))
- {
- vector2 = func("add", maidAndMan);
- }
- if (flag)
- {
- vector = -vector;
- vector2 = -vector2;
- if (flag2)
- {
- maidAndMan.fullBodyIK.floorColliderY = vector.y;
- maidAndMan.fullBodyIK.wallColliderZ = vector.z;
- }
- maidAndMan.fullBodyIK.floorColliderY += vector2.y;
- maidAndMan.fullBodyIK.wallColliderZ += vector2.z;
- }
- else
- {
- if (flag2)
- {
- maidAndMan.motionOffsetGP03 = vector;
- }
- maidAndMan.motionOffsetGP03 += vector2;
- }
- }
- }
- return false;
- }
- private bool TagInverseOffset(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "inverseoffset", new string[]
- {
- "target"
- });
- if (GameMain.Instance.CMSystem.GetTmpGenericFlag("AddAllOffset_Ignore") != 1)
- {
- return false;
- }
- string[] array = tagData.GetTagProperty("target").AsString().Split(new char[]
- {
- ','
- });
- Vector3 vector = Vector3.zero;
- if (tagData.IsValid("y"))
- {
- vector.y = tagData.GetTagProperty("y").AsReal();
- }
- vector = -vector;
- foreach (string tag_str in array)
- {
- Maid maidAndMan = base.GetMaidAndMan(tag_str);
- if (maidAndMan)
- {
- maidAndMan.motionOffsetGP03 = vector;
- maidAndMan.fullBodyIK.floorColliderY = vector.y;
- maidAndMan.fullBodyIK.wallColliderZ = vector.z;
- }
- }
- return false;
- }
- private bool TagSetIKOrder(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "setikorder", new string[]
- {
- "order"
- });
- string[] array = tagData.GetTagProperty("order").AsString().Split(new char[]
- {
- ','
- });
- if (array.Length <= 1)
- {
- Debug.LogError("@setikorderはキャラクターを2人以上指定してください");
- return false;
- }
- for (int i = 0; i < array.Length; i++)
- {
- Maid maidAndMan = base.GetMaidAndMan(array[i]);
- if (maidAndMan)
- {
- maidAndMan.body0.fullBodyIK.ikExecOrder = i;
- }
- }
- return false;
- }
- private bool TagSetBeroMorph(KagTagSupport tagData)
- {
- base.CheckAbsolutelyNecessaryTag(tagData, "setberomorph", new string[]
- {
- "target"
- });
- Maid maidAndMan = base.GetMaidAndMan(tagData.GetTagProperty("target").AsString());
- TongueCtrl tongueCtrl = maidAndMan.body0.Face.tongueCtrl;
- if (tongueCtrl == null)
- {
- return false;
- }
- tongueCtrl.isEnable = true;
- tongueCtrl.BlendStatusReset();
- if (tagData.IsValid("blend"))
- {
- tongueCtrl.blendTime = MathUtility.MillisecondToSecond(tagData.GetTagProperty("blend").AsInteger());
- }
- foreach (TongueCtrl.FaceMorph morph in TongueCtrl.TongueUseMorph)
- {
- string morphName = tongueCtrl.GetMorphData(morph).morphName;
- if (tagData.IsValid(morphName))
- {
- float value = MathUtility.PercentageToRatio(tagData.GetTagProperty(morphName).AsInteger(), false);
- tongueCtrl.SetTargetValue(morph, value);
- }
- }
- return false;
- }
- private bool TagSetMaidOffsetMultiPos2(KagTagSupport tag_data)
- {
- if (this.valid_pos)
- {
- base.TagSetMaidOffsetMultiPos(tag_data);
- }
- return false;
- }
- private bool TagMotAllProcPropSeqStart(KagTagSupport tag_data)
- {
- Maid maidAndMan = base.GetMaidAndMan(tag_data, true);
- if (maidAndMan == null)
- {
- return false;
- }
- if (tag_data.IsValid("fix"))
- {
- maidAndMan.AllProcProp();
- }
- else
- {
- NDebug.Assert(!this.script_mgr_.is_motion_all_prop_seq, "MotionKagManager AllProcPropSeqStart error.");
- this.script_mgr_.is_motion_all_prop_seq = true;
- this.script_mgr_.motion_all_prop_seq_maid = maidAndMan;
- }
- return false;
- }
- private bool TagMotFace(KagTagSupport tag_data)
- {
- return !this.face_fix_ && base.TagFace(tag_data);
- }
- private bool TagMotFaceBlend(KagTagSupport tag_data)
- {
- return !this.face_fix_ && base.TagFaceBlend(tag_data);
- }
- public void SetNextMotion(bool is_next)
- {
- this.next_flag_ = is_next;
- }
- public void SetFaceFix(bool is_fix)
- {
- this.face_fix_ = is_fix;
- }
- protected override void PlayMaidMotion(Maid maid, string fn, bool additive = false, bool loop = false, bool boAddQue = false, float val = 0.5f)
- {
- if (this.next_flag_)
- {
- boAddQue = true;
- this.next_flag_ = false;
- }
- base.PlayMaidMotion(maid, fn, additive, loop, boAddQue, val);
- if (!maid.boMAN && !boAddQue && 0 <= maid.ActiveSlotNo && maid.ActiveSlotNo < this.last_maid_motion_set_log_.Length)
- {
- this.last_maid_motion_set_log_[maid.ActiveSlotNo] = fn.ToLower();
- }
- else if (maid.boMAN && !boAddQue && 0 <= maid.ActiveSlotNo && maid.ActiveSlotNo < this.last_man_motion_set_log_.Length)
- {
- this.last_man_motion_set_log_[maid.ActiveSlotNo] = fn.ToLower();
- }
- }
- public void ClearMotion()
- {
- this.exec_wait_data_.Clear();
- this.wait_event_list_.Clear();
- }
- public void SetSloatNo(int no)
- {
- this.sloat_no_ = no;
- }
- public override string GetKagClassName()
- {
- return "モーションkag : " + this.sloat_no_.ToString();
- }
- public override Maid GetMaid(int no)
- {
- if (no == 0 && this.main_maid_ != null)
- {
- return this.main_maid_;
- }
- return base.GetMaid(no);
- }
- public override Maid GetMan(int man_no)
- {
- if (man_no == 0 && this.main_man_ != null)
- {
- return this.main_man_;
- }
- return base.GetMan(man_no);
- }
- public bool valid_pos
- {
- get
- {
- return this.valid_pos_;
- }
- set
- {
- this.valid_pos_ = value;
- }
- }
- public Maid main_maid
- {
- get
- {
- return this.main_maid_;
- }
- }
- public Maid main_man
- {
- get
- {
- return this.main_man_;
- }
- }
- public string[] last_maid_motion_set_log
- {
- get
- {
- return this.last_maid_motion_set_log_;
- }
- }
- public string[] last_man_motion_set_log
- {
- get
- {
- return this.last_man_motion_set_log_;
- }
- }
- private const string COMMON_SETTING_LABEL = "*共通";
- private List<Maid> ActiveMaidList = new List<Maid>();
- private List<Maid> ActiveManList = new List<Maid>();
- public const string MOTIONSCRIPT_META_FILE = "motionscript.msmeta";
- private Dictionary<string, MotionKagManager.MotionScriptMeta> MotionScriptMetaDic = new Dictionary<string, MotionKagManager.MotionScriptMeta>();
- private MotionKagManager.MotionScriptMeta CurrentScriptMeta;
- public bool isBodyMixOK;
- private int sloat_no_;
- private bool next_flag_;
- private bool face_fix_;
- private Maid main_maid_;
- private Maid main_man_;
- private bool valid_pos_ = true;
- protected string[] last_maid_motion_set_log_ = new string[6];
- protected string[] last_man_motion_set_log_ = new string[6];
- [Serializable]
- public class MotionScriptMetaPackage
- {
- public List<MotionKagManager.MotionScriptMeta> metaList = new List<MotionKagManager.MotionScriptMeta>();
- }
- [Serializable]
- public class MotionScriptMeta
- {
- public string scriptName;
- public int maidCount;
- public int manCount;
- }
- }
|