Box Collider Center#
Physics 3D / Collider / Box Collider / Box Collider Center
Description#
Compares the Center property of Box Collider component to another value
Parameters#
| Name | Description |
|---|---|
| Box Collider | |
| 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("Box Collider Center")]
[Category("Physics 3D/Collider/Box Collider/Center")]
[Description("Compares the Center property of Box Collider component to another value")]
[Image(typeof(IconCubeSolid), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Box Collider")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_BoxCollider_CheckCenter : Condition
{
[SerializeField] private GetGameObject m_BoxCollider = new GetGameObject(
new GenTypeGameObject_BoxCollider()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Center");
return $"{this.m_BoxCollider} {member} = {this.m_Value}";
}
protected override bool Run(Args args)
{
BoxCollider component = this.m_BoxCollider.Get<BoxCollider>(args);
if (component == null) return false;
return component.center == (Vector3) this.m_Value.Get(args);
}
}
}