Beispiel #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();
        }
    }
Beispiel #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);
            }
        }
    }