Created
March 14, 2025 21:23
-
-
Save DanMillerDev/97a8fad5a6f004bc1c1e400d4ba3fca3 to your computer and use it in GitHub Desktop.
A script to show a unique logo per platform using the preprocessor directives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
public class LogoManagerPPD : MonoBehaviour | |
{ | |
[SerializeField] | |
Sprite MetaLogo; | |
[SerializeField] | |
Sprite AndroidLogo; | |
[SerializeField] | |
Sprite AppleLogo; | |
[SerializeField] | |
Sprite UnknownLogo; | |
[SerializeField] | |
Image m_UIImage; | |
void Start() | |
{ | |
#if UNITY_VISIONOS | |
m_UIImage.sprite = AppleLogo; | |
#elif UNITY_META_QUEST | |
m_UIImage.sprite = MetaLogo; | |
#elif UNITY_ANDROID_XR | |
m_UIImage.sprite = AndroidLogo; | |
#else | |
m_UIImage.sprite = UnknownLogo; | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment