本文整理汇总了C#中CallbackArguments.GetArray方法的典型用法代码示例。如果您正苦于以下问题:C# CallbackArguments.GetArray方法的具体用法?C# CallbackArguments.GetArray怎么用?C# CallbackArguments.GetArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CallbackArguments
的用法示例。
在下文中一共展示了CallbackArguments.GetArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: pairs
public static DynValue pairs(ScriptExecutionContext executionContext, CallbackArguments args)
{
DynValue table = args[0];
DynValue meta = executionContext.GetMetamethodTailCall(table, "__pairs", args.GetArray());
return meta ?? DynValue.NewTuple(DynValue.NewCallback(next), table);
}
示例2: ipairs
public static DynValue ipairs(ScriptExecutionContext executionContext, CallbackArguments args)
{
var table = args[0];
var meta = executionContext.GetMetamethodTailCall(table, "__ipairs", args.GetArray());
return meta ?? DynValue.NewTuple(DynValue.NewCallback(__next_i), table, DynValue.NewNumber(0));
}
示例3: assert
public static DynValue assert(ScriptExecutionContext executionContext, CallbackArguments args)
{
var v = args[0];
var message = args[1];
if (!v.CastToBool())
{
if (message.IsNil())
throw new ScriptRuntimeException("assertion failed!") {DoNotDecorateMessage = true};
throw new ScriptRuntimeException(message.ToPrintString()) {DoNotDecorateMessage = true};
}
return DynValue.NewTupleNested(args.GetArray());
}
示例4: resume
public static DynValue resume(ScriptExecutionContext executionContext, CallbackArguments args)
{
DynValue handle = args.AsType(0, "resume", DataType.Thread);
try
{
DynValue ret = handle.Coroutine.Resume(args.GetArray(1));
List<DynValue> retval = new List<DynValue>();
retval.Add(DynValue.True);
if (ret.Type == DataType.Tuple)
{
for (int i = 0; i < ret.Tuple.Length; i++)
{
var v = ret.Tuple[i];
if ((i == ret.Tuple.Length - 1) && (v.Type == DataType.Tuple))
{
retval.AddRange(v.Tuple);
}
else
{
retval.Add(v);
}
}
}
else
{
retval.Add(ret);
}
return DynValue.NewTuple(retval.ToArray());
}
catch (ScriptRuntimeException ex)
{
return DynValue.NewTuple(
DynValue.False,
DynValue.NewString(ex.Message));
}
}
示例5: yield
public static DynValue yield(ScriptExecutionContext executionContext, CallbackArguments args)
{
return DynValue.NewYieldReq(args.GetArray());
}
示例6: __wrap_wrapper
public static DynValue __wrap_wrapper(ScriptExecutionContext executionContext, CallbackArguments args)
{
DynValue handle = (DynValue)executionContext.AdditionalData;
return handle.Coroutine.Resume(args.GetArray());
}