yasirkula / UnityIngameDebugConsole

A uGUI based console to see debug messages and execute commands during gameplay in Unity
MIT License
2.14k stars 224 forks source link

19 Warnings when entering playmode on unity 2022 #77

Closed ultrakorne closed 10 months ago

ultrakorne commented 1 year ago

Description of the bug

Warning spam in console about (19 warnings on various objects in the prefab SendMessage cannot be called during Awake, CheckConsistency, or OnValidate (Image: OnRectTransformDimensionsChange)

Reproduction steps

Have prefab in the scene and start the game

Platform specs

Please provide the following info if this is a Unity 3D repository.

Additional info

Please check Logcat (Android) or Xcode console (iOS) for any meaningful error messages and include them here.

yasirkula commented 1 year ago

I don't have 2022.2 installed at the moment unfortunately. The error originates from built-in Image component for some reason, it may or may not be an internal Unity bug (happens from time to time). If you open the IngameDebugConsole prefab, make a dummy change and re-save it, does it resolve the issue?

HyagoOliveira commented 1 year ago

The warning messages are from some Editor code. No matter if we change the IngameDebugConsole prefab (or create a new one), the warnings spam from time to time.

Retr0-01 commented 1 year ago

I have encountered the exact same issue too. Are there any chances this is an internal Unity bug?

yasirkula commented 1 year ago

There is a chance yeah. So far, it did happen numerous times for different plugins of mine. I usually apply a workaround on those Unity versions when applicable but I just haven't installed 2022.2 yet so I can't say if the same can be done for this issue at the moment.

yasirkula commented 1 year ago

Workaround: https://forum.unity.com/threads/in-game-debug-console-open-source.411323/page-3#post-8920076

tl;dr

Disable Canvas Scaler in the IngameDebugConsole object/prefab and add the following script to it:

using UnityEngine;
using UnityEngine.UI;

[DefaultExecutionOrder(1)]
public class IngameDebugConsoleWarningsWorkaround : MonoBehaviour
{
    private void Start()
    {
        GetComponent<CanvasScaler>().enabled = true;
    }
}
maniczombie commented 1 year ago

Thanks alot for fix, those warnings were driving me crazy.

yasirkula commented 10 months ago

I've finally applied a simpler built-in solution to this problem. Hopefully the warnings won't show up anymore 🤞