コード例 #1
0
        void Update()
        {
            if (PointerLock.GetMode() == PointerLock.Mode.FIRST_PERSON)
            {
                CheckPhysics();
                CheckInput();

                transform.position += velocity * Time.deltaTime;
            }
        }
コード例 #2
0
        void Update()
        {
#if !UNITY_WEBGL || UNITY_EDITOR
            if (Input.GetKeyDown(KeyCode.Escape) && PointerLock.GetMode() == PointerLock.Mode.FIRST_PERSON)
            {
                EnableMenus();
            }
#endif
            if (PointerLock.GetMode() == PointerLock.Mode.FIRST_PERSON)
            {
                FollowMouseRotation();
            }
        }