UnityException: FindObjectsOfType is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'DataController' on game object 'DataController'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.Object.FindObjectOfType (System.Type type) (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:381)
UnityEngine.Object.FindObjectOfType[T] () (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:362)
DataController.GetInstance () (at Assets/DataController.cs:12)
DataController..ctor () (at Assets/DataController.cs:28)
๊ตฌ๊ธ์ ๊ฒ์ํด๋ณด๋๊น void Start ์๋๋ฉด void Awake ํจ์์ ์ ๊ฑธ ๋ฃ์ผ๋ผ๋๋ฐ
ํจ์์์ static ํจ์๋ฅผ ๋ฃ์์๊ฐ ์๋์? ๋ฃ์ผ๋ฉด ์ ์ ๋ก์ปฌํจ์๋ ์ง์๋์ง ์๋๋ค๊ณ ๋ ์,,
๋ง์ ์คํํ๋ฉด ์๋๊ธดํ๋๋ฐ,,, ์ ์๋๋ค๊ฐ ๊ฐ์๊ธฐ ์ ์ ๋ฌ๋์ง ๋ชจ๋ฅด๊ฒ ๋ค์
์์ด๊ณต๋ถ๋ฅผ ํ๋๊ฑด ์ด๋
๋ค์ ์ฐจ๊ทผ์ฐจ๊ทผ C#๊ธฐ์ด๋ถํฐ ์ดํด๋ณด์