using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using XLua;
|
using System;
|
|
|
[CSharpCallLua]
|
public class CSharpCallLua
|
{
|
[CSharpCallLua]
|
public delegate void ByteArrayDelegate(ushort cmd, byte[] bytes);
|
|
static ByteArrayDelegate onRecieveNetPackage;
|
|
public static void Init()
|
{
|
LuaUtility.DoString("protocol.ProtocalRegister");
|
onRecieveNetPackage = LuaUtility.Global.Get<ByteArrayDelegate>("OnRecieveNetPackage");
|
}
|
|
public static void CallLua(ushort cmd, byte[] bytes)
|
{
|
if (onRecieveNetPackage != null)
|
{
|
onRecieveNetPackage(cmd, bytes);
|
}
|
}
|
|
public class Test
|
{
|
public int a = 0;
|
public int b = 2;
|
public int c = 3;
|
}
|
|
}
|