Chman / Moments

A quick GIF replay recorder for Unity
zlib License
856 stars 118 forks source link

not working on a phone #21

Open mouseoffun opened 5 years ago

mouseoffun commented 5 years ago

I have been using Moments and it's great- thanks. But it's not creating a gif when running on my phone, only on pc. I really don't understand what's wrong and there are no errors being created. I guess this is the bit that has the issue: private void startGifEncoding() { InstructionsText.enabled = false; WaitText.enabled = true; FBButton.enabled = false;

GalleryButton.enabled = false;

_progressBarHolder.SetActive(true); ProgressBar.fillAmount = 0; _gifRecorder.OnPreProcessingDone += gifDone; _gifRecorder.OnFileSaved += gifSaved; _gifRecorder.OnFileSaveProgress += progressUpdated; _gifRecorder.Save("GamePlayCapture"); }

Any help is gratefully received!

ForestGameDev commented 4 years ago

For anyone facing this, I managed to make it work, I did two changes, not sure if both are needed.

First I stopped using a Thread in Worker.cs, as I normally avoid creating additional threads by myself in Unity. In my case, I'm fine to freeze my app a bit while creating the gif.

Second I changed the separator "/" in Recorder.cs, under PreProcess method, instead of using "/" I used Path.DirectorySeparatorChar like this:

string filepath = SaveFolder + Path.DirectorySeparatorChar + filename + ".gif";

You will need to add using System.IO;

CzYoL6 commented 3 years ago

The saving process is not working after been built into a Windows standalone, (m_progress is 0), any idea why

CzYoL6 commented 3 years ago

The saving process is not working after been built into a Windows standalone, (m_progress is 0), any idea why

OK, I got it. I manually changed the save path(added '/Capture'), but the default path in a standalone is Application.persistentDataPath, so the directory doesn''t exist. I have to check and create it myself. 无标题 无标题1