Heya! I wanted to do something very specific but was struggling a little with customizing the UI.
My settings are --
Interaction Method: Choose Hotspot then interaction
Select interactions by "Clicking Menu"
See interactions with "Click on Hotspot"
For the Hotspot buttons I want to--
- Have a base graphic upon which the icon sits on. This way I can have a border around the icons I can update independently of the icon itself.
example: https://imgur.com/fKLEwr6
- Have the border graphic change display based on whether or not the player has seen the interaction or not. [for example: Gold flashing border around unseen interactions. Grey border around seen interactions or when no more interactions are left in the sequence] Important to show that a hotspot has a sequence of interactions to go through in order to see them all. This also needs to be saved in the save data.
example: https://imgur.com/ehoA3aR
- And last I wanted it to have animations on mouseover, and when clicked on.
Any advice on the best way to do this within this engine?
For the cursor I want to--
- Have the cursor change based on whether the interactable hotspot is a person or an environmental object. Right now it appears it can only be one thing.
Comments
Welcome to the community, @Jhano.
If you set your Interaction menu's Source to Unity Ui Prefab, then you'll be able to decorate your Interaction element with an additional border Image in its Hierarchy. This mode will also be necessary for the other topics you mention.
Using Unity UI with AC menus can be a little trickier that AC's built-in option, but it offers much more control when it comes to styling and custom behaviour. For details, see the Manual's "Unity UI menus" chapter, as well as this tutorial.
The default Interaction menu will work with Unity UI, which you can restyle by opening up the linked InteractionUI canvas prefab.
This'll require some scripting.
You'll first need a script, attached to a Hotspot, that records which "Use" buttons have been run by the player. This is possible by hooking into the OnHotspotInteract custom event. Custom events are a way of running custom code when AC performs common tasks - a tutorial on their usage can be found here.
If you also have this script derive from AC's Remember class, you can have it store its button-usage record within save-game files. A tutorial on saving custom scene data can be found here.
Here's a script (RememberHotspotChoices.cs) that you can attach to your Hotspots to perform the above:
The second script you'll need is one that is attached to your Interaction menu prefab, and updates the background graphic based on the first script's HasInteractionBeenSeen function. This too relies on a custom event - this time, OnMenuTurnOn, which will fire when a menu is turned on.
This one's a bit more complicated, as you'll need to update it's Inspector with details of each Interaction button and its border Image component:
Animated interaction icons can be handled in a couple of ways:
When using Choose Hotspot Then Interaction mode, the Cursor Manager's "Hospot cursor" texture is fixed. However, it is possible to change this field - and any Manager field - at runtime through script. To do so, just right-click on the field's label to get an API reference to it.
Here's a script that - when placed in the scene - will alter the texture based on whether or not the last-selected Hotspot has an NPC component or not:
I appreciate there's a lot to go through here, so just let me know if you have any issues and I'll guide you through them further.
Thank you very much! You've really gone above and beyond in your answer here. I'll get on it and see how it goes. Fingers crossed.