Description
The Rotation
method is an extension method for the System.Random
class, provided by the Sandbox.SandboxSystemExtensions
class. It generates a random Rotation
object, which can be used in various 3D transformations and operations within the Sandbox environment.
Usage
To use the Rotation
method, you need to have an instance of System.Random
. This method extends the Random
class, allowing you to call it directly on any Random
object. The method does not require any additional parameters beyond the Random
instance itself.
Example
// Example of using the Rotation extension method
// Create a new instance of System.Random
Random random = new Random();
// Generate a random Rotation
Rotation randomRotation = random.Rotation();
// Use the randomRotation in your application
// For example, apply it to a game object or component
GameObject myObject = new GameObject();
myObject.Transform.Rotation = randomRotation;