Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
GebRock Class Reference

Detailed Description

Script for both the rocks that Geb throws and the debris that fall when Geb's walls break. This script detects when the rock collides with any object on collisionLayers (defined on this script in the Inspector). Optionally, this script can have a chance to spawn a rock golem upon impact. If a rock golem is not spawned, the rock will break instead.

Documentation updated 1/11/2025

Author
Alexander Art

Public Attributes

LayerMask collisionLayers
 The layers that the rock will detect when collided with.
 
float spawnProbability = 0.5f
 The probability for a rock golem to spawn on collision.
 

Protected Attributes

GebRoomController gebRoomController
 Reference to Geb's room controller.
 
GameObject rockGolem
 Reference to the rock golem prefab that the rocks spawn.
 

Private Member Functions

void Awake ()
 
void OnTriggerEnter2D (Collider2D col)
 

Private Attributes

System.Random rng = new System.Random()
 Create random number generator.
 

Member Function Documentation

◆ Awake()

void GebRock.Awake ( )
private

◆ OnTriggerEnter2D()

void GebRock.OnTriggerEnter2D ( Collider2D col)
private

Member Data Documentation

◆ collisionLayers

LayerMask GebRock.collisionLayers

The layers that the rock will detect when collided with.

◆ gebRoomController

GebRoomController GebRock.gebRoomController
protected

Reference to Geb's room controller.

◆ rng

System.Random GebRock.rng = new System.Random()
private

Create random number generator.

◆ rockGolem

GameObject GebRock.rockGolem
protected

Reference to the rock golem prefab that the rocks spawn.

◆ spawnProbability

float GebRock.spawnProbability = 0.5f

The probability for a rock golem to spawn on collision.


The documentation for this class was generated from the following file: