Character Controller Height#
Physics 3D / Collider / Character Controller / Character Controller Height
Can Read
Can Write
Description#
The Height property of the Character Controller 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]
[Set]
[Title("Character Controller Height")]
[Category("Physics 3D/Collider/Character Controller/Height")]
[Description("The Height property of the Character Controller component")]
[Image(typeof(IconCapsuleSolid), ColorTheme.Type.Lime, typeof(BadgeCharacter))]
[Keywords("Physics, 3D, Kinematic")]
[Serializable]
public class GenTypeNumber_CharacterController_Height : TypeNumber
{
[SerializeField] private GetGameObject m_CharacterController = new GetGameObject(
new GenTypeGameObject_CharacterController()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_CharacterController.GetPreview(source);
if (instance == null) return default;
CharacterController component = instance.GetComponent<CharacterController>();
return component != null ? component.height : default;
}
public override double Get(Args args)
{
CharacterController instance = this.m_CharacterController.Get<CharacterController>(args);
return instance != null
? instance.height
: default;
}
public override void Set(double value, Args args)
{
CharacterController component = this.m_CharacterController.Get<CharacterController>(args);
if (component != null) component.height = (float) value;
}
public override string ToString()
{
return $"{this.m_CharacterController} Height";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}