Script for a zone which entities that inherit from BaseEntityController will patrol until a player is in range.
Documentation updated 9/7/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.
|
|
|
Color | leftColor = new Color((170f/255f), (250f/255f), (112f/255f), 1f) |
| In the Unity Editor, the left point will be displayed as a dot with this color.
|
|
Color | rightColor = new Color((62f/255f), (207f/255f), (76f/255f), 1f) |
| In the Unity Editor, the right point will be displayed as a dot with this color.
|
|
◆ LeftPoint()
Vector2 PatrolZoneProto.LeftPoint |
( |
| ) |
|
Returns the position of the left end of the patrol zone.
◆ OnDrawGizmos()
void PatrolZoneProto.OnDrawGizmos |
( |
| ) |
|
|
private |
\breif 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 PatrolZoneProto.RightPoint |
( |
| ) |
|
Returns the position of the right end of the patrol zone.
◆ leftColor
Color PatrolZoneProto.leftColor = new Color((170f/255f), (250f/255f), (112f/255f), 1f) |
|
private |
In the Unity Editor, the left point will be displayed as a dot with this color.
◆ leftEndOffset
Vector2 PatrolZoneProto.leftEndOffset = new Vector2(0f, 0f) |
The offset from SpawnBasePos that the left end of the patrol zone is. The entity will go back and forth between this point and the right end while patrolling. This will be set to leftOffset in PrototypeBaseEntity.InitializePatrolZone().
◆ rightColor
Color PatrolZoneProto.rightColor = new Color((62f/255f), (207f/255f), (76f/255f), 1f) |
|
private |
In the Unity Editor, the right point will be displayed as a dot with this color.
◆ rightEndOffset
Vector2 PatrolZoneProto.rightEndOffset = new Vector2(0f, 0f) |
The offset from SpawnBasePos that the right end of the patrol zone is. The entity will go back and forth between this point and the left end while patrolling. This will be set to rightOffset in PrototypeBaseEntity.InitializePatrolZone().
◆ spawnedIn
bool PatrolZoneProto.spawnedIn = false |
True if the prototype entity has been spawned in. Used to determine what LeftPoint() and RightPoint() should return.
◆ SpawnBasePos
Vector2 PatrolZoneProto.SpawnBasePos |
|
getset |
The documentation for this class was generated from the following file: