/// <summary> /// Binds the event handler to the specified object and method name. /// For example: Bridge.BindCallback("MyObject", "doSomething", doSomething) /// would bind the doSomething handler to be callable from Javascript with: /// MyObject.invoke("DoSomething"); /// See uWebKitExamlples/WebBrowser/UnityPageInfo.cs in examples /// </summary> public static void BindCallback(string objectName, string methodName, BridgeEventHandler handler) { BridgeObject bo; if (!objects.TryGetValue (objectName, out bo)) { bo = AddObject (objectName); } bo.Bind (methodName, handler); }
/// <summary> /// Binds the event handler to the specified object and method name. /// For example: Bridge.BindCallback("MyObject", "doSomething", doSomething) /// would bind the doSomething handler to be callable from Javascript with: /// MyObject.invoke("DoSomething"); /// See uWebKitExamlples/WebBrowser/UnityPageInfo.cs in examples /// </summary> public static void BindCallback(string objectName, string methodName, BridgeEventHandler handler) { BridgeObject bo; if (!objects.TryGetValue(objectName, out bo)) { bo = AddObject(objectName); } bo.Bind(methodName, handler); }
/// <summary> /// Bind the specified methodName and handler. /// </summary> public void Bind(string methodName, BridgeEventHandler handler) { string m = methodName.ToLower(); if (!callbacks.ContainsKey(m)) { callbacks [m] = handler; } else { callbacks [m] += handler; } }
/// <summary> /// Bind the specified methodName and handler. /// </summary> public void Bind(string methodName, BridgeEventHandler handler) { string m = methodName.ToLower (); if (!callbacks.ContainsKey (m)) callbacks [m] = handler; else callbacks [m] += handler; }