The Swartz-Manning’s first exhibit will provide a detailed history of Aaron Swartz Day. https://www.aaronswartzday.org/vr
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MouseLock : MonoBehaviour {
  5. public bool lockOnStart = true;
  6. public bool relockOnClick = true;
  7. void Lock()
  8. {
  9. if (lockOnStart)
  10. {
  11. Cursor.lockState = CursorLockMode.Locked;
  12. Cursor.visible = false;
  13. }
  14. }
  15. // Use this for initialization
  16. void Start () {
  17. Lock();
  18. }
  19. // Update is called once per frame
  20. void Update () {
  21. if (relockOnClick && Input.GetMouseButtonDown(0))
  22. {
  23. Lock();
  24. }
  25. }
  26. }