Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Overlap Area#

Physics 2D / Overlap Area PointA, PointB, LayerMask, MinDepth, MaxDepth

  • Can Read

  • Cannot Write

Description#

Returns the execution of Overlap Area static method on the Physics 2D class

Code#

// <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;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Overlap Area")]
    [Category("Physics 2D/Overlap Area", "PointA, PointB, LayerMask, MinDepth, MaxDepth")]
    [Description("Returns the execution of Overlap Area static method on the Physics 2D class")]

    [Image(typeof(IconPhysics), ColorTheme.Type.Lime, typeof(Badge2D))]
    [Keywords("Physics, 2D")]

    [Serializable]
    public class GenTypeGameObject_Physics2D_OverlapArea_5_Vector2PointA_Vector2PointB_IntLayerMask_FloatMinDepth_FloatMaxDepth : TypeGameObject
    {
        [SerializeField] private GetVector2 m_PointA = new GetVector2();

        [SerializeField] private GetVector2 m_PointB = new GetVector2();

        [SerializeField] private GetInteger m_LayerMask = new GetInteger();

        [SerializeField] private GetNumber m_MinDepth = new GetNumber();

        [SerializeField] private GetNumber m_MaxDepth = new GetNumber();

        public override GameObject Get(Args args)
        {
            Collider2D value = (Collider2D) Physics2D.OverlapArea(
                (Vector2) this.m_PointA.Get(args),
                (Vector2) this.m_PointB.Get(args),
                (int) this.m_LayerMask.Get(args),
                (float) this.m_MinDepth.Get(args),
                (float) this.m_MaxDepth.Get(args)
            );
            return value != null ? value.gameObject : null;
        }

        public override U Get<U>(Args args)
        {
            if (typeof(U) == typeof(Physics2D))
            {
                return Physics2D.OverlapArea(
                    (Vector2) this.m_PointA.Get(args),
                    (Vector2) this.m_PointB.Get(args),
                    (int) this.m_LayerMask.Get(args),
                    (float) this.m_MinDepth.Get(args),
                    (float) this.m_MaxDepth.Get(args)
                ) as U;
            }

            return base.Get<U>(args);
        }

        public override string ToString()
        {
            return $"Physics 2D Overlap Area ({this.m_PointA}, {this.m_PointB}, {this.m_LayerMask}, {this.m_MinDepth}, {this.m_MaxDepth})";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.