C# 클래스 Epigene.UI.UIManager

User interface manager. This class will manage the UI.
파일 보기 프로젝트 열기: fi-content2-games-platform/FIcontent.Gaming.Enabler.phenomobilecharactermanager 1 사용 예제들

공개 메소드들

메소드 설명
ActivateScreen ( string screenName ) : Epigene.UI.UIScreen

Activate a screen by name. This function will deactivat old screen and activate the new one. It will also send a notification to screenChanged(old, new) if any delegates is set.

Add ( UIType type, GameObject obj, string fileName, Sprite spr = null ) : UIObject

Adds a UI button.

AddDialog ( Epigene.UI.UIDialog dialog ) : void

Add a dialog to available list

AddScreen ( Epigene.UI.UIScreen screen ) : void

Add a new screen.

BlinkImage ( UIImage image, int numberOfblinks = 2, double speedInMs = 200 ) : void

Blink an image by numberOfBlinks times. The speed of blinks depends on the speedInMs parameter.

BlinkToggle ( UIImage image ) : void

Helper for processing blinking of an image. It will toggle the visible flag based on the preset values

ChangeLayers ( GameObject obj, string name ) : void

Change layers in game objet and in all of it's children

CheckTooltipVisibility ( GameObject obj ) : bool

Check if the tooltip can be visible at the moment or should be hidden

Clear ( bool force = false ) : void

Free up memory with dropping all ui objects. Clears UI elements with removing them from internal lists and destroys them.

ClearHuds ( ) : void

Remove all registered screens.

ClearModels ( ) : void
ClearPopups ( ) : void
ClearScreens ( ) : void

Remove all registered screens.

ClearUI ( UIType type ) : void

Remove all registered UIImages, where type is match

ContainsButton ( int id ) : bool

Check if the button already exist.

ContainsHud ( string id ) : bool

Check if the Hud already exist.

ContainsModel ( string id ) : bool

Check if the Model already exist.

ContainsPopup ( string id ) : bool

Check if the Popup already exist.

ContainsScreen ( string name ) : bool

Check if the button already exist.

CreateGameObject ( string prefab ) : GameObject

Helper to create a gameobject from a prefab.

CreateImage ( string id, string filename, GameObject parent, GameObject obj = null ) : UIImage

Create a new push or toggle button

CreateTexture ( GameObject obj, Rect rect, float orthSize ) : Texture2D

Create a texture from game object. It will clone the object and the camera, create a screenshot of the camera and save it. Set rect to the size of the new image.

DisableButton ( Epigene.UI.UIButton b ) : void
DisableHuds ( ) : void

Disable all the huds

EnableButton ( Epigene.UI.UIButton b ) : void
Get ( int id ) : UIObject
Get ( string name ) : UIObject
GetDialog ( string id ) : Epigene.UI.UIDialog

Get a dialog from available list by id

GetHud ( string id, string prefab = null ) : GameObject

Helper to get the game object for a hud. TODOstatic??

GetHudNames ( object>.Dictionary dict ) : List

Get name of used huds.

GetModel ( string id, string prefab = null ) : GameObject

Helper to get the game object for a hud. TODOstatic??

GetPopup ( string id, string prefab = null ) : GameObject

Helper to get the game object for a popup. TODOstatic??

GetPopupNames ( object>.Dictionary dict ) : List

Get name of used popups.

GetScreen ( string name ) : Epigene.UI.UIScreen
GetScreenId ( ) : string

Return the active screen Id

GetVirtualCamera ( float orthSize ) : Camera

Get a virtual camera, which can render the object alone. The new camera cloned from the current main camera or from a it's prefab in case of no main camera.

InitUI ( GameObject parent ) : void

Helper to reset/recreate the ui parent objects

IsLayerVisible ( string layerName ) : bool

Return if a layer is visible or not

LoadPrefab ( string prefab, string name, GameObject parent ) : GameObject

Helper to load a prefab by name under specific parent

LoadResources ( object>.Dictionary dict, GameObject gameObject = null ) : UIObject>.Dictionary

Load object resources from dictionary TODO make more generic helpers and way of parse similar stuff. ie. transform parameter should be one parser for all

LoadResources ( string fileName, GameObject gameObject = null ) : void

Create a screen from a json file including all ui elements

LoadSprite ( string fileName ) : UnityEngine.Sprite[]

Loads a sprite and return a list of textures. If the sprite is in multi mode, the list will contains each sprites. If the sprite is single mode, the list will contains only one item.

Remove ( int id ) : void

Remove an image type

RemoveAllDialog ( ) : void

Remove ALL dialogs

RemoveDialog ( string id ) : void

Remove a dialog by id

RemoveModal ( ) : void
SaveTextureToFile ( Texture2D texture, string fileName ) : void

Save a texture into a file as png

Screenshot ( Camera camera, Rect rect ) : Texture2D

Save the rectangle from the camera view as a texture.

SetResolution ( int w, int h, bool fullScreen ) : void

Helper to notify when screen is resizes.

ShowLayer ( string layerName, bool flag ) : void

Show and hide a layer by name If flag is set to true, it will show the layer if flag is false, it will hide the layer

ShowModal ( GameObject obj ) : void

Use this function to show (activate) an object in modal mode. While the object is active, it will capture all user inputs and gets all focus. Deactivating the object will trigger the uimanager to go back to normal mode (hide and forget).

SlideScreen ( string screenName ) : Epigene.UI.UIScreen
ToggleLayer ( string layerName ) : void

Togle a layer by name

UIManager ( ) : UnityEngine

Initializes a new instance of the UIManager class.

Update ( ) : void

Process inputs and update state of ui element.

비공개 메소드들

메소드 설명
GetObjectUnderCursor ( ) : GameObject

Get an object under the cursor

GetUIButtonFromObject ( GameObject obj ) : Epigene.UI.UIButton

Internal helper to get a uiButton from an object

InternalInit ( ) : void

메소드 상세

ActivateScreen() 공개 메소드

Activate a screen by name. This function will deactivat old screen and activate the new one. It will also send a notification to screenChanged(old, new) if any delegates is set.
public ActivateScreen ( string screenName ) : Epigene.UI.UIScreen
screenName string The name of the screen.
리턴 Epigene.UI.UIScreen

Add() 공개 메소드

Adds a UI button.
public Add ( UIType type, GameObject obj, string fileName, Sprite spr = null ) : UIObject
type UIType
obj UnityEngine.GameObject Parent game object.
fileName string Resource file name with path, relative to Rersources folder.
spr UnityEngine.Sprite
리턴 UIObject

AddDialog() 공개 메소드

Add a dialog to available list
public AddDialog ( Epigene.UI.UIDialog dialog ) : void
dialog Epigene.UI.UIDialog
리턴 void

AddScreen() 공개 메소드

Add a new screen.
public AddScreen ( Epigene.UI.UIScreen screen ) : void
screen Epigene.UI.UIScreen
리턴 void

BlinkImage() 공개 메소드

Blink an image by numberOfBlinks times. The speed of blinks depends on the speedInMs parameter.
public BlinkImage ( UIImage image, int numberOfblinks = 2, double speedInMs = 200 ) : void
image UIImage
numberOfblinks int
speedInMs double
리턴 void

BlinkToggle() 공개 메소드

Helper for processing blinking of an image. It will toggle the visible flag based on the preset values
public BlinkToggle ( UIImage image ) : void
image UIImage
리턴 void

ChangeLayers() 공개 정적인 메소드

Change layers in game objet and in all of it's children
public static ChangeLayers ( GameObject obj, string name ) : void
obj UnityEngine.GameObject
name string
리턴 void

CheckTooltipVisibility() 공개 메소드

Check if the tooltip can be visible at the moment or should be hidden
public CheckTooltipVisibility ( GameObject obj ) : bool
obj UnityEngine.GameObject
리턴 bool

Clear() 공개 메소드

Free up memory with dropping all ui objects. Clears UI elements with removing them from internal lists and destroys them.
public Clear ( bool force = false ) : void
force bool
리턴 void

ClearHuds() 공개 메소드

Remove all registered screens.
public ClearHuds ( ) : void
리턴 void

ClearModels() 공개 메소드

public ClearModels ( ) : void
리턴 void

ClearPopups() 공개 메소드

public ClearPopups ( ) : void
리턴 void

ClearScreens() 공개 메소드

Remove all registered screens.
public ClearScreens ( ) : void
리턴 void

ClearUI() 공개 메소드

Remove all registered UIImages, where type is match
public ClearUI ( UIType type ) : void
type UIType
리턴 void

ContainsButton() 공개 메소드

Check if the button already exist.
public ContainsButton ( int id ) : bool
id int
리턴 bool

ContainsHud() 공개 메소드

Check if the Hud already exist.
public ContainsHud ( string id ) : bool
id string
리턴 bool

ContainsModel() 공개 메소드

Check if the Model already exist.
public ContainsModel ( string id ) : bool
id string
리턴 bool

ContainsPopup() 공개 메소드

Check if the Popup already exist.
public ContainsPopup ( string id ) : bool
id string
리턴 bool

ContainsScreen() 공개 메소드

Check if the button already exist.
public ContainsScreen ( string name ) : bool
name string
리턴 bool

CreateGameObject() 공개 정적인 메소드

Helper to create a gameobject from a prefab.
public static CreateGameObject ( string prefab ) : GameObject
prefab string
리턴 UnityEngine.GameObject

CreateImage() 공개 메소드

Create a new push or toggle button
public CreateImage ( string id, string filename, GameObject parent, GameObject obj = null ) : UIImage
id string
filename string
parent UnityEngine.GameObject
obj UnityEngine.GameObject
리턴 UIImage

CreateTexture() 공개 정적인 메소드

Create a texture from game object. It will clone the object and the camera, create a screenshot of the camera and save it. Set rect to the size of the new image.
public static CreateTexture ( GameObject obj, Rect rect, float orthSize ) : Texture2D
obj UnityEngine.GameObject
rect UnityEngine.Rect
orthSize float
리턴 UnityEngine.Texture2D

DisableButton() 공개 정적인 메소드

public static DisableButton ( Epigene.UI.UIButton b ) : void
b Epigene.UI.UIButton
리턴 void

DisableHuds() 공개 메소드

Disable all the huds
public DisableHuds ( ) : void
리턴 void

EnableButton() 공개 정적인 메소드

public static EnableButton ( Epigene.UI.UIButton b ) : void
b Epigene.UI.UIButton
리턴 void

Get() 공개 메소드

public Get ( int id ) : UIObject
id int
리턴 UIObject

Get() 공개 메소드

public Get ( string name ) : UIObject
name string
리턴 UIObject

GetDialog() 공개 메소드

Get a dialog from available list by id
public GetDialog ( string id ) : Epigene.UI.UIDialog
id string
리턴 Epigene.UI.UIDialog

GetHud() 공개 메소드

Helper to get the game object for a hud. TODOstatic??
public GetHud ( string id, string prefab = null ) : GameObject
id string
prefab string
리턴 UnityEngine.GameObject

GetHudNames() 공개 메소드

Get name of used huds.
public GetHudNames ( object>.Dictionary dict ) : List
dict object>.Dictionary
리턴 List

GetModel() 공개 메소드

Helper to get the game object for a hud. TODOstatic??
public GetModel ( string id, string prefab = null ) : GameObject
id string
prefab string
리턴 UnityEngine.GameObject

GetPopup() 공개 메소드

Helper to get the game object for a popup. TODOstatic??
public GetPopup ( string id, string prefab = null ) : GameObject
id string
prefab string
리턴 UnityEngine.GameObject

GetPopupNames() 공개 메소드

Get name of used popups.
public GetPopupNames ( object>.Dictionary dict ) : List
dict object>.Dictionary
리턴 List

GetScreen() 공개 메소드

public GetScreen ( string name ) : Epigene.UI.UIScreen
name string
리턴 Epigene.UI.UIScreen

GetScreenId() 공개 메소드

Return the active screen Id
public GetScreenId ( ) : string
리턴 string

GetVirtualCamera() 공개 정적인 메소드

Get a virtual camera, which can render the object alone. The new camera cloned from the current main camera or from a it's prefab in case of no main camera.
public static GetVirtualCamera ( float orthSize ) : Camera
orthSize float
리턴 UnityEngine.Camera

InitUI() 공개 메소드

Helper to reset/recreate the ui parent objects
public InitUI ( GameObject parent ) : void
parent UnityEngine.GameObject
리턴 void

IsLayerVisible() 공개 정적인 메소드

Return if a layer is visible or not
public static IsLayerVisible ( string layerName ) : bool
layerName string
리턴 bool

LoadPrefab() 공개 메소드

Helper to load a prefab by name under specific parent
public LoadPrefab ( string prefab, string name, GameObject parent ) : GameObject
prefab string
name string
parent UnityEngine.GameObject
리턴 UnityEngine.GameObject

LoadResources() 공개 메소드

Load object resources from dictionary TODO make more generic helpers and way of parse similar stuff. ie. transform parameter should be one parser for all
public LoadResources ( object>.Dictionary dict, GameObject gameObject = null ) : UIObject>.Dictionary
dict object>.Dictionary
gameObject UnityEngine.GameObject
리턴 UIObject>.Dictionary

LoadResources() 공개 메소드

Create a screen from a json file including all ui elements
public LoadResources ( string fileName, GameObject gameObject = null ) : void
fileName string
gameObject UnityEngine.GameObject
리턴 void

LoadSprite() 공개 정적인 메소드

Loads a sprite and return a list of textures. If the sprite is in multi mode, the list will contains each sprites. If the sprite is single mode, the list will contains only one item.
public static LoadSprite ( string fileName ) : UnityEngine.Sprite[]
fileName string file name with path relative to Resource folder.
리턴 UnityEngine.Sprite[]

Remove() 공개 메소드

Remove an image type
public Remove ( int id ) : void
id int
리턴 void

RemoveAllDialog() 공개 메소드

Remove ALL dialogs
public RemoveAllDialog ( ) : void
리턴 void

RemoveDialog() 공개 메소드

Remove a dialog by id
public RemoveDialog ( string id ) : void
id string
리턴 void

RemoveModal() 공개 메소드

public RemoveModal ( ) : void
리턴 void

SaveTextureToFile() 공개 정적인 메소드

Save a texture into a file as png
public static SaveTextureToFile ( Texture2D texture, string fileName ) : void
texture UnityEngine.Texture2D
fileName string
리턴 void

Screenshot() 공개 정적인 메소드

Save the rectangle from the camera view as a texture.
public static Screenshot ( Camera camera, Rect rect ) : Texture2D
camera UnityEngine.Camera
rect UnityEngine.Rect
리턴 UnityEngine.Texture2D

SetResolution() 공개 메소드

Helper to notify when screen is resizes.
public SetResolution ( int w, int h, bool fullScreen ) : void
w int The new width.
h int The new height.
fullScreen bool
리턴 void

ShowLayer() 공개 정적인 메소드

Show and hide a layer by name If flag is set to true, it will show the layer if flag is false, it will hide the layer
public static ShowLayer ( string layerName, bool flag ) : void
layerName string
flag bool
리턴 void

ShowModal() 공개 메소드

Use this function to show (activate) an object in modal mode. While the object is active, it will capture all user inputs and gets all focus. Deactivating the object will trigger the uimanager to go back to normal mode (hide and forget).
public ShowModal ( GameObject obj ) : void
obj UnityEngine.GameObject
리턴 void

SlideScreen() 공개 메소드

public SlideScreen ( string screenName ) : Epigene.UI.UIScreen
screenName string
리턴 Epigene.UI.UIScreen

ToggleLayer() 공개 정적인 메소드

Togle a layer by name
public static ToggleLayer ( string layerName ) : void
layerName string
리턴 void

UIManager() 공개 메소드

Initializes a new instance of the UIManager class.
public UIManager ( ) : UnityEngine
리턴 UnityEngine

Update() 공개 메소드

Process inputs and update state of ui element.
public Update ( ) : void
리턴 void