getsocial-im / getsocial-capture

The project goal is to let Unity developers record GIFs of gameplay of their game for easy sharing between friends.
https://www.getsocial.im
Apache License 2.0
124 stars 30 forks source link

Sample game project #4

Open DhGhost opened 5 years ago

DhGhost commented 5 years ago

On the flappy bird game sample I have the loop playback off/unchecked but it still plays it twice in a row, then stops. [edit - using version 2018.2.18 and some bugs that might be the problem: [Singleton] An instance of GetSocialSdk.Scripts.Internal.Util.MainThreadExecutor is needed in the scene, so '(singleton) GetSocialSdk.Scripts.Internal.Util.MainThreadExecutor (UnityEngine.GameObject)' was created with DontDestroyOnLoad. UnityEngine.Debug:Log(Object) GetSocialSdk.Scripts.Internal.Util.Singleton1:get_Instance() (at Assets/GetSocialCapture/Scripts/Internal/Util/Singleton.cs:54) GetSocialSdk.Scripts.Internal.Util.Singleton1:LoadInstance() (at Assets/GetSocialCapture/Scripts/Internal/Util/Singleton.cs:18) GetSocialSdk.Scripts.Internal.Util.MainThreadExecutor:Init() (at Assets/GetSocialCapture/Scripts/Internal/Util/MainThreadExecutor.cs:16) ]

On adjusting speed- I would like to only vary the speed in the preview box (like normal, slow, or 2x speed) which could obviously be done using the playback frame Rate, but the 'get social capture' is what would determine the initial speed and quality of the playback, so say for a game with a 2 minute timer to complete the level, what would the optimal 'capture frame rate' be to have the best capture of animations etc to represent exactly 2 minutes when played back at normal speed?

Also, is there a way to sync the preview box size to the camera viewing size, to minimize distortion or just doing it manually (ex using a 16:9 aspect ratio calculator to find the size of the box).

edit- and where can we find the filesize of the generated video?

DhGhost commented 5 years ago

Added this coroutine code to the GameControl.cs inside the flappy bird 'sampleapp', replacing the BirdDied() function, so that the death animation would fully complete before the recording stopped and playback started:

 public void BirdDied()
{
// pause for death animation to finish
    StartCoroutine(WaitforFinish());
    }
   IEnumerator WaitforFinish()
{
    // wait for 2 seconds
    yield return new WaitForSeconds(2);
    //Activate the game over text.
    gameOvertext.SetActive(true);
    //Set the game to be over.
    gameOver = true;
    // stop recording
    _capture.StopCapture();
    capturePreview.Play();
}