Example #1
0
    void OnMouseDown()
    {
        visible = false;
        sew.setVisible(false);
        sew.setRigidBody(false);
        hasBody = false;
        textbox1.GetComponent <changePos>().setPos(new Vector3(-7.1f, -1.5f, 0.0f));
        textbox2.GetComponent <changePos>().setPos(new Vector3(-7.1f, -2.5f, 0.0f));
        textbox3.GetComponent <changePos>().setPos(new Vector3(-3.9f, -1.5f, 0.0f));
        textbox4.GetComponent <changePos>().setPos(new Vector3(-3.9f, -2.5f, 0.0f));

        GameObject      displayQuestionObject = GameObject.Find("qq");
        DisplayQuestion displayQuestionScript = displayQuestionObject.GetComponent <DisplayQuestion> ();
        int             kkk = displayQuestionScript.boxNumber;

        //Question questemp = (Question)qs.GetComponent<DisplayQuestion> ().questions[kkk];

        DisplayQuestion.Question qls = (DisplayQuestion.Question)qs.GetComponent <DisplayQuestion> ().questions[kkk];
        //Debug.Log("questemp: "+qls.getQuestionText());
        string swg  = qls.getAnswerText(1).getAnswer();
        string swg2 = qls.getAnswerText(2).getAnswer();
        string swg3 = qls.getAnswerText(3).getAnswer();
        string swg4 = qls.getAnswerText(4).getAnswer();



        t1.GetComponent <TextMesh>().text  = ResolveTextSize(swg, 27);
        t2.GetComponent <TextMesh> ().text = ResolveTextSize(swg2, 27);
        t3.GetComponent <TextMesh> ().text = ResolveTextSize(swg3, 27);
        t4.GetComponent <TextMesh> ().text = ResolveTextSize(swg4, 27);
        //showButton = false;
    }
Example #2
0
    void OnMouseDown()
    {
        visible = false;
        ShowMore.setVisible(false);
        ShowMore.setRigidBody(false);
        hasBody = false;
        //show.setShowButton(false);
        textbox1.GetComponent <changePos>().setPos(new Vector3(-7.1f, -1.5f, 0.0f));
        textbox2.GetComponent <changePos>().setPos(new Vector3(-7.1f, -2.5f, 0.0f));
        textbox3.GetComponent <changePos>().setPos(new Vector3(-3.9f, -1.5f, 0.0f));
        textbox4.GetComponent <changePos>().setPos(new Vector3(-3.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 = lol2;
        DisplayQuestion.Question fuck2 = (DisplayQuestion.Question)t2.GetComponent <DisplayQuestion>().manQuestions[lol2];
        string swg2 = fuck2.getQuestionText();
        int    lol3 = (int)Random.Range(0, 12);

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

        t4.GetComponent <DisplayQuestion>().boxNumber = lol4;
        DisplayQuestion.Question fuck4 = (DisplayQuestion.Question)t4.GetComponent <DisplayQuestion>().manQuestions[lol4];
        string swg4 = fuck4.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;
    }
Example #3
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);
    }