Behavior: Request to publicize ConditionUtils.CheckConditions

Hey Behavior team,

I’ve got a fairly simple request, I think. ConditionUtils has a nice function that all of the conditional based comparisons are using to determine each tick if the conditions have been satisfied or not. Unfortunately, this function is currently set to internal so only classes built with the Unity.Behavior assembly can use it. From what users can see when inspecting the decompiled code, it’s not doing anything complex that requires the use of the internal keyword. Marking it as internal means that anyone who wants to utilize conditional checks in their own custom nodes will have to have a copy of that code in their own assembly rather than using the same code the rest of the behavior system uses.

I ran into this when implementing a Wait (Conditional) node (which may be a good request in itself for a generic node to be added) for a certain behavior I was working on. I can workaround for now and just copy the code its using, but it would be better to directly use what the other conditional based nodes are using in case things change with future upgrades to the package. Thanks!

Edit: Spoke a little too soon, I’m guessing something is using IConditional to control the drawing of the actual special condition sections of the in-built nodes as simply serializing a List of Conditions and the boolean for RequiresAllConditions does not show the assign condition section in the inspector. IConditional may also need to be public rather than internal in that case

2 Likes

I completely agree with you. I think we tried to do something quite similar.
I tried to create a more generic action inspired by ConditionalGuardAction to wait until the condition was met. However, when I saw the number of members marked as internal, I gave up. I’d have to replicate the entire verification logic.
I ended up deciding to make a more specific action just to meet that purpose.

1 Like

Hi @zkrizo

Thank you for raising this, we are currently working toward our feature planning for the upcoming year and your point has been raised and put on the board during the meeting (especially the point about exposing Utility function we use for built-in node).

Several users has been asking for the same in regard to IConditional so we will probably look into it sooner or later.

Sorry for the inconvenience and thank you for your patience :bowing_man: