本文整理汇总了C#中CSLE.CLS_Content.OutStackContent方法的典型用法代码示例。如果您正苦于以下问题:C# CLS_Content.OutStackContent方法的具体用法?C# CLS_Content.OutStackContent怎么用?C# CLS_Content.OutStackContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSLE.CLS_Content
的用法示例。
在下文中一共展示了CLS_Content.OutStackContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StaticCall
public CLS_Content.Value StaticCall(CLS_Content contentParent, string func, BetterList<CLS_Content.Value> _params)
{
if (staticMemberContent == null)
NewStatic(contentParent.environment);
// 静态函数判断
Function fun;
if (this.functions.TryGetValue(func, out fun))
{
#if UNITY_EDITOR
if (!fun.bStatic)
throw new Exception("成员函数必须通过实例来调用: " + this.Name + "." + func);
#endif
CLS_Content.Value value = null;
if (fun.expr_runtime != null)
{
CLS_Content content = CLS_Content.NewContent(contentParent.environment);
#if UNITY_EDITOR
contentParent.InStackContent(content);//把这个上下文推给上层的上下文,这样如果崩溃是可以一层层找到原因的
#endif
content.CallType = this;
content.CallThis = null;
for (int i = 0, count = fun._paramtypes.Count; i < count; i++)
{
content.DefineAndSet(fun._paramnames[i], fun._paramtypes[i].type, _params[i].value);
}
value = fun.expr_runtime.ComputeValue(content);
if (value != null)
value.breakBlock = 0;
#if UNITY_EDITOR
contentParent.OutStackContent(content);
#endif
CLS_Content.PoolContent(content);
}
return value;
}
// 委托判断
CLS_Content.Value smDeleVal;
if (this.staticMemberValues.TryGetValue(func, out smDeleVal))
{
Delegate dele = smDeleVal.value as Delegate;
if (dele != null)
{
CLS_Content.Value value = new CLS_Content.Value();
value.type = null;
object[] objs = CLS_Content.ParamObjsArray[_params.size];
for (int i = 0; i < _params.size; i++)
{
objs[i] = _params[i].value;
}
value.value = dele.DynamicInvoke(objs);
if (value.value != null)
value.type = value.value.GetType();
value.breakBlock = 0;
return value;
}
}
throw new NotImplementedException("未实现静态函数: " + this.Name + "." + func);
}
示例2: MemberCall
public CLS_Content.Value MemberCall(CLS_Content contentParent, object object_this, string func, BetterList<CLS_Content.Value> _params, bool isBaseCall = false)
{
SInstance callThis = object_this as SInstance;
// 成员函数判断
Function fun;
if (this.functions.TryGetValue(func, out fun))
{
#if UNITY_EDITOR
if (fun.bStatic)
throw new Exception("不能通过实例来调用静态函数: " + this.Name + "." + func);
#endif
CLS_Content.Value value = null;
SType callType = this;
if (isBaseCall)
{
SType tempType = contentParent.CallType.BaseType;
SType.Function tempFun;
while (tempType != null)
{
if (tempType.functions.TryGetValue(func, out tempFun))
{
if (tempFun.ownerType == null || tempFun.ownerType == tempType)
{
callType = tempType;
fun = tempFun;
break;
}
}
tempType = tempType.BaseType;
}
}
else
{
if (callType != callThis.type)
{
SType tempType = callThis.type;
Function tempFun;
while (tempType != null)
{
if (tempType.functions.TryGetValue(func, out tempFun))
{
if (tempFun.ownerType == null || tempFun.ownerType == tempType)
{
callType = tempType;
fun = tempFun;
break;
}
}
tempType = tempType.BaseType;
}
}
else if (fun.ownerType != null && fun.ownerType != callType)
{
callType = fun.ownerType;
}
}
if (fun.expr_runtime != null)
{
CLS_Content content = CLS_Content.NewContent(contentParent.environment);
#if UNITY_EDITOR
contentParent.InStackContent(content);//把这个上下文推给上层的上下文,这样如果崩溃是可以一层层找到原因的
#endif
content.CallType = callType;
content.CallThis = callThis;
for (int i = 0, count = fun._paramtypes.Count; i < count; i++)
{
content.DefineAndSet(fun._paramnames[i], fun._paramtypes[i].type, _params[i].value);
}
value = fun.expr_runtime.ComputeValue(content);
if (value != null)
value.breakBlock = 0;
#if UNITY_EDITOR
contentParent.OutStackContent(content);
#endif
CLS_Content.PoolContent(content);
}
return value;
}
// 委托判断
CLS_Content.Value mDeleVal;
if (callThis.member.TryGetValue(func, out mDeleVal))
{
Delegate dele = mDeleVal.value as Delegate;
if (dele != null)
{
CLS_Content.Value value = new CLS_Content.Value();
value.type = null;
object[] objs = CLS_Content.ParamObjsArray[_params.size];
for (int i = 0; i < _params.size; i++)
{
objs[i] = _params[i].value;
}
//.........这里部分代码省略.........