Skip to content

Add IActionable.HasAction() method #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MasterDisaster64
Copy link

@MasterDisaster64 MasterDisaster64 commented May 6, 2025

A method that checks if a state has the given action defined, or if the current state in a state machine has it defined. This can be used to easily create "default behaviors" that can be overridden by defining the action.

Basic example:

if (sm.HasAction(TestAction.Attack))
    sm.OnAction(TestAction.Attack);
else
    print(Time.time + ": Not attacking :(");

This is meant to be an alternative to my other PR like this. You can use the one you think would be most performant in most situations.

@MasterDisaster64 MasterDisaster64 changed the title Add Iactionable.HasAction() method Add IActionable.HasAction() method May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant