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;
var poseData = new PoseData();
poseData.Name = NameLabel.text;
poseData.Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
poseData.Character = container.name;
poseData.Description = DescriptionLabel.text;
poseData.ViewerVersion = Application.version;
poseData.Bones = container.SaveBones();
poseData.Morphs = container.SaveMorphs(true);
var poseData = new PoseData()
{
Name = NameLabel.text,
Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"),
Character = container.name,
Description = DescriptionLabel.text,
ViewerVersion = Application.version,
Bones = container.SaveBones(),
Morphs = container.SaveMorphs(true)
};
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);
return;
@@ -129,17 +131,19 @@ public class UIPoseContainer : MonoBehaviour
if (container == null) return;
var poseData = new PoseData();
poseData.Name = NameLabel.text;
poseData.Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
poseData.Character = container.name;
poseData.Description = DescriptionLabel.text;
poseData.ViewerVersion = Application.version;
poseData.Bones = container.SaveBones();
poseData.Morphs = container.SaveMorphs(true);
var poseData = new PoseData()
{
Name = NameLabel.text,
Date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"),
Character = container.name,
Description = DescriptionLabel.text,
ViewerVersion = Application.version,
Bones = container.SaveBones(),
Morphs = container.SaveMorphs(true)
};
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);
return;
+1 -1
View File
@@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 2.1.10
bundleVersion: 2.1.11
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0