Skip to content

Instantly share code, notes, and snippets.

Forked from xloger/
Created March 7, 2017 08:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
package com.xloger.unitylib;
import android.util.Log;
import java.util.LinkedList;
import java.util.Queue;
public class Proxy {
public static class invokeData {
public String method;
public String data;
public static invokeData create(String method, String data) {
invokeData iD = new invokeData();
iD.method = method; = data;
return iD;
private static CivHandler civHandler;
private static Queue<invokeData> queue = new LinkedList<>();
public static void SetHandler(CivHandler source) {
civHandler = source;
public static CivHandler getCivHandler() {
return civHandler;
public static void clearInvokeQueue() {
public static void enqueueInvoke(invokeData invokeData) {
if (civHandler != null){
private static void pollAllInvoke() {
invokeData d;
while((d = queue.poll()) != null) {
Log.d("UnityInvoke", "执行了"+d.method);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment