Search Unity

Simulate app suspend and resume in Unity play mode

Discussion in 'VR' started by W3dge_, Oct 15, 2018.

  1. W3dge_

    W3dge_

    Joined:
    Aug 2, 2018
    Posts:
    2
    Hello everyone,

    Do you know if it is possible to simulate an UWP app suspend and resume event in Unity ? This would help me a lot because I wouldn't need to build a new release each time I have a bug related to this pause/resume mechanism.

    Thanks.
    Joran.
     
  2. ivan20071

    ivan20071

    Joined:
    Nov 15, 2017
    Posts:
    29
    Hi,
    you can simulate suspend and resume event with VS debugger.
    You must open the Debug Location toolbar
    upload_2018-10-16_9-15-30.png
    upload_2018-10-16_9-19-41.png
    Ivan
     
  3. W3dge_

    W3dge_

    Joined:
    Aug 2, 2018
    Posts:
    2
    Hi Ivan,

    Thanks for the answer, though I'm not sure if it is exactly what I was looking for. With your solution I probably need to make a UWP build and run in it either in the headset or in a emulator.

    But in my case, I would like to remain in the Unity play mode and generate those events. It might simply just not be possible.

    Joran.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Suspend/resume concepts don't exist on Windows desktop applications (and that's what Unity editor is). The one thing I could suggest would be to bind a key to editor to invoke your specific events, but I'm not sure how accurate such a simulation would be.
     
  5. ivan20071

    ivan20071

    Joined:
    Nov 15, 2017
    Posts:
    29
    Hi,
    yes with my solution you must make a UWP build.
    As mentioned by Tautvydas-Zilys when you are in Unity play mode you don't have a uwp app but a desktop application and suspend/resume concepts don't exist on Windows desktop applications.
    Ivan