Collider 2D Can Contact#
Physics 2D / Collider 2D / Collider 2D / Collider 2D Can Contact
Can Read
Cannot Write
Description#
Returns the execution of Can Contact method on the Collider 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("Collider 2D Can Contact")]
[Category("Physics 2D/Collider 2D/Collider 2D/Can Contact")]
[Description("Returns the execution of Can Contact method on the Collider 2D component")]
[Image(typeof(IconDiamondOutline), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Serializable]
public class GenTypeBool_Collider2D_CanContact_1 : TypeBool
{
[SerializeField] private GetGameObject m_Collider2D = new GetGameObject(
new GenTypeGameObject_Collider2D()
);
[SerializeField] private GetGameObject m_Collider = new GetGameObject();
public override bool Get(Args args)
{
Collider2D component = this.m_Collider2D.Get<Collider2D>(args);
if (component == null) return default;
bool value = (bool) component.CanContact(
(Collider2D) this.m_Collider.Get<Collider2D>(args)
);
return value;
}
public override string ToString()
{
return $"{this.m_Collider2D} Can Contact ({this.m_Collider})";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}