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

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,000
    Well this is disappointing to hear.

    So I guess we're reverting back to the bad old days of Unity, where we are unable to modify or build on top of the code as most of it will be marked internal without serious hoop jumping via reflection and stuck waiting for Unity to fix simple bugs or issues for half a decade.

    Not your fault but this whole package business has been a total screw up from start to finish, with Unity. With UT being so reactive they have destroyed what was one of the best decisions they had made in recent times, just to placate bad user choices.
     
  2. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    I think it's alright moving back some packages to built-in engine code. There's no reason and no cause to assume that Unity will start offering less public API just because it's shipped as a built-in module. I do think Packages have a lot of issues to solve, the big one being editor loading performance, but moving some stuff away from packages to built-in will make startup faster, for example. Also, the simulator had big performance issues while being a package, and now in 2021, it's fast and responsive again, so for me it's moving in the right direction.
     
  3. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,000
    Weird, i'd not noticed any performance issues with the simulator, and for the most part don't see how changing between a package and having it internal would make a difference. Not that I don't believe you, just trying to work out what aspect of the package might have caused this. Obviously there may be some critical code paths that if implemented natively might gain performance, but off hand I can't really think what that would be, as the simulator is just a special game view.

    Are you sure it was being moved internally that 'fixed' these issues and not just the progress of bug fixing from the team? Just reading through this thread there were clearly a number of bugs and issues that had to be addressed over time as the package gained wide spread usage. Could easily see trying to override values from native classes like Screen and Application might have had unforeseen consequences which will now be resolved through use of the Device namespace having simulator versions of them. Things like the simulator actually rendering to the native screen size of the device which can be substantially higher than a normal game view would undoubtedly caused massive slow downs for some too.

    However i'm not as convinced as yourself that most of the classes wont simply be marked internal, as that seems to be pretty much the Unity way. So that would prevent class extending and certainly prevents fixing any bugs or issues. I would check but don't have it to hand and the github reference only goes up to 2020.2

    Since you're using it in 2021 can you tell me, do we still have access to device definition files in an external folder? I found having access to these files very useful and it would be a real shame to lose access to them. Also have they implemented a simple means to add new devices? I was hoping by now to have a simple scene that could be built, loaded onto a device, ran and it would spit out the json required.

    .. and we're right back to the typical problem of using Unity, being pushed to constantly upgrade to the latest version to get improvements to existing features, yet in my experience no commercial project is going to risk such constant upgrades. This is what packages were meant to solve and for the most part many of them did.

    Sigh. I mean I have to commend the Device Simulator team on producing a great bit of tech that will be a huge time saver for anyone developing on mobile devices. I like the improvements that are being made and how its progressing, but I just hate its being moved internally.
     
  4. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    135
    DeviceSimulator is very useful. Thank you very much!!
    However, I do have a performance issue.

    The frame rate varies non-negligibly depending on whether the DeviceSimulatorWindow is open or not.
    The first image shows GameWindow only, which stabilizes at 60FPS.
    The second image is with the DeviceSimulator window open, and the frame rate drops to 15FPS.
    The UniversalRenderPipeline has taken up so much of my time.
    Is this a known issue? Or should I be prepared with additional information?

    Environment
    - macOS Big Sur 11.2.1
    - Unity2020.2.2f1
    - DeviceSimulator 2.2.4-preview
    - Core RP Library(Verified)
    - Universal RP 10.2.2(Verified)

    Screen_Shot_2021-02-18_at_9_28_23.png Screen_Shot_2021-02-18_at_9_29_22.png Screen Shot 2021-02-18 at 9.30.50.png
     
  5. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    Probably the one I was also experiencing a couple of posts before: https://forum.unity.com/threads/new-device-simulator-preview.751067/page-5#post-6632845

    The performance is much better in Unity 2021 because they changed the way simulation works. In older versions, as far as I understand it, the only "fix" would be to turn off SystemInfo etc. simulation for code. There may be an official option to disable these features (soon?), but I've actually just made the Simulator an embedded package and edited the code to remove simulation of the SystemInfo and Application class because we don't need this in our project. After that, the performance was perfect again.
     
    kyubuns and Noisecrime like this.
  6. kyubuns

    kyubuns

    Joined:
    Aug 6, 2013
    Posts:
    135
    > Probably the one I was also experiencing a couple of posts before
    Oops, sorry.
    I was helped by your info! Thank you!
     
    Xarbrough likes this.
  7. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Yes! That would be amazing! I would just change from one device to another in a loop to check all of them.
     
  8. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    The device list is pretty limited, when are we going to get a longer list?
     
  9. d2clon

    d2clon

    Joined:
    Aug 19, 2017
    Posts:
    19
    Also be sure you are selecting "Unity Registry" in the main source selector:

    UnityDeviveSimulator.jpg
     
  10. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    660
    is it faster than real device? I'm not sure if it same speed as real devices
    Sometime I have an issue in device But in Unity is no problem at all.
     
  11. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    The simulator doesn't simulate performance (and that's a really difficult thing to do). So, most likely, your desktop workstation will run faster than the mobile devices you're targeting (not in all cases though, scene loading is sometimes faster on modern mobile chips than on our development PCs, for example).
     
  12. Noisecrime

    Noisecrime

    Joined:
    Apr 7, 2010
    Posts:
    2,000
    Just noticed that the Device Simulator doesn't respect OnDemandRendering settings, at least not in 2019.4.9.

    Can this be addressed in the future? Is it already fixed in 2021?
    It would be really useful since OnDemandRendering is mostly designed for use with mobile in the first place.

    In addition I noticed that in 2019.4 Screen.refreshrate is returning 0 in the simulator, is that something which is fixed in 2021 with the new simulated classes?
     
  13. Midiphony

    Midiphony

    Joined:
    Jan 25, 2019
    Posts:
    14
    Sharing my two cents with an example.
    We've been using UI Toolkit but had huge issues with touch inputs (btw, UITK is really great but loads of issues aren't addressed yet).

    We spotted a bug in October 2020 where the actual touch inputs positions were completely offset because of a simple mistake with a coordinates system change. Basically, touch inputs were unusable.

    Because it is a package we were able to :
    - identify the bug in the source code
    - modify the code and fix the bug

    We are in April 2021 : the bug has just been fixed in Unity 2021.2 alpha and should be fixed in the next, still unreleased, package release.

    If it was not a package, we would not have been able (easily) to read the source code, find the bug and fix it.


    You illustrated the issue yourself :
    "I've actually just made the Simulator an embedded package and edited the code to remove simulation of the SystemInfo and Application class because we don't need this in our project. After that, the performance was perfect again."

    I can see the benefits from having some packages back as built-in modules. But with current Unity ecosystem, this eventually means more things in the blackbox :D
     
    Noisecrime likes this.
  14. hyagogow

    hyagogow

    Joined:
    Apr 25, 2014
    Posts:
    26
    Is there any way to check on code (running on Editor) if the Simulator Windows is selected?
     
    BattlefieldNoob likes this.
  15. TG-jkhoo

    TG-jkhoo

    Joined:
    May 10, 2021
    Posts:
    4
    I found a difference in behavior regarding Application.platform between the

    Device Simulator package for 2019/2020
    vs. the
    Integrated Device Simulator in 2021


    Device Simulator package for 2019/2020
    In Unity 2019/2020, Application.platform calls into the ShimManager:
    Code (CSharp):
    1. public static RuntimePlatform platform => ShimManager.applicationShim.platform;
    which will eventually call into Device Simulator package code (ApplicationSimulation.cs)
    to return a device platform like RuntimePlatform.Android or RuntimePlatform.IPhonePlayer:
    Code (CSharp):
    1.         public override RuntimePlatform platform
    2.         {
    3.             get
    4.             {
    5.                 if (m_DeviceInfo != null && ShouldShim())
    6.                 {
    7.                     if (m_DeviceInfo.IsAndroidDevice())
    8.                         return RuntimePlatform.Android;
    9.  
    10.                     if (m_DeviceInfo.IsiOSDevice())
    11.                         return RuntimePlatform.IPhonePlayer;
    12.                 }
    13.  
    14.                 return base.platform;
    15.             }
    16.         }
    Integrated Device Simulator in 2021
    In Unity 2021, Application.platform calls a UnityEngine internal method:
    Code (CSharp):
    1. public static extern RuntimePlatform platform { [FreeFunction("systeminfo::GetRuntimePlatform", IsThreadSafe = true), MethodImpl(MethodImplOptions.InternalCall)] get; }
    And at runtime, even when using the simulator, it'll return an editor platform like RuntimePlatform.OSXEditor.


    Which one is the correct behavior?
    1. Device Simulator package for 2019/2020 is correct
      1. It's not safe to assume that RuntimePlatform.Android is running on a mobile device.
      2. If you want to ensure that you're not running in the Device Simulator, you can add:
        Code (CSharp):
        1. #if !UNITY_EDITOR
    2. Integrated Device Simulator in 2021 is correct
      1. And the Device Simulator package shouldn't override the behavior of Application.platform.

    Real-world scenario

    We're using the Amplitude SDK which assumes that RuntimePlatform.Android means running on a physical Android device.
    Code (CSharp):
    1. #if UNITY_ANDROID
    2.         if (Application.platform == RuntimePlatform.Android) {
    3.             Debug.Log ("construct instance");
    4.             pluginClass = new AndroidJavaClass(androidPluginName);
    5.         }
    6. #endif
    Depending upon what the correct behavior is, either this calling code will need to be modified, or the Device Simulator package for 2019/2020 will need to be modified.
     
    ByMedion likes this.
  16. kjyv

    kjyv

    Joined:
    Feb 20, 2018
    Posts:
    53
    @RomanBanana: Hi, probably I'm not the first to ask but when are you adding cuerrent devices to the list? We are developing a lot for current iOS devices and we're missing iPhone 11 Pro, 11 Pro Max, 12, 12 mini, 12 Pro, 12 Pro Max and soon there will be a new iPad Pro as well. Currently we can't really use Device Simulator for those devices.
     
  17. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    Device Simulator package version 3.0.0-preview is now live.

    Highlights!
    - New devices, mostly flagships from the year 2020.
    - Options in the Project Settings to disable SystemInfo and Application simulation. Disabling these will help if Device Simulator is causing performance issues.
     
    Noisecrime likes this.
  18. RomanBanana

    RomanBanana

    Unity Technologies

    Joined:
    Jun 23, 2015
    Posts:
    51
    In the core version of Device Simulator the correct thing to do is to call UnityEngine.Device.Application.platform, this API behaves as you would expect. In Device Simulator it returns simulated values and on a real device it returns real values. UnityEngine.Device namespace also contains other classes that work well with Device Simulator.
     
  19. kjyv

    kjyv

    Joined:
    Feb 20, 2018
    Posts:
    53
    It seems in Device Simulator 2.2.4 and also in 3.0, SystemInfo.deviceModel is not simulated (the project options are enabled). I always just get the model of the computer I'm working on, not the selected device. Is it necessary to have a similar wrapper method?
    You were suggesting a while in this same thread that it is simulated and it can be used to map to Device.generation.
     
    ByMedion likes this.
  20. LE-Peter

    LE-Peter

    Joined:
    Sep 15, 2020
    Posts:
    42
    3.0.0-priview causes Vuforia to break in editor.

    With this version, the error Dataset <db> could not be loaded and cannot be activated. appears in the console when trying to use Vuforia.
     
  21. marwi

    marwi

    Joined:
    Aug 13, 2014
    Posts:
    138
    Hello, does Device Simulator support Keyboard events yet? We use Keyboard callbacks for ARSimulation to navigate in a scene.
     
    Last edited: Jun 6, 2021
    BebopTune likes this.
  22. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    97
    I've read through the comments but can't seem to find anyone else having an issue with the Device Simulator when using the New Input System. Mouse and Finger input positions are always returned as (Infinity, -Infinity). Given that we're talking about touchscreen devices, I'm of the opinion I really might be doing something wrong... because surely this would be the first thing that was tested?

    A mouse example:

    void Update ()
    {
    // Will always print (Infinity, -Infinity)
    if ( Mouse.current.wasUpdatedThisFrame ) Debug.Log( Mouse.current.position.ReadValue() );
    }


    Same goes for the finger values when responding to, for example:

    using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
    ...
    Touch.onFingerDown += OnFingerDown;
    ...
    void OnFingerDown (Finger finger)
    {
    Debug.Log( finger.currentTouch.screenPosition );
    }



    All code works correctly when the tab is set to 'Game', instead of 'Simulator'.
     
    Last edited: Jun 18, 2021
    viktorcode likes this.
  23. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    Is it not possible to use the legacy Input class to receive keyboard input when running with the device simulator in the editor? No keycodes or inputString are reported when I have the simulator open, which makes otherwise quick and easy debug scripts pretty difficult. I also don't want to start with the new input system because the project is mobile only, the keyboard input would only be a quick way to skip a tutorial via keyboard press when testing in the editor.
     
  24. stu_dious

    stu_dious

    Joined:
    Feb 19, 2013
    Posts:
    32
    Is there a way in code to identify in code that the Device Simulator is active, like a #define directive? Thanks
     
  25. marwi

    marwi

    Joined:
    Aug 13, 2014
    Posts:
    138
    Do you mean if it is installed? You can archieve that using asmdef definition expressions. Otherwise you would need to check if the DeviceSimulator window is open and focused
     
  26. marwi

    marwi

    Joined:
    Aug 13, 2014
    Posts:
    138
    Same issue - we had to build a lot of tooling/workarounds in our AR package just to make that work. Would be great if keyboard input would become a first class citizen of DS
     
  27. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    87
    I'm on Unity 2021.2.0.a21 I am trying out the Device Simulator but it is not giving me any information about the device and also it does not detect that the device. It says "Desktop". This is my device check code.


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class DeviceCheck : MonoBehaviour
    6. {
    7.     public Camera myCamera;
    8.     public GameObject map;
    9.  
    10.     // Start is called before the first frame update
    11.     void Start()
    12.     {
    13.      
    14.  
    15.     }
    16.  
    17.     // Update is called once per frame
    18.     void Update()
    19.     {
    20.  
    21.         //Check if the device running this is a desktop
    22.         if (SystemInfo.deviceType == DeviceType.Desktop)
    23.         {
    24.             Debug.Log("Desktop");
    25.             myCamera.fieldOfView = 53;
    26.             map.transform.localScale += new Vector3(0f, 0f, 0f);
    27.         }
    28.  
    29.         //Check if the device running this is a handheld
    30.         if (SystemInfo.deviceType == DeviceType.Handheld)
    31.         {
    32.             Debug.Log("Mobile");
    33.             myCamera.fieldOfView = 40;
    34.             map.transform.localScale += new Vector3(6f, 6f, 6f);
    35.         }
    36.  
    37.     }
    38. }
    39.  
    And this is what I see in the viewport.
     
  28. rzimin

    rzimin

    Joined:
    Jan 15, 2020
    Posts:
    3
    Same problem here. Tried almost everything I could - still Infinity. Did you find a solution?
     
    viktorcode likes this.
  29. ByMedion

    ByMedion

    Joined:
    May 10, 2018
    Posts:
    19
    Hello! Just ran into a bug: SystemInfo simulation doesn't work when accessed from AsmDef. Simulation only works in Assembly-CSharp :(
     
  30. perholmes

    perholmes

    Joined:
    Dec 29, 2017
    Posts:
    295
    I was going in circles for hours on why SystemInfo and Application classes kept detecting your Windows/Mac device while simulating a mobile device. There is an answer, which I'm posting here because I see many others have searched for the same issue.

    In the release build of Device Simulator, SystemInfo and Application intentionally detect the system you're actually on. In order for this to also work with the simulator, you have to use mirror classes in UnityEngine.Device.SystemInfo and UnityEngine.Device.Application.

    These classes are the same, and you can use them in release builds. The only difference is that they're willing to pretend to be another device through the simulator, whereas the original top-level classes are always honest.

    It's a good change, and it's actually in the new docs. The problem is that all Google searches kept sending me to the Device Simulator 3.0.1 Preview (last public preview before integration into Unity), which specifically says the wrong thing. The answer is actually also buried somewhere in this thread, but blink and you'll miss it.

    It took me 4-5 hours to work this out, so I'm posting this here in case it saves someone else the confusion.

    New docs: https://docs.unity3d.com/2021.1/Documentation/Manual/device-simulator-simulated-classes.html
     
    OutplayDavie, fherbst and Noisecrime like this.
  31. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,001
    Why does importing the Device Simulator package on 2020.3.16f1 cause a full texture re-compression? I do not understand.
     
  32. RodAbreu

    RodAbreu

    Joined:
    Aug 17, 2021
    Posts:
    1
    Everything editor related will not work, the workaround is to use
    Application.installMode == ApplicationInstallMode.Editor
     
  33. Menyus777

    Menyus777

    Joined:
    Jun 11, 2017
    Posts:
    24
    Where did the Device specification tab gone?
    I would like to see the device resolution and other system infos that were there in 2.x.x
    When doing UI related stuff it was so helpful just to select different devices with different resolutions for fast UI checks.
     
    genstant and Xarbrough like this.
  34. Max_Bol

    Max_Bol

    Joined:
    May 12, 2014
    Posts:
    168
    I was kinda out of the loop about the Simulator feature until now. (Learned about its existence while learning about Adaptive Performance as I upgraded a on-ice mobile project to Unity 2021.1,15f1)

    For some reason, while the project UI works properly in the regular Game mode, the UI doesn't seem to work (recognize actions like a mouse click to simulate touch) at all. Is there some sort of special setup required for the Simulator window to recognize "touch" actions (from mouse click)?

    I tried switching between Input systems (old or new or both) and none worked.

    I tried looking up for answers around and all I could find was either people having problem with a previous version of the Device Simulator (which are supposed to be fixed now) or people asking about specific touch actions (like pinch, multi-touch, etc.) In my case, single touch (click) doesn't even work and I would really like to make it work as this Simulator mode really helps fitting the UI properly.
     
  35. LE-Peter

    LE-Peter

    Joined:
    Sep 15, 2020
    Posts:
    42
    I haven't done anything special to use UI with the device simulator.
    Using old input system
    Device simulator version 2.2.4
    Make sure you have an active/enabled event system in the scene
     
  36. Max_Bol

    Max_Bol

    Joined:
    May 12, 2014
    Posts:
    168
    Event system is present and active. As I have previously stated, the game's UI works fine when launching the game in the regular Game Mode. I have also tried a built and it also works fine within the built. It doesn't work only when the Simulator mode is active. It even works if I switch from Simulator to Game mode while Play is active, but stop working as soon as I switch toward Simulator.

    After a bunch of tests and tries, I found out that a new project's UI works properly in Simulator mode, but any project made with the version 2020.1.1f1 will have issues with the UI in Simulator mode once upgraded to 2021.1.15f1. Seems like there are something missing during the conversion that breaks the built-in Device Simulator package from working properly with the UI once the project got converted.

    The solution is obvious now for me. Packaging the old project's general assets and import them in a new project.
    I'm sharing it in case someone else upgrade their project and face the same issues as me.
     
  37. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    Thanks for adding this useful tool to Unity!

    Feedback:
    1) I'm using the Device Simulator to simulate iPhones and there doesn't seem to be a Home Bar available (or option to show one). If anyone has made a custom device overlay with this visible, I would appreciate if you could share it.

    2) UnityEngine.iOS.Device.generation returns Unknown when it would be great if the Simulator could make it return the correct enumerator.
     
  38. moyashiking

    moyashiking

    Joined:
    Jul 10, 2018
    Posts:
    35
    In Device Simulator 3.0.2, there is no "Auto Rotation" item in the menu.
    It was in an older version of his Deice Simulator.

    Is there a way to enable "Auto Rotation" in 3.0.2?
    Is it enabled from the beginning even if I don't set it?
     
  39. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    In addition to the feedback above, here's some more bugs. We're using Unity 2020.3.21 LTS with Device Simulator 3.0.2-preview package.

    3) Often when dragging in the Simulator view with the mouse, the mouse move events stop being sent and the mouse-up or drop message never get sent to UGUI Event System. The result is that while dragging, a ScrollView will just randomly stop in place and also won't snap back after button release. It's like the ScrollView thinks I'm still dragging even though the content no longer moves when I move the mouse nor does the ScrollView respond when I finally let up the mouse button. If I re-click and drag then it responds. This does not happen in the normal Game View or on any actual devices.

    4) When rotating the orientation, there's a noticeable lag in the safe area changes in script. For example, when rotating from portrait to landscape, code in a MonoBehaviour.Update() event will first show a change in orientation (Screen.orientation) to landscape, but safe area will still be portrait. Then the next frame, the safe area will change to landscape. Screen width and height will also lag, which then causes UGUI layout system to lag behind another frame after that for layout rebuilds. All this causes some trouble when you have a responsive UI and it's not the same behavior that you get on the actual devices.

    @RomanBanana
    @JC-Cimetiere
     
    Last edited: Nov 24, 2021
  40. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    Previous versions of the simulator showed some helpful device info in the control panel (side-bar), e.g. screen width, height, DPI etc. This was removed some time ago. Will those stats be re-introduced?

    I'm trying to re-implement this myself as a DeviceSimulatorPlugin, however I'm missing a callback for when the simulator device changes. Does this exist? If I know when the device was changed, I can update my UI Toolkit labels to pull the data from Screen.width, etc, however without the callback I would have to do it every second or so, which seems like it wouldn't really take advantage of the new stateful system.

    EDIT: Actually, the issue is worse: If I try to poll the simulated values every x seconds via the UI toolkit scheduler, the simulated values are incorrect half of the time. It seems Screen.width only returns correct values when queried from within the regular Update loop, but not in VisualElement.schedule.Execute. :(
     
    Last edited: Nov 11, 2021
    Menyus777 and genstant like this.
  41. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    More feedback for the Unity team (is anyone listening?):

    5) The UGUI clicking fixes in 3.0.3-preview release don't seem to correct our issues. I'm still getting issues where sometimes Buttons activate but don't register the mouse up so the Click event never happened. Also dragging a ScrollRect is still broken as I explained in feedback #3 above.

    6) It would be great if the UnityEngine.Device namespace used by the Device Simulator integrated in Unity 2021 was also implemented in the package for Unity 2020 so that the code can directly port to Unity 2021 when the time comes for us to do that. Currently Unity 2021 has too many bugs to be usable for our production product.

    @RomanBanana
    @JC-Cimetiere
     
  42. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,444
    From a user perspective, it would be nice for a visual cue or warning that the upside down rotation isn't supported? It's a bit unclear when you register to listen for the rotation flags then they just don't work on upside down mode.
     
  43. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    Device simulator doesn't have the 'Reload' button on MAC, so whenever you want to check a different device you have to restart... is this normal ? will be fixed?

    Im on 2020.3.21
     
  44. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    Why do you need it? You can just change the device in the dropdown without restarting. A GUI/Canvas with adaptive design should be able to scale and position to the new screen size and safe area. Your script Update method can detect changes in the safe area.
     
  45. tomfulghum

    tomfulghum

    Joined:
    May 8, 2017
    Posts:
    69
    I just noticed that when using the device simulator and simulating touch input with a mouse, in the first frame after clicking, the value of the Touch event's deltaPosition is always something like (-216972032, -216972032) when it should be (0, 0). In the normal game view or in a build this does not occur.
    Does somebody know a fix or is at least able to reproduce the problem?

    Using Unity 2020.3.17f1 and device simulator version 3.0.1-preview.
     
    Menyus777 likes this.
  46. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    383
    Try the latest version 3.0.3-preview
     
    ROBYER1 likes this.
  47. ScottAdams

    ScottAdams

    Joined:
    Nov 23, 2016
    Posts:
    72
    For those trying to find the built in Device Simulator I found it in 2021.2 under "Window/General/Device Simulator"
     
    jGate99 likes this.
  48. BlackclawsK

    BlackclawsK

    Joined:
    Jan 9, 2019
    Posts:
    100
    For modules such as this that were migrated back into editor modules. Would it be possible to selectively switch the license of the reference source to allow modification? The source code is still viewable but modification isn't permitted as per the license once its part of the engine code. There are modifications such as accessing the device list programmatically from outside the device simulator that make sense in the context of automatic tests running on different device classes. This can still be done but only with reflection so its a bit "meh".
     
  49. Vedran_M

    Vedran_M

    Joined:
    Dec 16, 2019
    Posts:
    14
    Any news on supporting keys through Input.GetKeyDown()? Thanks!
     
  50. OldKing_Wang

    OldKing_Wang

    Joined:
    Jan 25, 2015
    Posts:
    43

    Hi.

    there is no `UnityEngine.Device.Screen` in Unity 2020 LTS with any version of Device Simulator. both 2.x & 3.x

    so , how can i get the correct resolution & DPI without upgrade to Unity 2021.

    thanks.
     
    leutnant_kane likes this.