C# 클래스 FairyGUI.Window

Window class. 窗口使用前首先要设置窗口中需要显示的内容,这通常是在编辑器里制作好的,可以直接使用Window.contentPane进行设置。 建议把设置contentPane等初始化操作放置到Window.onInit方法中。 另外,FairyGUI还提供了一套机制用于窗口动态创建。动态创建是指初始时仅指定窗口需要使用的资源,等窗口需要显示时才实际开始构建窗口的内容。 首先需要在窗口的构造函数中调用Window.addUISource。这个方法需要一个IUISource类型的参数,而IUISource是一个接口, 用户需要自行实现载入相关UI包的逻辑。当窗口第一次显示之前,IUISource的加载方法将会被调用,并等待载入完成后才返回执行Window.OnInit,然后窗口才会显示。 如果你需要窗口显示时播放动画效果,那么覆盖doShowAnimation编写你的动画代码,并且在动画结束后调用onShown。覆盖onShown编写其他需要在窗口显示时处理的业务逻辑。 如果你需要窗口隐藏时播放动画效果,那么覆盖doHideAnimation编写你的动画代码,并且在动画结束时调用Window.hideImmediately(注意不是直接调用onHide!)。覆盖onHide编写其他需要在窗口隐藏时处理的业务逻辑。
상속: GComponent
파일 보기 프로젝트 열기: fairygui/FairyGUI-unity 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_requestingCmd int

공개 메소드들

메소드 설명
AddUISource ( IUISource source ) : void

Set a UISource to this window. It must call before the window is shown. When the window is first time to show, UISource.Load is called. Only after all UISource is loaded, the window will continue to init. 为窗口添加一个源。这个方法建议在构造函数调用。当窗口第一次显示前,UISource的Load方法将被调用,然后只有所有的UISource 都ready后,窗口才会继续初始化和显示。

BringToFront ( ) : void

CenterOn ( GRoot r, bool restraint ) : void

Make the window be center of the screen.

CloseModalWait ( ) : bool

CloseModalWait ( int requestingCmd ) : bool

Close modal waiting. If rquestingCmd is equal to the value you transfer in ShowModalWait, mowal wait will be closed. Otherwise, this function has no effect. 关闭模式等待。如果requestingCmd和ShowModalWait传入的不相同,则这个函数没有任何动作,立即返回。

Dispose ( ) : void
Hide ( ) : void

HideImmediately ( ) : void

Hide window immediately, no OnHide will be called.

Init ( ) : void

Show ( ) : void

ShowModalWait ( ) : void

ShowModalWait ( int requestingCmd ) : void

Display a modal waiting sign in the front. 显示一个等待标志在最前面。等待标志的资源可以通过UIConfig.windowModalWaiting。等待标志组件会设置为屏幕大小,请内部做好关联。 还可以设定一个requestingCmd作为等待的命令字,在CloseModalWait里传入相同的命令字ModalWait将结束,否则CloseModalWait无效。

ShowOn ( GRoot r ) : void

ToggleStatus ( ) : void

Switch show and hide status.

Window ( ) : System.Collections.Generic

보호된 메소드들

메소드 설명
DoHideAnimation ( ) : void

DoShowAnimation ( ) : void

LayoutModalWaitPane ( ) : void
OnHide ( ) : void

OnInit ( ) : void

OnShown ( ) : void

__onHide ( ) : void
__onShown ( ) : void
__uiLoadComplete ( ) : void
_init ( ) : void
closeEventHandler ( ) : void

비공개 메소드들

메소드 설명
__dragStart ( EventContext context ) : void
__touchBegin ( EventContext context ) : void

메소드 상세

AddUISource() 공개 메소드

Set a UISource to this window. It must call before the window is shown. When the window is first time to show, UISource.Load is called. Only after all UISource is loaded, the window will continue to init. 为窗口添加一个源。这个方法建议在构造函数调用。当窗口第一次显示前,UISource的Load方法将被调用,然后只有所有的UISource 都ready后,窗口才会继续初始化和显示。
public AddUISource ( IUISource source ) : void
source IUISource
리턴 void

BringToFront() 공개 메소드

public BringToFront ( ) : void
리턴 void

CenterOn() 공개 메소드

Make the window be center of the screen.
public CenterOn ( GRoot r, bool restraint ) : void
r GRoot
restraint bool Add relations to ensure keeping center on screen size changed.
리턴 void

CloseModalWait() 공개 메소드

public CloseModalWait ( ) : bool
리턴 bool

CloseModalWait() 공개 메소드

Close modal waiting. If rquestingCmd is equal to the value you transfer in ShowModalWait, mowal wait will be closed. Otherwise, this function has no effect. 关闭模式等待。如果requestingCmd和ShowModalWait传入的不相同,则这个函数没有任何动作,立即返回。
public CloseModalWait ( int requestingCmd ) : bool
requestingCmd int
리턴 bool

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

DoHideAnimation() 보호된 메소드

protected DoHideAnimation ( ) : void
리턴 void

DoShowAnimation() 보호된 메소드

protected DoShowAnimation ( ) : void
리턴 void

Hide() 공개 메소드

public Hide ( ) : void
리턴 void

HideImmediately() 공개 메소드

Hide window immediately, no OnHide will be called.
public HideImmediately ( ) : void
리턴 void

Init() 공개 메소드

public Init ( ) : void
리턴 void

LayoutModalWaitPane() 보호된 메소드

protected LayoutModalWaitPane ( ) : void
리턴 void

OnHide() 보호된 메소드

protected OnHide ( ) : void
리턴 void

OnInit() 보호된 메소드

protected OnInit ( ) : void
리턴 void

OnShown() 보호된 메소드

protected OnShown ( ) : void
리턴 void

Show() 공개 메소드

public Show ( ) : void
리턴 void

ShowModalWait() 공개 메소드

public ShowModalWait ( ) : void
리턴 void

ShowModalWait() 공개 메소드

Display a modal waiting sign in the front. 显示一个等待标志在最前面。等待标志的资源可以通过UIConfig.windowModalWaiting。等待标志组件会设置为屏幕大小,请内部做好关联。 还可以设定一个requestingCmd作为等待的命令字,在CloseModalWait里传入相同的命令字ModalWait将结束,否则CloseModalWait无效。
public ShowModalWait ( int requestingCmd ) : void
requestingCmd int
리턴 void

ShowOn() 공개 메소드

public ShowOn ( GRoot r ) : void
r GRoot
리턴 void

ToggleStatus() 공개 메소드

Switch show and hide status.
public ToggleStatus ( ) : void
리턴 void

Window() 공개 메소드

public Window ( ) : System.Collections.Generic
리턴 System.Collections.Generic

__onHide() 보호된 메소드

protected __onHide ( ) : void
리턴 void

__onShown() 보호된 메소드

protected __onShown ( ) : void
리턴 void

__uiLoadComplete() 보호된 메소드

protected __uiLoadComplete ( ) : void
리턴 void

_init() 보호된 메소드

protected _init ( ) : void
리턴 void

closeEventHandler() 보호된 메소드

protected closeEventHandler ( ) : void
리턴 void

프로퍼티 상세

_requestingCmd 보호되어 있는 프로퍼티

protected int _requestingCmd
리턴 int