本文整理汇总了C#中LuaState.PushThread方法的典型用法代码示例。如果您正苦于以下问题:C# LuaState.PushThread方法的具体用法?C# LuaState.PushThread怎么用?C# LuaState.PushThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LuaState
的用法示例。
在下文中一共展示了LuaState.PushThread方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestToThread
public void TestToThread()
{
LuaState L = null;
using (L = new LuaState())
{
LuaFunction f = l => 0;
L.PushNil()
.PushNumber(123.45)
.PushInteger(987)
.PushString("Test")
.PushString("5.6")
.PushString("5D")
.PushString("5z")
.PushBoolean(true)
.PushCClosure(f, 0)
//.PushLightUserData(DateTime.Now)
.PushGlobalTable()
;
L.PushThread();
Assert.Equal(null, L.ToThread(1));
Assert.Equal(null, L.ToThread(2));
Assert.Equal(null, L.ToThread(3));
Assert.Equal(null, L.ToThread(4));
Assert.Equal(null, L.ToThread(5));
Assert.Equal(null, L.ToThread(6));
Assert.Equal(null, L.ToThread(7));
Assert.Equal(null, L.ToThread(8));
Assert.Equal(null, L.ToThread(9));
Assert.Equal(null, L.ToThread(10));
Assert.Same(L, L.ToThread(11));
Assert.Equal(null, L.ToThread(12));
}
}
示例2: TestIsThread
public void TestIsThread()
{
LuaState L = null;
using (L = new LuaState())
{
L.PushNil()
.PushNumber(123.45)
.PushInteger(987)
.PushString("Test")
.PushString("5.6")
.PushString("5D")
.PushString("5")
.PushBoolean(true)
.PushCClosure(l => 0, 0)
//.PushLightUserData(DateTime.Now)
.NewTable()
.PushGlobalTable()
;
L.PushThread();
Assert.False(L.IsThread(1));
Assert.False(L.IsThread(2));
Assert.False(L.IsThread(3));
Assert.False(L.IsThread(4));
Assert.False(L.IsThread(5));
Assert.False(L.IsThread(6));
Assert.False(L.IsThread(7));
Assert.False(L.IsThread(8));
Assert.False(L.IsThread(9));
Assert.False(L.IsThread(10));
Assert.False(L.IsThread(11));
Assert.True(L.IsThread(12));
}
}
示例3: TestPushThread
public void TestPushThread()
{
LuaState L = null;
using (L = new LuaState())
{
L.PushThread();
Assert.Equal(1, L.GetTop());
Assert.Equal(LuaType.Thread, L.Type(-1));
}
}