1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

Everplay Restart Time

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

  1. skillbow

    skillbow

    Joined:
    Dec 2, 2014
    Posts:
    7
    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:
    7
    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:
    110
    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:
    7
    Thanks pmjo - don't know why I've only just spotted this but thanks for the response.