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

Detailed Description

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

Public Member Functions

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.
 

Public Attributes

bool spawnedIn = false
 True if the prototype entity has been spawned in. Used to determine what LeftPoint() and RightPoint() should return.
 
Vector2 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().
 
Vector2 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().
 

Properties

Vector2 SpawnBasePos [get, set]
 The base position of the patrol zone. This will be set to the entity's position in PrototypeBaseEntity.InitializePatrolZone().
 

Private Member Functions

void OnDrawGizmos ()
 

Private Attributes

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.
 

Member Function Documentation

◆ 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.

Member Data Documentation

◆ 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.

Property Documentation

◆ SpawnBasePos

Vector2 PatrolZoneProto.SpawnBasePos
getset

The base position of the patrol zone. This will be set to the entity's position in PrototypeBaseEntity.InitializePatrolZone().


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