Just got this error (I have a debugger)
(X) Error occured: get_isActiveAndEnabled can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function./ at (wrapper managed-to-native) UnityEngine.Behaviour.get_isActiveAndEnabled(UnityEngine.Behaviour)
at UnityEngine.EventSystems.UIBehaviour.IsActive () [0x00000] in D:\Unity Game Engine\2020.1.6f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\UIBehaviour.cs:28
at UnityEngine.UI.Graphic.SetVerticesDirty () [0x00000] in D:\Unity Game Engine\2020.1.6f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Graphic.cs:267
at UnityEngine.UI.Text.set_text (System.String value) [0x0003d] in D:\Unity Game Engine\2020.1.6f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\Text.cs:212
at ChatController.Print (System.String msg) [0x0007e] in D:\Untitled Sandbox\Assets\Resources\Multiplayer\ChatController.cs:60
at ClientController.ProcessMessage (System.Net.Sockets.NetworkStream stream) [0x00184] in D:\Untitled Sandbox\Assets\Resources\Multiplayer\ClientController.cs:103
at ClientController.MessageProcessLoop () [0x00019] in D:\Untitled Sandbox\Assets\Resources\Multiplayer\ClientController.cs:45
Okay, MessageProcessLoop() is self-explanatory.
ProcessMessage() is also self-explanatory. It calls Print() funciton.
Print() just adds a text into list, and then applies it to text UI object.
And then this error comes out.
Any ideas?