[英]Unity, show different logo on different platforms in code
I want to show a different logo on Windows and Linux .我想在Windows和Linux上显示不同的徽标。 I test in windows, but build for Linux. How can I do this without having different code files and builds.我在 windows 中测试,但为 Linux 构建。如果没有不同的代码文件和构建,我如何才能做到这一点。
public void ShowLogo()
{
if (isOpen == true)
{
//Logos are both off by default
//Show In Linux??
// linuxLogo.SetActive(true);
//Show In Windows??
// WindowsLogo.SetActive(true);
}
}
Check out platform dependent code compilation.查看依赖于平台的代码编译。
https://docs.unity3d.com/Manual/PlatformDependentCompilation.html https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
public void ShowLogo()
{
if (isOpen == true)
{
#if (UNITY_STANDALONE_WIN || UNITY_EDITOR)
WindowsLogo.SetActive(true);
#endif
#if (UNITY_STANDALONE_LINUX)
linuxLogo.SetActive(true);
#endif
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.