Пример #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
    // Update is called once per frame
    void Update()
    {
        if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_SHORTCUT &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_UNPIN_RED)
        {
            return;
        }

        if (PopupObject.IsPopup)
        {
            return;
        }
        if (PinCollider == null)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (PinCollider.OverlapPoint(touchPos))
            {
                if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_UNPIN_RED)
                {
                    MainMenuGlobal.Tutorial.NextTutorial();
                }
                //UnPinned item
                UnPinn();
            }
        }
    }
Пример #3
0
 // Update is called once per frame
 protected override void Update()
 {
     if (MainMenuGlobal.getCurrentState() != WorkingState)
     {
         return;
     }
     base.Update();
 }
Пример #4
0
 public void StartTutorial()
 {
     currentIndex = 0;
     MainMenuGlobal.SetState(pageList[0].state);
     skipObject.SetActive(true);
     pageList[0].gameObject.SetActive(true);
     pageList[0].HighlightObject();
 }
Пример #5
0
    public void Reset()
    {
        ResetRegisterDataForm();

        ResetUpdateDataForm();

        MainMenuGlobal.SetLoginObject(false);
    }
Пример #6
0
    public void facebookLogin()
    {
        Debug.Log("Facebook Login");

        LoginPage.SetActive(false);
        LoginBottom.SetActive(false);
        UpdatePage.SetActive(true);
        UpdateBottom.SetActive(true);
        btLoginFB.gameObject.SetActive(false);
        MainMenuGlobal.SetLoginObject(false);
    }
Пример #7
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < NormalList.Count; i++)
     {
         NormalList[i].SetIndex(i);
     }
     if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_SHORTCUT)
     {
         TriggerShortcut();
     }
     LoadShortcut();
 }
Пример #8
0
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown && MainMenuState.MS_SETTING == MainMenuGlobal.getCurrentState())
        {
            if (BTSound.OverlapPoint(touchPos))
            {
                //Debug.Log("Sound");
                BTON      = 1;
                IsTouch   = true;
                lastTouch = touchPos;
            }
            else if (BTTel.OverlapPoint(touchPos))
            {
                //Debug.Log("Tel");
                BTON      = 2;
                IsTouch   = true;
                lastTouch = touchPos;
            }
            else if (BTLat.OverlapPoint(touchPos))
            {
                //Debug.Log("Lat Lon");
                BTON      = 3;
                IsTouch   = true;
                lastTouch = touchPos;
            }
//			else if(newsCollider.OverlapPoint(touchPos)){
//				//Debug.Log("Lat Lon");
//				BTON=4;
//				IsTouch = true;
//				lastTouch = touchPos;
//			}
        }
        if (touchedUp && MainMenuState.MS_SETTING == MainMenuGlobal.getCurrentState())
        {
            if (IsTouch)
            {
                IsTouch = false;

//				if(newsCollider.OverlapPoint(touchPos)){
//
//				}
//				else{
                BTON = 0;
//				}
            }
        }
        setUpdateSlide();
    }
Пример #9
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");
 }
Пример #10
0
 // Update is called once per frame
 void Update()
 {
     if ((MainMenuGlobal.getCurrentState() != MainMenuState.MS_NORMAL) &&
         (MainMenuGlobal.getCurrentState() != MainMenuState.MS_DRAG) &&
         (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_DRAG) &&
         (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT)
         )
     {
         IsDrag      = false;
         IsMouseDown = false;
         return;
     }
     updateTouch();
     updateRotate();
 }
Пример #11
0
 void NormalLoginCB(APIMsg msg)
 {
     Debug.Log(msg.msg);
     if (msg.msg == "OK")
     {
         UserCommonData.SetUserData(msg.user[0]);
         userLogin();
         LoadingScript.HideLoading();
         MainMenuGlobal.SetLoginObject(false);
     }
     else
     {
         //popup LoginFail
         LoadingScript.HideLoading();
     }
 }
Пример #12
0
 public void RegisterDone()
 {
     LoginPage.SetActive(false);
     LoginBottom.SetActive(false);
     UpdatePage.SetActive(true);
     UpdateBottom.SetActive(true);
     if (FacebookLogin.IsLogin)
     {
         btLoginFB.gameObject.SetActive(false);
     }
     else
     {
         btLoginFB.gameObject.SetActive(true);
     }
     MainMenuGlobal.SetLoginObject(false);
 }
Пример #13
0
 public void UnPinn()
 {
     PinnHeader.ShiftUp(this);
     UnPinnObj.PushBackItem();
     if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_SHORTCUT)
     {
         UserCommonData.RemoveBookmark(UnPinnObj.index);
     }
     if (EventCollider != null)
     {
         EventCollider.enabled = false;
     }
     StopCoroutine("PlayUnPin");
     StopCoroutine("PlayPin");
     StopCoroutine("PlayShiftUp");
     StartCoroutine("PlayUnPin");
 }
Пример #14
0
 public void Pinn(int idx)
 {
     index = idx;
     transform.localPosition = new Vector3(-8, index * -0.6f, 0);
     if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_SHORTCUT)
     {
         UserCommonData.AddBookmark(UnPinnObj.index);
     }
     if (EventCollider != null)
     {
         EventCollider.enabled = false;
     }
     //run Shift in
     StopCoroutine("PlayUnPin");
     StopCoroutine("PlayPin");
     StopCoroutine("PlayShiftUp");
     StartCoroutine("PlayPin");
 }
Пример #15
0
    public void GuestLogin()
    {
        Debug.Log("Guest Login");

        LoginPage.SetActive(false);
        LoginBottom.SetActive(false);
        UpdatePage.SetActive(true);
        UpdateBottom.SetActive(true);
        if (FacebookLogin.IsLogin)
        {
            btLoginFB.gameObject.SetActive(false);
        }
        else
        {
            btLoginFB.gameObject.SetActive(true);
        }
        MainMenuGlobal.SetLoginObject(false);
    }
Пример #16
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);
        }
    }
Пример #17
0
    public void skipTutorial()
    {
        Debug.Log("Skip Tutorial");
        pageList[currentIndex].UnHightlightObject();
        currentIndex = pageList.Length;
        skipObject.SetActive(false);
        Awake();

        switch (MainMenuGlobal.getCurrentState())
        {
        case MainMenuState.MS_TUTORIAL_DRAG:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_SHORTCUT:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_PIN_RED:
        { ShortCutMain.pGlobal.TriggerShortcut(); } break;

        case MainMenuState.MS_TUTORIAL_UNPIN_RED:
        { ShortCutMain.pGlobal.TriggerShortcut(); } break;

        case MainMenuState.MS_TUTORIAL_PIN_GREEN:
        { ShortCutMain.pGlobal.TriggerShortcut(); } break;

        case MainMenuState.MS_TUTORIAL_UNPIN_GREEN:
        { ShortCutMain.pGlobal.TriggerShortcut(); } break;

        case MainMenuState.MS_TUTORIAL_CLOSE_SHORTCUT:
        { ShortCutMain.pGlobal.TriggerShortcut(); } break;

        case MainMenuState.MS_TUTORIAL_SETTING:
        {
        } break;
        }
        NextTutorial();
    }
Пример #18
0
    // Update is called once per frame
    void Update()
    {
        if (PopupObject.IsPopup)
        {
            return;
        }
        if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_NORMAL &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_SHORTCUT &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_SHORTCUT &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_CLOSE_SHORTCUT)
        {
            return;
        }
        if (ShortCutCollider == null)
        {
            return;
        }
        if (IsRunning)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (ShortCutCollider.OverlapPoint(touchPos))
            {
                //Trigger Shortcut
                mSound.playSound("click");
                TriggerShortcut();
            }
            else if ((MainMenuGlobal.getCurrentState() == MainMenuState.MS_SHORTCUT) && TouchArea.OverlapPoint(touchPos))
            {
                //mSound.playSound("click");
                lastTouchPos       = touchPos;
                ShortCutCurrentPos = DummyPosition.transform.localPosition;
                IsDrag             = true;
            }
        }
        if (touchedUp)
        {
            IsDrag = false;
        }

        if (IsDrag)
        {
            float tempPosx = ShortCutCurrentPos.x;
            //calculate CurrentMapPos
            Vector3 movedPosition = ShortCutCurrentPos + new Vector3(0,
                                                                     touchPos.y - lastTouchPos.y,
                                                                     0);
            ShortCutCurrentPos = new Vector3(tempPosx, ShortCutCurrentPos.y, 0);
            DummyPosition.GetComponent <Rigidbody2D>().velocity = (movedPosition - ShortCutCurrentPos) * 60;
            lastTouchPos = touchPos;
        }
        else
        {
            DummyPosition.GetComponent <Rigidbody2D>().AddForce(-DummyPosition.GetComponent <Rigidbody2D>().velocity *5);
        }
        ShortCutDetail.transform.localPosition = DummyPosition.GetComponent <Rigidbody2D>().transform.localPosition;
    }
Пример #19
0
 void SettingButtonPress()
 {
     MainMenuGlobal.SetSettingObject(true);
 }
Пример #20
0
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (boxSkip.OverlapPoint(touchPos))
            {
                IsTouch      = true;
                lastTouchPos = touchPos;
            }
        }
        if (touchedUp)
        {
            if (boxSkip.OverlapPoint(touchPos))
            {
                if (IsTouch && (Vector2.Distance(touchPos, lastTouchPos) < 0.5f))
                {
                    skipTutorial();
                }
            }
        }
        switch (MainMenuGlobal.getCurrentState())
        {
        case MainMenuState.MS_TUTORIAL_DRAG:
        {
            if (touchedDown)
            {
                pageList[currentIndex].gameObject.SetActive(false);
            }
            else if (touchedUp)
            {
                pageList[currentIndex].gameObject.SetActive(true);
            }
        } break;

        case MainMenuState.MS_TUTORIAL_SHORTCUT:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_PIN_RED:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_UNPIN_RED:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_PIN_GREEN:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_UNPIN_GREEN:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_CLOSE_SHORTCUT:
        {
        } break;

        case MainMenuState.MS_TUTORIAL_SETTING:
        {
            if (touchedUp)
            {
                NextTutorial();
            }
        } break;
        }
    }
Пример #21
0
 void HelpButtonPress()
 {
     MainMenuGlobal.SetHelpObject(true);
 }
Пример #22
0
    // Update is called once per frame
    void Update()
    {
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown && MainMenuState.MS_HELP == MainMenuGlobal.getCurrentState())
        {
            if (BTMenu1.OverlapPoint(touchPos))
            {
                PrevMenuPage = MenuPage;
                MenuPage     = 1;
                SubMenuPage  = 0;
                ChangeMenu();
            }
            else if (BTMenu2.OverlapPoint(touchPos))
            {
                PrevMenuPage = MenuPage;
                MenuPage     = 2;
                SubMenuPage  = 0;
                ChangeMenu();
            }
            else if (BTMenu3.OverlapPoint(touchPos))
            {
                PrevMenuPage = MenuPage;
                MenuPage     = 3;
                SubMenuPage  = 0;
                ChangeMenu();
            }
            else if (BTMenu4.OverlapPoint(touchPos))
            {
                PrevMenuPage = MenuPage;
                MenuPage     = 4;
                SubMenuPage  = 0;
                ChangeMenu();
            }
            else if (BTMenu5.OverlapPoint(touchPos))
            {
                PrevMenuPage = MenuPage;
                MenuPage     = 5;
                SubMenuPage  = 0;
                ChangeMenu();
            }
            else if (BTRootMenu.OverlapPoint(touchPos))
            {
                PrevMenuPage = MenuPage;
                MenuPage     = 0;
                SubMenuPage  = 0;
                BTOBjRootMenu.SetActive(false);
                ChangeMenu();
            }
            else if (BTFW.OverlapPoint(touchPos))
            {
                SubMenuPage++;
                ChangeSubMenu(true);
            }
            else if (BTBACK.OverlapPoint(touchPos))
            {
                if (SubMenuPage > 0)
                {
                    SubMenuPage--;
                    ChangeSubMenu(false);
                }
                else
                {
                    changeToRoot();
                }
            }
        }
    }
Пример #23
0
 void ProfileButtonPress()
 {
     MainMenuGlobal.SetLoginObject(true);
 }
Пример #24
0
    void SchoolButtonPress()
    {
//		Debug.Log ("SchoolActivity Input : "+schoolTextInput.text);
        MainMenuGlobal.SetState(MainMenuState.MS_SETTING);
        PopupObject.ShowAlertPopup("ท่านต้องการลงทะเบียนเพื่อเข้าร่วมกิจกรรมหรือไม่", "ถ้าหากท่านได้ลงทะเบียนเข้าร่วมกิจกรรมแล้วท่านจะไม่สามารถลงทะเบียนซ้ำได้", "ตกลง", SchoolRegisAcitivity, "ยกเลิก", null);
    }
Пример #25
0
 void HelpClose()
 {
     MainMenuGlobal.SetHelpObject(false);
 }
Пример #26
0
 void PressCloseButton()
 {
     MainMenuGlobal.SetSettingObject(false);
 }
Пример #27
0
 void NewsButtonPress()
 {
     NewsBoardLayer.SetActive(true);
     SettingLayer.SetActive(false);
     MainMenuGlobal.SetState(MainMenuState.MS_NEWSBOARD);
 }
Пример #28
0
    // Update is called once per frame
    void Update()
    {
        if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_SHORTCUT &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_PIN_GREEN &&
            MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_UNPIN_GREEN)
        {
            return;
        }
        if (SubList.Length > 0)
        {
            bool NoSubPinn = true;
            for (int i = 0; i < SubList.Length; i++)
            {
                if (!SubList[i].IsPinn)
                {
                    NoSubPinn = false;
                    break;
                }
            }
            if (NoSubPinn)
            {
                IsPinn       = true;
                PinSR.sprite = Pin_Green;
            }
            else
            {
                IsPinn       = false;
                PinSR.sprite = UnPin_Green;
            }
        }
        if (PinCollider == null)
        {
            return;
        }
        if (IsRunning)
        {
            return;
        }
        bool    touchedDown = TouchInterface.GetTouchDown();
        bool    touchedUp   = TouchInterface.GetTouchUp();
        Vector2 touchPos    = TouchInterface.GetTouchPosition();

        if (touchedDown)
        {
            if (PinCollider.OverlapPoint(touchPos))
            {
                //pinned all sub item or pin itself
                if (!IsPinn)
                {
                    if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_UNPIN_GREEN)
                    {
                        PinnItem();
                    }
                    if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_PIN_GREEN)
                    {
                        MainMenuGlobal.Tutorial.NextTutorial();
                    }
                }
                else if (IsPinn)
                {
                    if (MainMenuGlobal.getCurrentState() != MainMenuState.MS_TUTORIAL_PIN_GREEN)
                    {
                        UnPinnItem();
                    }
                    if (MainMenuGlobal.getCurrentState() == MainMenuState.MS_TUTORIAL_UNPIN_GREEN)
                    {
                        MainMenuGlobal.Tutorial.NextTutorial();
                    }
                }
            }
        }
    }
Пример #29
0
 void SettingClose()
 {
     MainMenuGlobal.SetSettingObject(false);
 }
Пример #30
0
 void ProfileClose()
 {
     MainMenuGlobal.SetLoginObject(false);
 }