BotNavSim  v0.4.3
Mobile Robot Simulation
Destination Class Reference

Sets a random sprite for displaying the robot destination. More...

Inheritance diagram for Destination:
Collaboration diagram for Destination:

Public Member Functions

void ChooseRandomSprite ()
 Chooses the random sprite. More...
 

Public Attributes

Sprite[] sprites
 Sprite library (values set in Unity Inspector) More...
 

Private Member Functions

void Awake ()
 Awake this instance. More...
 
void Update ()
 Set the sprite to face the camera. More...
 

Private Attributes

SpriteRenderer _sr
 Reference to the sprite renderer component. More...
 

Detailed Description

Sets a random sprite for displaying the robot destination.

Definition at line 7 of file Destination.cs.

Member Function Documentation

void Destination.Awake ( )
private

Awake this instance.

Definition at line 29 of file Destination.cs.

29  {
30  _sr = GetComponent<SpriteRenderer>();
31  }
SpriteRenderer _sr
Reference to the sprite renderer component.
Definition: Destination.cs:17
void Destination.ChooseRandomSprite ( )

Chooses the random sprite.

Definition at line 22 of file Destination.cs.

22  {
23  _sr.sprite = sprites[Random.Range(0, sprites.Length-1)];
24  }
SpriteRenderer _sr
Reference to the sprite renderer component.
Definition: Destination.cs:17
Sprite[] sprites
Sprite library (values set in Unity Inspector)
Definition: Destination.cs:12
void Destination.Update ( )
private

Set the sprite to face the camera.

Definition at line 36 of file Destination.cs.

36  {
37  transform.LookAt(CamController.Instance.transform);
38  }
static CamController Instance
Gets the MonoBehaviour instance.
Controls the camera orientation and render modes according to ViewMode in viewModeList user input...

Member Data Documentation

SpriteRenderer Destination._sr
private

Reference to the sprite renderer component.

Definition at line 17 of file Destination.cs.

Sprite [] Destination.sprites

Sprite library (values set in Unity Inspector)

Definition at line 12 of file Destination.cs.


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