Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

MVC Pattern Framework for Unity3d GUI System (UGUI)

License

NotificationsYou must be signed in to change notification settings

iMemento/UMVC

Repository files navigation

===MVC Pattern Framework for Unity3d GUI System

Diagram

Model

  • Holds no view data nor view state data.
  • Is accessed by theController and otherModels only
  • Will trigger events to notify external system of changes.

View

  • UGUI Prefabs

Presenter

  • Each Presenter corresponds to a View
  • Holds references to elements needed for drawing
  • Receive User Input
  • NotifyController when an user input
  • This script is a UI refresh operation function set

Controller

  • Controls view flow.
  • Holds the application state needed for that view
  • Will trigger events to notify external system of changes.
  • Handles events either triggered by the player in theView or triggered by theModels
  • Each Controller corresponds to a Presenter and holds the reference of it'sPresenter  
  • Holds the references of the smallControllers under this controller

NotificationCenter

  • A notification dispatch mechanism that enables the broadcast of information to registered observers.
  • Add observer inControllers
  • Post notifications inModels
    void Start()    {        NotificationCenter.DefaultCenter.AddObserver(this, "UserDataChanged", UserDataChanged);    }    void OnDestroy()    {        NotificationCenter.DefaultCenter.RemoveObserver(this, "UserDataChanged");    }

Create Controller and Presenter from Template

  • Click menuTemplate Scripts andCreate
  • Type class name and namespace
  • Then it will create two scripts, oneController and onePresenterDiagram

About

MVC Pattern Framework for Unity3d GUI System (UGUI)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp