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;

}

相关推荐
龚子亦7 小时前
【Unity开发】热更新学习——HybridCLR框架
学习·unity·游戏引擎·热更新
IMPYLH7 小时前
Lua 的 OS(操作系统) 模块
开发语言·笔记·后端·游戏引擎·lua
出门吃三碗饭8 小时前
论文随笔 聊聊感知智能用户界面的三大核心
ui
Just_Paranoid9 小时前
【Android UI】Android 添加圆角背景和点击效果
android·ui·shape·button·textview·ripple
龚子亦10 小时前
【GameFramework框架】FSM使用
学习·unity·游戏开发·游戏框架
我的xiaodoujiao10 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 34--基础知识 9--文件上传功能
前端·python·测试工具·ui·pytest
龚子亦10 小时前
【Unity开发】安卓应用开发中,用户进行权限请求
android·unity·安卓权限
君莫愁。11 小时前
【Unity】相机与UI的自适应
ui·unity·c#·游戏引擎
feiduoge20 小时前
教程 44 - 相机系统
windows·游戏引擎·图形渲染
lrh30251 天前
Custom SRP - 16 Render Scale
3d·unity·srp·render pipeline·render scale