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;

}

相关推荐
xiami_world1 小时前
2026年UI/UX设计工具私有化部署方案深度解析
人工智能·ui·ai·产品经理·ux
不知名的老吴2 小时前
Unity3D 2022安装教程及全流程下载步骤指南
unity·游戏引擎
Thomas_YXQ2 小时前
Unity3D Addressable 深度优化热更性能消耗
开发语言·3d·unity·微信
程序员也有头发2 小时前
如何使用AI工具开发Unity
unity·游戏引擎·ai编程
隔窗听雨眠2 小时前
从零开始的游戏开发入门指南
unity
sinat_384503112 小时前
【无标题】
unity·webgl
caimouse2 小时前
Godot 引擎官方常见问题(FAQ)整理
游戏引擎·godot
川石课堂软件测试3 小时前
UI自动化测试|XPath元素定位实践
功能测试·测试工具·jmeter·microsoft·ui·postman·harmonyos
一锅炖出任易仙3 小时前
创梦汤锅学习日记day29
学习·ai·ue5·游戏引擎
隔窗听雨眠3 小时前
Unity与Simulink联合仿真:实现无人机目标追踪系统
unity·无人机·cocos2d·simulink