Exemple #1
0
    public static void lockMouse()
    {
        Cursor.lockState = CursorLockMode.Locked;
        GameObject         v   = GameObject.Find("vThirdPersonCamera");
        vThirdPersonCamera cam = v.GetComponent <vThirdPersonCamera>();

        cam.lockCamera = false;

        Invector.CharacterController.vThirdPersonAnimator   a = v.GetComponent <Invector.CharacterController.vThirdPersonAnimator>();
        Invector.CharacterController.vThirdPersonInput      i = v.GetComponent <Invector.CharacterController.vThirdPersonInput>();
        Invector.CharacterController.vThirdPersonController c = v.GetComponent <Invector.CharacterController.vThirdPersonController>();

        //     i.enabled = true;
        //   c.lockMovement = false;
        //   c.enabled = true;
        //   a.enabled = true;

        //i.enabled = true;
        Cursor.lockState = CursorLockMode.Locked;
    }
Exemple #2
0
    public static void unlockMouse()
    {
        GameObject         v   = GameObject.Find("vThirdPersonController");
        vThirdPersonCamera cam = v.GetComponent <vThirdPersonCamera>();

        cam.lockCamera = true;

        /*Invector.CharacterController.vThirdPersonInput i = v.GetComponent<Invector.CharacterController.vThirdPersonInput>();
         * Invector.CharacterController.vThirdPersonController c = v.GetComponent<Invector.CharacterController.vThirdPersonController>();
         * c.enabled = false;
         * i.enabled = false;*/

        Invector.CharacterController.vThirdPersonAnimator   a = v.GetComponent <Invector.CharacterController.vThirdPersonAnimator>();
        Invector.CharacterController.vThirdPersonInput      i = v.GetComponent <Invector.CharacterController.vThirdPersonInput>();
        Invector.CharacterController.vThirdPersonController c = v.GetComponent <Invector.CharacterController.vThirdPersonController>();
        //     c.lockMovement = true;
        //c.enabled = false;
        //    a.enabled = false;
        // i.enabled = false;
        //i.enabled = false;
        Cursor.lockState = CursorLockMode.None;
        c.keepDirection  = false;
    }