Property | Type | Description | |
---|---|---|---|
asteroidCount | int | ||
asteroidMaxRotation | int | ||
asteroidMaxScale | int | ||
asteroidMaxVelocity | int | ||
asteroidMinRotation | int | ||
asteroidMinScale | int | ||
asteroidMinVelocity | int | ||
asteroidTemplates | List |
||
negativeXTrajectory | bool | ||
negativeYTrajectory | bool | ||
negativeZTrajectory | bool | ||
positiveXTrajectory | bool | ||
positiveYTrajectory | bool | ||
positiveZTrajectory | bool |
Method | Description | |
---|---|---|
Start ( ) : void |
Initialize script.
|
|
Update ( ) : void |
Per frame update. Performs asteroid update.
|
Method | Description | |
---|---|---|
CreateAsteroid ( ) : GameObject |
Creates a new Asteroid object randomly from the avaiable templates.
|
|
IsAsteroidInCube ( GameObject asteroid ) : bool |
Checks if asteroid is in cube.
|
|
PlaceAsteroid ( GameObject asteroid ) : void |
Picks a random trajectory through the cube of those allowed by the script parameters and applies a random force and rotation on the asteroid in that direction.
|
|
RandomFacePoint ( ) : Vector3 |
Randomly selects a point from one of the six cube faces. If a selected face is one that is deactivated by the trajectory params for the script then selects again.
|
|
UpdateAsteroid ( GameObject asteroid ) : void |
Performs asteroid frame update. We use physics to move asteroids so this function merely picks a new trajectory for the asteroid if we reach the edge of the cube.
|