private void EndWin() { rootAction = new OrderAction(); WaitActor waitActor = new WaitActor(1000); rootAction.AddNode(waitActor); //PromptModel.Instance.Pop(LanguageUtil.GetTxt(11402)); ExecuteAction(FightStadus.end_win); }
public void WhenIWaitForTickUpdateTimePeriods(int timePeriods) { var configQuery = RootLevelActors.HeartBeatActorRef.Ask <HeartBeatActor.ConfigurationResult>(new HeartBeatActor.QueryConfiguration()); configQuery.Wait(); var period = configQuery.Result.State.UpdatePeriod; TimeSpan result = period; for (int i = 0; i < timePeriods; i++) { result = result + period; } var waiterAwaiter = _state.TestKit.CreateTestProbe("waiterTestProbe"); var waiter = _state.TestKit.Sys.ActorOf(WaitActor.CreateProps()); waiter.Tell(new WaitActor.Wait((int)result.TotalMilliseconds), waiterAwaiter); var msg = waiterAwaiter.ExpectMsg <WaitActor.WaitComplete>(result + TimeSpan.FromSeconds(3)); Assert.IsNotNull(msg); }
private void PlayPutAutoSkill() { rootAction = new OrderAction(); WaitActor waitActor = new WaitActor(200); rootAction.AddNode(waitActor); List <SkillEntityInfo> skillEntitys = SkillModel.Instance.GetNewSkillEntitys(); fightUI.ShowSkill(); if (lastTouchCell != null && skillEntitys.Count > 0) { ParallelAction parallelAction = new ParallelAction(); int holdIndex = 0; bool lastIsHump = lastTouchCell.IsHump(); for (int i = 0; i < skillEntitys.Count; i++) { OrderAction skillOrder = new OrderAction(); SkillEntityInfo skillEntity = skillEntitys[i]; Vector2 addPos = new Vector2(); for (int h = holdIndex; h < 19; h++) { Vector2 holePos = FightConst.GetHoleByLevel(h, lastIsHump); Vector2 checkPos = new Vector2(lastTouchCell.posX + holePos.x, lastTouchCell.posY - holePos.y); CellInfo checkCell = CellModel.Instance.GetCellByPos((int)checkPos.x, (int)checkPos.y); if (checkCell != null && checkCell.isBlank) { addPos = checkPos; holdIndex = h + 1; break; } } CellInfo addItem = CellModel.Instance.AddItem(skillEntity.seed.config_cell_item.id, (int)addPos.x, (int)addPos.y); SkillModel.Instance.ThrowSkillEntity(skillEntity, addItem); GameObject itemObj = CreateCellItem(addItem); itemObj.transform.SetParent(effectLayer.transform, false); Vector2 toPos = PosUtil.GetFightCellPos(addItem.posX, addItem.posY); PosUtil.SetCellPos(itemObj.transform, skillEntity.seed.seed_x, skillEntity.seed.seed_y, 1.0f); rootAction.AddNode(new PlaySoundActor("Useskill")); rootAction.AddNode(new ShowEffectActor(itemObj.transform, "effect_skill_fly")); rootAction.AddNode(new MoveActor((RectTransform)itemObj.transform, new Vector3(toPos.x, toPos.y, 0), 1200)); skillOrder.AddNode(new SetLayerActor(itemObj.transform, transform)); skillOrder.AddNode(new PlaySoundActor("PutAutoSkill")); skillOrder.AddNode(new ClearEffectActor(itemObj.transform, "effect_skill_fly")); skillOrder.AddNode(new ScaleActor((RectTransform)itemObj.transform, new Vector3(1.2f, 1.2f, 0), 0.2f)); skillOrder.AddNode(new ScaleActor((RectTransform)itemObj.transform, new Vector3(1, 1, 0), 0.1f)); parallelAction.AddNode(skillOrder); } rootAction.AddNode(parallelAction); } waitActor = new WaitActor(200); rootAction.AddNode(waitActor); ExecuteAction(FightStadus.auto_skill); }
public WaitAction(WaitActor target, int rounds) { this.target = target; this.rounds = rounds; }