Rune580 / LethalCompanyInputUtils

GNU Lesser General Public License v3.0
12 stars 5 forks source link

[Bug]: Unable to use unity debugger with InputUtils lib #35

Open DiFFoZ opened 6 months ago

DiFFoZ commented 6 months ago

Acknowledgements

Lobby Related

No

Lobby Acknowledgements

InputUtils Version

-

Game Version

-

Describe the bug

[Error  : Unity Log] UnityException: CreateScriptableObjectInstanceFromType is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'Plugin' on game object 'BepInEx_Manager'.
See "Script Serialization" page in the Unity Manual for further details.
Stack trace:
UnityEngine.ScriptableObject.CreateInstance (System.Type type) (at <e27997765c1848b09d8073e5d642717a>:IL_0001)
UnityEngine.ScriptableObject.CreateInstance[T] () (at <e27997765c1848b09d8073e5d642717a>:IL_0001)
LethalCompanyInputUtils.Api.LcInputActions..ctor () (at /home/runner/work/LethalCompanyInputUtils/LethalCompanyInputUtils/LethalCompanyInputUtils/Api/LcInputActions.cs:39)
InventoryFixPlugin.Keybinds..ctor () (at <f92c6f5b829748f487607ff156405879>:IL_0000)
InventoryFixPlugin.Plugin..cctor () (at <f92c6f5b829748f487607ff156405879>:IL_0000)
Rethrow as TypeInitializationException: The type initializer for 'InventoryFixPlugin.Plugin' threw an exception.
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.InputSystem.InputSystem:.cctor()

Unable to use debug unity with InputUtils library

Reproduction steps

-

ModPack code or file

-

Logs

-

Additional context

No response

Rune580 commented 6 months ago

Weird, I have no idea why this happens, and I'm not sure how to go about solving it either.

DiFFoZ commented 6 months ago

What about to queue LcInputActions and then process them in next Update frame?