Rigidbody 2D Is Touching Layers#
Physics 2D / Rigidbody 2D / Rigidbody 2D Is Touching Layers LayerMask
Can Read
Cannot Write
Description#
Returns the execution of Is Touching Layers method on the Rigidbody 2D component
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("Rigidbody 2D Is Touching Layers")]
[Category("Physics 2D/Rigidbody 2D/Is Touching Layers", "LayerMask")]
[Description("Returns the execution of Is Touching Layers method on the Rigidbody 2D component")]
[Image(typeof(IconPhysics), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeBool_Rigidbody2D_IsTouchingLayers_1_IntLayerMask : TypeBool
{
[SerializeField] private GetGameObject m_Rigidbody2D = new GetGameObject(
new GenTypeGameObject_Rigidbody2D()
);
[SerializeField] private GetInteger m_LayerMask = new GetInteger();
public override bool Get(Args args)
{
Rigidbody2D component = this.m_Rigidbody2D.Get<Rigidbody2D>(args);
if (component == null) return default;
bool value = (bool) component.IsTouchingLayers(
(int) this.m_LayerMask.Get(args)
);
return value;
}
public override string ToString()
{
return $"{this.m_Rigidbody2D} Is Touching Layers ({this.m_LayerMask})";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}