homothetyhk / HollowKnight.BenchwarpMod

Mod to adjust bench respawn location ingame
GNU Lesser General Public License v2.1
24 stars 21 forks source link

The mod outputs garbage logs #27

Closed ghost closed 2 years ago

ghost commented 2 years ago

https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/TopMenu.cs#L418 https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/TopMenu.cs#L428 https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/TopMenu.cs#L413

Using HeroController.instance to check for player presence will cause UnityLogger to output a lot of garbage, use HeroController.UnsafeInstance instead.The same is true for GameManager.instance.

ghost commented 2 years ago

https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/CanvasUtil/CanvasButton.cs#L69-L71 https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/CanvasUtil/CanvasButton.cs#L46-L58 https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/CanvasUtil/CanvasText.cs#L42-L48 https://github.com/homothetyhk/HollowKnight.BenchwarpMod/blob/7047c5b235f6e4281ce960e47e08f41140c6dc1e/Benchwarp/CanvasUtil/CanvasImage.cs#L34-L42 UnityEngine.Object.DontDestroyOnLoad can only be used for root objects, otherwise it will output "DontDestroyOnLoad only works for root GameObjects or components on root GameObjects."

homothetyhk commented 2 years ago

Closed by #28.