BotNavSim  v0.4.3
Mobile Robot Simulation
UI_Credits Class Reference

IWindowFunction class for displaying credits. Also inherits from MonoBehaviour to expose credit data to UnityEditor when added as a component to the UI GameObject More...

Inheritance diagram for UI_Credits:
Collaboration diagram for UI_Credits:

Classes

class  Credit
 Serializable (exposed to UnityEditor) for holding creditation data More...
 

Public Attributes

Credit[] credits
 Array of credits exposed and edited in the Unity Inspector More...
 
float width = 500f
 The width of the window. More...
 
bool close
 

Properties

string windowTitle [get]
 
Rect windowRect [get, set]
 
GUI.WindowFunction windowFunction [get]
 
- Properties inherited from IWindowFunction
string windowTitle [get]
 Gets the window title. More...
 
Rect windowRect [get, set]
 Gets or sets the window rect (window size and position). More...
 
GUI.WindowFunction windowFunction [get]
 Gets the window function definition for GUILayout.Window() More...
 

Private Member Functions

void Awake ()
 Awake this instance. More...
 
void Window (int id)
 GUI Window function to display credits in a scroll view. More...
 

Private Attributes

Vector2 _scrollPos = new Vector2()
 

Detailed Description

IWindowFunction class for displaying credits. Also inherits from MonoBehaviour to expose credit data to UnityEditor when added as a component to the UI GameObject

Definition at line 8 of file UI_Credits.cs.

Member Function Documentation

void UI_Credits.Awake ( )
private

Awake this instance.

Definition at line 71 of file UI_Credits.cs.

71  {
72  windowRect = new Rect(0,0,500,500);
73  }
Rect windowRect
Definition: UI_Credits.cs:53
void UI_Credits.Window ( int  id)
private

GUI Window function to display credits in a scroll view.

Definition at line 78 of file UI_Credits.cs.

78  {
79  if (GUILayout.Button("Close")) {
80  close = true;
81  }
82  _scrollPos = GUILayout.BeginScrollView(_scrollPos, true, false);
83  GUILayout.Label(Strings.projectAbout, GUILayout.Width(width-60f));
84  GUILayout.Space (25);
85  GUILayout.Label("The following resources were used in this project: ");
86  GUILayout.Space (25);
87  foreach(Credit c in credits) {
88  GUILayout.Label(c.name + " by " + c.author,GUILayout.Width(width-60f));
89  GUILayout.Label(c.description,GUILayout.Width(width-60f));
90  if (GUILayout.Button(c.url,GUILayout.Width(width-60f))) Application.OpenURL(c.url);
91  GUILayout.Space (50);
92  }
93  GUILayout.EndScrollView();
94  GUI.DragWindow();
95  }
const string projectAbout
Project summary.
Definition: Strings.cs:24
Vector2 _scrollPos
Definition: UI_Credits.cs:66
float width
The width of the window.
Definition: UI_Credits.cs:45
A utility class for strings used in this project.
Definition: Strings.cs:9
bool close
Definition: UI_Credits.cs:64
Credit[] credits
Array of credits exposed and edited in the Unity Inspector
Definition: UI_Credits.cs:40

Member Data Documentation

Vector2 UI_Credits._scrollPos = new Vector2()
private

Definition at line 66 of file UI_Credits.cs.

bool UI_Credits.close

Definition at line 64 of file UI_Credits.cs.

Credit [] UI_Credits.credits

Array of credits exposed and edited in the Unity Inspector

Definition at line 40 of file UI_Credits.cs.

float UI_Credits.width = 500f

The width of the window.

Definition at line 45 of file UI_Credits.cs.

Property Documentation

GUI.WindowFunction UI_Credits.windowFunction
get

Definition at line 57 of file UI_Credits.cs.

Rect UI_Credits.windowRect
getset

Definition at line 53 of file UI_Credits.cs.

string UI_Credits.windowTitle
get

Definition at line 47 of file UI_Credits.cs.


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