MPPM - Disable CloneSceneChangedHandler

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:

[InitializeOnLoad]
public static class BootLoader
{
    static BootLoader()
    {
        EditorApplication.playModeStateChanged += OnPlayModeChanged;
    }
   
    private static void OnPlayModeChanged(PlayModeStateChange obj)
    {
        if (obj == PlayModeStateChange.ExitingEditMode)
        {
            EditorSceneManager.playModeStartScene = AssetDatabase.LoadAssetAtPath<SceneAsset>("Assets/Boot.unity");
        }
    }
}

This seems to confuse MPPM since it tries to sync the boot scene, I get this error:

ArgumentException: Scene file not found: 'Boot'.
UnityEditor.SceneManagement.EditorSceneManager.OpenScene (System.String scenePath, UnityEditor.SceneManagement.OpenSceneMode mode) (at <3e71e083846d4f14a92f58a607b12d8e>:0)
UnityEditor.SceneManagement.EditorSceneManager.OpenScene (System.String scenePath) (at <3e71e083846d4f14a92f58a607b12d8e>:0)
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)
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)
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)
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)
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)
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)
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)
UnityEngine.Debug:LogException(Exception)
Unity.Multiplayer.Playmode.VirtualProjects.Editor.MessagingService:HandleIncomingData(Byte[]) (at ./Library/PackageCache/com.unity.multiplayer.playmode@0.1.0/VirtualProjects/Editor/Messaging/MessagingService.cs:228)
UnityEditor.MPE.ChannelClient:IncomingChannelClientData(Int32, Byte[])

Is it possible to just disable the CloneSceneChangedHandler?

Hi @MylesLambert , I redirected your question to the MPPM team and I’ll write here again once I have an answer to it!

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

1 Like