// Update is called once per frame
    void Update()
    {
        updateNavigation();
        updateStackingManipulation();
        updateMovingManipulation();

        if (Input.GetButton("Fire1"))
        {
            lastGameObjectHit = raycastscript.getTargetObjects(Input.mousePosition, playerCam.camera);
            if (lastGameObjectHit != rotateScript.clone)
            {
                rotateScript.selectedObject = lastGameObjectHit;
                rotateScript.SetDrawFeedback(true);
            }
            //if (lastGameObjectHit != scaleScript.clone){
            //	scaleScript.selectedObject = lastGameObjectHit;
            //	scaleScript.SetDrawFeedback(true, "x");
            //}
        }
        //rotate
        if (Input.GetKey("-"))
        {
            rotateScript.RotateLeft();
        }
        if (Input.GetKey("="))
        {
            rotateScript.RotateRight();
        }
        //scale

        /*if (Input.GetKey("["))
         *      scaleScript.ScaleXSmaller();
         * if (Input.GetKey("]"))
         *      scaleScript.ScaleXBigger();
         * if (Input.GetKey(";"))
         *      scaleScript.ScaleYSmaller();
         * if (Input.GetKey("'"))
         *      scaleScript.ScaleYBigger();
         *      if (Input.GetKey("."))
         *      scaleScript.ScaleZSmaller();
         * if (Input.GetKey("/"))
         *      scaleScript.ScaleZBigger();*/


        //Set the gui shizzle
        Vector3 mousePos = Input.mousePosition;
        float   mouseX   = mousePos.x / Screen.width;
        float   mouseY   = mousePos.y / Screen.height;
        //Debug.Log(mouseX + "\t" + mouseY);
        //screenpointer.transform.position = new Vector3(Screen.width/2, Screen.height/2, 0);
        //screenpointer.transform.position = new Vector3(mouseX, mouseY, 0);
        //screenpointer.transform.position = mouseY;
        //Rect cursloc = new Rect(mousePos.x, Screen.height - mousePos.y, cursorImage.width, cursorImage.height);
        //GUI.Label(cursloc, cursorImage);
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        updateNavigation();
        updateStackingManipulation();

        if (Input.GetButton("Fire1"))
        {
            lastGameObjectHit = raycastscript.getTargetObjects(Input.mousePosition, playerCam.camera);
            if (lastGameObjectHit != rotateScript.clone)
            {
                rotateScript.selectedObject = lastGameObjectHit;
                rotateScript.SetDrawFeedback(true);

                scaleScript.selectedObject = lastGameObjectHit;
                scaleScript.SetDrawFeedback(true);
            }
        }
        //rotate
        if (Input.GetKey("-"))
        {
            rotateScript.RotateLeft();
        }
        if (Input.GetKey("="))
        {
            rotateScript.RotateRight();
        }
        //scale
        if (Input.GetKey("["))
        {
            scaleScript.ScaleKleiner();
        }
        if (Input.GetKey("]"))
        {
            scaleScript.ScaleGroter();
        }
        if (Input.GetKey("p"))
        {
            scaleScript.volgendeAs();
        }
        if (Input.GetKeyUp("p"))
        {
            scaleScript.releaseLock();
        }

        //camera
        if (Input.GetKeyUp(";"))
        {
            smoothCameraScript.getNextCameraLokatie();
        }

        if (Input.GetKeyUp("'"))
        {
            smoothCameraScript.getVorigCameraLokatie();
        }

        if (Input.GetKey("/"))
        {
            smoothCameraScript.GaNaarVorigePositie();
        }

        //camera uitzoomen naar top view
        if (Input.GetKey("."))
        {
            smoothCameraScript.GaNaarTopView();
        }


        //Set the gui shizzle
        Vector3 mousePos = Input.mousePosition;
        float   mouseX   = mousePos.x / Screen.width;
        float   mouseY   = mousePos.y / Screen.height;

        //Debug.Log(mouseX + "\t" + mouseY);
        //screenpointer.transform.position = new Vector3(Screen.width/2, Screen.height/2, 0);
        screenpointer.transform.position = new Vector3(mouseX, mouseY, 0);
        //screenpointer.transform.position = mouseY;
        Rect cursloc = new Rect(mousePos.x, Screen.height - mousePos.y, cursorImage.width, cursorImage.height);
        //GUI.Label(cursloc, cursorImage);
    }