linuxgurugamer / ksp_toolbar

Common API for GUI toolbars in KSP
BSD 2-Clause "Simplified" License
13 stars 14 forks source link

Fix for the get_dataPath spam bug #11

Closed PiezPiedPy closed 5 years ago

PiezPiedPy commented 6 years ago

Fix for the below bug:

While loading, before Main Menu scene.

[EXC 12:55:49.143] 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 'ToolbarManager' on game object 'ToolbarManager'.
See "Script Serialization" page in the Unity Manual for further details.
    KSPUtil.get_ApplicationRootPath ()
    Toolbar.ToolbarManager..cctor ()
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Toolbar.ToolbarManager

Also mentioned on Toolbar Controller issue #2 https://github.com/linuxgurugamer/ToolbarControl/issues/2

PiezPiedPy commented 5 years ago

@linuxgurugamer Have you any thoughts regarding the merge of this PR

linuxgurugamer commented 5 years ago

Sorr for the lateness of this, thanks