If you want to set the arguments in the event inspector, the issue is that Animator.SetBool requires two arguments passed, but the UnityEvent inspector only supports setting up a single argument.
As far as I know the easiest way to deal with this is to use a wrapper script e.g.:
public class AnimatorUnityEventHandler
{
public Animator animator;
public string boolName = "myBool";
public void SetBool(bool value)
{
animator.SetBool(boolName, value);
}
}
Here you can call the SetBool method with a single argument via UnityEvent as long as you set up this component with the bool parameter name in the inspector.
Other than that you can create variations of the same idea with UnityEvent e.g. a custom UnityEvent type that receives a the custom parameter data.
It’s a little old this post but I arrived here with the same problem today, so I expose my solution. I made an AnimatorExtension monobehaviour like this:
[RequireComponent(typeof(Animator))]
public class AnimatorExtension : MonoBehaviour
{
Animator animator_;
// Start is called before the first frame update
void Awake()
{
animator_ = GetComponent<Animator>();
}
public void SetBoolTrue(string name) => animator_.SetBool(name, true);
public void SetBoolFalse(string name) => animator_.SetBool(name, false);
}
It’s similar to cmyd solution, but I think is more generic have two calls for true/false and make variable the name argument.