gif and eyebrow bug fix

This commit is contained in:
CroakFang
2023-11-01 01:36:24 +08:00
parent e850c2f72d
commit ec0e9b0e61
3 changed files with 37 additions and 29 deletions
+3 -2
View File
@@ -29,8 +29,9 @@ public class Screenshot : MonoBehaviour
string fileName = Application.dataPath + "/../Screenshots/" + string.Format("UmaViewer_{0}", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss-fff"));
byte[] pngShot = ImageConversion.EncodeToPNG(image);
Directory.CreateDirectory(Application.dataPath + "/../Screenshots");
File.WriteAllBytes(fileName + ".png", pngShot);
var fullpath = $"{fileName}.png";
File.WriteAllBytes(fullpath, pngShot);
UmaViewerUI.Instance.ShowMessage($"Screenshot saved: {fullpath}", UIMessageType.Success);
Destroy(image);
}
+3 -2
View File
@@ -39,9 +39,10 @@ namespace uGIF
while(bytes == null) yield return new WaitForEndOfFrame();
string fileName = Application.dataPath + "/../Screenshots/" + string.Format("UmaViewer_{0}", DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss-fff"));
Directory.CreateDirectory(Application.dataPath + "/../Screenshots");
File.WriteAllBytes(fileName + ".gif", bytes);
var fullpath = $"{fileName}.gif";
File.WriteAllBytes(fullpath, bytes);
bytes = null;
Debug.Log("Gif saved!");
UmaViewerUI.Instance.ShowMessage($"GIF saved: {fullpath}", UIMessageType.Success);
Frames.Clear();
stop = false;
UmaViewerUI.Instance.GifButton.GetComponentInChildren<TMPro.TextMeshProUGUI>().text = "Record GIF";