Unity 判断平台

1. 判断 程序运行平台

Application.platform != RuntimePlatform.WindowsEditor 

            // 关闭程序
            CloseBtn.onClick.AddListener(() =>
            {
                if (Application.platform != RuntimePlatform.WindowsEditor)
                {
                    Application.Quit();
                }
                else
                {
                    Debug.Log("编辑器模式不关闭程序!");
                }
            });

2. 判断Unity 版本号

 #if UNITY_2019_1_OR_NEWER
     
#else

#endif

猜你喜欢

转载自blog.csdn.net/qq_39097425/article/details/112305299