Skip to content
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

New Feature: Have Set Interactable Apply to Children #896

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

Conversation

CG-Tespy
Copy link
Collaborator

@CG-Tespy CG-Tespy commented Oct 4, 2020

Description

New feature, as the title of this PR says.

What is the current behavior?

Set Interactable only works with Selectables set up in the scene in the editor.

What is the new behavior?

It now also works with programmatically-generated Selectables; all you have to do is make sure they're parented to whatever GameObjects you added to the Target Objects field. And that the applyToChildren field is set to true.

This makes it easier to do things like dynamically create battle commands in the UI, and have them able to be interactable or uninteractable with a single command. Without this, you'd have to either limit your command list more, or find some other workaround for your dynamic vision.

Important Notes

  • My change requires modifications or additions to documentation
  • My change modifies the workflow/editing/behaviour of the Set Interactable command. If you set applyToChildren to true, then it also applies the state to all Selectables that are parented to the ones you put in the Target Objects field.
  • I added a scene called 'setInteractableApplyToChildrenTest' to the FungusExamples folder so you can see this feature in action.
  • So that it doesn't break projects using older versions of Fungus, applyToChildren is set to false by default. This makes the command behave just as it did before.
  • I figured I might as well refactor the code for cleanliness, so I did.

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