Wheel Collider Is Grounded#
Physics 3D / Collider / Wheel Collider / Wheel Collider Is Grounded
Can Read
Cannot Write
Description#
The Is Grounded property of the Wheel Collider 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("Wheel Collider Is Grounded")]
[Category("Physics 3D/Collider/Wheel Collider/Is Grounded")]
[Description("The Is Grounded property of the Wheel Collider component")]
[Image(typeof(IconWheel), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Serializable]
public class GenTypeBool_WheelCollider_IsGrounded : TypeBool
{
[SerializeField] private GetGameObject m_WheelCollider = new GetGameObject(
new GenTypeGameObject_WheelCollider()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_WheelCollider.GetPreview(source);
if (instance == null) return default;
WheelCollider component = instance.GetComponent<WheelCollider>();
return component != null ? component.isGrounded : default;
}
public override bool Get(Args args)
{
WheelCollider instance = this.m_WheelCollider.Get<WheelCollider>(args);
return instance != null
? instance.isGrounded
: default;
}
public override string ToString()
{
return $"{this.m_WheelCollider} Is Grounded";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}