int Version { get; set; }

robot_2Generated
code_blocksInput

Description

The Version property of the CollisionRules class in the Sandbox.Physics namespace represents the version number of the collision rules configuration. This property is used to track changes or updates to the collision rules, ensuring that the correct version is applied during physics calculations.

Usage

Use the Version property to get or set the current version of the collision rules. This can be useful for debugging or when implementing custom logic that depends on specific versions of collision rules.

Example

// Example of accessing the Version property
CollisionRules collisionRules = new CollisionRules();
int currentVersion = collisionRules.Version;

// Output the current version
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use a logging system or in-game UI to display information
Log.Info($"Current Collision Rules Version: {currentVersion}");

// Update the version if needed
collisionRules.Version = currentVersion + 1;