示例#1
0
    public void NextTutorial()
    {
        Debug.Log(MainMenuGlobal.getCurrentState());
        if (currentIndex < pageList.Length)
        {
            pageList[currentIndex].UnHightlightObject();

            pageList[currentIndex].gameObject.SetActive(false);

            currentIndex++;
        }
        if (currentIndex >= pageList.Length)
        {
            MainMenuGlobal.SetState(MainMenuState.MS_NORMAL);
            skipObject.SetActive(false);

            UserCommonData.IsTutorial = false;
            UserCommonData.pGlobal.Save();
            //out to menu state
        }
        else
        {
            MainMenuGlobal.SetState(pageList[currentIndex].state);
            pageList[currentIndex].gameObject.SetActive(true);
            pageList[currentIndex].HighlightObject();
        }
    }
示例#2
0
 public void StartTutorial()
 {
     currentIndex = 0;
     MainMenuGlobal.SetState(pageList[0].state);
     skipObject.SetActive(true);
     pageList[0].gameObject.SetActive(true);
     pageList[0].HighlightObject();
 }
示例#3
0
 public void TriggerShortcut()
 {
     IsOpen = !IsOpen;
     if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_SHORTCUT)
     {
         MainMenuGlobal.Tutorial.NextTutorial();
     }
     else if (IsOpen)
     {
         MainMenuGlobal.SetState(MainMenuState.MS_SHORTCUT);
     }
     StartCoroutine("RunTrigger");
 }
示例#4
0
    IEnumerator RunTrigger()
    {
        Vector3 swapPts = (IsOpen)?SwapInPts.transform.position:SwapOutPts.transform.position;

        IsRunning = true;
        while (Vector3.Distance(transform.position, swapPts) > 0.05f)
        {
            Vector3 newPosition = Vector3.Lerp(transform.position, swapPts, Time.deltaTime * 10);
            transform.position = newPosition;
            yield return(null);
        }
        transform.position = swapPts;
        IsRunning          = false;
        if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_CLOSE_SHORTCUT)
        {
            MainMenuGlobal.Tutorial.NextTutorial();
        }
        else if (!IsOpen)
        {
            MainMenuGlobal.SetState(MainMenuState.MS_NORMAL);
        }
    }
示例#5
0
    void SchoolButtonPress()
    {
//		Debug.Log ("SchoolActivity Input : "+schoolTextInput.text);
        MainMenuGlobal.SetState(MainMenuState.MS_SETTING);
        PopupObject.ShowAlertPopup("ท่านต้องการลงทะเบียนเพื่อเข้าร่วมกิจกรรมหรือไม่", "ถ้าหากท่านได้ลงทะเบียนเข้าร่วมกิจกรรมแล้วท่านจะไม่สามารถลงทะเบียนซ้ำได้", "ตกลง", SchoolRegisAcitivity, "ยกเลิก", null);
    }
示例#6
0
 void NewsButtonPress()
 {
     NewsBoardLayer.SetActive(true);
     SettingLayer.SetActive(false);
     MainMenuGlobal.SetState(MainMenuState.MS_NEWSBOARD);
 }
示例#7
0
    private void updateTouch()
    {
        float diff = 0;

        if (TouchInterface.GetTouchDown())
        {
            if (rotateMorphVal.IsFinish())
            {
                IsMouseDown = true;
                Vector2 mousePos = TouchInterface.GetTouchPosition();
                lastTouchPos = mousePos;
            }
        }
        if (TouchInterface.GetTouchUp())
        {
            if (IsMouseDown)
            {
                mSound.playSound("fw");
                if (IsDrag)
                {
                    foreach (GameObject gobj in pageLayers)
                    {
                        PageLayer obj = gobj.GetComponent <PageLayer> ();
                        obj.PopBubble();
                        obj.PopObject();
                    }
                    if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_DRAG)
                    {
                        MainMenuGlobal.Tutorial.NextTutorial();
                    }
                }
                setCurrentLayerNo();
                rotateMorphVal.morphEasein(0, -moveVal, 10);
                IsDrag      = false;
                IsMouseDown = false;
            }
        }
        if (IsMouseDown)
        {
            Vector2 mousePos = TouchInterface.GetTouchPosition();
            diff = (lastTouchPos.x - mousePos.x) * DragSensitive;
            if (Mathf.Abs(diff) > DragTreshold)
            {
                if ((MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_DRAG) &&
                    (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT))
                {
                    MainMenuGlobal.SetState(MainMenuState.MS_DRAG);
                }
                IsDrag = true;
            }
            if (IsDrag)
            {
                lastTouchPos = mousePos;
                moveVal     += diff;

                Debug.Log("IsDrag Cal Page No = " + currentLayerNo + " " + moveVal);
                foreach (GameObject gobj in pageLayers)
                {
                    PageLayer obj = gobj.GetComponent <PageLayer> ();
                    obj.ResetBubble();
                }
                roadLayer.SlideRoad(diff);
                //move layer here
                foreach (GameObject gobj in pageLayers)
                {
                    PageLayer obj = gobj.GetComponent <PageLayer> ();
                    obj.RotatePageDiff(diff);
                }
                //get current Layer you're in
                //check current RotateVal length
            }
        }
        else
        {
            moveVal = 0;
            {
                //keep snap layer
                //snap layer by using rotateVal
                //get delta angle here
                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);
                    }
                }
            }
        }
    }
示例#8
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++;
        }
    }