MCPcopy Create free account
hub / github.com/Tencent/xLua / Test

Method Test

Assets/XLua/Examples/04_LuaObjectOrented/InvokeLua.cs:96–116  ·  view source on GitHub ↗
(LuaEnv luaenv)

Source from the content-addressed store, hash-verified

94 }
95
96 void Test(LuaEnv luaenv)
97 {
98 luaenv.DoString(script);
99 CalcNew calc_new = luaenv.Global.GetInPath<CalcNew>("Calc.New");
100 ICalc calc = calc_new(10, "hi", "john"); //constructor
101 Debug.Log("sum(*10) =" + calc.Add(1, 2));
102 calc.Mult = 100;
103 Debug.Log("sum(*100)=" + calc.Add(1, 2));
104
105 Debug.Log("list[0]=" + calc[0]);
106 Debug.Log("list[1]=" + calc[1]);
107
108 calc.PropertyChanged += Notify;
109 calc[1] = "dddd";
110 Debug.Log("list[1]=" + calc[1]);
111
112 calc.PropertyChanged -= Notify;
113
114 calc[1] = "eeee";
115 Debug.Log("list[1]=" + calc[1]);
116 }
117
118 void Notify(object sender, PropertyChangedEventArgs e)
119 {

Callers

nothing calls this directly

Calls 2

LogMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected