Exemple #1
0
    void Awake()
    {
        objTimer.SetActive(false);

        scrTimer = objTimer.GetComponent <TimerUI>();

        scrPrWPreTop = previewWordObjTop.GetComponent <PreviewWordPrefab>();
        scrPrWPreBot = previewWordObjBot.GetComponent <PreviewWordPrefab>();

        txtWordsShown    = new Text[2];
        btnScript        = new DragUIElementCol[2];
        btnText          = new Text[2];
        txtWordsShown[0] = shownWordsObject1.GetComponentInChildren <Text>();
        txtWordsShown[1] = shownWordsObject2.GetComponentInChildren <Text>();

        txtWordsShownScore    = new Text[2];
        txtWordsShownScore[0] = shownWordScoreObj[0].GetComponent <Text>();
        txtWordsShownScore[1] = shownWordScoreObj[1].GetComponent <Text>();

        sendScore = objSendScore.GetComponent <SendScore>();

        btnText[0] = btnObject1.GetComponentInChildren <Text>();
        btnText[1] = btnObject2.GetComponentInChildren <Text>();

        btnScript[0] = btnObject1.GetComponent <DragUIElementCol>();
        btnScript[1] = btnObject2.GetComponent <DragUIElementCol>();

        userWordsChoices = new List <DragWords>();
        userChoicesGroup = new List <int>();

        structureTextObj.SetActive(true);
        structureTextObj.GetComponent <Text>().text = GameInfoDrag.info.words[GameInfoDrag.currentRound].structure_text;
    }
Exemple #2
0
        public HttpResponseMessage SendScore([FromBody] SendScore m)
        {
            var eInfo = MongoDbHelper.FindOne <E_Info>(m.ExamID, DbName.E_Info);

            if (eInfo == null)
            {
                return(ResultHelper.Failed("未查到当前考试"));
            }
            if (m.School.ToLower() == "all")
            {
                var allsch = MongoDbHelper.QueryBy <Sch_Sc>(DbName.Sch_Sc, w => w.eid == eInfo._id);
                for (int i = 0; i < allsch.Count; i++)
                {
                    allsch[i].state = 1;
                    MongoDbHelper.ReplaceOne(allsch[i]._id.ToString(), allsch[i], DbName.Sch_Sc);
                }
                return(ResultHelper.OK());
            }
            var sch = MongoDbHelper.QueryOne <Sch_Sc>(DbName.Sch_Sc, w => w.eid == eInfo._id && w.sid == m.School);

            if (sch != null)
            {
                sch.state = 1;
                MongoDbHelper.ReplaceOne(sch._id.ToString(), sch, DbName.Sch_Sc);
                return(ResultHelper.OK());
            }
            return(ResultHelper.Failed("未找到该学校"));
        }
Exemple #3
0
    void Awake()
    {
        if (GameSettings.SOLO)
        {
            objTimer.SetActive(false);
        }

        scrTimer = objTimer.GetComponent <TimerUI>();

        scrPrWPreTop = previewWordObjTop.GetComponent <PreviewWordPrefab>();
        scrPrWPreBot = previewWordObjBot.GetComponent <PreviewWordPrefab>();

        txtWordsShown    = new Text[2];
        btnScript        = new DragUIElement[2];
        btnText          = new Text[2];
        txtWordsShown[0] = shownWordsObject1.GetComponentInChildren <Text>();
        txtWordsShown[1] = shownWordsObject2.GetComponentInChildren <Text>();

        txtWordsShownScore    = new Text[2];
        txtWordsShownScore[0] = shownWordScoreObj[0].GetComponent <Text>();
        txtWordsShownScore[1] = shownWordScoreObj[1].GetComponent <Text>();

        sendScore = objSendScore.GetComponent <SendScore>();

        btnText[0] = btnObject1.GetComponentInChildren <Text>();
        btnText[1] = btnObject2.GetComponentInChildren <Text>();

        btnScript[0] = btnObject1.GetComponent <DragUIElement>();
        btnScript[1] = btnObject2.GetComponent <DragUIElement>();

        userWordsChoices = new List <DragWords>();
        userChoicesGroup = new List <int>();
    }
Exemple #4
0
    public void SendScore()
    {
        WriteSocket("recieve");
        SendScore lol = new SendScore(0, 100);

        new BinaryFormatter().Serialize(_myStream, lol);
    }
Exemple #5
0
 // Use this for initialization
 public void Initialise(float scoreRate, float scoreInterval, float cooldown, SendScore del)
 {
     _del           = del;
     _scoreRate     = scoreRate;
     _scoreInterval = scoreInterval;
     _cooldown      = cooldown;
     _cr            = StartCoroutine(AddScore());
 }
    public void Initialise(float lifetime, float scoreRate, SendScore del)
    {
        TargetContainer.Instance.ControlPoints.Add(gameObject);

        _scoreRate = scoreRate;
        _lifetime  = lifetime;
        _del       = del;
        _mr        = GetComponent <MeshRenderer>();
        _timestamp = Time.time + _lifetime;
        _init      = true;
    }
    // Use this for initialization
    void Awake()
    {
        if (GameSettings.SOLO)
        {
            objTimer.SetActive(false);
            soloButtonObj.SetActive(true);
            soloButtonText = soloButtonObj.GetComponentInChildren <Text>();

            /*soloButtonText.text = TEXT_NEXT;
             * if (GameInfoChoose.currentRound == (GameInfoChoose.info.number_of_rounds - 1))
             * {
             *  soloButtonText.text = TEXT_END;
             * }*/
        }

        scrTimer = objTimer.GetComponent <TimerUI>();

        starsScripts = new StarsPrefab[starsObj.Length];
        for (int i = 0; i < starsObj.Length; i++)
        {
            starsScripts[i] = starsObj[i].GetComponent <StarsPrefab>();
        }

        sumPointsText       = sumPointsObj.GetComponent <Text>();
        rightOrderScoreText = rightOrderScoreObj.GetComponent <Text>();
        rightOrderText      = rightOrderTextObj.GetComponent <Text>();

        chosenWordsText      = new Text[3];
        chosenWordsScoreText = new Text[3];
        for (int i = 0; i < 3; i++)
        {
            chosenWordsText[i]      = chosenWordsObj[i].GetComponent <Text>();
            chosenWordsScoreText[i] = chosenWordsScoreObj[i].GetComponent <Text>();

            chosenWordsText[i].text      = "";
            chosenWordsScoreText[i].text = "";
        }

        scrSendScore = objSendScore.GetComponent <SendScore>();

        scrGetScoreboard = objGetScoreboard.GetComponent <GetScoreboard>();

        scrConnect = objConnect.GetComponent <Connect>();

        saveRound = GameInfoChoose.currentRound;
        maxRounds = GameInfoChoose.info.number_of_rounds;

        canvasObj.SetActive(false);
        objProgressCircle.SetActive(true);
    }
    void Awake()
    {
        objTimer.SetActive(false);
        soloButtonObj.SetActive(true);

        scrTimer = objTimer.GetComponent <TimerUI>();

        previewWord    = GameInfoInsert.info.words[0].word;
        previewWordPos = GameInfoInsert.info.words[0].position;

        scrSendScore = objSendScore.GetComponent <SendScore>();

        structureTextObj.SetActive(true);
        structureTextObj.GetComponent <Text>().text = GameInfoInsert.info.words[GameInfoInsert.currentRound].structure_text;
    }
Exemple #9
0
    void Awake()
    {
        if (GameSettings.SOLO)
        {
            objTimer.SetActive(false);
            soloButtonObj.SetActive(true);
        }

        scrTimer = objTimer.GetComponent <TimerUI>();

        previewWord    = GameInfoInsert.info.words[GameInfoInsert.currentRound].word;
        previewWordPos = GameInfoInsert.info.words[GameInfoInsert.currentRound].position;

        scrSendScore = objSendScore.GetComponent <SendScore>();
    }
    // Use this for initialization
    void Awake()
    {
        objTimer.SetActive(false);
        soloButtonObj.SetActive(true);

        scrTimer = objTimer.GetComponent <TimerUI>();

        starsScripts = new StarsPrefab[starsObj.Length];
        for (int i = 0; i < starsObj.Length; i++)
        {
            starsScripts[i] = starsObj[i].GetComponent <StarsPrefab>();
        }

        sumPointsText = sumPointsObj.GetComponent <Text>();

        soloText = soloButtonObj.GetComponentInChildren <Text>();

        chosenWordsText      = new Text[3];
        chosenWordsScoreText = new Text[3];
        for (int i = 0; i < 3; i++)
        {
            chosenWordsText[i]      = chosenWordsObj[i].GetComponent <Text>();
            chosenWordsScoreText[i] = chosenWordsScoreObj[i].GetComponent <Text>();

            chosenWordsText[i].text      = "";
            chosenWordsScoreText[i].text = "";
        }

        scrSendScore = objSendScore.GetComponent <SendScore>();

        scrGetScoreboard = objGetScoreboard.GetComponent <GetScoreboard>();

        scrConnect = objConnect.GetComponent <Connect>();

        saveRound = GameInfoInsert.currentRound;
        maxRounds = GameInfoInsert.info.number_of_rounds;

        canvasObj.SetActive(false);
        objProgressCircle.SetActive(true);

        setUpWords();

        CheckScores();
    }
    void Awake()
    {
        if (GameSettings.SOLO)
        {
            objTimer.SetActive(false);
            soloButtonObj.SetActive(true);
        }

        scrTimer = objTimer.GetComponent <TimerUI>();

        previewWord    = GameInfoSynonym.info.words[GameInfoSynonym.currentRound].word;
        previewWordPos = GameInfoSynonym.info.words[GameInfoSynonym.currentRound].position;

        Text headwordtext = headword.GetComponent <Text>();

        headwordtext.text = previewWord;

        scrSendScore = objSendScore.GetComponent <SendScore>();
    }
    // Use this for initialization
    void Awake()
    {
        canvasObj.SetActive(false);

        if (GameSettings.SOLO)
        {
            objTimer.SetActive(false);
            soloButtonObj.SetActive(true);
        }

        scrTimer = objTimer.GetComponent <TimerUI>();

        scrollRectWords = objScrollViewTxtWordsObj.GetComponent <ScrollRect>();
        contentTrans    = contentObj.GetComponent <RectTransform>();

        scrSendScore = objSendScore.GetComponent <SendScore>();

        sumPointsText = sumPointsObj.GetComponent <Text>();

        scrConnect = objConnect.GetComponent <Connect>();

        scrGetScoreboard = objGetScoreboard.GetComponent <GetScoreboard>();

        /*rightOrderScoreText = rightOrderScoreObj.GetComponent<Text>();
         *
         * chosenWordsText = new Text[3];
         * chosenWordsScoreText = new Text[3];
         * for (int i = 0; i < 3; i++)
         * {
         *  chosenWordsText[i] = chosenWordsObj[i].GetComponent<Text>();
         *  chosenWordsScoreText[i] = chosenWordsScoreObj[i].GetComponent<Text>();
         *
         *  chosenWordsText[i].text = "";
         *  chosenWordsScoreText[i].text = "";
         * }
         *
         * saveRound = GameInfoChoose.currentRound;
         * maxRounds = GameInfoChoose.info.number_of_rounds;*/

        //setUpWords();
    }
Exemple #13
0
 void Start()
 {
     _sendScore = GameObject.FindObjectOfType <SendScore>();
 }