fixed pose saving

This commit is contained in:
Katboi01
2023-12-30 14:35:50 +01:00
parent 812de090d2
commit cfecfffd46
2 changed files with 23 additions and 19 deletions
+22 -18
View File
@@ -88,17 +88,19 @@ public class UIPoseContainer : MonoBehaviour
if (container == null) return; if (container == null) return;
var poseData = new PoseData(); var poseData = new PoseData()
poseData.Name = NameLabel.text; {
poseData.Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); Name = NameLabel.text,
poseData.Character = container.name; Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"),
poseData.Description = DescriptionLabel.text; Character = container.name,
poseData.ViewerVersion = Application.version; Description = DescriptionLabel.text,
poseData.Bones = container.SaveBones(); ViewerVersion = Application.version,
poseData.Morphs = container.SaveMorphs(true); Bones = container.SaveBones(),
Morphs = container.SaveMorphs(true)
};
var duplicateContainer = CheckIfContainerExists(poseData.Name); var duplicateContainer = CheckIfContainerExists(poseData.Name);
if (duplicateContainer != this) if (duplicateContainer != null && duplicateContainer != this)
{ {
UmaViewerUI.Instance.ShowMessage($"Another save exists with name {poseData.Name}", UIMessageType.Error); UmaViewerUI.Instance.ShowMessage($"Another save exists with name {poseData.Name}", UIMessageType.Error);
return; return;
@@ -129,17 +131,19 @@ public class UIPoseContainer : MonoBehaviour
if (container == null) return; if (container == null) return;
var poseData = new PoseData(); var poseData = new PoseData()
poseData.Name = NameLabel.text; {
poseData.Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); Name = NameLabel.text,
poseData.Character = container.name; Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"),
poseData.Description = DescriptionLabel.text; Character = container.name,
poseData.ViewerVersion = Application.version; Description = DescriptionLabel.text,
poseData.Bones = container.SaveBones(); ViewerVersion = Application.version,
poseData.Morphs = container.SaveMorphs(true); Bones = container.SaveBones(),
Morphs = container.SaveMorphs(true)
};
var duplicateContainer = CheckIfContainerExists(poseData.Name); var duplicateContainer = CheckIfContainerExists(poseData.Name);
if (duplicateContainer != this) if (duplicateContainer != null && duplicateContainer != this)
{ {
UmaViewerUI.Instance.ShowMessage($"Another save exists with name {poseData.Name}", UIMessageType.Error); UmaViewerUI.Instance.ShowMessage($"Another save exists with name {poseData.Name}", UIMessageType.Error);
return; return;
+1 -1
View File
@@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 2.1.10 bundleVersion: 2.1.11
preloadedAssets: [] preloadedAssets: []
metroInputSource: 0 metroInputSource: 0
wsaTransparentSwapchain: 0 wsaTransparentSwapchain: 0