Exemple #1
0
    void OnMouseDown()
    {
        visible = false;
        ShowMore.setVisible(false);
        ShowMore.setRigidBody(false);
        hasBody = false;
        //show.setShowButton(false);
        textbox1.GetComponent <changePos>().setPos(new Vector3(-9.1f, -1.0f, 0.0f));
        textbox2.GetComponent <changePos>().setPos(new Vector3(-9.1f, -2.5f, 0.0f));
        textbox3.GetComponent <changePos>().setPos(new Vector3(-4.9f, -1.0f, 0.0f));
        textbox4.GetComponent <changePos>().setPos(new Vector3(-4.9f, -2.5f, 0.0f));
        int lol = (int)Random.Range(0, 12);

        t1.GetComponent <DisplayQuestion>().boxNumber = lol;
        DisplayQuestion.Question f**k = (DisplayQuestion.Question)t1.GetComponent <DisplayQuestion>().manQuestions[lol];
        string swg1 = f**k.getQuestionText();
        int    lol2 = (int)Random.Range(0, 12);

        t2.GetComponent <DisplayQuestion>().boxNumber = lol;
        DisplayQuestion.Question fuck2 = (DisplayQuestion.Question)t2.GetComponent <DisplayQuestion>().manQuestions[lol];
        string swg2 = f**k.getQuestionText();
        int    lol3 = (int)Random.Range(0, 12);

        t1.GetComponent <DisplayQuestion>().boxNumber = lol;
        DisplayQuestion.Question fuck3 = (DisplayQuestion.Question)t3.GetComponent <DisplayQuestion>().manQuestions[lol];
        string swg3 = f**k.getQuestionText();
        int    lol4 = (int)Random.Range(0, 12);

        t1.GetComponent <DisplayQuestion>().boxNumber = lol;
        DisplayQuestion.Question fuck4 = (DisplayQuestion.Question)t4.GetComponent <DisplayQuestion>().manQuestions[lol];
        string swg4 = f**k.getQuestionText();

        t1.GetComponent <TextMesh>().text  = ResolveTextSize(swg1, 27);
        t2.GetComponent <TextMesh> ().text = ResolveTextSize(swg2, 27);
        t3.GetComponent <TextMesh> ().text = ResolveTextSize(swg3, 27);
        t4.GetComponent <TextMesh> ().text = ResolveTextSize(swg4, 27);

        //showButton = false;
    }
Exemple #2
0
    void OnCollisionEnter(Collision col)
    {
        //Debug.Log (col.gameObject.name);


        bool notResponse = true;

        for (int i = 1; i < 5; i++)
        {
            string nam = "response" + i;
            if (col.gameObject.name == nam)
            {
                notResponse = false;
            }
            nam = "ques" + i;
            if (col.gameObject.name == nam)
            {
                notResponse = false;
            }
        }

        if (notResponse && (col.gameObject.name == "dragQuestion(Clone)" || col.gameObject.name == "dragnddrop(Clone)"))
        {
            if (col.gameObject.name == "dragQuestion(Clone)" && this.name == "GirlResponse")
            {
                Debug.Log("I'm not gonna check score.");
                float k = repoman.GetComponent <ControlReputation> ().reputationLevel;
                repoman.GetComponent <ControlReputation> ().reputationLevel = k - 5;
            }
            else if (col.gameObject.name == "dragnddrop(Clone)" && this.name == "GirlResponse")
            {
                string anstxt = "";
                int    ans    = 0;
                //int score;
                //Debug.Log ("bout to check score");



                //Debug.Log("The score was "+score);

                if (selectedAns == "response1")
                {
                    anstxt = t1.GetComponent <TextMesh> ().text;
                }
                if (selectedAns == "response2")
                {
                    anstxt = t2.GetComponent <TextMesh> ().text;
                }
                if (selectedAns == "response3")
                {
                    anstxt = t3.GetComponent <TextMesh> ().text;
                }
                if (selectedAns == "response4")
                {
                    anstxt = t4.GetComponent <TextMesh> ().text;
                }

                int score = getScoreFromAnswerText(anstxt);
                Debug.Log(anstxt);
                Debug.Log(score);
                float curr = repoman.GetComponent <ControlReputation> ().reputationLevel;
                if ((curr + score * 2.5) < 55)
                {
                    repoman.GetComponent <ControlReputation> ().reputationLevel = curr + score * 3;
                }

                /*estionObject = GameObject.Find ("qq");
                 * //int r = displayText.GetComponent<DisplayQuestion>().boxNumber;
                 * //Debug.Log(anstxt);
                 *
                 * //int kkk = displayQuestionScript.boxNumber;
                 * //Question questemp = (Question)qs.GetComponent<DisplayQuestion> ().questions[kkk];
                 * //	Debug.Log(ans);
                 * //DisplayQuestion.Question qls = (DisplayQuestion.Question)displayText.GetComponent<DisplayQuestion> ().questions[kkk];
                 * //int score = q.getAnswerText(ans).getScore();
                 * ///float curr = repoman.GetComponent<ControlReputation>().reputationLevel;
                 * //epoman.GetComponent<ControlReputation>().reputationLevel = curr+score;
                 */
            }
        }
        Destroy(col.gameObject);
        move = true;
        makeNew();
        int lol = (int)Random.Range(0, 12);

        while (lol == displayText.GetComponent <DisplayQuestion>().boxNumber)
        {
            lol = (int)Random.Range(0, 12);
        }
        displayText.GetComponent <DisplayQuestion> ().boxNumber = lol;
        DisplayQuestion.Question ques1 = (DisplayQuestion.Question)displayText.GetComponent <DisplayQuestion> ().manQuestions [lol];
        string heh = ques1.getQuestionText();

        displayText.GetComponent <TextMesh> ().text = ResolveTextSize(heh, 27);
    }