snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.63k stars 291 forks source link

Clickable character (New Feature) #984

Open breadnone opened 3 years ago

breadnone commented 3 years ago

Description

Make character portraits on stage to be interactable (clickable).

What is the current behavior?

There's no easy way to achieve clickable character in Fungus currently as Fungus character portrait system mostly handled on runtime.

What is the new behavior?

User can choose the behavior of their character by assigning block to be executed when click occurs on character portraits. This will give them freedom and space to be more creative with their character.

https://user-images.githubusercontent.com/64100867/121684114-79d29780-cae8-11eb-8a03-f652665f929e.mp4

image

New command to toggle the state of clickable character image

Important Notes

Other information

Tested this on my current project and worked wonders (for my use cases) but needs more further testing. Let me know if you find any bugs so I can fix it. Thanks!

Sorry had to opening/closing same PRs due to lates windows update nuked my git entirely. Had to clean reinstalled and walah!

Edit: Added screenshot for clickable character command Edit2: Added new screenshot. Character inspector now can get a list of connected blocks via custom editor

breadnone commented 3 years ago

I thought using EventTrigger rather than manually getting Raycast hit would be much cheaper and much more cleaner

breadnone commented 3 years ago

Added dedicated command to toggle on/off the clickable state.

All is done, let me know if there's any other things that you want to be added, and please test it on your end if you can. Thanks!

breadnone commented 3 years ago

I should mention that the goal of this pr is to have more control over a character, like in Renp'y..