Skip to content

Instantly share code, notes, and snippets.

@arturaz
Created September 10, 2013 14:01
Show Gist options
  • Save arturaz/6509829 to your computer and use it in GitHub Desktop.
Save arturaz/6509829 to your computer and use it in GitHub Desktop.
using System;
using UnityEngine;
namespace com.tinylabproductions.u3d_gps_bridge {
public class ConnectionCallbacks : AndroidJavaProxy {
public ConnectionCallbacks() :
base("com.tinylabproductions.u3d_gps_bridge.ConnectionCallbacks")
{}
public Action OnConnected = delegate {};
public Action OnDisconnected = delegate {};
// Params: errorCode
public Action<int> OnConnectionFailed = delegate { };
/** Java interface methods **/
void onConnected() { OnConnected.Invoke(); }
void onDisconnected() { OnDisconnected.Invoke(); }
void onConnectionFailed(int errorCode) {
OnConnectionFailed.Invoke(errorCode);
}
}
}
package com.tinylabproductions.u3d_gps_bridge;
public interface ConnectionCallbacks {
public void onConnected();
public void onDisconnected();
public void onConnectionFailed(int errorCode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment