Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 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:
    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:
    113
    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.