C# Класс UIScreen, Unity-UI-Framework

UIScreen contains dictionaries which keeps references to all Text, Slider, Image.
Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
imageDict Image>.Dictionary
sliderDict Slider>.Dictionary
textDict Text>.Dictionary

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

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

Deactivates the instance of a gameObject that UI_Screen is attached to.

GetImage ( string imageName ) : Image

Returns an instance of an image.

GetSlider ( string sliderName ) : Slider,

Returns an instance of a slider.

GetText ( string textName ) : Text

Returns an instance of a Text gameObject.

OpenThisScreen ( ) : void

Activates the instance of a gameObject that UI_Screen is attached to.

SetImageColor ( string imageName, Color setColor ) : void

Takes in a Unity's Color component and sets the Image Component to that that color.

SetImageColor ( string imageName, float r, float g, float b, float a = 1 ) : void

Takes in Unity's Color RGBA values as a float between 0 and 1 and sets the ImageComponent to that color.

SetImageFill ( string imageName, float fillValue ) : void
SetSliderFill ( string sliderName, float sliderValue ) : void

Sets the slider's fill value to the desired amount.

SetSliderFill ( string sliderName, int sliderValue ) : void

Overloads the SetSliderFill method to take in whole numbers (integers) and set the value of the slider to that value.

SetText ( string textName, string screenText ) : void

Sets the text variable in the Text gameObject to a custom string.

SetUp ( ) : void

Populates the dictionaries with references to all Text, Image, and Slider components within the scene.

TextProgression ( string textName, string rollingText, KeyCode, interruptKey ) : System.Collections.IEnumerator

Sets text to progress one letter at a time

Защищенные методы

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

Unity's Start() method; this checks to see if the dictionaries are built up, if not then it builds up the dictionaries.

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

Метод Описание
SetUpImageDict ( Image imageList ) : void

Builds the imageDict with keys as a unique Image Component's name and value as the associated Image's object.

SetUpSliderDict ( Slider, sliderList ) : void

Builds the sliderDict with keys as a unique Slider Component's name and value as the associated Slider's object.

SetUpTextDict ( Text textList ) : void

Builds the textDict with keys as a unique Text Component's name and the value as the associated Text's object.

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

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

Deactivates the instance of a gameObject that UI_Screen is attached to.
public CloseThisScreen ( ) : void
Результат void

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

Returns an instance of an image.
public GetImage ( string imageName ) : Image
imageName string Name of the image gameObject
Результат Image

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

Returns an instance of a slider.
public GetSlider ( string sliderName ) : Slider,
sliderName string Name of the slider gameObject
Результат Slider,

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

Returns an instance of a Text gameObject.
public GetText ( string textName ) : Text
textName string Name of the text gameObject.
Результат Text

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

Activates the instance of a gameObject that UI_Screen is attached to.
public OpenThisScreen ( ) : void
Результат void

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

Takes in a Unity's Color component and sets the Image Component to that that color.
public SetImageColor ( string imageName, Color setColor ) : void
imageName string Name of the Image Component
setColor Color Color value
Результат void

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

Takes in Unity's Color RGBA values as a float between 0 and 1 and sets the ImageComponent to that color.
public SetImageColor ( string imageName, float r, float g, float b, float a = 1 ) : void
imageName string Name of the Image Component
r float Float value between 0 and 1 for the red component
g float Float value between 0 and 1 for the green component
b float Float value between 0 and 1 for the blue component
a float Float value between 0 and 1 for the alpha component
Результат void

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

public SetImageFill ( string imageName, float fillValue ) : void
imageName string
fillValue float
Результат void

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

Sets the slider's fill value to the desired amount.
public SetSliderFill ( string sliderName, float sliderValue ) : void
sliderName string Name of the slider component
sliderValue float Float value between the min and the max values.
Результат void

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

Overloads the SetSliderFill method to take in whole numbers (integers) and set the value of the slider to that value.
public SetSliderFill ( string sliderName, int sliderValue ) : void
sliderName string Name of the slider component (string)
sliderValue int Integer value of the slider's value between the min and max values.
Результат void

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

Sets the text variable in the Text gameObject to a custom string.
public SetText ( string textName, string screenText ) : void
textName string Name of the Text Component
screenText string The string to display
Результат void

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

Populates the dictionaries with references to all Text, Image, and Slider components within the scene.
public SetUp ( ) : void
Результат void

Start() защищенный Метод

Unity's Start() method; this checks to see if the dictionaries are built up, if not then it builds up the dictionaries.
protected Start ( ) : void
Результат void

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

Sets text to progress one letter at a time
public TextProgression ( string textName, string rollingText, KeyCode, interruptKey ) : System.Collections.IEnumerator
textName string Name of the Text Component
rollingText string The text to be displayed progressively
interruptKey KeyCode, Set key to interrupt the coroutine and display the entire text
Результат System.Collections.IEnumerator

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

imageDict защищенное свойство

protected Dictionary imageDict
Результат Image>.Dictionary

sliderDict защищенное свойство

protected Dictionary sliderDict
Результат Slider>.Dictionary

textDict защищенное свойство

protected Dictionary textDict
Результат Text>.Dictionary