|
@@ -29,24 +29,41 @@ public class WindowPartsFaceMorph : MonoBehaviour
|
|
|
}
|
|
|
this.SetPhotoFaceData(PhotoFaceData.Get(long.Parse(storeData["id"])));
|
|
|
this.CreateBackupData(maid);
|
|
|
+ List<BlendData> blendDatas = maid.body0.Face.morph.BlendDatas;
|
|
|
+ Dictionary<string, int> dictionary = new Dictionary<string, int>();
|
|
|
+ for (int i = 0; i < blendDatas.Count; i++)
|
|
|
+ {
|
|
|
+ if (blendDatas[i] != null)
|
|
|
+ {
|
|
|
+ if (!dictionary.ContainsKey(blendDatas[i].name))
|
|
|
+ {
|
|
|
+ dictionary.Add(blendDatas[i].name, i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.blendIdDictionary.ContainsKey(maid.status.guid))
|
|
|
+ {
|
|
|
+ this.blendIdDictionary.Add(maid.status.guid, new Dictionary<string, int>());
|
|
|
+ }
|
|
|
+ this.blendIdDictionary[maid.status.guid] = dictionary;
|
|
|
if (!isDeserializeLoad)
|
|
|
{
|
|
|
- for (int i = 0; i < this.propValInput.Length; i++)
|
|
|
+ for (int j = 0; j < this.propValInput.Length; j++)
|
|
|
{
|
|
|
- for (int j = 0; j < this.propValInput[i].SliderAndInput.Length; j++)
|
|
|
+ for (int k = 0; k < this.propValInput[j].SliderAndInput.Length; k++)
|
|
|
{
|
|
|
- WindowPartsInputSliderSet.SliderAndInputSet sliderAndInputSet = this.propValInput[i].SliderAndInput[j];
|
|
|
+ WindowPartsInputSliderSet.SliderAndInputSet sliderAndInputSet = this.propValInput[j].SliderAndInput[k];
|
|
|
storeData.Add("morph_val_" + sliderAndInputSet.Name, this.GetValue(maid, sliderAndInputSet.Name).ToString("G9"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- for (int k = 0; k < this.propValInput.Length; k++)
|
|
|
+ for (int l = 0; l < this.propValInput.Length; l++)
|
|
|
{
|
|
|
- for (int l = 0; l < this.propValInput[k].SliderAndInput.Length; l++)
|
|
|
+ for (int m = 0; m < this.propValInput[l].SliderAndInput.Length; m++)
|
|
|
{
|
|
|
- WindowPartsInputSliderSet.SliderAndInputSet sliderAndInputSet2 = this.propValInput[k].SliderAndInput[l];
|
|
|
+ WindowPartsInputSliderSet.SliderAndInputSet sliderAndInputSet2 = this.propValInput[l].SliderAndInput[m];
|
|
|
this.SetValue(maid, sliderAndInputSet2.Name, float.Parse(storeData["morph_val_" + sliderAndInputSet2.Name]));
|
|
|
}
|
|
|
}
|
|
@@ -134,14 +151,18 @@ public class WindowPartsFaceMorph : MonoBehaviour
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ Dictionary<string, int> dictionary = this.blendIdDictionary[maid.status.guid];
|
|
|
for (int i = 0; i < this.propValInput.Length; i++)
|
|
|
{
|
|
|
for (int j = 0; j < this.propValInput[i].SliderAndInput.Length; j++)
|
|
|
{
|
|
|
string name = this.propValInput[i].SliderAndInput[j].Name;
|
|
|
PhotoSliderAndInput sliderAndInput = this.propValInput[i].GetSliderAndInput(name);
|
|
|
- sliderAndInput.ResetNum = this.backupBlendSets[maid.status.guid][this.selectData.setting_name][this.blendIdDictionary[name]];
|
|
|
+ sliderAndInput.ResetNum = this.backupBlendSets[maid.status.guid][this.selectData.setting_name][dictionary[name]];
|
|
|
+ List<Action<float>> onChangeValue = sliderAndInput.onChangeValue;
|
|
|
+ sliderAndInput.onChangeValue = new List<Action<float>>();
|
|
|
sliderAndInput.value = this.GetValue(maid, name);
|
|
|
+ sliderAndInput.onChangeValue = onChangeValue;
|
|
|
this.faceWindow.GetMaidStoreData(maid)["morph_val_" + name] = sliderAndInput.value.ToString("G9");
|
|
|
}
|
|
|
}
|
|
@@ -158,21 +179,8 @@ public class WindowPartsFaceMorph : MonoBehaviour
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- if (this.blendIdDictionary.Count <= 0)
|
|
|
- {
|
|
|
- List<BlendData> blendDatas = maid.body0.Face.morph.BlendDatas;
|
|
|
- for (int i = 0; i < blendDatas.Count; i++)
|
|
|
- {
|
|
|
- if (blendDatas[i] != null)
|
|
|
- {
|
|
|
- if (!this.blendIdDictionary.ContainsKey(blendDatas[i].name))
|
|
|
- {
|
|
|
- this.blendIdDictionary.Add(blendDatas[i].name, i);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.selectData.BlendArray(maid)[this.blendIdDictionary[name]] = val;
|
|
|
+ Dictionary<string, int> dictionary = this.blendIdDictionary[maid.status.guid];
|
|
|
+ this.selectData.BlendArray(maid)[dictionary[name]] = val;
|
|
|
}
|
|
|
|
|
|
private float GetValue(Maid maid, string name)
|
|
@@ -181,21 +189,8 @@ public class WindowPartsFaceMorph : MonoBehaviour
|
|
|
{
|
|
|
return 0f;
|
|
|
}
|
|
|
- if (this.blendIdDictionary.Count <= 0)
|
|
|
- {
|
|
|
- List<BlendData> blendDatas = maid.body0.Face.morph.BlendDatas;
|
|
|
- for (int i = 0; i < blendDatas.Count; i++)
|
|
|
- {
|
|
|
- if (blendDatas[i] != null)
|
|
|
- {
|
|
|
- if (!this.blendIdDictionary.ContainsKey(blendDatas[i].name))
|
|
|
- {
|
|
|
- this.blendIdDictionary.Add(blendDatas[i].name, i);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return this.selectData.BlendArray(maid)[this.blendIdDictionary[name]];
|
|
|
+ Dictionary<string, int> dictionary = this.blendIdDictionary[maid.status.guid];
|
|
|
+ return this.selectData.BlendArray(maid)[dictionary[name]];
|
|
|
}
|
|
|
|
|
|
public bool visible
|
|
@@ -218,7 +213,7 @@ public class WindowPartsFaceMorph : MonoBehaviour
|
|
|
|
|
|
private FaceWindow faceWindow;
|
|
|
|
|
|
- private Dictionary<string, int> blendIdDictionary = new Dictionary<string, int>();
|
|
|
+ private Dictionary<string, Dictionary<string, int>> blendIdDictionary = new Dictionary<string, Dictionary<string, int>>();
|
|
|
|
|
|
private Dictionary<string, Dictionary<string, float[]>> backupBlendSets = new Dictionary<string, Dictionary<string, float[]>>();
|
|
|
|