S-C-A-N / SCANsat

Real Scanning, Real Science, at Warp Speed!
216 stars 96 forks source link

Changed instantiator into an Awake because of the following error which #358

Closed linuxgurugamer closed 4 years ago

linuxgurugamer commented 4 years ago

Changed instantiator into an Awake because of the following error which is only visible in a debug build:

UnityException: get_dataPath is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'SCANtoolbar' on game object 'SCANtoolbar'. See "Script Serialization" page in the Unity Manual for further details. at (wrapper managed-to-native) UnityEngine.Application.get_dataPath() at KSPUtil.get_ApplicationRootPath () [0x0001d] in <9d71e4043e394d78a6cf9193ad011698>:0 at SCANsat.SCAN_Toolbar.SCANtoolbar..ctor () [0x00377] in <532e0c7735694646a2dba646ef08b593>:0

DMagic1 commented 4 years ago

Fixed in version 20.