Skip to content

Fix static state wrong reset#32

Open
Antoshidza wants to merge 1 commit intoPlaygama:mainfrom
Antoshidza:fix-static-reset
Open

Fix static state wrong reset#32
Antoshidza wants to merge 1 commit intoPlaygama:mainfrom
Antoshidza:fix-static-reset

Conversation

@Antoshidza
Copy link

@Antoshidza Antoshidza commented Dec 2, 2025

Issue

Bridge.cs uses [RuntimeInitializeOnLoadMethod] to reset it's static state. The issue is that it happens after it's own Awake() so state is being cleared right after initialization. On the next run without domain reload (which is often disable by unity devs for rapid developing) Bridge.cs still have it's _isApplicationQuitting: true which cause returning null by instance property.

In my particular case it breaks initialization of my project after first run.

What is changed

Instead of clear static state "before" something happens I think it is better to clear it in the "end" of run, so I've put logic into simple Bridge.OnDestroy().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant