vrchat-community / EasyQuestSwitch

EasyQuestSwitch is a Unity editor tool developed for VRChat world creators, it can automate changes to components within a scene as soon as the build platform is changed from PC to Android (for Oculus Quest) or vice versa.
Other
126 stars 13 forks source link

Object reference exceptions when switching platforms or using Build & Publish #7

Closed JordoVR closed 2 years ago

JordoVR commented 2 years ago

This is with 1.1.1 and presumably 2019. Check thread: https://twitter.com/mimyquality/status/1441048316188377093

East-vrc commented 2 years ago

日本語ですいません、UnityVer.4.31fからEasyQuesttoolのQuestbuildの調子が悪いです。 具体的に言うと、Questbuild中に NullReferenceException: Object reference not set to an instance of an object EasyQuestSwitch.EQS_Data.CheckTarget (UnityEditor.BuildTarget newTarget) (at Assets/EasyQuestSwitch/EQS_Data.cs:147) EasyQuestSwitch.EQS_Data.Update () (at Assets/EasyQuestSwitch/EQS_Data.cs:119) というエラーが発生し、buildが止まります。 対処方法も分かりました。EasyQuesttoolを立ち上げるとQuest対応させるObjectの適用が完了しましたと出ますので その後buildさせると成功します。逆にいうとそれがないとエラーが発生するので、 以前のversionではしなくてもよかったので4.31fからのバグなんでしょうか・・・

Legoman99573 commented 2 years ago

What I did to EQS_Data.cs to get rid of the message spam:

        private void Update()
        {
            try
            {
                NewBuildTarget = EditorUserBuildSettings.activeBuildTarget;
                if (CachedBuildTarget != NewBuildTarget && Objects != null) CheckTarget(NewBuildTarget);
                CachedBuildTarget = NewBuildTarget;
            }
            catch (NullReferenceException ex)
            {
                //Debug.Log("Failed to grab data");
            }
        }

This also happens when tabbing back into unity.

JordoVR commented 2 years ago

This issue is now fixed with release 1.1.2: https://github.com/JordoVR/EasyQuestSwitch/releases/tag/v1.1.2

East-vrc commented 2 years ago

Thank you for the correction.