- Home /
Singleton field getter/setter doesn't work
I looked up what would be the difference between using Singleton
and good ol' GetComponent
and there really isn't that much in terms of speed so I just went with Singleton
as it's much easier to access. So I changed some of my code that still uses GetComponent
to use Singleton
to access this one script that is attached to my character. After those changes, I can't seem to set a field that I could normally set before and getting was not working as well. After some testing, I tried to revert back to GetComponent
and setting worked again. I'm wondering what could be the reason for this behaviour?
A small side question. Is the long getter/setter(get{ return _something; } equal to the shorter getter/setter(get; set;)?
Your answer
Follow this Question
Related Questions
Acessing a Script Instance from Another Object 3 Answers
I want to create a bookmark function using the toggle button,I want to develop the bookmark function 0 Answers
NullReference when calling a function to another script 2 Answers
What does this mean ? 1 Answer
An issue with GetComponent 2 Answers