Exemplo n.º 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);
    }
Exemplo n.º 2
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");
    }