|
@@ -1,16 +1,20 @@
|
|
|
using System;
|
|
|
-using System.Collections;
|
|
|
using System.IO;
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using System.Xml.Linq;
|
|
|
using UnityEngine;
|
|
|
+using static TBody;
|
|
|
|
|
|
namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
{
|
|
|
internal class Meido
|
|
|
{
|
|
|
- private const int MAX_MAIDS = 12;
|
|
|
- private static CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
|
|
|
- public readonly int stockNo;
|
|
|
+ private const int maxMaids = 12;
|
|
|
+ public static readonly PoseInfo DefaultPose =
|
|
|
+ new PoseInfo(Constants.PoseGroupList[0], Constants.PoseDict[Constants.PoseGroupList[0]][0]);
|
|
|
+ public static readonly string defaultFaceBlendSet = "通常";
|
|
|
public static readonly string[] faceKeys = new string[24]
|
|
|
{
|
|
|
"eyeclose", "eyeclose2", "eyeclose3", "eyebig", "eyeclose6", "eyeclose5", "hitomih",
|
|
@@ -26,44 +30,52 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
// cry 1, cry 2, cry 3, blush 1, blush 2, blush 3
|
|
|
"tear1", "tear2", "tear3", "hohos", "hoho", "hohol"
|
|
|
};
|
|
|
- public static readonly PoseInfo defaultPose
|
|
|
- = new PoseInfo(Constants.PoseGroupList[0], Constants.PoseDict[Constants.PoseGroupList[0]][0]);
|
|
|
- public static readonly string defaultFaceBlendSet = "通常";
|
|
|
- private MeidoDragPointManager dragPointManager;
|
|
|
- private bool initialized = false;
|
|
|
- public Maid Maid { get; private set; }
|
|
|
- public Texture2D Image { get; private set; }
|
|
|
- public string FirstName { get; private set; }
|
|
|
- public string LastName { get; private set; }
|
|
|
- public string NameJP => $"{LastName}\n{FirstName}";
|
|
|
- public string NameEN => $"{FirstName}\n{LastName}";
|
|
|
- public Quaternion DefaultEyeRotL { get; private set; }
|
|
|
- public Quaternion DefaultEyeRotR { get; private set; }
|
|
|
- public int ActiveSlot { get; private set; }
|
|
|
+ public enum Curl
|
|
|
+ {
|
|
|
+ front, back, shift
|
|
|
+ }
|
|
|
+ private bool initialized;
|
|
|
public event EventHandler<MeidoUpdateEventArgs> UpdateMeido;
|
|
|
- public event EventHandler BodyLoad;
|
|
|
- private bool isLoading = false;
|
|
|
- public float[] BlendValuesBackup { get; private set; }
|
|
|
- public float[] BlendValues { get; private set; }
|
|
|
- public bool IsIK
|
|
|
+ public int StockNo { get; }
|
|
|
+ public Maid Maid { get; private set; }
|
|
|
+ public TBody Body => Maid.body0;
|
|
|
+ public MeidoDragPointManager IKManager { get; private set; }
|
|
|
+ public Texture2D Portrait { get; private set; }
|
|
|
+ public PoseInfo CachedPose { get; private set; } = DefaultPose;
|
|
|
+ public string FaceBlendSet { get; private set; } = defaultFaceBlendSet;
|
|
|
+ public int Slot { get; private set; }
|
|
|
+ public bool Loading { get; private set; }
|
|
|
+ public string FirstName => Maid.status.firstName;
|
|
|
+ public string LastName => Maid.status.lastName;
|
|
|
+ public bool Busy => Maid.IsBusy && Loading;
|
|
|
+ public bool CurlingFront => Maid.IsItemChange("skirt", "めくれスカート")
|
|
|
+ || Maid.IsItemChange("onepiece", "めくれスカート");
|
|
|
+ public bool CurlingBack => Maid.IsItemChange("skirt", "めくれスカート後ろ")
|
|
|
+ || Maid.IsItemChange("onepiece", "めくれスカート後ろ");
|
|
|
+ public bool PantsuShift => Maid.IsItemChange("panz", "パンツずらし")
|
|
|
+ || Maid.IsItemChange("mizugi", "パンツずらし");
|
|
|
+ private bool freeLook;
|
|
|
+ public bool FreeLook
|
|
|
{
|
|
|
- get => dragPointManager?.Active ?? false;
|
|
|
+ get => freeLook;
|
|
|
set
|
|
|
{
|
|
|
- if (dragPointManager == null || value == dragPointManager.Active) return;
|
|
|
- else dragPointManager.Active = value;
|
|
|
+ if (this.freeLook == value) return;
|
|
|
+ this.freeLook = value;
|
|
|
+ Body.trsLookTarget = this.freeLook ? null : GameMain.Instance.MainCamera.transform;
|
|
|
+ OnUpdateMeido();
|
|
|
}
|
|
|
}
|
|
|
- public bool IsStop
|
|
|
+ public bool Stop
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- if (!Maid.body0.isLoadedBody) return true;
|
|
|
+ if (!Body.isLoadedBody) return true;
|
|
|
else return !Maid.GetAnimation().isPlaying;
|
|
|
}
|
|
|
set
|
|
|
{
|
|
|
- if (!Maid.body0.isLoadedBody || value == !Maid.GetAnimation().isPlaying) return;
|
|
|
+ if (!Body.isLoadedBody || value == Stop) return;
|
|
|
else
|
|
|
{
|
|
|
if (value) Maid.GetAnimation().Stop();
|
|
@@ -72,160 +84,87 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // private bool isBone = false;
|
|
|
- public bool IsBone
|
|
|
+ public bool IK
|
|
|
{
|
|
|
- get => dragPointManager?.IsBone ?? false;
|
|
|
+ get => IKManager.Active;
|
|
|
set
|
|
|
{
|
|
|
- if (dragPointManager == null || value == dragPointManager.IsBone) return;
|
|
|
- else dragPointManager.IsBone = value;
|
|
|
- OnUpdateMeido();
|
|
|
+ if (value == IKManager.Active) return;
|
|
|
+ else IKManager.Active = value;
|
|
|
}
|
|
|
}
|
|
|
- private bool isFreeLook;
|
|
|
- public bool IsFreeLook
|
|
|
+ public bool Bone
|
|
|
{
|
|
|
- get => isFreeLook;
|
|
|
+ get => IKManager.IsBone;
|
|
|
set
|
|
|
{
|
|
|
- if (this.isFreeLook == value) return;
|
|
|
- this.isFreeLook = value;
|
|
|
- Maid.body0.trsLookTarget = this.isFreeLook ? null : GameMain.Instance.MainCamera.transform;
|
|
|
+ if (value == Bone) return;
|
|
|
+ else IKManager.IsBone = value;
|
|
|
OnUpdateMeido();
|
|
|
}
|
|
|
}
|
|
|
- public PoseInfo CachedPose { get; private set; }
|
|
|
- public string FaceBlendSet { get; private set; } = defaultFaceBlendSet;
|
|
|
+ public float[] BlendValuesBackup { get; private set; }
|
|
|
+ public float[] BlendValues { get; private set; }
|
|
|
+ public Quaternion DefaultEyeRotL { get; private set; }
|
|
|
+ public Quaternion DefaultEyeRotR { get; private set; }
|
|
|
|
|
|
public Meido(int stockMaidIndex)
|
|
|
{
|
|
|
- this.Maid = characterMgr.GetStockMaid(stockMaidIndex);
|
|
|
- this.stockNo = stockMaidIndex;
|
|
|
- this.Image = Maid.GetThumIcon();
|
|
|
- this.FirstName = Maid.status.firstName;
|
|
|
- this.LastName = Maid.status.lastName;
|
|
|
- this.CachedPose = defaultPose;
|
|
|
- // I don't know why I put this here. Must've fixed something with proc loading
|
|
|
+ this.StockNo = stockMaidIndex;
|
|
|
+ this.Maid = GameMain.Instance.CharacterMgr.GetStockMaid(stockMaidIndex);
|
|
|
+ this.Portrait = Maid.GetThumIcon();
|
|
|
Maid.boAllProcPropBUSY = false;
|
|
|
+ IKManager = new MeidoDragPointManager(this);
|
|
|
+ IKManager.SelectMaid += (s, args) => OnUpdateMeido((MeidoUpdateEventArgs)args);
|
|
|
}
|
|
|
|
|
|
- public void Update()
|
|
|
+ public void BeginLoad()
|
|
|
{
|
|
|
- if (isLoading)
|
|
|
- {
|
|
|
- if (!Maid.IsBusy)
|
|
|
- {
|
|
|
- isLoading = false;
|
|
|
- OnBodyLoad();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void Flip()
|
|
|
- {
|
|
|
- if (this.dragPointManager == null) return;
|
|
|
- IsStop = true;
|
|
|
- this.dragPointManager.Flip();
|
|
|
+ FreeLook = false;
|
|
|
+ Maid.Visible = true;
|
|
|
+ Body.boHeadToCam = true;
|
|
|
+ Body.boEyeToCam = true;
|
|
|
+ Body.SetBoneHitHeightY(-1000f);
|
|
|
}
|
|
|
|
|
|
- public byte[] SerializePose()
|
|
|
+ public void Load(int slot)
|
|
|
{
|
|
|
- CacheBoneDataArray cache = this.Maid.gameObject.GetComponent<CacheBoneDataArray>();
|
|
|
+ Slot = slot;
|
|
|
+ Loading = true;
|
|
|
|
|
|
- if (cache == null)
|
|
|
+ if (!Body.isLoadedBody)
|
|
|
{
|
|
|
- cache = this.Maid.gameObject.AddComponent<CacheBoneDataArray>();
|
|
|
- cache.CreateCache(this.Maid.body0.GetBone("Bip01"));
|
|
|
+ Maid.DutPropAll();
|
|
|
+ Maid.AllProcPropSeqStart();
|
|
|
}
|
|
|
|
|
|
- return cache.GetAnmBinary(true, true);
|
|
|
+ GameMain.Instance.StartCoroutine(Load());
|
|
|
}
|
|
|
|
|
|
- public void SetHandPreset(string filename, bool right)
|
|
|
+ private IEnumerator Load()
|
|
|
{
|
|
|
- if (this.dragPointManager == null) return;
|
|
|
-
|
|
|
- XDocument handDocument = XDocument.Load(filename);
|
|
|
- XElement handElement = handDocument.Element("FingerData");
|
|
|
- if (handElement.IsEmpty || handElement.Element("GameVersion").IsEmpty
|
|
|
- || handElement.Element("RightData").IsEmpty || handElement.Element("BinaryData").IsEmpty)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- IsStop = true;
|
|
|
-
|
|
|
- bool rightData = bool.Parse(handElement.Element("RightData").Value);
|
|
|
- string base64Data = handElement.Element("BinaryData").Value;
|
|
|
-
|
|
|
- byte[] handData = Convert.FromBase64String(base64Data);
|
|
|
+ while (Maid.IsBusy) yield return null;
|
|
|
|
|
|
- this.dragPointManager.DeserializeHand(handData, right, rightData != right);
|
|
|
- }
|
|
|
-
|
|
|
- public byte[] SerializeHand(bool right) => this.dragPointManager?.SerializeHand(right);
|
|
|
-
|
|
|
- public Maid Load(int activeSlot, int maidSlot)
|
|
|
- {
|
|
|
- isLoading = true;
|
|
|
- this.ActiveSlot = activeSlot;
|
|
|
-
|
|
|
- Maid.Visible = true;
|
|
|
-
|
|
|
- if (!Maid.body0.isLoadedBody)
|
|
|
- {
|
|
|
- if (maidSlot >= MAX_MAIDS)
|
|
|
- {
|
|
|
- Maid.DutPropAll();
|
|
|
- Maid.AllProcPropSeqStart();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- GameMain.Instance.CharacterMgr.Activate(maidSlot, maidSlot, false, false);
|
|
|
- GameMain.Instance.CharacterMgr.CharaVisible(maidSlot, true, false);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- SetPose(defaultPose);
|
|
|
- }
|
|
|
-
|
|
|
- dragPointManager = new MeidoDragPointManager(this);
|
|
|
- dragPointManager.SelectMaid += OnMeidoSelect;
|
|
|
-
|
|
|
- this.IsFreeLook = false;
|
|
|
- Maid.body0.boHeadToCam = true;
|
|
|
- Maid.body0.boEyeToCam = true;
|
|
|
- Maid.body0.SetBoneHitHeightY(-1000f);
|
|
|
-
|
|
|
- return Maid;
|
|
|
+ OnBodyLoad();
|
|
|
}
|
|
|
|
|
|
public void Unload()
|
|
|
{
|
|
|
- if (Maid.body0.isLoadedBody)
|
|
|
+ if (Body.isLoadedBody)
|
|
|
{
|
|
|
- Maid.body0.MuneYureL(1f);
|
|
|
- Maid.body0.MuneYureR(1f);
|
|
|
- Maid.body0.jbMuneL.enabled = true;
|
|
|
- Maid.body0.jbMuneR.enabled = true;
|
|
|
- Maid.body0.quaDefEyeL = DefaultEyeRotL;
|
|
|
- Maid.body0.quaDefEyeR = DefaultEyeRotR;
|
|
|
+ Body.jbMuneL.enabled = true;
|
|
|
+ Body.jbMuneR.enabled = true;
|
|
|
}
|
|
|
|
|
|
- Maid.body0.SetMaskMode(TBody.MaskMode.None);
|
|
|
+ Body.MuneYureL(1f);
|
|
|
+ Body.MuneYureR(1f);
|
|
|
|
|
|
- Maid.body0.trsLookTarget = GameMain.Instance.MainCamera.transform;
|
|
|
+ Body.SetMaskMode(MaskMode.None);
|
|
|
+ Body.SetBoneHitHeightY(0f);
|
|
|
|
|
|
Maid.Visible = false;
|
|
|
|
|
|
- if (dragPointManager != null)
|
|
|
- {
|
|
|
- dragPointManager.Destroy();
|
|
|
- dragPointManager.SelectMaid -= OnMeidoSelect;
|
|
|
- dragPointManager = null;
|
|
|
- }
|
|
|
+ IKManager.Destroy();
|
|
|
}
|
|
|
|
|
|
public void Deactivate()
|
|
@@ -235,41 +174,44 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
Maid.SetPos(Vector3.zero);
|
|
|
Maid.SetRot(Vector3.zero);
|
|
|
Maid.SetPosOffset(Vector3.zero);
|
|
|
- Maid.body0.SetBoneHitHeightY(0f);
|
|
|
+ Body.transform.localScale = Vector3.one;
|
|
|
|
|
|
Maid.DelPrefabAll();
|
|
|
-
|
|
|
Maid.ActiveSlotNo = -1;
|
|
|
}
|
|
|
|
|
|
public void SetPose(PoseInfo poseInfo)
|
|
|
{
|
|
|
- this.CachedPose = poseInfo;
|
|
|
+ CachedPose = poseInfo;
|
|
|
SetPose(poseInfo.Pose);
|
|
|
}
|
|
|
|
|
|
public void SetPose(string pose)
|
|
|
{
|
|
|
- if (!Maid.body0.isLoadedBody) return;
|
|
|
+ if (!Body.isLoadedBody) return;
|
|
|
+
|
|
|
if (pose.StartsWith(Constants.customPosePath))
|
|
|
{
|
|
|
- SetPoseCustom(pose);
|
|
|
- return;
|
|
|
+ byte[] poseBuffer = File.ReadAllBytes(pose);
|
|
|
+ string hash = Path.GetFileName(pose).GetHashCode().ToString();
|
|
|
+ Body.CrossFade(hash, poseBuffer, loop: true, fade: 0f);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ string[] poseComponents = pose.Split(',');
|
|
|
+ pose = poseComponents[0] + ".anm";
|
|
|
|
|
|
- string[] poseComponents = pose.Split(',');
|
|
|
- pose = poseComponents[0] + ".anm";
|
|
|
-
|
|
|
- Maid.CrossFade(pose, false, true, false, 0f);
|
|
|
- Maid.SetAutoTwistAll(true);
|
|
|
- Maid.GetAnimation().Play();
|
|
|
+ Maid.CrossFade(pose, loop: true, val: 0f);
|
|
|
+ Maid.GetAnimation().Play();
|
|
|
|
|
|
- if (poseComponents.Length > 1)
|
|
|
- {
|
|
|
- Maid.GetAnimation()[pose].time = float.Parse(poseComponents[1]);
|
|
|
- Maid.GetAnimation()[pose].speed = 0f;
|
|
|
+ if (poseComponents.Length > 1)
|
|
|
+ {
|
|
|
+ Maid.GetAnimation()[pose].time = float.Parse(poseComponents[1]);
|
|
|
+ Maid.GetAnimation()[pose].speed = 0f;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ Maid.SetAutoTwistAll(true);
|
|
|
SetMune();
|
|
|
}
|
|
|
|
|
@@ -277,37 +219,51 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
{
|
|
|
byte[] poseBinary = fromMeido.SerializePose();
|
|
|
string tag = $"copy_{fromMeido.Maid.status.guid}";
|
|
|
- Maid.body0.CrossFade(tag, poseBinary, false, true, false, 0f);
|
|
|
+ Body.CrossFade(tag, poseBinary, false, true, false, 0f);
|
|
|
Maid.SetAutoTwistAll(true);
|
|
|
Maid.transform.rotation = fromMeido.Maid.transform.rotation;
|
|
|
SetMune();
|
|
|
}
|
|
|
|
|
|
- public void SetPoseCustom(string path)
|
|
|
+ public void SetMune(bool drag = false)
|
|
|
{
|
|
|
- if (!Maid.body0.isLoadedBody) return;
|
|
|
- byte[] bytes = File.ReadAllBytes(path);
|
|
|
- string hash = Path.GetFileName(path).GetHashCode().ToString();
|
|
|
- Maid.body0.CrossFade(hash, bytes, false, true, false, 0f);
|
|
|
- Maid.SetAutoTwistAll(true);
|
|
|
- SetMune();
|
|
|
+ bool momiOrPaizuri = CachedPose.Pose.Contains("_momi") || CachedPose.Pose.Contains("paizuri_");
|
|
|
+ float onL = (drag || momiOrPaizuri) ? 0f : 1f;
|
|
|
+ Body.MuneYureL(onL);
|
|
|
+ Body.MuneYureR(onL);
|
|
|
+ Body.jbMuneL.enabled = !drag;
|
|
|
+ Body.jbMuneR.enabled = !drag;
|
|
|
}
|
|
|
|
|
|
- public void SetMune(bool drag = false)
|
|
|
+ public void SetHandPreset(string filename, bool right)
|
|
|
+ {
|
|
|
+ XDocument handDocument = XDocument.Load(filename);
|
|
|
+ XElement handElement = handDocument.Element("FingerData");
|
|
|
+ if (handElement.IsEmpty || handElement.Element("GameVersion").IsEmpty
|
|
|
+ || handElement.Element("RightData").IsEmpty || handElement.Element("BinaryData").IsEmpty
|
|
|
+ ) return;
|
|
|
+
|
|
|
+ Stop = true;
|
|
|
+
|
|
|
+ bool rightData = bool.Parse(handElement.Element("RightData").Value);
|
|
|
+ string base64Data = handElement.Element("BinaryData").Value;
|
|
|
+
|
|
|
+ byte[] handData = Convert.FromBase64String(base64Data);
|
|
|
+
|
|
|
+ IKManager.DeserializeHand(handData, right, rightData != right);
|
|
|
+ }
|
|
|
+
|
|
|
+ public byte[] SerializePose(bool frameBinary = false)
|
|
|
{
|
|
|
- bool isMomiOrPaizuri = CachedPose.Pose.Contains("_momi") || CachedPose.Pose.Contains("paizuri_");
|
|
|
- float onL = (drag || isMomiOrPaizuri) ? 0f : 1f;
|
|
|
- Maid.body0.MuneYureL(onL);
|
|
|
- Maid.body0.MuneYureR(onL);
|
|
|
- Maid.body0.jbMuneL.enabled = !drag;
|
|
|
- Maid.body0.jbMuneR.enabled = !drag;
|
|
|
+ CacheBoneDataArray cache = GetCacheBoneData();
|
|
|
+ return frameBinary ? cache.GetFrameBinary(true, true) : cache.GetAnmBinary(true, true);
|
|
|
}
|
|
|
|
|
|
public void SetFaceBlendSet(string blendSet)
|
|
|
{
|
|
|
FaceBlendSet = blendSet;
|
|
|
Maid.boMabataki = false;
|
|
|
- TMorph morph = Maid.body0.Face.morph;
|
|
|
+ TMorph morph = Body.Face.morph;
|
|
|
morph.EyeMabataki = 0f;
|
|
|
morph.MulBlendValues(blendSet, 1f);
|
|
|
morph.FixBlendValues_Face();
|
|
@@ -316,7 +272,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
|
|
|
public void SetFaceBlendValue(string hash, float value)
|
|
|
{
|
|
|
- TMorph morph = Maid.body0.Face.morph;
|
|
|
+ TMorph morph = Body.Face.morph;
|
|
|
if (hash == "nosefook")
|
|
|
{
|
|
|
morph.boNoseFook = value > 0f;
|
|
@@ -342,60 +298,83 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
morph.FixBlendValues_Face();
|
|
|
}
|
|
|
|
|
|
- public void SetMaskMode(TBody.MaskMode maskMode)
|
|
|
+ public void SetMaskMode(MaskMode maskMode)
|
|
|
{
|
|
|
- TBody body = Maid.body0;
|
|
|
- bool invisibleBody = !body.GetMask(TBody.SlotID.body);
|
|
|
- body.SetMaskMode(maskMode);
|
|
|
+ bool invisibleBody = !Body.GetMask(SlotID.body);
|
|
|
+ Body.SetMaskMode(maskMode);
|
|
|
if (invisibleBody) SetBodyMask(false);
|
|
|
}
|
|
|
|
|
|
public void SetBodyMask(bool enabled)
|
|
|
{
|
|
|
- TBody body = Maid.body0;
|
|
|
- Hashtable table = Utility.GetFieldValue<TBody, Hashtable>(body, "m_hFoceHide");
|
|
|
- foreach (TBody.SlotID bodySlot in MaidDressingPane.bodySlots)
|
|
|
+ Hashtable table = Utility.GetFieldValue<TBody, Hashtable>(Body, "m_hFoceHide");
|
|
|
+ foreach (SlotID bodySlot in MaidDressingPane.bodySlots)
|
|
|
{
|
|
|
table[bodySlot] = enabled;
|
|
|
}
|
|
|
- if (body.goSlot[19].m_strModelFileName.Contains("melala_body"))
|
|
|
+ if (Body.goSlot[19].m_strModelFileName.Contains("melala_body"))
|
|
|
{
|
|
|
- table[TBody.SlotID.accHana] = enabled;
|
|
|
+ table[SlotID.accHana] = enabled;
|
|
|
}
|
|
|
- body.FixMaskFlag();
|
|
|
- body.FixVisibleFlag(false);
|
|
|
+ Body.FixMaskFlag();
|
|
|
+ Body.FixVisibleFlag(false);
|
|
|
}
|
|
|
|
|
|
- public Transform GetBoneTransform(AttachPoint point) => this.dragPointManager?.GetAttachPointTransform(point);
|
|
|
+ public void SetCurling(Curl curling, bool enabled)
|
|
|
+ {
|
|
|
+ string[] name = curling == Curl.shift
|
|
|
+ ? new[] { "panz", "mizugi" }
|
|
|
+ : new[] { "skirt", "onepiece" };
|
|
|
+ if (enabled)
|
|
|
+ {
|
|
|
+ string action = curling == Curl.shift
|
|
|
+ ? "パンツずらし" : curling == Curl.front
|
|
|
+ ? "めくれスカート" : "めくれスカート後ろ";
|
|
|
+ Maid.ItemChangeTemp(name[0], action);
|
|
|
+ Maid.ItemChangeTemp(name[1], action);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Maid.ResetProp(name[0]);
|
|
|
+ Maid.ResetProp(name[1]);
|
|
|
+ }
|
|
|
+ Maid.AllProcProp();
|
|
|
+ }
|
|
|
|
|
|
- private void OnBodyLoad()
|
|
|
+ private CacheBoneDataArray GetCacheBoneData()
|
|
|
{
|
|
|
- BodyLoad?.Invoke(this, EventArgs.Empty);
|
|
|
+ CacheBoneDataArray cache = this.Maid.gameObject.GetComponent<CacheBoneDataArray>();
|
|
|
+ if (cache == null)
|
|
|
+ {
|
|
|
+ cache = this.Maid.gameObject.AddComponent<CacheBoneDataArray>();
|
|
|
+ cache.CreateCache(this.Maid.body0.GetBone("Bip01"));
|
|
|
+ }
|
|
|
+ return cache;
|
|
|
+ }
|
|
|
|
|
|
+ private void OnBodyLoad()
|
|
|
+ {
|
|
|
if (!initialized)
|
|
|
{
|
|
|
- TMorph morph = Maid.body0.Face.morph;
|
|
|
- this.BlendValuesBackup = Utility.GetFieldValue<TMorph, float[]>(morph, "BlendValuesBackup");
|
|
|
- this.BlendValues = Utility.GetFieldValue<TMorph, float[]>(morph, "BlendValues");
|
|
|
-
|
|
|
- this.DefaultEyeRotL = this.Maid.body0.quaDefEyeL;
|
|
|
- this.DefaultEyeRotR = this.Maid.body0.quaDefEyeR;
|
|
|
+ TMorph faceMorph = Body.Face.morph;
|
|
|
+ BlendValuesBackup = Utility.GetFieldValue<TMorph, float[]>(faceMorph, "BlendValuesBackup");
|
|
|
+ BlendValues = Utility.GetFieldValue<TMorph, float[]>(faceMorph, "BlendValues");
|
|
|
+ DefaultEyeRotL = Body.quaDefEyeL;
|
|
|
+ DefaultEyeRotR = Body.quaDefEyeR;
|
|
|
initialized = true;
|
|
|
}
|
|
|
|
|
|
- this.IsIK = true;
|
|
|
- this.IsStop = false;
|
|
|
- this.IsBone = false;
|
|
|
- }
|
|
|
+ IKManager.Initialize();
|
|
|
|
|
|
- private void OnUpdateMeido(MeidoUpdateEventArgs args = null)
|
|
|
- {
|
|
|
- this.UpdateMeido?.Invoke(this, args ?? MeidoUpdateEventArgs.Empty);
|
|
|
+ IK = true;
|
|
|
+ Stop = false;
|
|
|
+ Bone = false;
|
|
|
+ Loading = false;
|
|
|
}
|
|
|
|
|
|
- private void OnMeidoSelect(object sender, MeidoUpdateEventArgs args)
|
|
|
+ public void OnUpdateMeido(MeidoUpdateEventArgs args = null)
|
|
|
{
|
|
|
- UpdateMeido?.Invoke(this, args);
|
|
|
+ this.UpdateMeido?.Invoke(this, args ?? MeidoUpdateEventArgs.Empty);
|
|
|
}
|
|
|
}
|
|
|
|