1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  3. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  4. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  5. Unity 5.5 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  7. Unity 5.6 beta is now available for download.
    Dismiss Notice

Everplay Restart Time

Discussion in 'Unity Everyplay' started by skillbow, Jan 26, 2017.

  1. skillbow

    skillbow

    Joined:
    Dec 2, 2014
    Posts:
    3
    I've noticed that stopping and starting Everyplay too quickly keeps the old recording, even when Everyplay.StopRecording() and then Everyplay.StartRecording() is called on a new session. Is there a way to check whether the previous recording has stopped? I've tried registering for the Everyplay.ReadyForRecording event but it never seems to be called.

    This is a big problem for me as my game allows players to restart a level very quickly. If they then go on to win the level on their next try, the previous failed try is the recording that shows.
     
  2. skillbow

    skillbow

    Joined:
    Dec 2, 2014
    Posts:
    3
    If anyone is interested, I've solved this problem. You simply need to make a small delay before starting Everyplay recording after stopping. Something like this:

    Code (CSharp):
    1.  
    2.     public void startEveryplayRecording ()
    3.     {
    4.         if(Everyplay.IsReadyForRecording()) {
    5.             StartCoroutine(startEveryplayDelayed());
    6.         } else {
    7.             Everyplay.ReadyForRecording += startEveryplayRecordingAfterEvent;
    8.         }
    9.     }
    10.  
    11.     IEnumerator startEveryplayDelayed ()
    12.     {
    13.         float pauseEndTime = Time.realtimeSinceStartup + 1.2f;
    14.         while (Time.realtimeSinceStartup < pauseEndTime) {
    15.             yield return 0;
    16.         }
    17.  
    18.         Everyplay.StartRecording();
    19.  
    20.         yield return null;
    21.     }
    22. ...
    23.  
     
  3. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    96
    Everyplay should take this internally into account however it is best that you don't start a new recording before you have received RecordingStopped event.
     
    skillbow likes this.
  4. skillbow

    skillbow

    Joined:
    Dec 2, 2014
    Posts:
    3
    Thanks pmjo - don't know why I've only just spotted this but thanks for the response.