---
tags:
    - "UI, Layout"
---

# Canvas Group Is Raycast Location Valid

[UI](../../index.md) / [Layout](../index.md) / [Canvas Group](index.md) / **Canvas Group Is Raycast Location Valid**

## Description

Compares the Is Raycast Location Valid method of Canvas Group component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Canvas Group |  |
| Sp |  |
| Event Camera |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Canvas Group Is Raycast Location Valid")]
    [Category("UI/Layout/Canvas Group/Is Raycast Location Valid")]
    [Description("Compares the Is Raycast Location Valid method of Canvas Group component to another value")]
    
    [Image(typeof(IconCanvasGroup), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Parameter("Canvas Group")]
    [Parameter("Sp")]
    [Parameter("Event Camera")]
    
    [Serializable]
    public class GenConditionBool_CanvasGroup_CheckIsRaycastLocationValid_2 : Condition
    {
        [SerializeField] private GetGameObject m_CanvasGroup = new GetGameObject(
            new GenTypeGameObject_CanvasGroup()
        );
        
        [SerializeField] private GetVector2 m_Sp = new GetVector2();
        
        [SerializeField] private GetGameObject m_EventCamera = new GetGameObject();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Is Raycast Location Valid");
            string parameters = $"({this.m_Sp}, {this.m_EventCamera})";
            return $"{this.m_CanvasGroup} {method}";
        }
        
        protected override bool Run(Args args)
        {
            CanvasGroup component = this.m_CanvasGroup.Get<CanvasGroup>(args);
            if (component == null) return false;
            
            bool value = component.IsRaycastLocationValid(
                (Vector2) this.m_Sp.Get(args),
                (Camera) this.m_EventCamera.Get<Camera>(args)
            );
            
            return value;
        }
    }
}


```

