I want to add a secondary highlight script to the framework.
Keep the default highlighting for somethings, but also have a cool comic book style fx for some others.
The idea being i can attach the default highlight script to some hotspots, and my custom comicbook one to other hotspots using the Unity IDE/Editor Component Workflow.
I'm a bit new to c#, unity, and c#/unity software engineering code patterns, but not coding in general.
So I'm not sure what a good SANE way to approach this code and integrating it into the larger framework is ?
Should I just replace the original highlight script ? Is it better to inherit from highlight ?
Do people often just edit the source code of the assets they buy ?
I'm also finding some of the editor driven workflows a bit tricky, when you need to change things globally, so I've kinda leaning to a more code oriented approach.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
At least when it comes to AC, editing the source code should be avoided when possible - as it'll mean such changes are reverted upon importing an update.
The alternative that AC provides is to hook into custom events - which are essentially "signals" that fire when AC performs common tasks, such as having a character speak, or selecting a Hotspot.
Events can be both hooked into via the Events Editor, available in the top toolbar, or via custom script.
More details on this topic can be found in the Manual's "Custom events" chapter, and a tutorial on script-based custom events can be found here.
For custom Hotspot highlighting, you can hook into the OnHotspotSelect and OnHotspotDeselect events to run custom code if a specific Hotspot is selected / de-selected. Boilerplate code:
A more complete example, using this technique to integrate with the Easy Performant Outline asset, can be found on the AC wiki:
https://adventure-creator.fandom.com/wiki/Easy_Performant_Outline_integration
cool thanks!