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;

}

相关推荐
scott.cgi36 分钟前
Unity使用AndroidX获取,导航栏与虚拟键盘的高度
unity·androidx·keyboard·导航栏高度·虚拟键盘高度·判断键盘关闭·获取虚拟键盘高度
丁小未2 小时前
Unity车机地图Tile流式渲染系统高性能架构方案
unity·架构·ecs·dots·车机系统·车机系统架构图
LONGZETECH6 小时前
工业实训仿真设计实践:电机拆装软件的 DAG 流程建模、工具精度分级与数据体系搭建
大数据·算法·unity·架构·汽车
Python私教6 小时前
Godot 4 CharacterBody2D 角色移动:输入、碰撞与八方向控制实战
人工智能·游戏引擎·godot·gdscript·游戏开发
派葛穆1 天前
Unity-UI 按钮点击弹窗功能
unity·游戏引擎
toponad1 天前
Unity Ads Bidding 现已正式加入TopOn 聚合平台
unity·topon
绿浪19841 天前
WPF UI标准流水线
ui·wpf
unityのkiven1 天前
Unity UGUI 实战:动态生成任务面板
unity·游戏引擎
郝学胜-神的一滴1 天前
中级OpenGL教程 026:Assimp库从编译到实战全攻略
c++·unity·游戏引擎·图形渲染·unreal engine·opengl
凯尔3152 天前
Unity简单涂料实现
unity·游戏引擎·图形渲染