本文整理汇总了C#中Operation.createStack方法的典型用法代码示例。如果您正苦于以下问题:C# Operation.createStack方法的具体用法?C# Operation.createStack怎么用?C# Operation.createStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation.createStack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: mainGameThread
void mainGameThread()
{
IList rulesAndEffects=_GameData[_effects] as IList;
Conditional stack=new Conditional();
stack[_Game]=_GameData;
List<Conditional> wrappedEffects=wrapGameEffects();
stack[_effects]=wrappedEffects;
stack[_target]=null;
stack[_rootl]=_GameData;
string curName="";
Debug.Log(string.Format("effects : {0}",wrappedEffects.Count));
try
{
while(runThread)
{
int ii=0;
while(ii<rulesAndEffects.Count)
{
object obj =rulesAndEffects[ii];
ii++;
Conditional eff=obj as Conditional;
curName=eff["__name"] as string;
if(!eff.hasTag(EXECUTE_PREFIX)&&!eff.hasTag(EXECUTE_POSTFIX))
{
Condition cnd=eff[_condition] as Condition;
//Debug.Log(cnd);
//Monitor.Enter(gameLock);
if(cnd.isFulfilled(stack,stack[_Game] as Conditional))
{
//Debug.Log(cnd);
lock(gameLock)
{
Operation op=new Operation(Operation.Commands.NEW);
Conditional nstack=op.createStack(stack, eff);
int oneff=rulesAndEffects.Count;
op.executeList(eff[_commands], nstack);
if(rulesAndEffects.Count!=oneff)
{
stack[_effects]=wrapGameEffects();
Debug.Log("added trules");
}
if(nstack.hasTag(TAG_ABORT))
{
Debug.Log("GameObject Overlapped");
return;//gameover? I guess
}
}
}
//Monitor.Exit(gameLock);
}
}
}
}
catch (System.Exception ex)
{
Debug.Log(ex);
Debug.Log(curName);
// I WILL LOG THE EXCEPTION object "EX" here ! but ex.StackTrace is truncated!
}
}