Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (mouseclick)
        {
            Instantiate(button, transform.position, transform.rotation);

            GetComponent <changePos>().setPos(new Vector3(20.0f, -20.0f, 0.0f));
            otherbox2.GetComponent <changePos>().setPos(new Vector3(-20.1f, -20.5f, 0.0f));
            otherbox3.GetComponent <changePos>().setPos(new Vector3(-20.0f, -20.0f, 0.0f));
            otherbox1.GetComponent <changePos>().setPos(new Vector3(-20.0f, -20.0f, 0.0f));
            count++;
            GetComponent <Renderer>().enabled = true;
            mousePosition             = Input.mousePosition;
            mousePosition             = Camera.main.ScreenToWorldPoint(mousePosition);
            button.transform.position = Vector2.Lerp(mousePosition, mousePosition, moveSpeed);
            mousePosition             = Input.mousePosition;
            mousePosition             = Camera.main.ScreenToWorldPoint(mousePosition);
            mouseclick = !mouseclick;
        }
        else if (drag)
        {
            //Instantiate(button, mousePosition, transform.rotation);
            sew.setVisible(true);
            ShowMore.setVisible(true);
            sew.setRigidBody(true);
            ShowMore.setRigidBody(true);
            drag       = !drag;
            stopMoving = true;
        }
    }
Beispiel #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;
    }