from2001 / VRM_VisualScriptingNodes

Unity Visual Scripting node library for VRM
MIT License
4 stars 2 forks source link

Material appears pink when run in Unity Editor #25

Closed afjk closed 6 months ago

afjk commented 6 months ago
image

If you want to run only on the built VisionOS, you can specify the following.

 #if !UNITY_EDITOR && UNITY_VISIONOS
// Only executed on built VisionOS
 #endif
from2001 commented 6 months ago

I’ll fix isVisionOs function.

from2001 commented 6 months ago

It happens only with Unity editor with VisionOs build settings now.

from2001 commented 6 months ago

I fixed the function to check whether app is running on VisionOS

        /// <summary>
        /// Return true if current OS is VisionOS.
        /// </summary>
        /// <returns></returns>
        public static bool IsVisionOS()
        {
            //When operatingSystem is "visionOS", return true
            if (SystemInfo.operatingSystem.Contains("visionOS")) return true;
            if (Application.platform == RuntimePlatform.VisionOS) return true;
#if UNITY_VISIONOS
            return true;
#else
            return false;
#endif
        }
from2001 commented 6 months ago

https://github.com/from2001/VRM_VisualScriptingNodes/pull/26/commits/765a87627720d126ba060e5e9894062ba1aa4f7d