C# Класс ShowInfoPanel, astrochimps

This class will create an object and put it as a child from another. It's show a text in the screen, right above the parent object, and then move it towards the top of the screen (like a score info from an old-school game). Useful, for instance, to show a player what resource an extractor is extracting and it's amount
Наследование: MonoBehaviour
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
mySkin UnityEngine.GUISkin

Открытые методы

Метод Описание
OnGUI ( ) : void

Actually draws the text on screen

SetInfoText ( string newText, Vector3 position ) : void

Set the text to be shown and it's initial position

Start ( ) : void
Update ( ) : void

Приватные методы

Метод Описание
BeingRenderedOnCamera ( ) : bool

Check if the object is being rendered in the screen. If not, there's no need to display the info text, right?

Описание методов

OnGUI() публичный Метод

Actually draws the text on screen
public OnGUI ( ) : void
Результат void

SetInfoText() публичный Метод

Set the text to be shown and it's initial position
public SetInfoText ( string newText, Vector3 position ) : void
newText string String with the text to be shown
position Vector3
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

Update() публичный Метод

public Update ( ) : void
Результат void

Описание свойств

mySkin публичное свойство

public GUISkin,UnityEngine mySkin
Результат UnityEngine.GUISkin