Пример #1
0
    public void ShowDaySelectPanel(string gameType)
    {
        GameModeManager.SetGameType(gameType);

        menubtnpanel.SetActive(false);

        int daybtnsize = GameModeManager.dayButtonSize;

        dselectpanel.GetComponent <DaySelectPanelController>().ResetDayButtons();
        dselectpanel.GetComponent <DaySelectPanelController>().ResetDayButtonCheck();
        dselectpanel.GetComponent <DaySelectPanelController>().ResetUnlockBGColor();
        string gametype = GameModeManager.GetGameType();

        if (gametype.Equals("StudyVocab"))
        {
            title.GetComponent <TitlePanelController>().SetTitle("단어 리스트");
            dselectpanel.GetComponent <DaySelectPanelController>().SetDayButtonsForStudyVocab();
        }
        else
        {
            if (gametype.Equals("OXGame"))
            {
                title.GetComponent <TitlePanelController>().SetTitle("OX 퀴즈");
            }
            else if (gametype.Equals("SentenceGame"))
            {
                title.GetComponent <TitlePanelController>().SetTitle("Sentence");
            }
            dselectpanel.GetComponent <DaySelectPanelController>().SetDayButtonUnlock(daybtnsize, gametype);
            dselectpanel.GetComponent <DaySelectPanelController>().SetDayButtonAlphaValue(daybtnsize);
            dselectpanel.GetComponent <DaySelectPanelController>().SetDayButtonCheck(daybtnsize, gametype);
        }

        dselectpanel.gameObject.SetActive(true);
    }
Пример #2
0
    void Start()
    {
        isDGBoxOn = false;
        string gametype = GameModeManager.GetGameType();

        if (gametype.Equals("OXGame"))
        {
            SetOXResultPanel();
        }
        else if (gametype.Equals("SentenceGame"))
        {
            SetSentenceResultPanel();
        }
        else if (gametype.Equals("StudyVocab"))
        {
            SetStudyVocabPanel();
        }
        else if (gametype.Equals("MyList"))
        {
            SetMyListPanel();
        }
        else if (gametype.Equals("MySentenceList"))
        {
            SetMyListSentencePanel();
        }
        //backButton.onClick.AddListener(() => { SceneManager.LoadScene("Scenes/MenuScene"); });
    }
Пример #3
0
    public void OnClickDayButton()
    {
        DOTween.KillAll();

        if (lockBG.activeSelf)
        {
            return;
        }
        if (this.GetComponent <CanvasGroup>().alpha <= 0)
        {
            Debug.Log("<color=red>Click " + daytextNew.buttonText + "</color>");
            return;
        }
        Debug.Log("<color=yellow>Click " + daytextNew.buttonText + "</color>");
        GameModeManager.SetDay(Int32.Parse(daytextNew.buttonText));

        string selectedGame = GameModeManager.GetGameType();

        if (selectedGame.Equals("OXGame"))
        {
            SceneManager.LoadScene("Scenes/OXScene");
        }
        else if (selectedGame.Equals("SentenceGame"))
        {
            SceneManager.LoadScene("Scenes/SentenceScene");
        }
        else if (selectedGame.Equals("StudyVocab"))
        {
            SceneManager.LoadScene("Scenes/StudyVocabScene");
        }
    }
Пример #4
0
    public void BackToPreviousMenu()
    {
        DOTween.KillAll();

        string gametype = GameModeManager.GetGameType();

        ShowMenuButtonPanel(gametype);
    }
Пример #5
0
    public void OnClickResultItem()
    {
        string gametype = GameModeManager.GetGameType();

        if (gametype.Equals("OXGame") && PrefabManager.Instance.dpanel.Count <= 0)
        {
            OpenDescPanel(PrefabManager.Instance.uicanvasResult.transform);
        }
        else if (gametype.Equals("SentenceGame"))
        {
            //if (PrefabManager.Instance.sDescPanel != null)
            if (PrefabManager.Instance.dpanel.Count > 0)
            {
                OpenDescPanel(PrefabManager.Instance.uicanvasResult.transform);
            }
            else
            {
                OpenSentenceDescPanel();
            }
        }
        else if (gametype.Equals("StudyVocab") && PrefabManager.Instance.dpanel.Count <= 0)
        {
            OpenDescPanel(PrefabManager.Instance.uicanvasResult.transform);
        }
        else if (gametype.Equals("MyList"))
        {
            OpenDescPanel(PrefabManager.Instance.uicanvasResult.transform);
        }
        else if (gametype.Equals("MySentenceList") && PrefabManager.Instance.dpanel.Count <= 1)
        {
            //if (PrefabManager.Instance.sDescPanel != null)
            if (PrefabManager.Instance.dpanel.Count > 0)
            {
                OpenDescPanel(PrefabManager.Instance.uicanvasResult.transform);
            }
            else
            {
                OpenSentenceDescPanel();
            }
        }
    }
Пример #6
0
    private void ProcessTurnTimer()
    {
        if (PrefabManager.Instance.tutorial_panel != null && PrefabManager.Instance.tutorial_panel.activeSelf)      // tutorial이 켜져있으면, 시간이 안가야한다.
        {
            return;
        }

        if (isTimerStart == false)
        {
            return;
        }

        if (timeLeft >= timeLimit)
        {
            Debug.Log("<color=yellow>" + timeLeft + "</color>");
            timeLeft = 0f;

            if (GameModeManager.GetGameType().Equals("SentenceGame"))
            {
                PrefabManager.Instance.SentenceTurnBaseTimesUp();
                return;
            }
            if (GameModeManager.GetGameType().Equals("OXGame"))
            {
                PrefabManager.Instance.OXTurnBaseTimesUp();
                return;
            }
        }
        timeLeft += Time.deltaTime;
        float f = timeLeft / timeLimit;

        filled.bar.DOFillAmount(f, Time.deltaTime);
#if TEST
        //transform.Find("TimeText").GetComponent<Text>().text = (timeLeft).ToString();
#endif
    }
Пример #7
0
    public void CreateVocabDesc(string v, Transform p, GameObject defPrefab, GameObject examplePrefab,
                                GameObject symPrefab, GameObject aymPrefab)
    {
        string def = string.Empty;
        string e1  = string.Empty;
        string t1  = string.Empty;
        string e2  = string.Empty;
        string t2  = string.Empty;
        string sym = string.Empty;
        string aym = string.Empty;

        string gametype = GameModeManager.GetGameType();

        if (gametype.Equals("OXGame") || gametype.Equals("MyList") || gametype.Equals("StudyVocab"))
        {
            def = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.answer];
            e1  = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.e1];
            t1  = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.t1];
            //e2 = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.e2];
            //t2 = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.t2];
            sym = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.sym];
            aym = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.aym];
        }
        else if (gametype.Equals("SentenceGame") || gametype.Equals("MySentenceList"))
        {
            def = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.answer];
            e1  = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.e1];
            t1  = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.t1];
            //e2 = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.e2];
            //t2 = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.t2];
            sym = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.sym];
            aym = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.aym];
        }


        GameObject d = null;
        GameObject e = null;
        GameObject s = null;
        GameObject a = null;

        if (def.Equals("") == false)
        {
            var title = Instantiate(titleForResult);
            {
                title.transform.GetChild(0).GetComponent <Text>().text = "정     의";
                title.transform.SetParent(p, false);
            }

            d = Instantiate(DGBoxforSentencedef);
            var panel   = d.GetComponent <DGBoxForSentenceDefController>().panel;
            var deflist = UIStaticManager.FormatDescDef(def);
            foreach (var s1 in deflist)
            {
                if (s1.Equals(""))
                {
                    continue;
                }

                var item = Instantiate(sentenceCardDescItem);
                {
                    item.GetComponent <SentenceCardDescController>().SetPsType(s1.Key);
                    item.GetComponent <SentenceCardDescController>().SetDesc(s1.Value);
                    item.GetComponent <SentenceCardDescController>().SetAlpah(1f);
                }
                item.transform.SetParent(panel.transform, false);
            }
            var defsize = defPrefab.GetComponent <DGBoxForSentenceDefController>().panel.GetComponent <RectTransform>()
                          .rect;
            d.GetComponent <RectTransform>().sizeDelta = new Vector2(defsize.width, defsize.height);
            d.GetComponent <CanvasGroup>().alpha       = 1f;
            d.transform.SetParent(p, false);
        }

        if (e1.Equals("") == false ||
            t1.Equals("") == false ||
            e2.Equals("") == false ||
            t2.Equals("") == false)
        {
            var title = Instantiate(titleForResult);
            {
                title.transform.GetChild(0).GetComponent <Text>().text = "예     문";
                title.transform.SetParent(p, false);
            }

            e = Instantiate(dynGameBGTextBox);

            string exampleSentence = "\n" + e1 + "\n" + "<color=#9d9d9d>" + t1 + "</color>" + "\n\n" + e2 + "\n" + "<color=#9d9d9d>" + t2 + "</color>" + "\n";
            //a.transform.GetComponent<DynamicBGTextBoxController>().SetTitleText("정답");
            e.transform.GetComponent <DynamicBGTextBoxController>().SetText(exampleSentence);

            var exampleSize = examplePrefab.GetComponent <DynamicBGTextBoxController>().rTransform.rect;
            e.GetComponent <RectTransform>().sizeDelta = new Vector2(exampleSize.width, exampleSize.height);
            e.GetComponent <CanvasGroup>().alpha       = 1f;
            e.transform.SetParent(p, false);
        }

        if (sym.Equals("") == false)
        {
            var title = Instantiate(titleForResult);
            {
                title.transform.GetChild(0).GetComponent <Text>().text = "유  의  어";
                title.transform.SetParent(p, false);
            }

            s = Instantiate(dynGameBGTextBox);

            sym = "\n" + sym + "\n";
            //a.transform.GetComponent<DynamicBGTextBoxController>().SetTitleText("정답");
            s.transform.GetComponent <DynamicBGTextBoxController>().SetText(sym);

            var symsize = symPrefab.GetComponent <DynamicBGTextBoxController>().rTransform.rect;
            s.GetComponent <RectTransform>().sizeDelta = new Vector2(symsize.width, symsize.height);
            s.GetComponent <CanvasGroup>().alpha       = 1f;
            s.transform.SetParent(p, false);
        }

        if (aym.Equals("") == false)
        {
            var title = Instantiate(titleForResult);
            {
                title.transform.GetChild(0).GetComponent <Text>().text = "반  의  어";
                title.transform.SetParent(p, false);
            }

            a = Instantiate(dynGameBGTextBox);

            aym = "\n" + aym + "\n";
            //a.transform.GetComponent<DynamicBGTextBoxController>().SetTitleText("정답");
            a.transform.GetComponent <DynamicBGTextBoxController>().SetText(aym);

            var aymsize = aymPrefab.GetComponent <DynamicBGTextBoxController>().rTransform.rect;
            a.GetComponent <RectTransform>().sizeDelta = new Vector2(aymsize.width, aymsize.height);
            a.GetComponent <CanvasGroup>().alpha       = 1f;
            a.transform.SetParent(p, false);
        }
        rpanel.GetComponent <ResultPanel>().TurnOffDGBox();
    }
Пример #8
0
    public List <GameObject> CreatePreVocabDesc(string v, Transform p)
    {
        string def      = string.Empty;
        string e1       = string.Empty;
        string t1       = string.Empty;
        string e2       = string.Empty;
        string t2       = string.Empty;
        string sym      = string.Empty;
        string aym      = string.Empty;
        string gametype = GameModeManager.GetGameType();

        if (gametype.Equals("OXGame") || gametype.Equals("MyList") || gametype.Equals("StudyVocab"))
        {
            def = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.answer];
            e1  = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.e1];
            t1  = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.t1];
            //e2 = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.e2];
            //t2 = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.t2];
            sym = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.sym];
            aym = OX_DataLoader.GetOXDataByVocab(v).Value[(int)OX_DataLoader.Index.aym];
        }
        else if (gametype.Equals("SentenceGame") || gametype.Equals("MySentenceList"))
        {
            def = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.answer];
            e1  = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.e1];
            t1  = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.t1];
            //e2 = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.e2];
            //t2 = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.t2];
            sym = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.sym];
            aym = Sentence_DataLoader.GetVocabDatabyVocab(v).Value[(int)OX_DataLoader.Index.aym];
        }

        GameObject d = null;
        GameObject e = null;
        GameObject s = null;
        GameObject a = null;

        if (def.Equals("") == false)
        {
            d = Instantiate(DGBoxforSentencedef);
            var panel   = d.GetComponent <DGBoxForSentenceDefController>().panel;
            var deflist = UIStaticManager.FormatDescDef(def);
            foreach (var s1 in deflist)
            {
                if (s1.Equals(""))
                {
                    continue;
                }

                var item = Instantiate(sentenceCardDescItem);
                {
                    item.GetComponent <SentenceCardDescController>().SetPsType(s1.Key);
                    item.GetComponent <SentenceCardDescController>().SetDesc(s1.Value);
                    item.GetComponent <SentenceCardDescController>().SetAlpah(0f);
                }
                item.transform.SetParent(panel.transform, false);
            }
        }

        if (e1.Equals("") == false ||
            t1.Equals("") == false ||
            e2.Equals("") == false ||
            t2.Equals("") == false)
        {
            e = Instantiate(dynGameBGTextBox);
            string exampleSentence = "\n" + e1 + "\n" + t1 + "\n" + e2 + "\n" + t2 + "\n";
            e.transform.GetComponent <DynamicBGTextBoxController>().SetText(exampleSentence);
        }

        if (sym.Equals("") == false)
        {
            s   = Instantiate(dynGameBGTextBox);
            sym = "\n" + sym + "\n";
            s.transform.GetComponent <DynamicBGTextBoxController>().SetText(sym);
        }

        if (aym.Equals("") == false)
        {
            a   = Instantiate(dynGameBGTextBox);
            aym = "\n" + aym + "\n";
            a.transform.GetComponent <DynamicBGTextBoxController>().SetText(aym);
        }

        if (d)
        {
            d.transform.SetParent(p, false);
            d.GetComponent <CanvasGroup>().alpha = 0f;
        }

        if (e)
        {
            e.transform.SetParent(p, false);
            e.GetComponent <CanvasGroup>().alpha = 0f;
        }
        if (s)
        {
            s.transform.SetParent(p, false);
            s.GetComponent <CanvasGroup>().alpha = 0f;
        }
        if (a)
        {
            a.transform.SetParent(p, false);
            a.GetComponent <CanvasGroup>().alpha = 0f;
        }
        return(new List <GameObject>()
        {
            d, e, s, a
        });
    }