3:断定当前运行的平台
由于PC真个操控和移植得手游上的操控不同,所以要写两套操控方法。
办法一: 断定当前的平台
switch (Application.platform)
{
case RuntimePlatform.WindowsEditor://PC端
print("aaaa");
break;
case RuntimePlatform.Android://android手机
print("cccc");
break;
}
办法二:通过宏定义断定
#if UNITY_IPHONE || UNITY_ANDROID
public static bool isAndroid = true;
#else
public static bool isAndroid = false;
#endif办法一: 断