Skip to content

OSCReceiverComponent not executing callback 1st time after Domain Reload #39

@MPierer

Description

@MPierer

Using Unity 2022.3 (or later, but issue seems not related to Unity version):
There seems to be an issue in the OSCReceiverComponent.
I have a scene with an OSCReceiverComponent and an attached callback.
In Project Settings "Enter Play Mode Options", "Reload Domain" and "Reload Scene" is disabled.
Normally, when I enter play mode and the OSCReceiverComponent receives a correspoding message it triggers the CB.
This works until I change a file and scripts are reloaded and the Domain is reloaded.
The first time I enter the playmode, the callback is not fired.
All following "stop playmode/enter playmode" will correctly fire the callback.
I tracked this down to the OSCReceiverComponent.cs
private OSCEventMessage _callback;

This field is serialized on Domain Reload by Unity.
Once I change it to:

[field:NonSerialized]
private OSCEventMessage _callback;

it works correctly even the first time I enter playmode after Domain Reload.
Maybe you can reproduce/verify this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions