簡單 UI框架 基於Stack

2021-10-08 11:03:14 字數 4767 閱讀 9292

簡易 ui 框架

//*************************=

// - filename: ibasemanager.cs

// - created: true.

// - createtime: 2020/07/02 18:00:58

// - email: [email protected]

// - region: china wuhan

// - description: 管理者介面

//*************************=

using system.collections;

using system.collections.generic;

using unityengine;

public

inte***ce

ibasemanager

//*************************=

// - filename: basemanager.cs

// - created: true.

// - createtime: 2020/07/02 18:02:56

// - email: [email protected]

// - region: china wuhan

// - description:

//*************************=

using system.collections;

using system.collections.generic;

using unityengine;

public

class

basemanager

:ibasemanager

public

virtual

void

ondestroy()

public

virtual

void

oninit()

public

virtual

void

onupdate()

}

using unityengine;

using system.collections;

using system.collections.generic;

///

/// 對dictory的擴充套件

///

public

static

class

dictionaryextension

}

using unityengine;

using system.collections;

using system.collections.generic;

using system;

public

class

uimanager

:basemanager

// return _instance;

// }

//}private

transform canvastransform;

private

transform canvastransform

return canvastransform;}}

private dictionarystring

> panelpathdict;

//儲存所有面板prefab的路徑

private dictionary paneldict;

//儲存所有例項化面板的遊戲物體身上的basepanel元件

private stack panelstack;

private

messagepanel msgpanel;

private

uipaneltype paneltypetopush = uipaneltype.none;

public

uimanager

(gamefacade facade)

:base

(facade)

public

override

void

oninit()

public

override

void

update()

}public

void

pushpanelsync

(uipaneltype paneltype)

///

/// 把某個頁面入棧, 把某個頁面顯示在介面上

///

public

basepanel

pushpanel

(uipaneltype paneltype)

basepanel panel =

getpanel

(paneltype)

; panel.

onenter()

; panelstack.

push

(panel)

;return panel;

}///

/// 出棧 ,把頁面從介面上移除

///

public

void

poppanel()

///

/// 根據面板型別 得到例項化的面板

///

///

private

basepanel

getpanel

(uipaneltype paneltype)

//basepanel panel;

out panel);//todo

basepanel panel = paneldict.

tryget

(paneltype);if

(panel ==

null

)else}[

serializable

]class

uipaneltypejson

private

void

parseuipaneltypejson()

}public

void

injectmsgpanel

(messagepanel msgpanel)

public

void

showmessage

(string msg)

msgpanel.

showmessage

(msg);}

public

void

showmessagesync

(string msg)

msgpanel.

showmessagesync

(msg);}

///

/// just for test

///

//public void test()

//}

json

,,

,,,,

]}

//*************************=

// - filename: uipanelinfo.cs

// - created: true.

// - createtime: 2020/06/26 00:38:38

// - email: [email protected]

// - region: china wuhan

// - description:

//*************************=

using unityengine;

using system.collections;

using system;

[serializable

]public

class

uipanelinfo

:iserializationcallbackreceiver

public

void

onbeforeserialize()

}

//*************************=

// - filename: uipaneltype.cs

// - created: true.

// - createtime: 2020/06/26 00:39:01

// - email: [email protected]

// - region: china wuhan

// - description:

//*************************=

using unityengine;

using system.collections;

using system;

public

enum uipaneltype

基於vue的UI框架

1 餓了麼 vue 2.0後台ui框架 2 iview元件庫 iview 主要服務於 pc 介面的中後台業務,很優秀的元件庫,可惜不適合移動端 4 mint ui 餓了麼移動端元件庫 由餓了麼前端團隊推出的 mint ui 是乙個基於 vue.js 的移動端元件庫 5 vue admin 管理面板u...

前端基於jquery的UI框架

正在做的乙個專案選擇jquery作為前端js核心庫。然後就想選乙個基於jquery的ui庫,然後悲催的事情發生了。至於為什麼使用jquery,一是因為不想為授權費用,而又不想引起可能法律糾紛 另一方面jquery也是所有最容易上手和流行的js庫。如果ext要用於商用就要付版權費,這個不行 dojo的...

閒談組合模式 基於UI動畫框架

先來看下組合模式的定義 將物件組合成樹型結構以表示 部分 整體 的層次結構。組合模式使得使用者對單個物件和組合物件的使用具有一致性。這個定義看起來舒服一點。再看一下類圖 組合模式的關鍵是抽象乙個類,既可以表示葉子物件,又可以表示組合物件,所以葉子物件和組合物件都要從統一的介面類派生,這樣客戶 就可以...