Script for a zone which entities that inherit from BaseEntityController will patrol until a player is in range. Also used by Geb and his rock golems to stay within the bossroom.
Documentation updated 8/26/2024
- Author
- Roy Pascual
|
Vector2 | LeftPoint () |
| Returns the position of the left end of the patrol zone.
|
|
Vector2 | RightPoint () |
| Returns the position of the right end of the patrol zone.
|
|
|
void | OnDrawGizmos () |
| Shows icons for the left and right ends in the Unity Editor scene view. This allows developers to see where these points are so they can be easily adjusted.
|
|
void | Awake () |
| Sets the left and right ends and sets their references so their positions can be accessed later.
|
|
◆ Awake()
void PatrolZone.Awake |
( |
| ) |
|
|
private |
Sets the left and right ends and sets their references so their positions can be accessed later.
◆ LeftPoint()
Vector2 PatrolZone.LeftPoint |
( |
| ) |
|
Returns the position of the left end of the patrol zone.
◆ OnDrawGizmos()
void PatrolZone.OnDrawGizmos |
( |
| ) |
|
|
private |
Shows icons for the left and right ends in the Unity Editor scene view. This allows developers to see where these points are so they can be easily adjusted.
- Important
- Must be commented out or removed to export the game. Otherwise, Unity will throw compiler errors.
◆ RightPoint()
Vector2 PatrolZone.RightPoint |
( |
| ) |
|
Returns the position of the right end of the patrol zone.
◆ leftEnd
Transform PatrolZone.leftEnd |
|
private |
Reference to a point representing the left end of the patrol zone. The entity will go back and forth between this point and rightEnd while patrolling.
◆ rightEnd
Transform PatrolZone.rightEnd |
|
private |
Reference to a point representing the right end of the patrol zone. The entity will go back and forth between this point and leftEnd while patrolling.
The documentation for this class was generated from the following file: