sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7.08k stars 1.11k forks source link

How to deal with "Enable Visual Debugging = true, but components is not showing in DontDestroyOnLoad"? #963

Closed atkdefender closed 2 years ago

atkdefender commented 3 years ago

https://github.com/atkdefender/Pic/blob/main/pic20201124122017.jpg

Dethrail commented 2 years ago

@atkdefender

I think problem was because you had trouble when registering all context observers

Solution only one, get some report via adding log in catch section at Contexts

e.g. } catch(System.Exception e) {Debug.LogError(e);}

After u got a report you can handle problem

sschmid commented 2 years ago

related #967

mrobaczyk commented 1 year ago

After adding these Debug.LogErrors and also in Entitas/Sources/Generated/Contexts.cs in the InitializeContextObservers() method I'm getting the following exception:

UnityEngine.UnityException: get_isPlaying is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'SceneLoader' on game object 'SceneLoader'.
See "Script Serialization" page in the Unity Manual for further details.