Пример #1
0
    private G2Block CreateNewLife(int number, GameObject parent, int idx)
    {
        G2Block g = G2BoardGenerator.GetInstance().CreateBlock(number, 0, parent);

        this.bloodList[idx] = g.gameObject;
        g.GetComponent <G2Block>().img_panel.SetActive(false);


        return(g);
    }
Пример #2
0
    public void video()
    {
        Debug.Log("광고 봤음");
        bool flag = false;

        if (this.m_mask.transform.localPosition.y <= 0f)
        {
            flag = true;
        }
        if (!flag)
        {
            float num = this.m_objEndPos.transform.position.y + 0.55f;
            int   idx = 0;
            for (int i = 0; i < this.blocks.Count; i++)
            {
                G2Block g = this.blocks[i];
                if (!(g == null) && g.transform.position.y <= num)
                {
                    flag = true;
                    idx  = i;
                    break;
                }
            }
            if (!flag)
            {
                return;
            }
            foreach (int current in G2BoardGenerator.GetInstance().Use(idx, 2))
            {
                if (current < this.blocks.Count)
                {
                    G2Block g2 = this.blocks[current];
                    this.blocks[current] = null;
                    if (!(g2 == null))
                    {
                        Debug.Log("name :" + g2.transform.position + "   " + g2.GetCurrentColor());
                        ParticlesControl.GetInstance().PlayExplodeEffic(g2.transform.position, g2.GetCurrentColor());
                        G2BoardGenerator.GetInstance().FreeBlock(g2.gameObject);
                    }
                }
            }
            this.BackMap(3);
            G2BoardGenerator.GetInstance().IsStart    = true;
            G2BoardGenerator.GetInstance().IsGameOver = false;
        }
    }
Пример #3
0
    private void Delete(List <int> list, int index)
    {
        AudioManager.GetInstance().PlayEffect("sound_eff_clear_2");
        List <Game2Manager.PathRDM> list2 = this.FindPath(list, index);

        if (list2.Count < 0)
        {
            return;
        }
        this.m_dobleTotal++;
        int      count    = list2[0].paths.Count;
        Sequence sequence = DOTween.Sequence();

        foreach (Game2Manager.PathRDM current in list2)
        {
            G2Block g = this.blocks[current.index];
            g.ShowScore();
            this.blocks[current.index] = null;
            int row = G2BoardGenerator.GetInstance().GetRow(current.index);
            int col = G2BoardGenerator.GetInstance().GetCol(current.index);
            if (current.paths.Count >= 2)
            {
                Vector2 b      = new Vector2((float)current.paths[0].x, (float)current.paths[0].y);
                Vector2 vector = new Vector2((float)current.paths[1].x, (float)current.paths[1].y) - b;
                int     index2 = G2BoardGenerator.GetInstance().GetIndex(row + (int)vector.y, col + (int)vector.x);
                Tween   t      = g.DelayMove(index2, (float)(count - current.paths.Count) * 0.1f);
                sequence.Insert(0f, t);
            }
        }
        sequence.OnComplete(delegate
        {
            //this.PlayDoubleAni();
            this.BackMap(2);
            this.blocks[index].setNum(G2BoardGenerator.GetInstance().GetNumber(index));
            G2BoardGenerator.GetInstance().Down();
        });
        G2BoardGenerator.GetInstance().IsPlaying = true;
        this.RefreshScore(true);
    }
Пример #4
0
    private void LoadBlock()
    {
        for (int i = 0; i < 7; i++)
        {
            for (int j = 0; j < 5; j++)
            {
                int number = G2BoardGenerator.GetInstance().GetNumber(i, j);
                if (number == 0)
                {
                    this.blocks.Add(null);
                }
                else
                {
                    int     index = G2BoardGenerator.GetInstance().GetIndex(i, j);
                    G2Block item  = G2BoardGenerator.GetInstance().CreateBlock(number, index, this.m_map);
                    item.img_panel.SetActive(true);

                    this.blocks.Add(item);
                }
            }
        }
    }
Пример #5
0
    private void Drop(List <sDropData> dropList, List <int> newList)
    {
        Sequence sequence = DOTween.Sequence();

        foreach (sDropData current in dropList)
        {
            G2Block g = this.blocks[current.srcIdx];
            this.blocks[current.srcIdx] = null;
            this.blocks[current.dstIdx] = g;
            g.Index = current.dstIdx;
            Tween t = g.Move(current.dstIdx);
            sequence.Insert(0f, t);
        }
        sequence.OnComplete(delegate
        {
            G2BoardGenerator.GetInstance().IsPlaying = false;
            G2BoardGenerator.GetInstance().AutoDelete();
            this.ShowGuide();
            this.PlayFingerAni();
        });
        if (G2BoardGenerator.GetInstance().CoinIndex > 0)
        {
            int row = G2BoardGenerator.GetInstance().GetRow(G2BoardGenerator.GetInstance().CoinIndex);
            int col = G2BoardGenerator.GetInstance().GetCol(G2BoardGenerator.GetInstance().CoinIndex);
            for (int i = 6; i > row; i--)
            {
                if (G2BoardGenerator.GetInstance().GetNumber(i, col) == 0)
                {
                    Vector3 endValue = new Vector3((float)col * 160f + 55f - 375f, (float)i * 160f + 55f - 440f, 0f);
                    this.m_img_coin.transform.DOLocalMove(endValue, 0.3f, false);
                    G2BoardGenerator.GetInstance().CoinIndex = G2BoardGenerator.GetInstance().GetIndex(i, col);
                    break;
                }
            }
        }
        G2BoardGenerator.GetInstance().IsPlaying = true;
    }
Пример #6
0
 private void OnClickBlock(G2Block block)
 {
 }
Пример #7
0
    public void OnClickBox(int idx)
    {
        if (!G2BoardGenerator.GetInstance().IsStart)
        {
            G2BoardGenerator.GetInstance().IsStart = true;
        }
        if (G2BoardGenerator.GetInstance().IsPuase)
        {
            return;
        }
        if (G2BoardGenerator.GetInstance().IsPlaying)
        {
            return;
        }
        if (!G2BoardGenerator.GetInstance().IsFinishGuide)
        {
            switch (this.m_step)
            {
            case 0:
                idx = 2;
                break;

            case 1:
                idx = 2;
                break;

            case 2:
                idx = 3;
                break;
            }
            this.m_step++;
            if (this.m_step >= 4)
            {
                G2BoardGenerator.GetInstance().FinishGuide();
                this.m_txt_tips.GetComponent <LanguageComponent>().SetText(this.m_data_tiptxts[0]);
                //AppsflyerUtils.TrackTutorialCompletion(2, 1);
            }
        }
        this.m_dobleTotal = 0;

        Debug.Log("시작");

        int num = G2BoardGenerator.GetInstance().AddBock(idx);

        if (num == -1)
        {
            return;
        }

        Debug.Log("넘어감");

        int     number        = G2BoardGenerator.GetInstance().GetNumber(num, idx);
        G2Block block         = G2BoardGenerator.GetInstance().CreateBlock(number, G2BoardGenerator.GetInstance().GetIndex(num, idx), this.m_map);
        Vector3 localPosition = block.transform.localPosition;

        block.transform.position = this.bloodPosList[idx].transform.position;
        block.transform.SetParent(this.m_map.transform, true);
        Vector3 localPosition2 = block.transform.localPosition;
        float   duration       = (localPosition.y - localPosition2.y) / this.m_upSpeed;

        Debug.Log("go " + localPosition + "  " + duration);
        block.GetComponent <G2Block>().img_panel.SetActive(true);

        block.transform.DOLocalMove(localPosition, duration, false).OnStart(delegate
        {
            G2BoardGenerator.GetInstance().AddLife();
            this.bloodList[2].GetComponent <G2Block>().setNum(G2BoardGenerator.GetInstance().GetBlood());
        }).OnComplete(delegate
        {
            this.blocks[block.Index] = block;
            this.BackMap(1);
            G2BoardGenerator.GetInstance().IsPlaying = false;
            G2BoardGenerator.GetInstance().Delete(block.Index);
            if (block.Index == G2BoardGenerator.GetInstance().CoinIndex)
            {
                GM.GetInstance().AddDiamond(1, true);
                G2BoardGenerator.GetInstance().CoinIndex = -1;
                this.m_img_coin.gameObject.SetActive(false);
            }
            TaskData.GetInstance().Add(100102, 1, true);
        });
        G2BoardGenerator.GetInstance().IsPlaying = true;
        this.HideTxtTips();
        this.StopFingerAni();
        AudioManager.GetInstance().PlayEffect("sound_eff_click_1");
    }