コード例 #1
0
    public void forceUpdate()
    {
        try {
            if (pos_x.text != "")
            {
                reference.localPosition = new Vector3(float.Parse(pos_x.text), reference.localPosition.y, reference.localPosition.z);
            }
            if (pos_y.text != "")
            {
                reference.localPosition = new Vector3(reference.localPosition.x, float.Parse(pos_y.text), reference.localPosition.z);
            }
            if (pos_z.text != "")
            {
                reference.localPosition = new Vector3(reference.localPosition.x, reference.localPosition.y, float.Parse(pos_z.text));
            }

            if (rot_x.text != "")
            {
                reference.localEulerAngles = new Vector3(float.Parse(rot_x.text), reference.localEulerAngles.y, reference.localEulerAngles.z);
            }
            if (rot_y.text != "")
            {
                reference.localEulerAngles = new Vector3(reference.localEulerAngles.x, float.Parse(rot_y.text), reference.localEulerAngles.z);
            }
            if (rot_z.text != "")
            {
                reference.localEulerAngles = new Vector3(reference.localEulerAngles.x, reference.localEulerAngles.y, float.Parse(rot_z.text));
            }

            if (sensorsize_x.text != "")
            {
                cam.sensorSize = new Vector2(float.Parse(sensorsize_x.text), cam.sensorSize.y);
            }
            if (sensorsize_y.text != "")
            {
                cam.sensorSize = new Vector2(cam.sensorSize.x, float.Parse(sensorsize_y.text));
            }

            if (lensshift_x.text != "")
            {
                cam.lensShift = new Vector2(float.Parse(lensshift_x.text), cam.lensShift.y);
            }
            if (lensshift_y.text != "")
            {
                cam.lensShift = new Vector2(cam.lensShift.x, float.Parse(lensshift_y.text));
            }

            if (focallength.text != "")
            {
                cam.focalLength = float.Parse(focallength.text);
            }

            if (topicname.text != "")
            {
                cam_topic.changeTopicName(topicname.text);
            }
            if (pubfreq.text != "")
            {
                cam_topic.frequency = float.Parse(pubfreq.text);
            }
            if (resolution_x.text != "")
            {
                cam_topic.resolutionWidth = int.Parse(resolution_x.text);
            }
            if (resolution_y.text != "")
            {
                cam_topic.resolutionHeight = int.Parse(resolution_y.text);
            }
        }
        catch (System.Exception e) { Globals.Instance.DevConsole.error("Exception occurred while reading TransformPanel Components: " + e.ToString()); }
    }