Search Unity

Everyplay not showing correct recording..

Discussion in 'Unity Everyplay' started by carking1996, Aug 15, 2017.

  1. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Hello, I start the game, recording everyplay, then I stop if the player dies, goes to the menu, or beats the level. If I go to another level, beat it, and then go to view the video using the code below, it shows the first time it recorded, every time.

    Code (CSharp):
    1.  
    2. void Start(){
    3.     if (Everyplay.IsSupported ()) {
    4.          Everyplay.SetLowMemoryDevice (true);
    5.          Everyplay.ReadyForRecording += OnReadyForRecording;
    6.     }
    7. }
    8.  
    9. public void OnReadyForRecording(bool enabled) {
    10.       if(enabled) {
    11.         // The recording is supported
    12.         Everyplay.StartRecording ();
    13.     }
    14. }
    15.  
    16. public void EndRecording(){
    17.     Everyplay.StopRecording ();
    18. }
    19.  
    20. public void ShareReplay(){
    21.     print ("Sharing");
    22.     Everyplay.PlayLastRecording ();
    23. }
     
    Last edited: Aug 15, 2017
  2. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Gonna bump this a bit early.. this is kinda a big issue.
     
  3. Nkon

    Nkon

    Unity Technologies

    Joined:
    Jun 12, 2017
    Posts:
    65
    Hi there,

    thanks for the messages.

    The OnReadyForRecording event happens when the app is started and Everyplay has finished setting itself up. So, in order to record the second level you need to call Everyplay.StartRecording() when the player starts the level instead.

    You could use something like this to do it:
    Code (CSharp):
    1.  
    2. public void OnLevelStarted()
    3. {
    4.     if (Everyplay.IsReadyForRecording())
    5.         Everyplay.StartRecording();
    6. }
    7.  
    Then call OnLevelStarted() at the appropriate time.

    Cheers,
    Niko