InverNessian / SafeguardsOfLeyto

For development of my game by the same name.
1 stars 0 forks source link

EventSystem #11

Closed InverNessian closed 5 years ago

InverNessian commented 5 years ago

I need to figure out how to effectively use the Events System that Unity has. It's a great way to avoid having specific hard codes for all my talents that key off of particular conditions. Custom events would make this super easy.

InverNessian commented 5 years ago

Finally got my first custom event working! You can extend the UnityEvent class to have any number of parameters of specified types and Unity will handle them. I created an ActionEvent class for now to handle this but it might be nice to have different types for the different action types, such as CombatEvent, MoveEvent, and so forth.

InverNessian commented 5 years ago

I think I need to find a way to vary my Events, otherwise I'll need a unique Event for every special action! That might be a bit overwhelming... but it might also be the best way of doing things? Ugh.

InverNessian commented 5 years ago

This is now well underway. The concept is tested and works, I just need to expand it. I do plan to have the unique event for each possible action, since some effects (Such as Inspire) can have multiple triggers off of one event. This allows for maximum granularity.

InverNessian commented 5 years ago

It may be easier to use delegates for this? At least for combat events & talents, that's what I had to do.