Game.Prefabs.BoneType
Assembly:
Namespace: Game.Prefabs
Type: public enum BoneType
Base: System.Enum
Summary:
Enumeration of bone transform/behavior types used by the prefab animation system (vehicles, props, buildings) to determine how a bone should move or rotate at runtime. Each value instructs the animation/physics code how to compute and apply transforms (e.g., look-at behaviors, wheel rolling, suspension movement, propeller rotation, etc.).
Fields
-
None
No special behavior. The bone is static or driven by a custom animation; no built-in runtime processing. -
LookAtDirection
Bone rotates to face a target direction vector (used for turrets, cameras, or parts that should orient toward a heading). -
WindTurbineRotation
Rotation behavior driven by wind turbine logic (wind speed and turbine parameters control rotation speed). -
WindSpeedRotation
Rotation driven directly by wind speed; useful for simple wind-reactive props like spinning signs. -
RollingTire
Wheel rolling behavior: bone rotates around its axle based on vehicle linear movement (distance traveled → wheel rotation). -
SteeringTire
Steerable wheel: bone rotates for steering angle (left/right) but may also combine with rolling behavior. -
PoweredRotation
Rotation driven by a power/engine source; may use engine RPM/torque or an animation curve. -
TrafficBarrierDirection
Bone or sign that faces/aligns with traffic direction; used for barrier elements that orient along lanes. -
SuspensionMovement
Bone moves along an axis to represent suspension travel (up/down) in response to wheel contact and suspension forces. -
SteeringRotation
Rotation typically used for steering linkages or bones that reflect steering input separate from wheel rolling. -
SuspensionRotation
Bone rotates in response to suspension articulation (e.g., control arms, pivoting parts). -
FixedRotation
Bone rotation is fixed to a specified orientation and not modified by runtime behaviors. -
FixedTire
A tire that does not roll (visual-only or fixed wheel); no rolling calculation applied. -
DebugMovement
Special debug-only movement behavior used during development for testing or visualization of bone transforms. -
VehicleConnection
Bone used as a vehicle-connection point (e.g., hitch, trailer coupling) and may have constrained movement/rotation. -
TrainBogie
Behavior specific to train bogies/trucks: governs pivoting and rotational behavior of wheel assemblies on rail vehicles. -
RollingRotation
Generic rolling rotation (not necessarily a tire): rotate bone based on linear motion along a direction. -
PropellerRotation
Rotates like a propeller; speed typically tied to engine/throttle or animation parameters. -
LookAtRotation
Bone rotates to look at a target transform or position (full 3D look-at behavior). -
LookAtAim
Aimed “look-at” used for targeting/aiming mechanisms where fine control of aim direction is needed. -
PropellerAngle
Controls the pitch angle of a propeller blade (blade pitch), not just RPM rotation. -
PantographRotation
Rotation/positioning behavior for pantographs (roof-mounted power pickup mechanisms on trains/trams). -
SteeringSuspension
Combined steering and suspension behavior for complex wheel assemblies that both steer and have travel. -
LengthwiseLookAtRotation
Look-at rotation constrained along the lengthwise axis of the bone/object (e.g., align along vehicle length). -
WorkingRotation
Rotation used for working machinery parts (e.g., conveyors, articulated machinery) that perform tasks. -
OperatingRotation
Rotation representing operational movement state (e.g., rotating elements when a machine is active). -
TimeRotation
Rotation driven by elapsed time (constant or time-based animation independent of physics). -
LookAtMovementX
Bone moves/offsets along the X axis in response to a target/look-at position or input. -
LookAtMovementY
Bone moves/offsets along the Y axis in response to a target/look-at position or input. -
LookAtMovementZ
Bone moves/offsets along the Z axis in response to a target/look-at position or input. -
LookAtRotationSide
Look-at rotation applied with a side/offset bias (used when the look-at orientation should favor one side). -
RotationXFromMovementY
Compute bone X rotation from movement along the Y axis (e.g., tilt caused by vertical displacement). -
ScaledMovement
Movement/translation scaled by a factor (useful for exaggerated or reduced response to inputs). -
LookAtAimForward
Look-at aimed forward with constraints; used for forward-facing aim behaviors with limited degrees of freedom.
Properties
This enum has no properties. Enums are value types representing a discrete set of named constants.
Constructors
Enums do not expose public constructors. Instances are created by assigning one of the named enum values.
Methods
No methods are defined on this enum. Behavior for each BoneType is implemented by the prefab/animation runtime code that interprets the enum value.
Usage Example
using Game.Prefabs;
public void ApplyBoneBehavior(PrefabBone bone, float deltaTime)
{
switch (bone.Type)
{
case BoneType.RollingTire:
// Example: rotate based on distance traveled
float distance = bone.AttachedWheel.GetDistanceTravelled();
float radius = bone.AttachedWheel.Radius;
float rotationDeg = (distance / (2f * Mathf.PI * radius)) * 360f;
bone.Transform.localRotation = Quaternion.Euler(rotationDeg, 0f, 0f);
break;
case BoneType.LookAtRotation:
// Example: rotate to look at a target position
Vector3 dir = (bone.TargetPosition - bone.Transform.position).normalized;
bone.Transform.rotation = Quaternion.LookRotation(dir);
break;
case BoneType.SuspensionMovement:
// Example: offset along local Y by suspension compression
float compression = bone.AttachedWheel.GetSuspensionCompression();
bone.Transform.localPosition = new Vector3(0f, -compression * bone.SuspensionScale, 0f);
break;
default:
// No built-in behavior; bone may be animated or static
break;
}
}
Notes: - The exact runtime implementation and data structures (PrefabBone, AttachedWheel, etc.) will depend on the game's modding API. This enum is intended to be read by that runtime code to decide which simulation/animation rule to apply to a bone.