ManlyMarco / RuntimeUnityEditor

In-game inspector and debugging tools for applications made with Unity3D game engine
GNU General Public License v3.0
802 stars 98 forks source link

Incompatible with games not using UnityEngine.Input #21

Closed baconwaifu closed 2 years ago

baconwaifu commented 3 years ago

Semi-relevant stack dump:

InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
  at (wrapper managed-to-native) UnityEngine.Input.GetKeyDownInt(UnityEngine.KeyCode)
  at UnityEngine.Input.GetKeyDown (UnityEngine.KeyCode key) [0x00001] in <a107d7e36e0048b18d7edb390dccd66c>:0
  at RuntimeUnityEditor.Core.RuntimeUnityEditorCore.Update () [0x00006] in <903752223476428390903c751060257d>:0
  at RuntimeUnityEditor.Bepin5.RuntimeUnityEditor5.Update () [0x00005] in <e01f6b065baf41b397d75560545aa04d>:0

Unfortunately, fixing this would require some spaghetti to detect which input system is in use, and then select appropriately. Which game is irrelevant, since this affects every game using the "new" input event system.

ManlyMarco commented 3 years ago

Spaghetti is the only way to solve this without having two different projects for each version. All places where input is used would need to be routed into an abstraction layer and dealt with in there through reflection.

Do you have any examples of games where this is an issue?

mindphluxnet commented 3 years ago

I have an example I was just trying to work on:

Elmarion: The Lost Temple (https://store.steampowered.com/app/1476230/Elmarion_the_Lost_Temple/), there's a free demo that doesn't want to cooperate because of this issue.

Anoyomouse commented 2 years ago

Trying this with Timberborn (specifically the experimental branch), same issue as above

ManlyMarco commented 2 years ago

Can you test these builds to see if input works in all games now? input abstraction test build.zip F1 for config manager, F12 for runtime editor.

ManlyMarco commented 2 years ago

Solved in ff186f15c4739b86c839864a6a54e49d1cba6166