public void Flow(ActionTree actionTree) { CoverModel.Instance.Flow(); List <CoverAnimInfo> anims = CoverModel.Instance.anims[0]; for (int i = 0; i < anims.Count; i++) { CoverAnimInfo animInfo = anims[i]; FightCoverItem item = GetItemByRunId(animInfo.coverInfo.runId); if (item != null) { ParallelAction paralle = new ParallelAction(); Vector2 toPos = PosMgr.GetFightCellPos(animInfo.coverInfo.posX, animInfo.coverInfo.posY); paralle.AddNode(new MoveActor((RectTransform)item.transform, new Vector3(toPos.x, toPos.y, 0), 0, 0.3f)); OrderAction orderAction = new OrderAction(); orderAction.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0.5f, 0.5f, 1), 0.1f)); orderAction.AddNode(new WaitActor(100)); orderAction.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(1, 1, 1), 0.1f)); paralle.AddNode(orderAction); actionTree.AddNode(paralle); } } }
public void PlayEliminate(List <CoverAnimInfo> coverAnimss, ActionTree actionTree) { for (int j = 0; j < coverAnimss.Count; j++) { OrderAction order = new OrderAction(); CoverAnimInfo coverAnimInfo = coverAnimss[j]; FightCoverItem item = GetItemByRunId(coverAnimInfo.coverInfo.runId); switch (coverAnimInfo.animationType) { case CellAnimType.clear: order.AddNode(new ShowEffectActor(item.transform, "effect_cell_bomb", fightModule.transform)); order.AddNode(new PlaySoundActor("remove")); order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.1f)); order.AddNode(new DestroyActor(item.gameObject)); break; case CellAnimType.wreck: order.AddNode(new ShowEffectActor(item.transform, "effect_cell_bomb", fightModule.transform)); order.AddNode(new PlaySoundActor("remove")); order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.1f)); order.AddNode(new ChangeCoverActor(this, item, coverAnimInfo.coverInfo)); break; } actionTree.AddNode(order); } }
public void AddAnim(CoverInfo coverInfo, CellAnimType animationType = CellAnimType.clear) { List <CoverAnimInfo> stepAnims = anims[anims.Count - 1]; CoverAnimInfo animInfo = new CoverAnimInfo(); animInfo.animationType = animationType; animInfo.startFrame = anims.Count; animInfo.coverInfo = coverInfo; stepAnims.Add(animInfo); }
//用来排序 public int CompareTo(object obj) { CoverAnimInfo target = obj as CoverAnimInfo; return(target.startFrame.CompareTo(startFrame)); }