forked from Tencent/xLua
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRawObjectTest.cs
More file actions
30 lines (26 loc) · 874 Bytes
/
Copy pathRawObjectTest.cs
File metadata and controls
30 lines (26 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using UnityEngine;
using XLua;
namespace XLuaTest
{
public class RawObjectTest : MonoBehaviour
{
public static void PrintType(object o)
{
Debug.Log("type:" + o.GetType() + ", value:" + o);
}
// Use this for initialization
void Start()
{
LuaEnv luaenv = new LuaEnv();
//直接传1234到一个object参数,xLua将选择能保留最大精度的long来传递
luaenv.DoString("CS.XLuaTest.RawObjectTest.PrintType(1234)");
//通过一个继承RawObject的类,能实现指明以一个int来传递
luaenv.DoString("CS.XLuaTest.RawObjectTest.PrintType(CS.XLua.Cast.Int32(1234))");
luaenv.Dispose();
}
// Update is called once per frame
void Update()
{
}
}
}