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