Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum DevicePlatform { Desktop, PCVR, AndroidVR, AndroidMobile };
- // ^ This goes in your namespace. Not in your UdonSharpBehaviour class! ^
- public DevicePlatform GetLocalPlayerPlatform()
- {
- if (!Utilities.IsValid(Networking.LocalPlayer)) return DevicePlatform.Desktop;
- #if UNITY_ANDROID
- if (Networking.LocalPlayer.IsUserInVR()) return DevicePlatform.AndroidVR;
- else return DevicePlatform.AndroidMobile;
- #endif
- if (Networking.LocalPlayer.IsUserInVR()) return DevicePlatform.PCVR;
- else return DevicePlatform.Desktop;
- }
Advertisement
Add Comment
Please, Sign In to add comment