23 lines
509 B
C#
23 lines
509 B
C#
using Sandbox;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace VeloX;
|
|
|
|
public abstract partial class VeloXBase
|
|
{
|
|
|
|
public float CombinedLoad { get; protected set; }
|
|
[Property] public List<VeloXWheel> Wheels { get; set; }
|
|
[Property] public TagSet WheelIgnoredTags { get; set; }
|
|
public bool IsOnGround => Wheels.Any( x => x.IsOnGround );
|
|
|
|
public List<VeloXWheel> FindWheels() => [.. Components.GetAll<VeloXWheel>()];
|
|
|
|
[Button]
|
|
public void SetupWheels()
|
|
{
|
|
Wheels = FindWheels();
|
|
}
|
|
}
|