//设置自身执行步骤 public void SetStep(int targetstep, InstallSpeed _ins = InstallSpeed.slowspeed, bool issingle = false) { // Debug.Log (Name+"执行步骤::::"+targetstep ); Stack <RealObj> rstack = new Stack <RealObj>(); if (issingle) { targetstep = this.step + targetstep; if (targetstep > this.step) { realstack = PushToStack(targetstep - 1, this.step - 1); } else { realstack = PushToStack(targetstep, this.step); } } else { if (targetstep > this.step) { realstack = PushToStack(targetstep - 1, this.step - 1); } else { realstack = PushToStack(targetstep, this.step); } UImanager.GetInstance.SetOtherButtonDisable(false); } if (realstack.Count == 0) { return; } RealObj re = realstack.Pop(); //Debug.Log("现在步数"+step+">>>>>>共推出多少个元素???"+realstack.Count+"第一次退出:::::"+re.name); re.Excute(targetstep >= this.step, _ins, ModelMoveEnd); if (issingle) { re.Spark(); } }
//回调执行 private void ModelMoveEnd(int aspeacket, InstallSpeed ins) { step += aspeacket; // Debug.Log ("有没有执行步骤添加?"+ step); if (realstack.Count > 0) { RealObj re = realstack.Pop(); lastobj = re; re.Excute(aspeacket > 0, ins, ModelMoveEnd); } else { if (lastobj != null) { CameraBess.GetInstance.ChoiseCamera(false, new PathObjects(lastobj.transform.position, lastobj.transform.eulerAngles)); } UImanager.GetInstance.SetOtherButtonDisable(); mapcontroll.SetAllChildActive(true); LimitStep(); // NextModelSparking(aspeacket); } }