Пример #1
0
    //
    // 매치된 블럭을 풀에 반환 하고 비활성화 처리를 합니다.
    //
    void ReleaseBlock()
    {
        CreateBlockCount += MatchList.Count;

        for (int i = 0; i < MatchList.Count; i++)
        {
            BlockHive hiveinfo = MatchList[i].GetComponent <BlockHive>();

            BlockPool.ReturnPool(hiveinfo.blockobj.gameObject);
            hiveinfo.blockobj.gameObject.SetActive(false);
            hiveinfo.InitData();
        }

        MatchList.Clear();
    }
Пример #2
0
    void ReleaseObs()
    {
        //
        // 팽이 주변에 빈공간이 있다면 주변에서 매치가 되었으므로 다이카운트를 낮춰 준다.
        //
        for (int i = 0; i < m_MapLoad.blocks.Length; i++)
        {
            if (m_MapLoad.blocks[i] == null)
            {
                continue;
            }

            BlockHive info = m_MapLoad.blocks[i].GetComponent <BlockHive>();

            if (info.blockobj == null)
            {
                continue;
            }
            if (info.GetBlockInfo().type != Map.BLOCKTYPPE.NONE && info.GetBlockInfo().type != Map.BLOCKTYPPE.BLOCK)
            {
                if (ObsCheck(i))
                {
                    info.GetBlockInfo().DieCount--;
                }
            }
        }

        //
        // 다이카운트가 0이하인 장해물을 제거한다.
        //
        for (int i = 0; i < m_MapLoad.blocks.Length; i++)
        {
            if (m_MapLoad.blocks[i] == null)
            {
                continue;
            }

            BlockHive info = m_MapLoad.blocks[i].GetComponent <BlockHive>();

            if (info.blockobj == null)
            {
                continue;
            }

            if (info.blockobj == null)
            {
                continue;
            }

            if (info.GetBlockInfo().type != Map.BLOCKTYPPE.NONE && info.GetBlockInfo().type != Map.BLOCKTYPPE.BLOCK)
            {
                if (info.GetBlockInfo().DieCount <= 0)
                {
                    BlockPool.ReturnPool(info.blockobj.gameObject);
                    info.blockobj.gameObject.SetActive(false);
                    info.InitData();
                    CreateBlockCount++;
                    Goal--;
                    UIGame.instance.SetGoal(Goal);
                }
            }
        }
    }