예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        /// <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;
            }
        }
예제 #4
0
        /// <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;
        }