All Projects → GeorgeDascalu → Unity-EventBinder

GeorgeDascalu / Unity-EventBinder

Licence: MIT license
User Interface Event decoupler

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Unity-EventBinder

league-lazy-event
💤 Provides a LazyListener for use with League\Event which allows for lazy fetching of actual listeners.
Stars: ✭ 14 (-48.15%)
Mutual labels:  event, listener
spa-bus
🔥Tools for multilevel components to pass values in any SPA
Stars: ✭ 15 (-44.44%)
Mutual labels:  event, listener
react-listener-provider
Create a ReactListenerProvider and use HOC (Higher Order Components) to listen for Events in one place.
Stars: ✭ 19 (-29.63%)
Mutual labels:  event, listener
October30
macOS Screen Saver showing 371 Apple logos from their 2018 iPad event
Stars: ✭ 200 (+640.74%)
Mutual labels:  event
Dc Sdk
DC-SDK 是基于 Cesium 进行二次开发的2、3D一体 WebGis 应用框架,该框架优化了 Cesium 的使用方式和增添了一些额外功能,旨在为开发者快速构建 WebGis 应用。🌎
Stars: ✭ 206 (+662.96%)
Mutual labels:  event
azeroth-event
Lightweight event-driven framework
Stars: ✭ 18 (-33.33%)
Mutual labels:  event
HorizontalTimesLayout
Layout to display time slots in horizontal 24 hour format
Stars: ✭ 31 (+14.81%)
Mutual labels:  event
Gear Lib
Gear-Lib, C library for IOT Embedded Multimedia and Network
Stars: ✭ 2,381 (+8718.52%)
Mutual labels:  event
tiny-typed-emitter
Fully type-checked NodeJS EventEmitter
Stars: ✭ 96 (+255.56%)
Mutual labels:  event
Swift Utils
A collection of handy swift utils
Stars: ✭ 253 (+837.04%)
Mutual labels:  event
React Native Webview Messaging
✉️ Send/Receive data between React Native app and WebView
Stars: ✭ 251 (+829.63%)
Mutual labels:  event
Juggle
juggle是一个极简的、组件式的js框架。无依赖,完美闭包,灵活且适合渐进学习,可与任何框架整合。包含(支持冒泡的事件 || Tween || MV框架 || http || websocket || 资源 || 模块)等组件,按需选择组件,不绑架开发者。
Stars: ✭ 208 (+670.37%)
Mutual labels:  event
GroundGrowing
Open Source Unity3d Planetary Terrain Editor Extension with incremental background updates via multithreading
Stars: ✭ 66 (+144.44%)
Mutual labels:  editor-extension
Qmq
QMQ是去哪儿网内部广泛使用的消息中间件,自2012年诞生以来在去哪儿网所有业务场景中广泛的应用,包括跟交易息息相关的订单场景; 也包括报价搜索等高吞吐量场景。
Stars: ✭ 2,420 (+8862.96%)
Mutual labels:  event
UnityPickers
Value selection controls for Unity game engine editor.
Stars: ✭ 34 (+25.93%)
Mutual labels:  editor-extension
Evmongoose
DEPRECATED. Evmongoose is an asynchronous, event(libev) based multi-protocol embedded networking library with functions including TCP, HTTP, WebSocket, MQTT and much more. It's based on mongoose and libev implementation and it's support Lua API.
Stars: ✭ 199 (+637.04%)
Mutual labels:  event
laravel-broadcast-demo
Article: Laravel PWA to implement Broadcasting
Stars: ✭ 17 (-37.04%)
Mutual labels:  event
Medium Zoom
🔎🖼 A JavaScript library for zooming images like Medium
Stars: ✭ 2,799 (+10266.67%)
Mutual labels:  event
micro-typed-events
The smallest, most convenient typesafe TS event emitter you'll ever need
Stars: ✭ 39 (+44.44%)
Mutual labels:  listener
EasyEventEditor
Drop in replacement for the default Unity event editor drawer that allows listener reordering
Stars: ✭ 103 (+281.48%)
Mutual labels:  editor-extension

Unity-EventBinder-Asset

EventBinder asset for Unity

Event binder Mini-Framework for Unity3D

Introduction

The Unity-EventBinder plugin is a de-coupling event framework built to specifically to target Unity 3D. It can be used to separate the event triggers (ex: Button "onClick") from the event listeners.

This project is open source. You can find the officical repository here

For general troubleshooting / support, please post to stack overflow using the tag 'UnityEventBinder'.

Or, if you have found a bug, you are also welcome to create an issue on the github page, or a pull request if you have a fix / extension.

Features

  • De-coupling
    • Separates the event "triggers" from the event "listeners"
    • Uses specific Actions to connect the triggers to the listeners
  • Multiple listeners for an UI event
  • Ability to add static event handlers for events - something that you cannot do with default Unity events
  • Ability to select Events
    • From "EventTriggerType": PointerDown, PointerUp, PointerClick...etc
    • From a specific GameObject (ex: onClick from Button, or onValueChanged from InputField)
  • Ability to add custom arguments including: "String", "int", "float", "double", "Vector2", "Vector3", "Vector4", "GameObject", "Component", "Color". More argument types will come in the future.
  • Ability to select a dynamic argument
    • Example: select the "text" property of a "InputField" component

Installation

You can install Unity-EventBinder using the following method:

  1. From Github Page. Here you can choose between the following:

    • Unity Package: /Unity Asset/ EventBinder[date]-[build].unitypackage - Including a sample scene
    • Source Code: /Source Code/Assets..

Usage

There are 3 main components for the EventBinder plugin

  1. The EventsCollection class

    • This is a collection with all the events that the plugin will search, display and use throughout the framework.
    • You can remove the events provided and add new ones as you would add an event normally
    • The events are Action type, they should be static & public.
    • It is best (yet optional) to name the arguments in your declaration (eg: delegate (string testValue)").
    public static event Action<string> EventWithStringArgument = delegate (string stringArgument) {};
  2. The EventBinderBehaviour class

    • Attach this to any GameObject in your scene
    • Set the Target Object from which the user event should be listened from. Will default to the GameObject attached.
    • Select the Event Type that will be listened
      • From TargetObject: Will display a list of components and a list of Events for that component Currently it only supports events extending UnityEvent, will add support for UnityEvent<T0,T1,T2..> in future releases.
      • EventTrigger Type: Will listen to any event supported by the EventTrigger component (PointerDown, PointerEnter, PointerClick...etc)
    • Select the Event Delegate
      • This will be an event from the EventsCollection class
      • If the event has arguments you will need to populate the arguments with values
        • Static - A static, hard-coded value written in the Inspector
        • Dynamic - The value will be retrieved at runtime from the specified component. For example: the text property of a InputField or the rotation of an object, or the position of an object..etc. Combine this with the ability of adding limitless listeners to the events and you can more easily modularize your project.

EventBinderBehaviour

  1. The listener class - In the sample EventBinderSampleListenerController
    • Add a listener to any event from the class as written below:
    public class EventBinderSampleListenerController : MonoBehaviour
    {
        /**LIFECYCLE*/
        private void Start ()
        {
      	AddListeners();
    	AddListenersStatic();
        }
        
        
        /**EVENT REGISTRATION*/
        private void AddListeners()
        {
       	 EventsCollection.eventWithStringArgs  += OnEventWithStringArgsHandler;
        }
        
        private static void AddListenersStatic()
        {
      	  EventsCollection.eventWithStringArgs  += OnStaticEventWithStringArgsHandler;
        }
        
        
        
        /**EVENT HANDLERS*/
        public void OnEventWithStringArgsHandler(string value)
        {
        	Debug.Log ("We got a new message with a String parameter: " + value);
        }	
        
        
        public void OnStaticEventWithStringArgsHandler(string value)
        {
        	Debug.Log ("[STATIC] We got a new message with a String parameter: " + value);
        }	
    }

License

The MIT License (MIT)

Copyright (c) 2018 George Dascalu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].