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;

}

相关推荐
ZC跨境爬虫18 小时前
跟着 MDN 学 HTML day_61:(构建反馈表单的结构化挑战)
前端·javascript·ui·html·音视频
鹤卿12320 小时前
OC UI ——UIGestureRecognizer 手势识别
ui·ios·objective-c
为你写首诗ge21 小时前
【Unity知识分享】Mirror实现房间等待功能(创建房间 / 搜索房间、加入房间、房间准备、房间内角色设置、返回房间)
unity·mirror·房间等待功能
阿正的梦工坊21 小时前
React:构建用户界面的JavaScript库
javascript·react.js·ui
游乐码1 天前
Unity坦克案例疑难记录(二)
unity·游戏引擎
小白学鸿蒙1 天前
Funplay Unity MCP 接入 trae 实战
unity·游戏引擎·mcp
ZC跨境爬虫1 天前
跟着 MDN 学 HTML day_62:(HTML调试与常见错误修复指南)
java·前端·javascript·ui·html·媒体
赏金术士1 天前
第二章:Compose入门—声明式UI编程
android·ui·kotlin·compose
相信神话20211 天前
3.5《酒魂》体验与失败设计
游戏引擎·godot·godot4