public void PlayEliminate(List <MonsterAnimInfo> monsterAnimss, ActionTree actionTree) { for (int j = 0; j < monsterAnimss.Count; j++) { OrderAction order = new OrderAction(); MonsterAnimInfo monsterAnimInfo = monsterAnimss[j]; FightMonsterItem item = GetItemByRunId(monsterAnimInfo.monsterInfo.runId); switch (monsterAnimInfo.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)); //if (monsterAnimInfo.monsterInfo.IsNull()) //{ // order.AddNode(new DestroyActor(item.gameObject)); //}else //{ order.AddNode(new ChangeMonsterActor(item, monsterAnimInfo.monsterInfo)); //} break; } actionTree.AddNode(order); } }
public void AddAnim(MonsterInfo monsterInfo, CellAnimType animationType = CellAnimType.clear) { List <MonsterAnimInfo> stepMoves = anims[anims.Count - 1]; MonsterAnimInfo animInfo = new MonsterAnimInfo(); animInfo.animationType = animationType; animInfo.startFrame = anims.Count; animInfo.monsterInfo = monsterInfo; stepMoves.Add(animInfo); }
//用来排序 public int CompareTo(object obj) { MonsterAnimInfo target = obj as MonsterAnimInfo; return(target.startFrame.CompareTo(startFrame)); }