Exemple #1
0
        public static Mouse_Position GetMousePos()
        {
            voxie_inputs_t mouse = (FindObjectOfType(typeof(VoxieCaptureVolume)) as VoxieCaptureVolume).GetMouse();
            Mouse_Position mp    = new Mouse_Position(new Vector3(mouse.dmousx, mouse.dmousy, mouse.dmousz));

            return(mp);
        }
    // Update is called once per frame
    void FixedUpdate()
    {
        Mouse_Position mp = Voxon.Input.GetMousePos();

        gameObject.transform.position = new Vector3(Mathf.Clamp(gameObject.transform.position.x + mp.x, min_limits.x, max_limits.x),
                                                    Mathf.Clamp(gameObject.transform.position.y + mp.z, min_limits.y, max_limits.y),
                                                    Mathf.Clamp(gameObject.transform.position.z - mp.y, min_limits.z, max_limits.z));

        if (Voxon.Input.GetMouseButtonDown("Left"))
        {
            gameObject.GetComponent <Renderer>().material.color = new Color(Random.Range(0, 1.0f), Random.Range(0, 1.0f), Random.Range(0, 1.0f));
        }

        if (Voxon.Input.GetMouseButtonDown("Right"))
        {
            transform.localScale = new Vector3(Random.Range(0.25f, 3f), Random.Range(0.25f, 3f), Random.Range(0.25f, 3f));
        }
    }