so I am programming a 2D game in Unity using C#. I have got a mainmenu, where you can buy one skin for now. After buying the skin, it gets transferred to your inventory, where you can activate it. At this time, everything works, except activating the skin. I do not know how to start implementing it, I have tried updating the Sprite in the SpriteRenderer of the old player, but the problem is, that the old player is in the scene "Game", whereas the activate button with the new skin is in the "mainmenu" scene, which is why I cant access it. Any ideas on how to properly do it? I want that after you press the activate button, the skin itself gets updated in the background, but the game itself should not directly start. It should rather start after pressing the "Play" button in the mainmenu. I would appreciate some help or any ideas in general on how to do it!
I created an "ActivateButtonController" script, which is attached to the GameObject that represents the "Activate" button. This script handles the skin activation functionality.
In the "ActivateButtonController" script, I provided a public variable to reference the new player skin prefab. This variable is assigned in the Inspector with the desired skin prefab.
When the "Activate" button is pressed, the "OnActivateButtonPressed()" method in the "ActivateButtonController" script is called.
In the "OnActivateButtonPressed()" method, I tried loading the game scene by calling SceneManager.LoadScene("Game");. At this point, the game scene is loaded, and the player is replaced with the new skin, but this is of course not what I want, since the game should start by pressing "Play".