Overlap Point#
Physics 2D / Overlap Point Point, LayerMask, MinDepth, MaxDepth
Can Read
Cannot Write
Description#
Returns the execution of Overlap Point 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 Point")]
[Category("Physics 2D/Overlap Point", "Point, LayerMask, MinDepth, MaxDepth")]
[Description("Returns the execution of Overlap Point static method on the Physics 2D class")]
[Image(typeof(IconPhysics), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeGameObject_Physics2D_OverlapPoint_4_Vector2Point_IntLayerMask_FloatMinDepth_FloatMaxDepth : TypeGameObject
{
[SerializeField] private GetVector2 m_Point = 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.OverlapPoint(
(Vector2) this.m_Point.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.OverlapPoint(
(Vector2) this.m_Point.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 Point ({this.m_Point}, {this.m_LayerMask}, {this.m_MinDepth}, {this.m_MaxDepth})";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}