コード例 #1
0
 private void CompleteHander()
 {
     itemCell   = null;
     itemEffect = null;
     info       = null;
     OnEnd();
 }
コード例 #2
0
 public PlayCellMoveEndActor(FightCellItem cellItem, FightEffectItem effectItem, CellInfo cellInfo)
     : base()
 {
     itemCell   = cellItem;
     itemEffect = effectItem;
     info       = cellInfo;
 }
コード例 #3
0
 public ShowBombActor(FightCellItem cellItem, FightEffectItem effectItem, bool isShow = true)
     : base()
 {
     itemCell   = cellItem;
     itemEffect = effectItem;
     isShowBomb = isShow;
 }
コード例 #4
0
    private void Filling(FightStadus fightState = FightStadus.move, int waitmillisecond = 0)
    {
        CellModel.Instance.anims = new List <List <CellAnimInfo> >();
        FunMove.Move(false, isDeductStep);
        List <CellMoveInfo> moveAnims = CellModel.Instance.moveAnims;

        rootAction = new OrderAction();
        ParallelAction paralle = new ParallelAction();

        Dictionary <int, int> newStartPos = new Dictionary <int, int>();

        for (int i = 0; i < moveAnims.Count; i++)
        {
            CellMoveInfo cellMoveInfo = moveAnims[i];

            OrderAction orderAction = new OrderAction();
            paralle.AddNode(orderAction);

            FightCellItem item = GetItemByRunId(cellMoveInfo.cellInfo.runId);
            if (item == null)
            {
                item = CreateCellItem(cellMoveInfo.cellInfo).GetComponent <FightCellItem>();
                int xKey = (int)cellMoveInfo.paths[0].x;
                if (newStartPos.ContainsKey(xKey))
                {
                    int preIndex = newStartPos[xKey];
                    newStartPos[xKey] = preIndex - 1;
                }
                else
                {
                    newStartPos.Add(xKey, -1);
                }

                PosUtil.SetFightCellPos(item.transform, xKey, newStartPos[xKey]);
            }

            for (int j = 0; j < cellMoveInfo.paths.Count; j++)
            {
                Vector2 pathPoint = cellMoveInfo.paths[j];
                Vector2 toPos     = PosUtil.GetFightCellPos((int)pathPoint.x, (int)pathPoint.y);
                float   speed     = isDeductStep ? 1750 : 1350;
                orderAction.AddNode(new MoveActor((RectTransform)item.transform, new Vector3(toPos.x, toPos.y, 0), speed));
            }
            FightEffectItem effectItem = effectLayer.GetEffectItemByPos(cellMoveInfo.cellInfo.posX, cellMoveInfo.cellInfo.posY);
            orderAction.AddNode(new PlayCellMoveEndActor(item, effectItem, cellMoveInfo.cellInfo));
        }
        if (waitmillisecond > 0)
        {
            rootAction.AddNode(new WaitActor(waitmillisecond));
        }
        rootAction.AddNode(paralle);
        ExecuteAction(fightState);
    }
コード例 #5
0
    private FightEffectItem CreateEffectItem(int posX, int posY)
    {
        list.ForceChangeItemPrefab(effectItem);
        GameObject item = list.NewItem();

        FightEffectItem itemCtr = item.AddComponent <FightEffectItem>();

        PosUtil.SetFightCellPos(item.transform, posX, posY);
        itemCtr.control_x = posX;
        itemCtr.control_y = posY;
        item.name         = itemCtr.control_x + "_" + itemCtr.control_y;

        return(itemCtr);
    }
コード例 #6
0
    private void DeductStep()
    {
        isDeductStep = true;
        bool isSkillDeduct = FuncDeduct.Deduct();

        fightUI.UpdateCollect(true, true);
        fightUI.UpdateCollect(false, true, isSkillDeduct);

        List <List <CellAnimInfo> > cellAnims = CellModel.Instance.anims;

        rootAction = new OrderAction();
        for (int i = 0; i < cellAnims.Count; i++)
        {
            ParallelAction paralle = new ParallelAction();

            List <CellAnimInfo> cellAnimss = cellAnims[i];
            int j;
            for (j = 0; j < cellAnimss.Count; j++)
            {
                CellAnimInfo  animInfo = cellAnimss[j];
                FightCellItem item     = GetItemByRunId(animInfo.runId);
                if (item != null)
                {
                    OrderAction order = new OrderAction();

                    FightEffectItem effectItem = effectLayer.FindEffectItemByPos(animInfo.toInfo.posX, animInfo.toInfo.posY);

                    order.AddNode(new ShowBombActor(item, effectItem));
                    order.AddNode(new WaitActor(300));
                    order.AddNode(new ShowBombActor(item, effectItem, false));
                    order.AddNode(new ChangeCellActor(item, animInfo.toInfo));
                    if (animInfo.toInfo.isBlank)
                    {
                        order.AddNode(new ShowEffectActor(item.transform, "effect_cell_clear", fightModule.transform));
                        order.AddNode(new DestroyActor(item.gameObject));
                    }

                    paralle.AddNode(order);
                }
            }
            rootAction.AddNode(new PlaySoundActor("wreck"));
            rootAction.AddNode(paralle);
        }

        ExecuteAction(FightStadus.deduct);
    }
コード例 #7
0
    public void ChangeBombs(List <CellInfo> cells)
    {
        if (cells != null)
        {
            for (int i = 0; i < cells.Count; i++)
            {
                CellInfo cellInfo = cells[i];

                FightEffectItem item = GetEffectItemByPos(cellInfo.posX, cellInfo.posY);
                if (item == null)
                {
                    item = CreateEffectItem(cellInfo.posX, cellInfo.posY);
                }
                item.SetBombSelect(cellInfo.bombMark);
            }
        }
    }
コード例 #8
0
    private void PlayEliminate()
    {
        FuncEliminate.Eliminate();

        List <List <CellAnimInfo> >    cellAnims    = CellModel.Instance.anims;
        List <List <FloorAnimInfo> >   floorAnims   = FloorModel.Instance.anims;
        List <List <WallAnimInfo> >    wallAnims    = WallModel.Instance.anims;
        List <List <CoverAnimInfo> >   coverAnims   = CoverModel.Instance.anims;
        List <List <MonsterAnimInfo> > monsterAnims = MonsterModel.Instance.anims;

        rootAction = new OrderAction();
        for (int i = 0; i < cellAnims.Count; i++)
        {
            ParallelAction paralle = new ParallelAction();

            List <CellAnimInfo> cellAnimss = cellAnims[i];
            int j;
            for (j = 0; j < cellAnimss.Count; j++)
            {
                CellAnimInfo  animInfo = cellAnimss[j];
                FightCellItem item     = GetItemByRunId(animInfo.runId);
                if (item == null && animInfo.animationType != CellAnimType.nullbomb)
                {
                    continue;                    //todo不因该有这个判断 变色技能需要再研究
                }

                OrderAction order = new OrderAction();

                switch (animInfo.animationType)
                {
                case CellAnimType.clear:
                    order.AddNode(new PlaySoundActor("clear"));
                    order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.1f));
                    FightEffectItem effectItem = effectLayer.GetEffectItemByPos(animInfo.toInfo.posX, animInfo.toInfo.posY);
                    order.AddNode(new ShowBombActor(item, effectItem, false));
                    order.AddNode(new ShowEffectActor(item.transform, "effect_cell_clear", fightModule.transform));
                    order.AddNode(new DestroyActor(item.gameObject));
                    break;

                case CellAnimType.wreck:
                    order.AddNode(new PlaySoundActor("wreck"));
                    order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.1f));
                    effectItem = effectLayer.GetEffectItemByPos(animInfo.toInfo.posX, animInfo.toInfo.posY);
                    order.AddNode(new ShowBombActor(item, effectItem, false));
                    order.AddNode(new ShowEffectActor(item.transform, "effect_cell_bomb", fightModule.transform));
                    order.AddNode(new ChangeCellActor(item, animInfo.toInfo));
                    if (animInfo.toInfo.isBlank)
                    {
                        order.AddNode(new DestroyActor(item.gameObject));
                    }
                    break;

                case CellAnimType.bomb:
                    order.AddNode(new PlaySoundActor("wreck"));
                    order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(1.2f, 1.2f, 1), 0.1f));
                    effectItem = effectLayer.GetEffectItemByPos(animInfo.toInfo.posX, animInfo.toInfo.posY);
                    order.AddNode(new ShowBombActor(item, effectItem, false));
                    order.AddNode(new ShowEffectActor(item.transform, "effect_cell_bomb", fightModule.transform));
                    order.AddNode(new ChangeCellActor(item, animInfo.toInfo));
                    if (animInfo.toInfo.isBlank)
                    {
                        order.AddNode(new DestroyActor(item.gameObject));
                    }
                    break;

                case CellAnimType.nullbomb:
                    effectItem = effectLayer.GetEffectItemByPos(animInfo.toInfo.posX, animInfo.toInfo.posY);
                    order.AddNode(new ShowBombActor(item, effectItem, false));
                    break;
                }

                if (item != null && item.cell_info.isBlank)
                {
                    if (item.cell_info.timer > 0)
                    {
                        order.AddNode(new AddStepActor(item.cell_info.addCount));
                        order.AddNode(new WaitActor(200));
                    }
                }

                paralle.AddNode(order);
            }

            floorLayer.PlayEliminate(floorAnims[i], paralle);
            coverLayer.PlayEliminate(coverAnims[i], paralle);
            fancelayer.PlayEliminate(wallAnims[i], paralle);
            monsterLayer.PlayEliminate(monsterAnims[i], paralle);

            rootAction.AddNode(paralle);
        }

        ExecuteAction(FightStadus.eliminate);
    }