unity中平台判断

public PlatformTypes mPlatformType;

// 设备类型枚举

public enum PlatformTypes

{

Mobile = 0,

Pc = 1

}

switch (Application.platform)

{

case RuntimePlatform.Android:

case RuntimePlatform.IPhonePlayer:

mPlatformType = PlatformTypes.Mobile;

break;

case RuntimePlatform.WindowsPlayer:

case RuntimePlatform.WindowsEditor:

mPlatformType = PlatformTypes.Pc;

break;

}

相关推荐
世洋Blog1 小时前
利用<<左移运算符优雅的设计游戏能力的任意组合和判断
游戏·unity·c#
lqj_本人6 小时前
鸿蒙与Qt的双线程模型:主线程与UI线程的博弈
qt·ui·harmonyos
南华9 小时前
Visual Studio 2022 加载解决方案缓慢
ui
毛甘木12 小时前
Unity MonoPInvokeCallback 使用教程
c++·unity
心疼你的一切13 小时前
Unity开发Rokid应用之离线语音指令交互模型
android·开发语言·unity·游戏引擎·交互·lucene
lqj_本人14 小时前
鸿蒙原生与Qt混合开发:UI集成与事件处理
qt·ui·harmonyos
Irene199114 小时前
Element UI 及其 Vue 3 版本 Element Plus 发展现状
前端·vue.js·ui
Sator116 小时前
Unity使用OpenXR时,初始化失败的问题
unity·游戏引擎·vr
周周爱喝粥呀1 天前
UI设计原则和Nielsen 的 10 条可用性原则
前端·ui
雨泽‎1 天前
Unity在URP中开启后处理导致RenderTexture存在背景
unity·游戏引擎·图形渲染