Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

New Device Simulator (preview)

Discussion in '2019.3 Beta' started by JC-Cimetiere, Sep 26, 2019.

  1. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    934
    Why do use an inconsistent naming convention? i.e. "Apple iPhone 7" and "iPhone 8"

    Makes it harder to find the devices since they're ordered by name.

    [EDIT]

    Scratch that, just updated to the latest and it has been fixed.
     
  2. Deleted User

    Deleted User

    Guest

    Not supported so far, noted.
     
    Lars-Steenhoff and User340 like this.
  3. Gamezaur

    Gamezaur

    Joined:
    Oct 12, 2016
    Posts:
    22
    This is actually more important than you might think. Having the side panel always visible takes the precious screen space and it makes the game widow really small. Can you give this a higher priority please?
     
  4. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    934
    Yeah, I'm having issues with the large size of the window as well. The large majority options are never used - I basically just switch between devices - and they just sit there taking precious screen space.
     
    ReneBaumgartner likes this.
  5. Deleted User

    Deleted User

    Guest

    We do realize it's important. So we already have a fix for it, should be included in the next release.
     
  6. Sebastian1989101

    Sebastian1989101

    Joined:
    Sep 5, 2017
    Posts:
    12
    Am I the only one without the simulator option (see screenshot)? I'm using 2019.3.0b8 and the package manager does not show very much.
     

    Attached Files:

  7. Deleted User

    Deleted User

    Guest

    Seems like you're missing a lot of packages, not just device simulator.
    upload_2019-10-28_15-21-41.png
     
  8. Tony_Max

    Tony_Max

    Joined:
    Feb 7, 2017
    Posts:
    334
    I use Unity Remote for debug Gyro input. So would be nice if this package will support Gyro with some sort of Instruments (like rotation gyzmo for example).
    One another thing i would like is support of TouchScreenKeyBoard (if it even possible in terms of simulating device).
     
    Noisecrime and brunocoimbra like this.
  9. Sebastian1989101

    Sebastian1989101

    Joined:
    Sep 5, 2017
    Posts:
    12
    Unity seems to have problems with the self signed certificate from our firewall. I can't even sign in in Unity. I have added this packages with my laptop in my home office, afterwards it was able to restore them also from the company network (the packages UI is still pretty empty).
     
  10. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,554
    Hi, after selecting a device the Screen API is simulated, however I wonder why Screen.width and Screen.height seems to be outputting some value I can't figure out where they came from. I have to use Screen.currentResolution to get the simulated screen size.
     
  11. DrTomato

    DrTomato

    Joined:
    May 24, 2017
    Posts:
    12
    Are the overlays supposed to show up by default? I can't seem to get the overlays to show, nor does the highlight safe area work. I see the png files for the overlays in com.unity.device-simulator@1.2.0-preview\.DeviceDefinitions but can't find a way to use them with the device simulator. Tried setting the device directory to this path as well to no avail.
     

    Attached Files:

    the_mr_matt likes this.
  12. the_mr_matt

    the_mr_matt

    Joined:
    Jul 21, 2015
    Posts:
    124
    I'm having the same issue. Using 2019.3b11 and Device Simulator 1.2.0 preview.
     
  13. Deleted User

    Deleted User

    Guest

    It's a known issue started from 2019.3.0b10, so some thing on the unity side broke the usage of the package.
    We will have a 1.3.0 release this week to have it fixed. Will post here once the new version is out.
     
    the_mr_matt and DrTomato like this.
  14. Deleted User

    Deleted User

    Guest

    Could you please submit a bug report then we can look into it? Thanks.
     
  15. Gamezaur

    Gamezaur

    Joined:
    Oct 12, 2016
    Posts:
    22
    @Vincent-Zhang so the new version is out with the option to hide the settings.. But why on earth do you show the settings panel it EVERY TIME when entering the playmode? What is the point of the hide button if it shows itself all the time? This is absurd :(
     
    luispedrofonseca likes this.
  16. Deleted User

    Deleted User

    Guest

    Yes... Will fix it in next release, probably next week.
     
  17. honyapeke

    honyapeke

    Joined:
    Apr 17, 2018
    Posts:
    1
    Thank you for great feature. This is exactly what I wanted.
    But I have the issue in Unity 2019.3.0b12 + Device Simulator 1.3.0, simulator view is broken when camera is rotated.
    Here is video I recorded :


    This issue happens easily to me, does anyone else have same problem? (or my environment / settings wrong?)
    Sorry about my poor English, thanks :)
     
  18. Deleted User

    Deleted User

    Guest

    Didn't see that before... Could you please report a bug for it with reproducible project? Thanks.
     
  19. justaguygames

    justaguygames

    Joined:
    Mar 4, 2015
    Posts:
    21
    When I click the play button the simulator rendering disappears, am I doing something wrong?
     
    AdrienMgm likes this.
  20. eli_123

    eli_123

    Joined:
    Oct 25, 2016
    Posts:
    5
    upload_2019-12-1_16-4-6.png
    Could you please make the scale value editable so we can just type it in?
     
    Peter77 likes this.
  21. eli_123

    eli_123

    Joined:
    Oct 25, 2016
    Posts:
    5
    It seems like Input.GetKeyDown(KeyCode...) doesn't work when playing in Simulator view.
    P.S. I need to use keyboard input to trigger/simulate some gameplay events.
     
  22. mashcroft

    mashcroft

    Joined:
    Oct 3, 2019
    Posts:
    1
    I am also having this issue. Was able to reproduce on multiple projects I created.
     
  23. Gamezaur

    Gamezaur

    Joined:
    Oct 12, 2016
    Posts:
    22
    I would also like to report that the phone "overlay" is cropped on the top or bottom (depending on the scene).
    Zrzut ekranu 2019-12-4 o 10.45.12.png
    Zrzut ekranu 2019-12-4 o 10.45.35.png
     

    Attached Files:

  24. Deleted User

    Deleted User

    Guest

    Sounds like familiar to a bug we fixed this week. IMO either creating a bug report now or waiting for the next release to verify is ok, up to you. :)
     
    honyapeke likes this.
  25. Deleted User

    Deleted User

    Guest

    Would you like to elaborate more clearly? Creating a bug with a project which can reproduce this issue is also good.
     
  26. Deleted User

    Deleted User

    Guest

    Ok, I will bring this to internal discussion and get back to you later.
     
  27. Deleted User

    Deleted User

    Guest

    We now only support the simplest mouse click... Will add more Input support in the future.
     
    Vedran_M and V_i_T like this.
  28. Deleted User

    Deleted User

    Guest

    Can you share you configurations, like the simulated phone you used, the scale etc.? Thanks.
     
  29. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    Device Simulator 2.0.0-preview released
    Minimum supported Unity versions are now 2019.3.0f1 and 2020.1.0a15.

    Added
    Changed
    • device.json format. The new format is incompatible with the old one.
    Fixed
    • Null reference exception when certain fields were omitted from device.json file.
    • Main camera transform affecting and corrupting device rendering.
    • Control panel stays hidden after domain reload.
     
    Peter77 likes this.
  30. Gamezaur

    Gamezaur

    Joined:
    Oct 12, 2016
    Posts:
    22
    The cutouts no longer happen with newest version.

    There is another problem, though. The game in simulator window is pixelated. Only 100% and 50% it is sharp like in the game view.
     
  31. ericnondahl

    ericnondahl

    Joined:
    Jan 13, 2017
    Posts:
    9
    This is great. Testing out the 2.0.0 preview - Input Handling would be a nice focus area for future versions.
    * Is there a way to lock the device scale so that mouse scroll wheel events can be passed to the game (for zoom testing?)
    * Similarly it would be nice to have a way to simulate pinch gestures (two touches.)
     
    btschumy and patrykszylindev like this.
  32. moproductions

    moproductions

    Joined:
    Sep 28, 2010
    Posts:
    72
    Is there a way we can use it to simulate multi-touch? Having to make a build every time to test multi-touch functionality is honestly one of the biggest headaches I encounter doing mobile development.
     
  33. Deleted User

    Deleted User

    Guest

    I'm not seeing Pixel 4 or Pixel 4 XL in Device list
     
    Miguel_TagaiArts likes this.
  34. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    That's strange, I've just tried printing cutouts while simulating iPhone XR and Galaxy S10+, both return correct values. Could you please provide more detailed steps, so we can reproduce the issue?
     
  35. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    Thank you for your feedback.

    At the moment we don't support multi-touch simulation.

    Can't say anything concrete about multi-touch support, but we will definitely look into it.

    This is not currently possible. We will keep this in mind, thank you.
     
  36. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    We don't have Pixel 4 or Pixel 4XL in the simulator at the moment. I will scan it in as soon as I can get my hands on one.
     
    Deleted User likes this.
  37. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    There is a different path that we use for inserting fake values for Screen.width and Screen.height. We set the resolution when we render the "Game view" and those values are propagated to the game code. The code that does that is on the native side of the engine. You should be able to get correct resolution while querying Screen.width and Screen.height in your game scripts.
     
  38. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    934
    I'm seeing a noticeable difference in performance while in Simulator mode compared to the regular Game view. Both are using the iPhone 6S resolution (1334x750). Any idea of what's causing it?
     
  39. JotaRata

    JotaRata

    Joined:
    Dec 8, 2014
    Posts:
    61
    Does it simulate touches as well?
     
  40. Deleted User

    Deleted User

    Guest

    So bascially the game view and simulator view are using the same rendering code... We built the simulator ui based on UIElement, not sure if it's related. Could you please report a bug for this with steps how to reproduce the performance difference? We definitely want to look into it.
     
  41. Deleted User

    Deleted User

    Guest

    Not for now, but we will look into it.
     
  42. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    140
    Hi. I've just tried the Device Simulator but everything is flipped (the Game View is working correctly). What's wrong?

     
  43. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,745
    What happens if you unclick "portrait upside down?"
     
  44. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    140
    No effect, still the same.
     
  45. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    140
    One more weird issue: although the screen is visually flipped, all the gameobject positions are not, e.g. I just blindly click on an expected-correct position of a button and it actually responds :|
     
  46. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    140
    I guess this is not an expected solution eventually, but is there any way to force Unity (2018.4.14f1) to trick the game into using the safe area as the full screen area that it can use (scarifying the top and bottom area - as in older games). I just want to make a real quick fix for this temporarily (I am not the original author of this game I'm working on so it takes time to make it 100% working with notch screens). Thanks.
     
  47. Deleted User

    Deleted User

    Guest

    Can't think of anything, never seen that before, especially with the overlay image with the notch rendered correctly... Could you please report a bug then we can look into it?

    Btw, could you please switch to the game view then switch back to the simulator view (by using the dropdown list at the top-left) to see if the issue is gone?
     
    Last edited by a moderator: Jan 6, 2020
  48. n-gist

    n-gist

    Joined:
    Mar 7, 2016
    Posts:
    41
    Same here. Can't provide project for testing, but here is some things i tested.
    Unity 2019.3.0f4, URP, Windows10, project have Application.targetFrameRate = 60; and it have internal fps counter based on
    DateTime.UtcNow changes, counting MonoBehaviour Update calls dividing by time passed.
    1. Fps meter shows 60 in Play mode. Stop.
    2. Installed Device Simulator and Custom NUnit packages.
    3. Play, just to check if it still shows 60. Stop.
    4. Switch Game window mode to Simulator, setting iPhone X for example. Switch it back to Game mode (even if not hitting Play in Simulator mode).
    5. Play, now fps meter shows about 35 fps in my case.
    From this state it is able to get back 60 fps if i uninstall package or restart Editor, but if i switch once to Simulator mode, fps drops to 35 again.
    Unity Stats window shows 150fps, about 6.2ms for CPU and 0.5ms for render thread when it have 60fps in-game, and about 140fps, 6.7ms CPU, 0.5ms for rt when it have 35fps in-game. Not much difference in stats window, but it is really a performance drop noticeable by eye.
    Don't know if it is connected, but if i hide Scene window, then fps goes back to 60. Maybe powers just enough to cover drops in this case. Thanks for package, will be using it in production.
     
    Last edited: Jan 11, 2020
  49. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    934
    Happens on all projects so I don't have anything specific to submit. I'm on an iMac Pro with a Vega 64, if that helps.
     
  50. Deleted User

    Deleted User

    Guest

    Thanks! We will have a look.
     
    Miguel_TagaiArts likes this.