|
@@ -86,7 +86,7 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
mMaidC[k].obj = gMaidC[k];
|
|
mMaidC[k].obj = gMaidC[k];
|
|
gMaidC[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
|
|
gMaidC[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
|
|
gMaidC[k].GetComponent<Renderer>().material =
|
|
gMaidC[k].GetComponent<Renderer>().material =
|
|
- new Material(Shader.Find("Transparent/Diffuse")) {color = new Color(0.5f, 0.5f, 1f, 0.8f)};
|
|
|
|
|
|
+ new Material(Shader.Find("Transparent/Diffuse")) { color = new Color(0.5f, 0.5f, 1f, 0.8f) };
|
|
gMaidC[k].layer = 8;
|
|
gMaidC[k].layer = 8;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -96,7 +96,10 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
{
|
|
{
|
|
gFinger[k, index] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
|
gFinger[k, index] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
|
if (index % 3 != 0)
|
|
if (index % 3 != 0)
|
|
|
|
+ {
|
|
;
|
|
;
|
|
|
|
+ }
|
|
|
|
+
|
|
mFinger[k, index] = gFinger[k, index].AddComponent<MouseDrag>();
|
|
mFinger[k, index] = gFinger[k, index].AddComponent<MouseDrag>();
|
|
mFinger[k, index].obj = gFinger[k, index];
|
|
mFinger[k, index].obj = gFinger[k, index];
|
|
float num = 0.0f;
|
|
float num = 0.0f;
|
|
@@ -153,7 +156,7 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
}
|
|
}
|
|
|
|
|
|
gFinger[k, index].transform.localScale = new Vector3(num, num, num);
|
|
gFinger[k, index].transform.localScale = new Vector3(num, num, num);
|
|
- var material = new Material(Shader.Find("Transparent/Diffuse"));
|
|
|
|
|
|
+ Material material = new Material(Shader.Find("Transparent/Diffuse"));
|
|
gFinger[k, index].GetComponent<Renderer>().material = material;
|
|
gFinger[k, index].GetComponent<Renderer>().material = material;
|
|
gFinger[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
|
|
gFinger[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
|
|
}
|
|
}
|
|
@@ -193,7 +196,7 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
}
|
|
}
|
|
|
|
|
|
gFinger2[k, index].transform.localScale = new Vector3(num, num, num);
|
|
gFinger2[k, index].transform.localScale = new Vector3(num, num, num);
|
|
- var material = new Material(Shader.Find("Transparent/Diffuse"));
|
|
|
|
|
|
+ Material material = new Material(Shader.Find("Transparent/Diffuse"));
|
|
gFinger2[k, index].GetComponent<Renderer>().material = material;
|
|
gFinger2[k, index].GetComponent<Renderer>().material = material;
|
|
gFinger2[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
|
|
gFinger2[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
|
|
}
|
|
}
|
|
@@ -201,12 +204,18 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
|
|
|
private void SetIKInit(int k)
|
|
private void SetIKInit(int k)
|
|
{
|
|
{
|
|
- var material = new Material(Shader.Find("Transparent/Diffuse"));
|
|
|
|
- material.color = new Color(0.4f, 0.4f, 1f, 0.3f);
|
|
|
|
- m_material2 = new Material(Shader.Find("Transparent/Diffuse"));
|
|
|
|
- m_material2.color = new Color(0.4f, 0.4f, 1f, 0.26f);
|
|
|
|
- m_material3 = new Material(Shader.Find("Transparent/Diffuse"));
|
|
|
|
- m_material3.color = new Color(0.4f, 0.4f, 1f, 0.36f);
|
|
|
|
|
|
+ Material material = new Material(Shader.Find("Transparent/Diffuse"))
|
|
|
|
+ {
|
|
|
|
+ color = new Color(0.4f, 0.4f, 1f, 0.3f)
|
|
|
|
+ };
|
|
|
|
+ m_material2 = new Material(Shader.Find("Transparent/Diffuse"))
|
|
|
|
+ {
|
|
|
|
+ color = new Color(0.4f, 0.4f, 1f, 0.26f)
|
|
|
|
+ };
|
|
|
|
+ m_material3 = new Material(Shader.Find("Transparent/Diffuse"))
|
|
|
|
+ {
|
|
|
|
+ color = new Color(0.4f, 0.4f, 1f, 0.36f)
|
|
|
|
+ };
|
|
gHandL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
|
gHandL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
|
gHandL[k].GetComponent<Renderer>().enabled = false;
|
|
gHandL[k].GetComponent<Renderer>().enabled = false;
|
|
gHandL[k].layer = 8;
|
|
gHandL[k].layer = 8;
|
|
@@ -304,28 +313,28 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
gClavicleR[k].GetComponent<Renderer>().material = m_material2;
|
|
gClavicleR[k].GetComponent<Renderer>().material = m_material2;
|
|
}
|
|
}
|
|
|
|
|
|
- var gameObject1 = new GameObject();
|
|
|
|
|
|
+ GameObject gameObject1 = new GameObject();
|
|
gameObject1.transform.SetParent(transform, false);
|
|
gameObject1.transform.SetParent(transform, false);
|
|
gizmoHandL[k] = gameObject1.AddComponent<GizmoRender>();
|
|
gizmoHandL[k] = gameObject1.AddComponent<GizmoRender>();
|
|
gizmoHandL[k].eRotate = true;
|
|
gizmoHandL[k].eRotate = true;
|
|
gizmoHandL[k].offsetScale = 0.25f;
|
|
gizmoHandL[k].offsetScale = 0.25f;
|
|
gizmoHandL[k].lineRSelectedThick = 0.25f;
|
|
gizmoHandL[k].lineRSelectedThick = 0.25f;
|
|
gizmoHandL[k].Visible = false;
|
|
gizmoHandL[k].Visible = false;
|
|
- var gameObject2 = new GameObject();
|
|
|
|
|
|
+ GameObject gameObject2 = new GameObject();
|
|
gameObject2.transform.SetParent(transform, false);
|
|
gameObject2.transform.SetParent(transform, false);
|
|
gizmoHandR[k] = gameObject2.AddComponent<GizmoRender>();
|
|
gizmoHandR[k] = gameObject2.AddComponent<GizmoRender>();
|
|
gizmoHandR[k].eRotate = true;
|
|
gizmoHandR[k].eRotate = true;
|
|
gizmoHandR[k].offsetScale = 0.25f;
|
|
gizmoHandR[k].offsetScale = 0.25f;
|
|
gizmoHandR[k].lineRSelectedThick = 0.25f;
|
|
gizmoHandR[k].lineRSelectedThick = 0.25f;
|
|
gizmoHandR[k].Visible = false;
|
|
gizmoHandR[k].Visible = false;
|
|
- var gameObject3 = new GameObject();
|
|
|
|
|
|
+ GameObject gameObject3 = new GameObject();
|
|
gameObject3.transform.SetParent(transform, false);
|
|
gameObject3.transform.SetParent(transform, false);
|
|
gizmoFootL[k] = gameObject3.AddComponent<GizmoRender>();
|
|
gizmoFootL[k] = gameObject3.AddComponent<GizmoRender>();
|
|
gizmoFootL[k].eRotate = true;
|
|
gizmoFootL[k].eRotate = true;
|
|
gizmoFootL[k].offsetScale = 0.25f;
|
|
gizmoFootL[k].offsetScale = 0.25f;
|
|
gizmoFootL[k].lineRSelectedThick = 0.25f;
|
|
gizmoFootL[k].lineRSelectedThick = 0.25f;
|
|
gizmoFootL[k].Visible = false;
|
|
gizmoFootL[k].Visible = false;
|
|
- var gameObject4 = new GameObject();
|
|
|
|
|
|
+ GameObject gameObject4 = new GameObject();
|
|
gameObject4.transform.SetParent(transform, false);
|
|
gameObject4.transform.SetParent(transform, false);
|
|
gizmoFootR[k] = gameObject4.AddComponent<GizmoRender>();
|
|
gizmoFootR[k] = gameObject4.AddComponent<GizmoRender>();
|
|
gizmoFootR[k].eRotate = true;
|
|
gizmoFootR[k].eRotate = true;
|
|
@@ -476,9 +485,12 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
private void CopyIK(Maid maid, int i, Maid maid2, int i2)
|
|
private void CopyIK(Maid maid, int i, Maid maid2, int i2)
|
|
{
|
|
{
|
|
poseIndex[i] = poseIndex[i2];
|
|
poseIndex[i] = poseIndex[i2];
|
|
- if (!(bool) maid || !maid.Visible)
|
|
|
|
|
|
+ if (!maid || !maid.Visible)
|
|
|
|
+ {
|
|
return;
|
|
return;
|
|
- var strArray = poseArray[poseIndex[i]].Split(',');
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ string[] strArray = poseArray[poseIndex[i]].Split(',');
|
|
isStop[i] = false;
|
|
isStop[i] = false;
|
|
if (strArray[0].Contains("_momi") || strArray[0].Contains("paizuri_"))
|
|
if (strArray[0].Contains("_momi") || strArray[0].Contains("paizuri_"))
|
|
{
|
|
{
|
|
@@ -494,10 +506,10 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
if (strArray[0].Contains("MultipleMaidsPose"))
|
|
if (strArray[0].Contains("MultipleMaidsPose"))
|
|
{
|
|
{
|
|
string path = strArray[0].Split('/')[1];
|
|
string path = strArray[0].Split('/')[1];
|
|
- var numArray = new byte[0];
|
|
|
|
|
|
+ byte[] numArray = new byte[0];
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
|
|
|
|
|
|
+ using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
|
|
{
|
|
{
|
|
numArray = new byte[fileStream.Length];
|
|
numArray = new byte[fileStream.Length];
|
|
fileStream.Read(numArray, 0, numArray.Length);
|
|
fileStream.Read(numArray, 0, numArray.Length);
|
|
@@ -509,19 +521,20 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
{
|
|
{
|
|
long hashCode = Path.GetFileName(path).GetHashCode();
|
|
long hashCode = Path.GetFileName(path).GetHashCode();
|
|
maid.body0.CrossFade(hashCode.ToString(), numArray, false, false, false, 0.0f, 1f);
|
|
maid.body0.CrossFade(hashCode.ToString(), numArray, false, false, false, 0.0f, 1f);
|
|
- var autoTwistArray = new Maid.AutoTwist[6]
|
|
|
|
|
|
+ Maid.AutoTwist[] autoTwistArray = new Maid.AutoTwist[6]
|
|
{
|
|
{
|
|
Maid.AutoTwist.ShoulderL, Maid.AutoTwist.ShoulderR, Maid.AutoTwist.WristL, Maid.AutoTwist.WristR,
|
|
Maid.AutoTwist.ShoulderL, Maid.AutoTwist.ShoulderR, Maid.AutoTwist.WristL, Maid.AutoTwist.WristR,
|
|
Maid.AutoTwist.ThighL, Maid.AutoTwist.ThighR
|
|
Maid.AutoTwist.ThighL, Maid.AutoTwist.ThighR
|
|
};
|
|
};
|
|
foreach (Maid.AutoTwist f_eType in autoTwistArray)
|
|
foreach (Maid.AutoTwist f_eType in autoTwistArray)
|
|
|
|
+ {
|
|
maid.SetAutoTwist(f_eType, true);
|
|
maid.SetAutoTwist(f_eType, true);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- int result;
|
|
|
|
- if (strArray[0].StartsWith("p") && int.TryParse(strArray[0].Substring(1), out result))
|
|
|
|
|
|
+ if (strArray[0].StartsWith("p") && int.TryParse(strArray[0].Substring(1), out int result))
|
|
{
|
|
{
|
|
loadPose[i] = strArray[0];
|
|
loadPose[i] = strArray[0];
|
|
}
|
|
}
|
|
@@ -531,8 +544,11 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if (!(bool) maid.body0.m_Bones.GetComponent<Animation>().GetClip(strArray[0] + ".anm"))
|
|
|
|
|
|
+ if (!maid.body0.m_Bones.GetComponent<Animation>().GetClip(strArray[0] + ".anm"))
|
|
|
|
+ {
|
|
maid.body0.LoadAnime(strArray[0] + ".anm", GameUty.FileSystem, strArray[0] + ".anm", false, false);
|
|
maid.body0.LoadAnime(strArray[0] + ".anm", GameUty.FileSystem, strArray[0] + ".anm", false, false);
|
|
|
|
+ }
|
|
|
|
+
|
|
maid.body0.m_Bones.GetComponent<Animation>().Play(strArray[0] + ".anm");
|
|
maid.body0.m_Bones.GetComponent<Animation>().Play(strArray[0] + ".anm");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -607,11 +623,17 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
Vector3 localEulerAngles20 = HandR1[i2].localEulerAngles;
|
|
Vector3 localEulerAngles20 = HandR1[i2].localEulerAngles;
|
|
Vector3 localEulerAngles21 = HandL2[i2].localEulerAngles;
|
|
Vector3 localEulerAngles21 = HandL2[i2].localEulerAngles;
|
|
Vector3 localEulerAngles22 = HandR2[i2].localEulerAngles;
|
|
Vector3 localEulerAngles22 = HandR2[i2].localEulerAngles;
|
|
- var vector3Array = new Vector3[40];
|
|
|
|
|
|
+ Vector3[] vector3Array = new Vector3[40];
|
|
for (int index = 0; index < 20; ++index)
|
|
for (int index = 0; index < 20; ++index)
|
|
|
|
+ {
|
|
vector3Array[index] = Finger[i2, index].localEulerAngles;
|
|
vector3Array[index] = Finger[i2, index].localEulerAngles;
|
|
|
|
+ }
|
|
|
|
+
|
|
for (int index = 20; index < 40; ++index)
|
|
for (int index = 20; index < 40; ++index)
|
|
|
|
+ {
|
|
vector3Array[index] = Finger[i2, index].localEulerAngles;
|
|
vector3Array[index] = Finger[i2, index].localEulerAngles;
|
|
|
|
+ }
|
|
|
|
+
|
|
Vector3 eulerAngles10 = UpperArmL1[i2].eulerAngles;
|
|
Vector3 eulerAngles10 = UpperArmL1[i2].eulerAngles;
|
|
Vector3 eulerAngles11 = ForearmL1[i2].eulerAngles;
|
|
Vector3 eulerAngles11 = ForearmL1[i2].eulerAngles;
|
|
Vector3 eulerAngles12 = UpperArmR1[i2].eulerAngles;
|
|
Vector3 eulerAngles12 = UpperArmR1[i2].eulerAngles;
|
|
@@ -654,9 +676,15 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
HandL2[i].localEulerAngles = localEulerAngles21;
|
|
HandL2[i].localEulerAngles = localEulerAngles21;
|
|
HandR2[i].localEulerAngles = localEulerAngles22;
|
|
HandR2[i].localEulerAngles = localEulerAngles22;
|
|
for (int index = 0; index < 20; ++index)
|
|
for (int index = 0; index < 20; ++index)
|
|
|
|
+ {
|
|
Finger[i, index].localEulerAngles = vector3Array[index];
|
|
Finger[i, index].localEulerAngles = vector3Array[index];
|
|
|
|
+ }
|
|
|
|
+
|
|
for (int index = 20; index < 40; ++index)
|
|
for (int index = 20; index < 40; ++index)
|
|
|
|
+ {
|
|
Finger[i, index].localEulerAngles = vector3Array[index];
|
|
Finger[i, index].localEulerAngles = vector3Array[index];
|
|
|
|
+ }
|
|
|
|
+
|
|
transform20.localEulerAngles = localEulerAngles1;
|
|
transform20.localEulerAngles = localEulerAngles1;
|
|
transform21.localEulerAngles = localEulerAngles2;
|
|
transform21.localEulerAngles = localEulerAngles2;
|
|
transform22.localEulerAngles = localEulerAngles3;
|
|
transform22.localEulerAngles = localEulerAngles3;
|
|
@@ -747,11 +775,17 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
Vector3 localEulerAngles20 = HandR1[i].localEulerAngles;
|
|
Vector3 localEulerAngles20 = HandR1[i].localEulerAngles;
|
|
Vector3 localEulerAngles21 = HandL2[i].localEulerAngles;
|
|
Vector3 localEulerAngles21 = HandL2[i].localEulerAngles;
|
|
Vector3 localEulerAngles22 = HandR2[i].localEulerAngles;
|
|
Vector3 localEulerAngles22 = HandR2[i].localEulerAngles;
|
|
- var vector3Array = new Vector3[40];
|
|
|
|
|
|
+ Vector3[] vector3Array = new Vector3[40];
|
|
for (int index = 0; index < 20; ++index)
|
|
for (int index = 0; index < 20; ++index)
|
|
|
|
+ {
|
|
vector3Array[index] = Finger[i, index].localEulerAngles;
|
|
vector3Array[index] = Finger[i, index].localEulerAngles;
|
|
|
|
+ }
|
|
|
|
+
|
|
for (int index = 20; index < 40; ++index)
|
|
for (int index = 20; index < 40; ++index)
|
|
|
|
+ {
|
|
vector3Array[index] = Finger[i, index].localEulerAngles;
|
|
vector3Array[index] = Finger[i, index].localEulerAngles;
|
|
|
|
+ }
|
|
|
|
+
|
|
Vector3 eulerAngles12 = UpperArmL1[i].eulerAngles;
|
|
Vector3 eulerAngles12 = UpperArmL1[i].eulerAngles;
|
|
Vector3 eulerAngles13 = ForearmL1[i].eulerAngles;
|
|
Vector3 eulerAngles13 = ForearmL1[i].eulerAngles;
|
|
Vector3 eulerAngles14 = UpperArmR1[i].eulerAngles;
|
|
Vector3 eulerAngles14 = UpperArmR1[i].eulerAngles;
|
|
@@ -760,8 +794,8 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
Vector3 eulerAngles17 = ForearmL2[i].eulerAngles;
|
|
Vector3 eulerAngles17 = ForearmL2[i].eulerAngles;
|
|
Vector3 eulerAngles18 = UpperArmR2[i].eulerAngles;
|
|
Vector3 eulerAngles18 = UpperArmR2[i].eulerAngles;
|
|
Vector3 eulerAngles19 = ForearmR2[i].eulerAngles;
|
|
Vector3 eulerAngles19 = ForearmR2[i].eulerAngles;
|
|
- transform21.eulerAngles = new Vector3((float) (360.0 - (eulerAngles11.x + 270.0) - 270.0),
|
|
|
|
- (float) (360.0 - (eulerAngles11.y + 90.0) - 90.0),
|
|
|
|
|
|
+ transform21.eulerAngles = new Vector3((float)(360.0 - (eulerAngles11.x + 270.0) - 270.0),
|
|
|
|
+ (float)(360.0 - (eulerAngles11.y + 90.0) - 90.0),
|
|
360f - eulerAngles11.z);
|
|
360f - eulerAngles11.z);
|
|
transform1.eulerAngles = getHanten(eulerAngles10);
|
|
transform1.eulerAngles = getHanten(eulerAngles10);
|
|
transform2.eulerAngles = getHanten(eulerAngles9);
|
|
transform2.eulerAngles = getHanten(eulerAngles9);
|
|
@@ -778,9 +812,15 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
HandR2[i].localEulerAngles = getHanten2(localEulerAngles21);
|
|
HandR2[i].localEulerAngles = getHanten2(localEulerAngles21);
|
|
HandL2[i].localEulerAngles = getHanten2(localEulerAngles22);
|
|
HandL2[i].localEulerAngles = getHanten2(localEulerAngles22);
|
|
for (int index = 0; index < 20; ++index)
|
|
for (int index = 0; index < 20; ++index)
|
|
|
|
+ {
|
|
Finger[i, index].localEulerAngles = getHanten2(vector3Array[index + 20]);
|
|
Finger[i, index].localEulerAngles = getHanten2(vector3Array[index + 20]);
|
|
|
|
+ }
|
|
|
|
+
|
|
for (int index = 20; index < 40; ++index)
|
|
for (int index = 20; index < 40; ++index)
|
|
|
|
+ {
|
|
Finger[i, index].localEulerAngles = getHanten2(vector3Array[index - 20]);
|
|
Finger[i, index].localEulerAngles = getHanten2(vector3Array[index - 20]);
|
|
|
|
+ }
|
|
|
|
+
|
|
transform4.localEulerAngles = getHanten2(localEulerAngles1);
|
|
transform4.localEulerAngles = getHanten2(localEulerAngles1);
|
|
transform3.localEulerAngles = getHanten2(localEulerAngles2);
|
|
transform3.localEulerAngles = getHanten2(localEulerAngles2);
|
|
transform6.localEulerAngles = getHanten2(localEulerAngles3);
|
|
transform6.localEulerAngles = getHanten2(localEulerAngles3);
|