Question by
KnightRiderGuy · Apr 03, 2017 at 03:27 PM ·
c#playerprefsstringsconsole errorsserialport
Get String Not Allowed To Be Called from Mono Behaviour Constructor
What does this even mean and how can it be fixed? We need to be able to set a string into player prefs for users to use their own serial port configuration?
GetString is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'Sending'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.PlayerPrefs:GetString(String)
Sending:.cctor()
screenshot-2017-04-03-101646.png
(298.0 kB)
screenshot-2017-04-03-101708.png
(231.2 kB)
Comment