Search Unity

MPPM - Disable CloneSceneChangedHandler

Discussion in 'Netcode for GameObjects' started by MylesLambert, Dec 12, 2022.

  1. MylesLambert

    MylesLambert

    Joined:
    Dec 31, 2012
    Posts:
    61
    Hello!
    Trying out MPPM. I often use EditorSceneManager.playModeStartScene to first load an initialisation/ entry scene before loading into the desired scene. Something like this usually:

    Code (CSharp):
    1. [InitializeOnLoad]
    2. public static class BootLoader
    3. {
    4.     static BootLoader()
    5.     {
    6.         EditorApplication.playModeStateChanged += OnPlayModeChanged;
    7.     }
    8.    
    9.     private static void OnPlayModeChanged(PlayModeStateChange obj)
    10.     {
    11.         if (obj == PlayModeStateChange.ExitingEditMode)
    12.         {
    13.             EditorSceneManager.playModeStartScene = AssetDatabase.LoadAssetAtPath<SceneAsset>("Assets/Boot.unity");
    14.         }
    15.     }
    16. }
    17.  
    This seems to confuse MPPM since it tries to sync the boot scene, I get this error:

    Code (CSharp):
    1. ArgumentException: Scene file not found: 'Boot'.
    2. UnityEditor.SceneManagement.EditorSceneManager.OpenScene (System.String scenePath, UnityEditor.SceneManagement.OpenSceneMode mode) (at <3e71e083846d4f14a92f58a607b12d8e>:0)
    3. UnityEditor.SceneManagement.EditorSceneManager.OpenScene (System.String scenePath) (at <3e71e083846d4f14a92f58a607b12d8e>:0)
    4. Unity.Multiplayer.Playmode.Workflow.Editor.CloneSceneChangedHandler.ProcessSceneChanged (System.String newScenePath) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/Workflow/Editor/Handlers/CloneSceneChangedHandler.cs:26)
    5. Unity.Multiplayer.Playmode.Workflow.Editor.CloneSceneChangedHandler.HandlePlay (System.String newScenePath) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/Workflow/Editor/Handlers/CloneSceneChangedHandler.cs:18)
    6. Unity.Multiplayer.Playmode.Workflow.Editor.StandardCloneWorkflow+<>c__DisplayClass0_0.<Initialize>b__6 (System.String scenePath) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/Workflow/Editor/Workflow/StandardCloneWorkflow.cs:34)
    7. Unity.Multiplayer.Playmode.Workflow.Editor.PlaymodeEvents.InvokePlay (System.String scenePath) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/Workflow/Editor/EditorSystems/Events/PlaymodeEvents.cs:17)
    8. Unity.Multiplayer.Playmode.Workflow.Editor.CloneSystems.<.ctor>b__0_8 (Unity.Multiplayer.Playmode.Workflow.Editor.PlayAllMessage message) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/Workflow/Editor/EditorSystems/CloneSystems.cs:38)
    9. Unity.Multiplayer.Playmode.VirtualProjects.Editor.MessagingService+<>c__DisplayClass13_0`1[TMessage].<Register>g__Wrapper|0 (System.Object o) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/VirtualProjects/Editor/Messaging/MessagingService.cs:143)
    10. Unity.Multiplayer.Playmode.VirtualProjects.Editor.MessagingService.HandleIncomingData (System.Byte[] bytes) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/VirtualProjects/Editor/Messaging/MessagingService.cs:221)
    11. UnityEngine.Debug:LogException(Exception)
    12. Unity.Multiplayer.Playmode.VirtualProjects.Editor.MessagingService:HandleIncomingData(Byte[]) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/VirtualProjects/Editor/Messaging/MessagingService.cs:228)
    13. UnityEditor.MPE.ChannelClient:IncomingChannelClientData(Int32, Byte[])
    Is it possible to just disable the CloneSceneChangedHandler?
     
  2. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi @MylesLambert , I redirected your question to the MPPM team and I'll write here again once I have an answer to it!
     
  3. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hey @MylesLambert , unfortunately currently there isn’t any workaround to that.

    The team is aware of the issue and they're going to figure out how to fix it in future relases of MPPM
     
    MylesLambert likes this.