public void OnValidateCmd(MenuItemValidationArgs args) { Debug.Log("Validate Command: " + args.Command); if (args.Command == "DisabledCmd") { args.IsValid = false; } }
private bool IsValid() { if (m_item == null) { return(false); } if (m_item.Validate == null) { return(true); } MenuItemValidationArgs args = new MenuItemValidationArgs(m_item.Command); m_item.Validate.Invoke(args); return(args.IsValid); }
private MenuItemValidationArgs IsValid(bool checkChildren) { if (m_item == null) { return(new MenuItemValidationArgs(m_item.Command, checkChildren && HasChildren) { IsValid = false, IsVisible = false }); } if (m_item.Validate == null) { return(new MenuItemValidationArgs(m_item.Command, checkChildren && HasChildren) { IsVisible = true }); } MenuItemValidationArgs args = new MenuItemValidationArgs(m_item.Command, checkChildren && HasChildren); m_item.Validate.Invoke(args); return(args); }
private MenuItemValidationArgs IsValid() { if (m_item == null) { return(new MenuItemValidationArgs(m_item.Command) { IsValid = false, IsVisible = false }); } if (m_item.Validate == null) { return(new MenuItemValidationArgs(m_item.Command) { IsValid = true, IsVisible = true }); } MenuItemValidationArgs args = new MenuItemValidationArgs(m_item.Command); m_item.Validate.Invoke(args); return(args); }