Quantcast
Channel: Questions in topic: "log"
Viewing all articles
Browse latest Browse all 235

A weird issue in Unity related to scripts and Editor.

$
0
0
I have a class called PlayerData, marked as serializable, and it doesn't inherit any classes including MonoBehaviour. and it also doesn't contain any "InitializeOnLoad" things related to the Editor. This constructor method contains a "Monobehaviour.Print("abc")" for example. Now the issue happens, when I start the Unity, open this project, I didn't run anything, the constructor will be automatically run, because the "abc" will be automatically printed even the scene is not in running. When I see the stacktrace in Unity, it starts with this constructor, nothing else is calling it. And, when I run the scene, this print() will be called multiple times, and some of them doesn't contain stacktraces in Unity, just a single line, which never happened before. I don't have any other scripts which contains Editor or Editor related script. What happened? I know it's related to the project, because it doesn't happen on other projects wich have the similar structure. I just want to know where to look into it. I'm using Unity 5.0.2f1, this issue happened on both Windows and MacOS.

Viewing all articles
Browse latest Browse all 235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>