Ejemplo n.º 1
0
    public void ServoUnityInit(ServoUnityPluginWindowCreatedCallback wccb, ServoUnityPluginWindowResizedCallback wrcb, ServoUnityPluginBrowserEventCallback becb, string userAgent)
    {
        windowCreatedCallback = wccb;
        windowResizedCallback = wrcb;
        browserEventCallback  = becb;

        // Create the callback stub prior to registering the callback on the native side.
        windowCreatedCallbackGCH = GCHandle.Alloc(windowCreatedCallback); // Does not need to be pinned, see http://stackoverflow.com/a/19866119/316487
        windowResizedCallbackGCH = GCHandle.Alloc(windowResizedCallback);
        browserEventCallbackGCH  = GCHandle.Alloc(browserEventCallback);

        ServoUnityPlugin_pinvoke.servoUnityInit(windowCreatedCallback, windowResizedCallback, browserEventCallback, userAgent);
    }