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. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    319
    Actually it's working already for One Finger! That is an awesome feature for testing my games (Unity Remote does not work for me when using Android) so this replaces it.

    But it would be interesting to simulate Multi-Touch someway!
     
  2. GreedyVox

    GreedyVox

    Joined:
    Nov 18, 2015
    Posts:
    28
    Also having the same issue.
    Using Unity Linux Editor and UI Elements for the GUI.
    Changing from Game view to Simulator doesn't work, always flipped when in Simulator view, but not flipped in Game view.

    Hope this is helpful, BTW thank you for this package, it's really awesome!

    UPDATE:
    After changing my Unity Editor from using OpenGL to Vulkan through the Player Settings, everything is working, no more flipping.
     
    Last edited: Jan 27, 2020
  3. justadaniel

    justadaniel

    Joined:
    Aug 19, 2015
    Posts:
    11
    I hope it's not too late, but could we have the ability to turn off safe area on the canvas so we could have UI both inside and outside the safe area? (backgrounds use the full display, and buttons in the safe area)
     
  4. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    801
    Hi, Device Simulator is pretty great!
    However, it seems that new input system is fully unsupported right now (and for a while, https://forum.unity.com/threads/new-device-simulator-preview.751067/#post-5010323).

    This leads to the weird situation of having to use Game View to click on UGUI elements, and then switching to Simulator view for seeing everything with the right DPI etc.

    (clicking on "old" IMGUI elements work, it's just UGUI not working)
     
  5. pixelsage

    pixelsage

    Joined:
    Jan 28, 2014
    Posts:
    8
    Just here to state I am having the same issue where the preview is flipped on both axis on the Device Simulator. I didn't have an option to use Vulkan through the Player Settings, so your solution unfortunately is unavailable to me.
     
  6. whizzkid74

    whizzkid74

    Joined:
    Jun 7, 2017
    Posts:
    2
    I also noticed that Application.isEditor gets set to False when the Device Simulator window is open. is that by design? or a bug?
     
  7. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    If I change the Application Settings - System Language Dropdown to any other language from English and then hit play, as soon as it starts the Language resets back to English, and once I stop the game it stays as English.

    Unity 2019.3.0f6
    Device Simulator preview - 2.0.0
     
  8. KimballMiridia

    KimballMiridia

    Joined:
    Sep 24, 2019
    Posts:
    3
    I was running into the same problem and running a Mac, I was able to get it fixed by going into Project Settings > Player > Settings for PC... > Other Settings > and then checking Metal Editor Support.
     
  9. Lukas-Labaj

    Lukas-Labaj

    Joined:
    Nov 22, 2012
    Posts:
    36
    Hi, got some error in our project :
    Library\PackageCache\com.unity.device-simulator@2.0.0-preview\Editor\DeviceDatabase.cs(114,33): error CS0168: The variable 'e' is declared but never used

    Device Simulator version 2.0.0
     
  10. igor_rst

    igor_rst

    Joined:
    Apr 20, 2017
    Posts:
    40
    Have the same issue, 2019.3.0f6
    In Game view everything correct
     
  11. igor_rst

    igor_rst

    Joined:
    Apr 20, 2017
    Posts:
    40
    Yeah, it's true
    After option change simulator works correctly
     
  12. Deleted User

    Deleted User

    Guest

    yeah, only one finger for old input system. We've put input system integration in the to-do list.
     
  13. Deleted User

    Deleted User

    Guest

    We have a toolbar toggle to disable/enable the safe are, not sure if it's what you want...
     
  14. Deleted User

    Deleted User

    Guest

    It's on purpose if simulator is active, as we're in simulation mode. Is there any problem with this?
     
  15. Deleted User

    Deleted User

    Guest

    It's a known issue and will be fixed in next release.
     
    Lukas-Labaj likes this.
  16. Deleted User

    Deleted User

    Guest

    We will look into it.
     
  17. Deleted User

    Deleted User

    Guest

    Yep. We do have something not be restored after entering playmode. We haven't decided what can be restored yet... Any feedback are welcomed!
     
  18. ericnondahl

    ericnondahl

    Joined:
    Jan 13, 2017
    Posts:
    9
    Would it be feasible to have an additional multi-rectangle safe area option? If you want to tuck things under the phone notch on some devices, a rectangular safe area is not specific enough to hit that visual goal.

    Some phones like the Galaxy S10e have a camera in the corner, some phones have a notch in the middle - if this multi-rectangle safe area data was available, smarter decisions could be made about putting UI closer to the available space.
     
  19. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    341
    I don't understand what you are saying?
    Right now the Language Dropdown is pointless as changing it does nothing.
     
  20. kodagames

    kodagames

    Joined:
    Jul 8, 2009
    Posts:
    548
    I was just using this beautiful monster and realized that my touch event were firing when using the mouse (mind blown and thank you for this), hmm... clicks register as touches, Im so intrigued I wonder if the left mouse being down while dragging would register as a touch moved?

    Thank you for this unity and everything else :D
     
  21. kodagames

    kodagames

    Joined:
    Jul 8, 2009
    Posts:
    548
    Hello,

    Im love this to be able to go back and forth between the game view and the simulator to test for PC and Smart Devices :D Absolutely amazing!
    I do have a minor issue as I use Playaker to create games and that is in a Touch Event the Touch Phase "Stationary" doesn't seem to fire when the mouse stops moving. The others: Begin, Moved and Ended all work fantastic including swipe gestures! Crazy Kool!
     
    Last edited: Feb 19, 2020
  22. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    140
    Further update:

    I've found that only the iPhone X series (X, XR, XS, XS Max, iPhone 11) have this wrong flip problem:



    The other devices (iPad, iPhone 6/7/8, etc.. and Android ones) display correctly:


    I've tried ticking the Metal Editor like other user's said but no luck.
     
  23. David_CGA

    David_CGA

    Joined:
    Apr 27, 2018
    Posts:
    7
    I'm using Unity 2019.3.1f1 with Device simulator 2.0.0 preview
    I'm having peformance issues in the editor
    I can have the package in the project and it runs fine in the game view, but as soon as I change to the simulator view the peformance drops massivly
    I will attach my profiler log as proof of the difference between have it in game view and simulator view
    Also going back to game view without unplaying the game the frame rate is still very low, there is 0.9mb of GC done for each frame for the RenderPipelineManager

    I'm not sure if this issue should be logged with this package or the RenderPipeline if this GC Alloc is the issue in the profiler

    Link to the Profile Data log
    This log file is 100MBs large but I tried to keep the recording from the profiler short
     
  24. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    934
    @David_CGA I reported the same issue some time ago and unfortunately no reply yet. Out of curiosity, are you on Windows or Mac?
     
  25. David_CGA

    David_CGA

    Joined:
    Apr 27, 2018
    Posts:
    7
    I'm using Windows 10
     
  26. Daan-Gijzen

    Daan-Gijzen

    Joined:
    Apr 6, 2017
    Posts:
    3
    So when I import the package and view my project in the Simulator view, then everything is mirrored and upside down......


    WHY? :(
     
    Xarbrough likes this.
  27. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    I've noticed, that Input.deviceOrientation does not seem to return the fake values from the Device Simulator in my own scripts, only every returns 'unknown'. Isn't this supported? The SafeArea works fine, but I'd also like to check for the mocked orientation in my user scripts.
     
    Daan-Gijzen likes this.
  28. esg_evan

    esg_evan

    Joined:
    Sep 29, 2016
    Posts:
    3
    Hey, first off, thanks for the great tool!

    Unfortunately I have to report that we're experiencing very large memory leaks when using the Device Simulator in Play Mode in Unity 2019.3.0f6 (on both Windows and Mac).

    - Leaving the editor running in Play Mode with the Device Simulator window open causes Unity to constantly use up more memory (it varies, but I've seen ~1-2 MB per second).
    - Switching back to the Game window stops the leak from getting worse.
    - Switching back to the Device Simulator again causes the memory consumption to resume increasing immediately.
    - Leaving Play Mode frees up memory again.
     
  29. MikePage_Artrix

    MikePage_Artrix

    Joined:
    Mar 18, 2016
    Posts:
    15
    I have the exact same thing - it was working now suddenly mirrored and upside down.

    Answered my own question:

    I was running in OpenGL ES 3.2 mode since I'm working on Android. Swapping the editor back to DX11 fixes the issue
     
    drallcom3 likes this.
  30. drallcom3

    drallcom3

    Joined:
    Feb 12, 2017
    Posts:
    162
    Huh, you're right. Setting Windows to "Auto graphics API", even if your platform is Android, fixes the bug. My Windows was set to OpenGL3.
     
  31. Deleted User

    Deleted User

    Guest

    Could you please report a bug with a repro project? Then we can track it.
     
  32. Froghuto

    Froghuto

    Joined:
    Oct 4, 2012
    Posts:
    61
    After opening the Device Simulator once the performance of the Timeline Window is really bad when interacting with it (the profiler shows it happens during repaint).
     
  33. anisimovdev

    anisimovdev

    Joined:
    Mar 4, 2013
    Posts:
    22
    Hi again, I am glad to see that my request 'hiding options' was implemented.
    I found a bug, this is not critical, but if we enable "Fit to Screen", then maximize the window and then go back, this does not fit correctly and needs to be adjusted manually.
     

    Attached Files:

    luispedrofonseca likes this.
  34. Deleted User

    Deleted User

    Guest

    Coud you please report a bug? Thanks.
     
  35. anisimovdev

    anisimovdev

    Joined:
    Mar 4, 2013
    Posts:
    22
    Yes for sure. Case 1227475. Thank you.
     
    Deleted User likes this.
  36. anisimovdev

    anisimovdev

    Joined:
    Mar 4, 2013
    Posts:
    22
    Will there be compatibility with “Rendering outside the safe zone” in Android Player Settings in the future?
    upload_2020-3-13_11-34-8.png
     
    SniperED007 likes this.
  37. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    204
    This is a great starting point, but there's 3 things on my wishlist.
    1) a "Simulate physical size" button where the display is simulated 1:1 to device size
    2) A BetterCanvasScaler that respects the DPI of the device simulator's simulated physical size (or just making the CanvasScaler do this by default)
    3) built-in Unity scripts that work on Canvas panels to handle offset/scaling of safe area

    I've been using a modified version of the SafeAreaHelper tool up til now:
    https://assetstore.unity.com/packages/tools/gui/safe-area-helper-130488
     
  38. LexaMV

    LexaMV

    Joined:
    Feb 20, 2018
    Posts:
    28
    Hi,

    We need to add our device with a resolution of 3000x4000. Yes, it does not exist in nature)))) We need to test the background of the game. We tried to add it ourselves by copying and editing json, but unity removes all devices that are probably different from this list. How do we do this?
     
  39. Deleted User

    Deleted User

    Guest

    > but unity removes all devices that are probably different from this list.
    Which list are you referring to? Anyway, I don't think we remove devices from the dropdown list, can you give more details how you did that? As in the daily work, I sometimes copied and modified the json files for my own, should just work IMO.
     
  40. LexaMV

    LexaMV

    Joined:
    Feb 20, 2018
    Posts:
    28
    In folder Library\PackageCache\com.unity.device-simulator@2.1.0-preview\.DeviceDefinitions i see all devices.
    Next, copy 1 of the devices, rename json and the cover and modify it to fit your needs.
    The first time it was deleted (could not repeat), the second time it called My left, but now I don’t see it in the device simulator.
     
  41. Deleted User

    Deleted User

    Guest

    I would encourage you to use the `customized device directory`. https://docs.unity3d.com/Packages/com.unity.device-simulator@2.0/manual/index.html, just search for `Preferences`, you will see where you can find it.
     
  42. MFG-jkhoo

    MFG-jkhoo

    Joined:
    Jul 15, 2016
    Posts:
    19
    I'm getting compilation errors when trying to do a device build with 2.2.0-preview and Unity 2019.3.7f1:

    It looks like this Unity.DeviceSimulator.Tests.Common is set for Any Platform, but has a dependency on Unity.DeviceSimulator.Editor
    Screen Shot 2020-03-27 at 2.12.46 PM.png
     
  43. lazyninjacat

    lazyninjacat

    Joined:
    Feb 8, 2019
    Posts:
    4
    Ohhh, multi-touch simulation would be awesome.
     
  44. frank-ijsfontein

    frank-ijsfontein

    Joined:
    Sep 11, 2015
    Posts:
    16
    Is there a way to have the simulated device automatically rotate to the orientation I specify, when it was rotated differently, like by calling
    Screen.orientation = ScreenOrientation.Portrait
    when the simulated device was in landscape mode?
     
  45. MassiveTchnologies

    MassiveTchnologies

    Joined:
    Jul 5, 2016
    Posts:
    87
    UnityEngine.iOS.Device.generation returns "Unknown" which renders the package useless for our case. Any plan to support it?
     
  46. IJsLauw

    IJsLauw

    Joined:
    May 31, 2015
    Posts:
    15
    We noticed that it also simulates touch... is it possible to somehow simulate multitouch?

    Alt-clicking was really helpful while using touchscript for example
     
  47. IJsLauw

    IJsLauw

    Joined:
    May 31, 2015
    Posts:
    15
    Or at least allow us to use Input.GetKey so we can differentiate between different touch interactions using the mouse. Or am I going about the wrong way and are there alternatives?
     
  48. petrinordlund

    petrinordlund

    Joined:
    Apr 23, 2020
    Posts:
    2
    I'd like to be able to disable the mouse wheel for zooming in the simulator, we use the mouse wheel in our game to zoom in/out in the editor as pinch-zooming won't obviously work.
     
  49. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    Funnily enough, I came here to ask how we disable the mouse-wheel zoom and let our game consume the input. Our game makes heavy use of mouse wheel for in-editor testing (pinch-zoom on device) and so the simulator isn't currently useful.
     
  50. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    Ah, two users post the same question about a front-of-the-box 2019.3 feature. No response in (essentially) a week. I'll file a bug report. They usually DO get good responses at some point in the future.