// Update is called once per frame
    void Update()
    {
        if (vcv == null)
        {
            vcv = FindObjectOfType <VoxieCaptureVolume>();
            if (vcv == null)
            {
                Debug.LogError("Capture Volume not found!");
            }
        }

        aspect_ratio = vcv.GetAspectRatio();
        if (Voxon.Input.GetKey("Grow"))
        {
            vcv.Scale           += 1;
            vcv.Scale            = Math.Min(vcv.Scale, 1000);
            transform.localScale = aspect_ratio * vcv.Scale;
            Debug.Log("Scale: " + vcv.Scale);
        }

        if (Voxon.Input.GetKey("Shrink"))
        {
            vcv.Scale -= 1;
            vcv.Scale  = Math.Max(vcv.Scale, 1);

            transform.localScale = aspect_ratio * vcv.Scale;
            Debug.Log("Scale: " + vcv.Scale);
        }

        if (Voxon.Input.GetKey("Up"))
        {
            transform.Translate(transform.up * Time.deltaTime, Space.World);
        }

        if (Voxon.Input.GetKey("Down"))
        {
            transform.Translate(-1 * transform.up * Time.deltaTime, Space.World);
        }

        if (Voxon.Input.GetKey("Forward"))
        {
            transform.Translate(-1 * transform.forward * Time.deltaTime, Space.World);
        }
        if (Voxon.Input.GetKey("Backward"))
        {
            transform.Translate(transform.forward * Time.deltaTime, Space.World);
        }
        if (Voxon.Input.GetKey("Left"))
        {
            transform.Translate(-1 * transform.right * Time.deltaTime, Space.World);
        }
        if (Voxon.Input.GetKey("Right"))
        {
            transform.Translate(transform.right * Time.deltaTime, Space.World);
        }
    }
Пример #2
0
    }                                                   //keep this

    // Update is called once per frame
    void Update()                                            //keep this
    {
        if (vcv == null)                                     //keep this
        {
            vcv = FindObjectOfType <VoxieCaptureVolume>();   //keep this
            if (vcv == null)                                 //keep this
            {                                                //keep this
                Debug.LogError("Capture Volume not found!"); //you don't have to keep this, but it doesn't make much sense to change it?
            }                                                //keep this
        }                                                    //keep this

        aspect_ratio = vcv.GetAspectRatio();                 //keep this


        //START AUBREY'S KEYBINDINGS (All OF THIS IS SAFE TO CHANGE)
        //these all manage movement
        if (Voxon.Input.GetKey("MoveRight"))
        {
            player.transform.Translate(-Vector3.right * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("MoveLeft"))
        {
            player.transform.Translate(-Vector3.left * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("MoveForward"))
        {
            player.transform.Translate(-Vector3.forward * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("MoveBack"))
        {
            player.transform.Translate(-Vector3.back * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("MoveUp"))
        {
            player.transform.Translate(-Vector3.up * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("MoveDown"))
        {
            player.transform.Translate(-Vector3.down * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("TiltUp"))
        {
            Debug.Log("Rotating up now");
            captureVolume.transform.Rotate(Vector3.up * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("TiltDown"))
        {
            captureVolume.transform.Rotate(Vector3.down * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("TiltRight"))
        {
            captureVolume.transform.Rotate(Vector3.right * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("TiltLeft"))
        {
            captureVolume.transform.Rotate(Vector3.left * speed * Time.deltaTime);
        }
        if (Voxon.Input.GetKey("MoveFaster"))
        {
            speed *= 1.1f;
        }
        if (Voxon.Input.GetKey("MoveSlower"))
        {
            speed %= 1.1f;
        }
        //these also manage movement, but they do so with the mouse instead of keyboad input
        //turns the player object red.
        if (Voxon.Input.GetKey("ChangeColor"))
        {
            rend.material.SetColor("_Color", Color.red);
        }
    }