Exemple #1
0
 private void OnDestroy()
 {
     this.HeadArea       = null;
     this._clsBase       = null;
     this.TouchAnimation = null;
     this.AnimationList.Clear();
     this.AnimationList    = null;
     this.ApproachScale    = null;
     this.ApproachPosition = null;
     this.StartPosY        = null;
     this.StartTime        = null;
     PSVitaInput.set_secondaryTouchIsScreenSpace(false);
 }
    private void OnGUI()
    {
        int num = 40;

        GUI.Toggle(new Rect(85f, (float)num, 300f, 20f), PSVitaInput.WirelesslyControlled(), " Wireless Controller detected");
        num += 15;
        GUI.Toggle(new Rect(85f, (float)num, 300f, 20f), Input.GetButton("Left Shoulder"), " Left Shoulder");
        GUI.Toggle(new Rect(385f, (float)num, 300f, 20f), Input.GetButton("Right Shoulder"), " Right Shoulder");
        num += 15;
        GUI.Toggle(new Rect(85f, (float)num, 300f, 20f), Input.GetButton("Left Shoulder 1"), " Left Shoulder 1 (Vita TV Only)");
        GUI.Toggle(new Rect(385f, (float)num, 300f, 20f), Input.GetButton("Right Shoulder 1"), " Right Shoulder 1 (Vita TV Only)");
        num += 15;
        GUI.Toggle(new Rect(85f, (float)num, 300f, 20f), Input.GetButton("Left Stick"), " Left Stick (Vita TV Only)");
        GUI.Toggle(new Rect(385f, (float)num, 300f, 20f), Input.GetButton("Right Stick"), " Right Stick (Vita TV Only)");
        num += 30;
        int num2 = 80;
        int num3 = num;

        GUI.TextField(new Rect((float)num2, (float)num3, 140f, 20f), " D-Pad");
        GUI.Toggle(new Rect((float)num2, (float)(num3 + 60), 100f, 20f), Input.GetButton("Dleft"), " Left");
        GUI.Toggle(new Rect((float)(num2 + 40), (float)(num3 + 30), 100f, 20f), Input.GetButton("Dup"), " Up");
        GUI.Toggle(new Rect((float)(num2 + 80), (float)(num3 + 60), 100f, 20f), Input.GetButton("Dright"), " Right");
        GUI.Toggle(new Rect((float)(num2 + 40), (float)(num3 + 90), 100f, 20f), Input.GetButton("Ddown"), " Down");
        int num4 = 380;
        int num5 = num;

        GUI.TextField(new Rect((float)num4, (float)num5, 140f, 20f), " Main Buttons");
        GUI.Toggle(new Rect((float)num4, (float)(num5 + 60), 100f, 20f), Input.GetButton("Square"), " Square");
        GUI.Toggle(new Rect((float)(num4 + 40), (float)(num5 + 30), 100f, 20f), Input.GetButton("Triangle"), " Triangle");
        GUI.Toggle(new Rect((float)(num4 + 80), (float)(num5 + 60), 100f, 20f), Input.GetButton("Circle"), " Circle");
        GUI.Toggle(new Rect((float)(num4 + 40), (float)(num5 + 90), 100f, 20f), Input.GetButton("Cross"), " Cross");
        int num6 = 590;
        int num7 = num;

        GUI.Toggle(new Rect((float)num6, (float)num7, 140f, 20f), Input.GetButton("Select"), " Select");
        GUI.Toggle(new Rect((float)num6, (float)(num7 + 20), 140f, 20f), Input.GetButton("Start"), " Start");
        num += 120;
        int num8 = 50;
        int num9 = num;

        GUI.TextField(new Rect((float)num8, (float)num9, 200f, 20f), " Left Stick X Axis: " + Input.GetAxis("Left Stick Horizontal"));
        GUI.TextField(new Rect((float)num8, (float)(num9 + 25), 200f, 20f), " Left Stick Y Axis: " + Input.GetAxis("Left Stick Vertical"));
        int num10 = 350;
        int num11 = num;

        GUI.TextField(new Rect((float)num10, (float)num11, 200f, 20f), " Right Stick X Axis: " + Input.GetAxis("Right Stick Horizontal"));
        GUI.TextField(new Rect((float)num10, (float)(num11 + 25), 200f, 20f), " Right Stick Y Axis: " + Input.GetAxis("Right Stick Vertical"));
    }
Exemple #3
0
    private void Update()
    {
        if (!this.gui)
        {
            GameObject gameObject = new GameObject("Motion Info");
            gameObject.AddComponent <GUIText>();
            gameObject.set_hideFlags(61);
            gameObject.get_transform().set_position(new Vector3(0.7f, 0.9f, 0f));
            this.gui = gameObject.GetComponent <GUIText>();
        }
        this.gui.set_pixelOffset(new Vector2(0f, 0f));
        Input.get_compass().set_enabled(true);
        PSVitaInput.set_gyroTiltCorrectionEnabled(false);
        PSVitaInput.set_gyroDeadbandFilterEnabled(true);
        this.gui.set_text("\nInput");
        GUIText expr_9C = this.gui;

        expr_9C.set_text(expr_9C.get_text() + "\n .deviceOrientation: ");
        GUIText expr_B7 = this.gui;

        expr_B7.set_text(expr_B7.get_text() + "\n   " + Input.get_deviceOrientation());
        GUIText expr_DC = this.gui;

        expr_DC.set_text(expr_DC.get_text() + "\n\nInput.acceleration");
        GUIText expr_F7 = this.gui;

        expr_F7.set_text(expr_F7.get_text() + "\n .x,y,z: " + Input.get_acceleration());
        GUIText expr_11C = this.gui;

        expr_11C.set_text(expr_11C.get_text() + "\n .magnitude: " + Input.get_acceleration().get_magnitude());
        GUIText expr_149 = this.gui;

        expr_149.set_text(expr_149.get_text() + "\n\nInput.gyro");
        GUIText expr_164 = this.gui;

        expr_164.set_text(expr_164.get_text() + "\n .enabled: " + Input.get_gyro().get_enabled());
        GUIText expr_18E = this.gui;

        expr_18E.set_text(expr_18E.get_text() + "\n .attitude: " + Input.get_gyro().get_attitude());
        GUIText expr_1B8 = this.gui;

        expr_1B8.set_text(expr_1B8.get_text() + "\n .gravity: " + Input.get_gyro().get_gravity());
        GUIText expr_1E2 = this.gui;

        expr_1E2.set_text(expr_1E2.get_text() + "\n .rotationRate: " + Input.get_gyro().get_rotationRate());
        GUIText expr_20C = this.gui;

        expr_20C.set_text(expr_20C.get_text() + "\n .rotationRateUnbiased: " + Input.get_gyro().get_rotationRateUnbiased());
        GUIText expr_236 = this.gui;

        expr_236.set_text(expr_236.get_text() + "\n .updateInterval: " + Input.get_gyro().get_updateInterval());
        GUIText expr_260 = this.gui;

        expr_260.set_text(expr_260.get_text() + "\n .userAcceleration: " + Input.get_gyro().get_userAcceleration());
        GUIText expr_28A = this.gui;

        expr_28A.set_text(expr_28A.get_text() + "\nPSVitaInput.gyroDeadbandFilterEnabled: " + PSVitaInput.get_gyroDeadbandFilterEnabled());
        GUIText expr_2AF = this.gui;

        expr_2AF.set_text(expr_2AF.get_text() + "\nPSVitaInput.gyroTiltCorrectionEnabled: " + PSVitaInput.get_gyroTiltCorrectionEnabled());
        GUIText expr_2D4 = this.gui;

        expr_2D4.set_text(expr_2D4.get_text() + "\n\nInput.compass");
        GUIText expr_2EF = this.gui;

        expr_2EF.set_text(expr_2EF.get_text() + "\n .enabled: " + Input.get_compass().get_enabled());
        GUIText expr_319 = this.gui;

        expr_319.set_text(expr_319.get_text() + "\n .magneticHeading: " + Input.get_compass().get_magneticHeading());
        GUIText expr_343 = this.gui;

        expr_343.set_text(expr_343.get_text() + "\n .trueHeading: " + Input.get_compass().get_trueHeading());
        GUIText expr_36D = this.gui;

        expr_36D.set_text(expr_36D.get_text() + "\n .rawVector: " + Input.get_compass().get_rawVector());
        GUIText expr_397 = this.gui;

        expr_397.set_text(expr_397.get_text() + "\n .timestamp: " + Input.get_compass().get_timestamp());
        GUIText expr_3C1 = this.gui;

        expr_3C1.set_text(expr_3C1.get_text() + "\n PSVitaInput.compassFieldStability:");
        GUIText expr_3DC = this.gui;

        expr_3DC.set_text(expr_3DC.get_text() + "\n   " + PSVitaInput.get_compassFieldStability());
        if (PSVitaInput.get_compassFieldStability() != 2)
        {
            GUIText expr_40C = this.gui;
            expr_40C.set_text(expr_40C.get_text() + "\nCompass unstable, needs calibration!");
        }
    }
Exemple #4
0
    private void Update()
    {
        if (!this.gui)
        {
            GameObject gameObject = new GameObject("Touch Info");
            gameObject.AddComponent <GUIText>();
            gameObject.set_hideFlags(61);
            gameObject.get_transform().set_position(new Vector3(0.1f, 0.5f, 0f));
            this.gui = gameObject.GetComponent <GUIText>();
            this.gui.set_pixelOffset(new Vector2(5f, 100f));
        }
        PSVitaInput.set_secondaryTouchIsScreenSpace(true);
        this.gui.set_text("\n\n\n\n\n\n\n\nSimulated Mouse\n");
        GUIText expr_8B = this.gui;
        string  text    = expr_8B.get_text();

        expr_8B.set_text(string.Concat(new object[]
        {
            text,
            " pos: ",
            Input.get_mousePosition().x,
            ", ",
            Input.get_mousePosition().y,
            "\n"
        }));
        for (int i = 0; i < 3; i++)
        {
            GUIText expr_F9 = this.gui;
            expr_F9.set_text(expr_F9.get_text() + " button: " + i);
            GUIText expr_11A = this.gui;
            expr_11A.set_text(expr_11A.get_text() + " held: " + Input.GetMouseButton(i));
            GUIText expr_140 = this.gui;
            expr_140.set_text(expr_140.get_text() + " up: " + Input.GetMouseButtonUp(i));
            GUIText expr_166 = this.gui;
            expr_166.set_text(expr_166.get_text() + " down: " + Input.GetMouseButtonDown(i));
            GUIText expr_18C = this.gui;
            expr_18C.set_text(expr_18C.get_text() + "\n");
        }
        GUIText expr_1B2 = this.gui;

        expr_1B2.set_text(expr_1B2.get_text() + "\nTouch Screen Front");
        GUIText expr_1CD = this.gui;

        text = expr_1CD.get_text();
        expr_1CD.set_text(string.Concat(new object[]
        {
            text,
            "\n touchCount: ",
            Input.get_touchCount(),
            "\n"
        }));
        Touch[] touches = Input.get_touches();
        for (int j = 0; j < touches.Length; j++)
        {
            Touch   touch    = touches[j];
            GUIText expr_229 = this.gui;
            text = expr_229.get_text();
            expr_229.set_text(string.Concat(new object[]
            {
                text,
                " pos: ",
                touch.get_position().x,
                ", ",
                touch.get_position().y
            }));
            GUIText expr_28C = this.gui;
            text = expr_28C.get_text();
            expr_28C.set_text(string.Concat(new object[]
            {
                text,
                " mp: ",
                Input.get_mousePosition().x,
                ", ",
                Input.get_mousePosition().y
            }));
            GUIText expr_2EB = this.gui;
            expr_2EB.set_text(expr_2EB.get_text() + " fid: " + touch.get_fingerId());
            GUIText expr_312 = this.gui;
            expr_312.set_text(expr_312.get_text() + " dpos: " + touch.get_deltaPosition());
            GUIText expr_339 = this.gui;
            expr_339.set_text(expr_339.get_text() + " dtime: " + touch.get_deltaTime());
            GUIText expr_360 = this.gui;
            expr_360.set_text(expr_360.get_text() + " tapcount: " + touch.get_tapCount());
            GUIText expr_387 = this.gui;
            expr_387.set_text(expr_387.get_text() + " phase: " + touch.get_phase());
            GUIText expr_3AE = this.gui;
            expr_3AE.set_text(expr_3AE.get_text() + "\n");
            if (touch.get_phase() == null)
            {
                MonoBehaviour.print("Began");
            }
            if (touch.get_phase() == 3)
            {
                if (touch.get_tapCount() == 2)
                {
                    MonoBehaviour.print("Ended Multitap");
                }
                else
                {
                    MonoBehaviour.print("Ended");
                }
            }
        }
        GUIText expr_422 = this.gui;

        expr_422.set_text(expr_422.get_text() + "\nRear Touch Pad");
        GUIText expr_43D = this.gui;

        expr_43D.set_text(expr_43D.get_text() + "\n isScreenSpace: " + PSVitaInput.get_secondaryTouchIsScreenSpace());
        if (!PSVitaInput.get_secondaryTouchIsScreenSpace())
        {
            GUIText expr_46C = this.gui;
            expr_46C.set_text(expr_46C.get_text() + "\n width: " + PSVitaInput.get_secondaryTouchWidth());
            GUIText expr_491 = this.gui;
            expr_491.set_text(expr_491.get_text() + " height: " + PSVitaInput.get_secondaryTouchHeight());
        }
        GUIText expr_4B6 = this.gui;

        text = expr_4B6.get_text();
        expr_4B6.set_text(string.Concat(new object[]
        {
            text,
            "\n touchCount: ",
            PSVitaInput.get_touchCountSecondary(),
            "\n"
        }));
        Touch[] touchesSecondary = PSVitaInput.get_touchesSecondary();
        for (int k = 0; k < touchesSecondary.Length; k++)
        {
            Touch   touch2   = touchesSecondary[k];
            GUIText expr_515 = this.gui;
            text = expr_515.get_text();
            expr_515.set_text(string.Concat(new object[]
            {
                text,
                " pos: ",
                touch2.get_position().x,
                ", ",
                touch2.get_position().y
            }));
            GUIText expr_578 = this.gui;
            expr_578.set_text(expr_578.get_text() + " fid: " + touch2.get_fingerId());
            GUIText expr_59F = this.gui;
            expr_59F.set_text(expr_59F.get_text() + " dpos: " + touch2.get_deltaPosition());
            GUIText expr_5C6 = this.gui;
            expr_5C6.set_text(expr_5C6.get_text() + " dtime: " + touch2.get_deltaTime());
            GUIText expr_5ED = this.gui;
            expr_5ED.set_text(expr_5ED.get_text() + " tapcount: " + touch2.get_tapCount());
            GUIText expr_614 = this.gui;
            expr_614.set_text(expr_614.get_text() + " phase: " + touch2.get_phase());
            GUIText expr_63B = this.gui;
            expr_63B.set_text(expr_63B.get_text() + "\n");
        }
    }