Exemple #1
0
    private void ItemEnterHander(GameObject go)
    {
        if (CrossPlatformInputManager.GetButton("Fire1") && FightModule.crtFightStadus == FightStadus.line)
        {
            FightControlItem itemCtr  = go.GetComponent <FightControlItem>();
            CellInfo         cellInfo = CellModel.Instance.GetCellByPos(itemCtr.control_x, itemCtr.control_y);
            CellLineType     lineType = FuncLine.Line(cellInfo);
            int lineCount             = CellModel.Instance.lineCells.Count;

            if (lineType == CellLineType.success)
            {
                GameMgr.audioMgr.PlayeSound("ItemEnter");
                cellLayer.RollInCell(cellInfo);
                List <CellInfo> skillCells = SkillModel.Instance.OutCell(CellModel.Instance.lineCells[lineCount - 2]);
                cellLayer.ChangeCells(skillCells);
                skillCells = SkillModel.Instance.EnterCell(cellInfo);
                cellLayer.ChangeCells(skillCells);
                lineLayer.ShowLine(CellModel.Instance.lineCells[lineCount - 2], cellInfo);
            }

            if (lineType == CellLineType.rollback)
            {
                GameMgr.audioMgr.PlayeSound("rollback");
                cellLayer.RollBackCell(CellModel.Instance.rollbackCell);
                List <CellInfo> skillCells = SkillModel.Instance.OutCell(CellModel.Instance.rollbackCell);
                cellLayer.ChangeCells(skillCells);
                skillCells = SkillModel.Instance.EnterCell(cellInfo);
                cellLayer.ChangeCells(skillCells);

                lineLayer.DestroyLine(cellInfo, CellModel.Instance.rollbackCell);
            }
            fightUI.UpdateCollect(true);
            monsterLayer.UpdateList();
            cellLayer.UpdateList();
        }
    }