Coder Social home page Coder Social logo

unity3d-eventsmanager's Introduction

Unity3d-EventsManager

simple unity3d events manager

how to use ?

1.Add the scripts(EventsMgr.cs) into your Unity3D-Assets-Path

2.Register your event as enum ,every enum value is an event , such as :

public enum eEventsKey {

ControlSystem_RabbitJump,

/*控制系统_兔子跳,*/

}

3.Init Events System before u use it

EventsMgr.GetInstance().Init();

4.Attach your method to the event key:

EventsMgr.GetInstance().AttachEvent(eEventsKey.ControlSystem_RabbitJump, RabbitJump);

5.Trigger the event where u want , and u can add u param to the event , such as:

EventsMgr.GetInstance().TriigerEvent(eEventsKey.ControlSystem_RabbitJump, 10.0f);

6.Detach the event from method ,if u don't want it:

EventsMgr.GetInstance().DetachEvent(eEventsKey.ControlSystem_RabbitJump, RabbitJump);

Any question see "testEvent.cs" before , this is a demo.

That's all ,

A Simple Events-Manager,

Have Fun.

By xuzhiping

unity3d-eventsmanager's People

Contributors

xuzhiping7 avatar

Watchers

Moqi avatar James Cloos 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.