示例#1
0
    public bool BlockPop()
    {
        List <BlockGroup> blockGroupList = new List <BlockGroup>();

        ClearVisitMap();
        for (int y = 0; y < Constants.BlockMapHeight_InRange; y++)
        {
            for (int x = 0; x < Constants.BlockMapWidth; x++)
            {
                if (isVIsited(x, y))
                {
                    continue;
                }
                if (GetBlock(x, y) == null)
                {
                    continue;
                }
                ClearPopMap();
                BlockGroup newGroup = new BlockGroup();
                newGroup.Init(x, y);
                if (newGroup.BlockList.Count >= GetNeedBlockForPpo())
                {
                    for (int i = 0; i < newGroup.BlockList.Count; i++)
                    {
                        CheckVisit(newGroup.BlockList[i]);
                    }
                    blockGroupList.Add(newGroup);
                }
            }
        }

        if (blockGroupList.Count > 0)
        {
            SoundManager.Instance.Play(new SoundPlayData("BlockPop_1", E_AUDIO_GROUP_TYPE.UI, E_AUDIO_CHANNEL_TYPE.UISE, E_AUDIO_CLIP_GROUP.UI, null, false));
        }

        DotList.Clear();
        for (int i = 0; i < blockGroupList.Count; i++)
        {
            Vector2 Dot = blockGroupList[i].CreateCenterPoint();
            DotList.Add(Dot);
            blockGroupList[i].PopAll(); //And Create Dot
        }
        return(blockGroupList.Count > 0);
    }