Skip to main content
Dec 13, 2019 3:03 PM UTC
Question

Field Question: In Unity there's a possibility to run code on specific (editor, iOS, Android etc)

In Unity there's a possibility to run code on specific hardware (editor, iOS, Android, etc.), is this also possible in Studio?

So that I can more quickly test stuff in the preview window. Here's the Unity way: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

    1 reply

    Dec 13, 2019 3:04 PM UTC

    the only platform-specific content you can create for View is the low-level shader code - for most platforms it is GLSL, for hololens it is HLSL.  Everything else is javascript and platform neutral. You should be able to run all javascript in the Preview tool

    if you want to run some 'debug' code specifically in the preview, you can use this logic :

    if (twx.app.isPreview()) { so preview stuff }