Ejemplo n.º 1
0
    IEnumerator ResultRunning()
    {
        ScoreMorph.morphEasein(0, Score, 60);
        ScoreBonusMorph.morphEasein(0, ScoreBonus, 60);
        GetComponent <AudioSource>().Play();
        while ((!ScoreMorph.IsFinish()) || (!ScoreBonusMorph.IsFinish()))
        {
            ScoreMorph.Update();
            ScoreBonusMorph.Update();
            int score      = (int)ScoreMorph.val;
            int scorebonus = (int)ScoreBonusMorph.val;
            ScoreText.text      = score.ToString("#,##0");
            ScoreBonusText.text = scorebonus.ToString() + "%";
            yield return(null);
        }
        GetComponent <AudioSource>().Stop();
        yield return(new WaitForSeconds(0.5f));

        if (ScoreBonus > 0)
        {
            ScoreMorph.morphEasein(Score + Score * ScoreBonus / 100, 60);
            GetComponent <AudioSource>().Play();
            while (!ScoreMorph.IsFinish())
            {
                ScoreMorph.Update();
                int score = (int)ScoreMorph.val;
                ScoreText.text = score.ToString("#,##0");
                yield return(null);
            }
            GetComponent <AudioSource>().Stop();
            yield return(new WaitForSeconds(1.0f));
        }
        //load friend list
        StartCoroutine("ShowOnlineResult");
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        switch (state)
        {
        case BubbleState.BS_HIDE:
        {
            transform.localScale = new Vector3(scale, scale, 1);
        }
        break;

        case BubbleState.BS_BUBBLE:
        {
            ScaleVal.Update();
            BubbleVal.Update();
            scale = ScaleVal.val;
            transform.localScale = new Vector3(ScaleVal.val, ScaleVal.val, 1);
            transform.rotation   = Quaternion.Euler(0, 0, BubbleVal.val);
            if (ScaleVal.IsFinish() && BubbleVal.IsFinish())
            {
                setButton(true);
                state = BubbleState.BS_FIX;
            }
        }
        break;

        case BubbleState.BS_FIX:
        {
            transform.localScale = new Vector3(scale, scale, 1);
        }
        break;
        }
    }
Ejemplo n.º 3
0
 IEnumerator RunMoney()
 {
     while (!MoneyMorph.IsFinish())
     {
         MoneyMorph.Update();
         int money = (int)MoneyMorph.val;
         MoneyText.text = money.ToString("#,##0");
         yield return(null);
     }
 }
Ejemplo n.º 4
0
 IEnumerator ScoreRunning()
 {
     morphScore.morphEaseout(Score, 30.0f);
     while (!morphScore.IsFinish())
     {
         morphScore.Update();
         int    val   = (int)morphScore.val;
         string scTxt = val.ToString("#,##0");
         scoreText.text = scTxt;
         yield return(null);
     }
 }
Ejemplo n.º 5
0
    IEnumerator IRunProgress()
    {
        int lvlCount    = nextLevel - currentLevel;
        int progressRun = (nextProgress + lvlCount * 100) - currentProgress;

        progressMorph.morphEasein(currentProgress, currentProgress + progressRun, 120);
        while (!progressMorph.IsFinish())
        {
            progressMorph.Update();
            int cPro = (int)progressMorph.val;
            int lvl  = currentLevel + (cPro) / 100;
            SetProgress(cPro % 100);
            LevelTxt.text = lvl.ToString();

            yield return(null);
        }
        yield return(null);
    }
Ejemplo n.º 6
0
    IEnumerator SnappingItem()
    {
        while (!SnappingMorph.IsFinish())
        {
            SnappingMorph.Update();
            PageMoveMent = SnappingMorph.val;

            if (PageMoveMent > 0)
            {
                PageMoveMent = 0;
            }
            if (PageMoveMent < -(PageLength * (PageSize - 1)))
            {
                PageMoveMent = -PageLength * (PageSize - 1);
            }

            for (int i = 0; i < PageSize; i++)
            {
                PageList [i].transform.localPosition = new Vector3(PageMoveMent + i * PageLength, 0.12f, 0);
                int pageIdx = (int)(-(PageMoveMent - (PageLength / 2.0f)) / PageLength);
                currentPageIndex = pageIdx;
                if (i == pageIdx)
                {
                    PageList [i].color = Color.white;
                }
                else
                {
                    PageList [i].color = new Color32(0, 0, 0, 117);
                }
            }
            yield return(0);
        }
        //load new XML
        if (lastPageIndex != currentPageIndex)
        {
            lastPageIndex = currentPageIndex;
            PageDetailGlobal.xmlDownload(currentPageIndex);
        }
    }
Ejemplo n.º 7
0
    IEnumerator SnappingItem()
    {
        while (!SnappingMorph.IsFinish())
        {
            SnappingMorph.Update();
            ItemMoveMent = SnappingMorph.val;
            if (ListHeight - ListHeightGap < 0)
            {
                yield break;
            }
            if (ItemMoveMent < 0)
            {
                ItemMoveMent = 0;
            }
            if (ItemMoveMent > ListHeight - ListHeightGap)
            {
                ItemMoveMent = ListHeight - ListHeightGap;
            }

            transform.localPosition = new Vector3(0, ItemMoveMent + lastHeight, 0);
            yield return(0);
        }
    }
Ejemplo n.º 8
0
    IEnumerator SnappingItem()
    {
        while (!SnappingMorph.IsFinish())
        {
            SnappingMorph.Update();
            ItemMoveMent = SnappingMorph.val;

            if (ItemMoveMent < 0)
            {
                ItemMoveMent = 0;
            }
            if (ItemMoveMent > (DetailLength * (itemDetailList.Count - 1)))
            {
                ItemMoveMent = DetailLength * (itemDetailList.Count - 1);
            }

            for (int i = 0; i < itemDetailList.Count; i++)
            {
                itemDetailList [i].transform.localPosition = new Vector3(0, ItemMoveMent - i * DetailLength, 0);
            }
            yield return(0);
        }
    }
Ejemplo n.º 9
0
    IEnumerator SnappingItem()
    {
        if (ShelfItemList.Count <= 0)
        {
            yield break;
        }
        while (!SnappingMorph.IsFinish())
        {
            SnappingMorph.Update();
            ItemMoveMent = SnappingMorph.val;

            if (ItemMoveMent > 0)
            {
                ItemMoveMent = 0;
            }
            if (ItemMoveMent < -(DetailLength * (ShelfItemList.Count - 1)))
            {
                ItemMoveMent = -DetailLength * (ShelfItemList.Count - 1);
            }
            currentShelfIndex = (int)(-(ItemMoveMent - (DetailLength / 2.0f)) / DetailLength);
            for (int i = 0; i < ShelfItemList.Count; i++)
            {
                ShelfItemList [i].transform.localPosition = new Vector3(ItemMoveMent + i * DetailLength, 0, 0);
                float size = ((ScaleItemRate + 4) - Mathf.Abs(ShelfItemList [i].transform.localPosition.x)) / (ScaleItemRate + 4);
                ShelfItemList [i].transform.localScale = new Vector3(size, size, 1);
                ItemDetail idt = ShelfItemList [i].GetComponent <ItemDetail>();
                idt.SetSortingOrder(10 - (int)Mathf.Abs(ShelfItemList [i].transform.localPosition.x * 100));
            }
            PrevPageArrow.transform.localPosition = new Vector3(-1 + ItemMoveMent + -DetailLength, 0, 0);
            NextPageArrow.transform.localPosition = new Vector3(1 + ItemMoveMent + ShelfItemList.Count * DetailLength, 0, 0);
            yield return(0);
        }
        content.SetContent(ShelfItemList [currentShelfIndex].GetComponent <ItemDetail> ().cData);
        content.ShowContent();
        //show IndexItem
    }
Ejemplo n.º 10
0
 // Update is called once per frame
 void Update()
 {
     BubbleVal.Update();
     transform.localRotation = Quaternion.Euler(0, 0, BubbleVal.val + fixRotate);
 }
Ejemplo n.º 11
0
    private void updateRotate()
    {
        if (onRotate == 1 || onRotate == 2)
        {
            if (onRotate == 1)
            {
                rotateDiff = (-0.734f) * DragSensitive;
            }
            else if (onRotate == 2)
            {
                rotateDiff = (0.736f) * DragSensitive;
            }

            if (onRotate == 1 || onRotate == 2)
            {
                if ((MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_DRAG) &&
                    (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT))
                {
                    MainMenuGlobal.SetState(MainMenuState.MS_DRAG);
                }
                IsDragArrow = true;
            }
            if (IsDragArrow)
            {
                moveVal += rotateDiff * 8;
                foreach (GameObject gobj in pageLayers)
                {
                    PageLayer obj = gobj.GetComponent <PageLayer> ();
                    obj.ResetBubble();
                }
                roadLayer.SlideRoad(rotateDiff);
                //move layer here
                foreach (GameObject gobj in pageLayers)
                {
                    PageLayer obj = gobj.GetComponent <PageLayer> ();
                    obj.RotatePageDiff(rotateDiff);
                }
                //get current Layer you're in
                //check current RotateVal length
            }
            if (countCor >= 6)
            {
                foreach (GameObject gobj in pageLayers)
                {
                    PageLayer obj = gobj.GetComponent <PageLayer> ();
                    obj.PopBubble();
                    obj.PopObject();
                }
                setCurrentLayerNo();
//				rotateMorphVal.morphEasein (0, -moveVal, 10);
                IsDragArrow = false;
                onRotate    = 0;
                moveVal     = 0f;
                foreach (GameObject gobj in pageLayers)
                {
                    PageLayer obj = gobj.GetComponent <PageLayer> ();
                    obj.RotatePageDiff(rotateMorphVal.dVal);
                }
                roadLayer.SlideRoad(rotateMorphVal.dVal);
                rotateMorphVal.Update();
                if (rotateMorphVal.IsFinish())
                {
                    if ((MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_DRAG) &&
                        (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT))

                    {
                        MainMenuGlobal.SetState(MainMenuState.MS_NORMAL);
                    }
                }
            }
            countCor++;
        }
    }