Added a Disable On Finished toggle (disabled by default) that, if enabled, disables the target objects of LeanTween and TweenUI commands once the tween is finished.
Tween commands also enable the target objects before starting the tween. This does not have a way to disable at this time since there are very few cases where tweening a disabled object are viable.
Disable On Finished uses an Invoke to work, meaning any cancel invokes and Stop Tween commands will prevent the command from disabling the target object.
What is the current behavior?
When calling a LeanTween/TweenUI command, the object is not disabled when the tween is finished.
When calling a LeanTween/TweenUI command, if the object is disabled from a prior script or event, the object will remain disabled during the Tween.
What is the new behavior?
If Disable On Finished is enabled, the target objects will be disabled at the end of the tween duration.
If the target objects are disabled, they are enabled before starting the tween command; there is no point tweening a disabled object and it's possible that it was disabled by another tween.
Important Notes
My change require modifcations or additions to documentation
Possibly. A tooltip has been added to the boolean, but information on CancelInvoke() and StopTween() calls as well as information that tweens will enable the target objects could prove useful.
My change modifies the workflow/editing of flowcharts/blocks/commands etc.
elegible to be shown; others are disabled. (the new change will enable the objects anyway regardless of their prior state)
Other information
Important: because I did a silly, this PR includes changes from PR #934 which contains an optional boolean to Writer Audio. When merging this branch, 934 can be deleted as this already contains it.
The changes will affect the following scenarios:
Manually assigning target object states based on the fact that they need to be manually toggled before and after the tween. (a Set Active = false command after a tween will no longer be necessary)
Tween commands that assume unneeded objects or certain objects in the command are disabled will no longer work as the tween command will enable the object anyway. This has niche affects, but could prove to have issues to those who have (for example) multiple characters speaking on a stage, but the player only has certain characters that are
Description
Added a Disable On Finished toggle (disabled by default) that, if enabled, disables the target objects of LeanTween and TweenUI commands once the tween is finished.
Tween commands also enable the target objects before starting the tween. This does not have a way to disable at this time since there are very few cases where tweening a disabled object are viable.
Disable On Finished uses an Invoke to work, meaning any cancel invokes and Stop Tween commands will prevent the command from disabling the target object.
What is the current behavior?
What is the new behavior?
Important Notes
Other information
Important: because I did a silly, this PR includes changes from PR #934 which contains an optional boolean to Writer Audio. When merging this branch, 934 can be deleted as this already contains it.
The changes will affect the following scenarios:
This change was prompted by this discussion on Discord