Collider Contact Offset#
Physics 3D / Collider / Collider Contact Offset
Description#
Compares the Contact Offset property of Collider component to another value
Parameters#
| Name | Description |
|---|---|
| Collider | |
| Compare | |
| Value |
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
{
[Title("Collider Contact Offset")]
[Category("Physics 3D/Collider/Contact Offset")]
[Description("Compares the Contact Offset property of Collider component to another value")]
[Image(typeof(IconSphereSolid), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Collider")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_Collider_CheckContactOffset : Condition
{
[SerializeField] private GetGameObject m_Collider = new GetGameObject(
new GenTypeGameObject_Collider()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Contact Offset");
return $"{this.m_Collider} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
Collider component = this.m_Collider.Get<Collider>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.contactOffset, (float) this.m_Value.Get(args));
}
}
}