Git Product home page Git Product logo

ttuiframework's Introduction

TTUIFramework

UI Framework For Unity3D

Simple and Powerful!

UI like a book,all you see are pages.you can easy jumpto between pages.

When create a new page ,only need to override some function!

Simple!Simple!Simple! (>,< important thing need 3 times.haha...)

THINKING IN IMAGE
Thanks This Guy

Usage

1:how to show one page?
Because how to load ui.prefab depend on yours.

Sync load & show ui api:

this style no need page instance. only page target type.
TTUIPage.ShowPage<T>()
TTUIPage.ShowPage<T>(object pageData)

another style is show target page instance with name. this is easy way for Lua use.
TTUIPage.ShowPage(string pageName,TTUIPage pageInstance)
TTUIPage.ShowPage(string pageName,TTUIPage pageInstance,object pageData)

NOTE:object pageData is your page's data instance. send or not depend on your page Refresh() logic.

Async load & show ui api:

TTUIPage.ShowPage<T>(Action callback)
TTUIPage.ShowPage<T>(Action callback,object pageData)
TTUIPage.ShowPage(string pageName,TTUIPage pageInstance,Action callback)
TTUIPage.ShowPage(string pageName,TTUIPage pageInstance,Action callback,object pageData)

ClosePage api:

TTUIPage.ClosePage() close the top page in nodes TTUIPage.ClosePage<T>() TTUIPage.ClosePage(string pageName) TTUIPage.ClosePage(TTUIPage target)

How to create new page?

all your new page should inherit from TTUIPage
5 virtual functions should implement base on your page needed.
virtual void Awake(GameObject go) this is once when Instantiate. virtual void Refresh() when ShowPage call eachtime. virtual void Active() this is how to active this page,default is this.gameObject.SetActive(true)
virtual void Hide() this is how to deactive this page,default is this.gameObject.SetActive(false)

Set Load UI Api Delegate

TTUIBind.cs is where you can do that.you can set TTUIPage.delegateSyncLoadUI = Resources.Load how to load ui. NOTE:the uiPath is used for this load action. NOTE:your uiPath = "" means wont load ui, so you can manager your speical page by yourself.

Write Your MVC page!

in Sample folder's TTSkillPage is simple to use MVC logic. clearly your Refresh() get your data. and your data only data!

ttuiframework's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.