Esempio n. 1
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);
    }
Esempio n. 2
0
    private void ItemDownHander(GameObject go)
    {
        if (FightModule.crtFightStadus == FightStadus.idle)
        {
            FightControlItem itemCtr  = go.GetComponent <FightControlItem>();
            CellInfo         cellInfo = CellModel.Instance.GetCellByPos(itemCtr.control_x, itemCtr.control_y);
            CellLineType     lineType = FuncLine.Line(cellInfo, true);
            if (lineType == CellLineType.success)
            {
                EventTriggerListener.Get(go).onUp += ItemUpHander;

                GameMgr.audioMgr.PlayeSound("ItemEnter");
                FightModule.crtFightStadus = FightStadus.line;
                cellLayer.RollInCell(cellInfo);
                List <CellInfo> skillCells = SkillModel.Instance.EnterCell(cellInfo);
                cellLayer.ChangeCells(skillCells);
                fightUI.UpdateCollect(true);
                //fightUI.propsPart.gameObject.SetActive(false);
                monsterLayer.UpdateList();
                cellLayer.UpdateList();
                fightUI.skillListPart.gameObject.SetActive(true);
            }
        }
    }