informatica:realidad_virtual:unity:puzzle
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
informatica:realidad_virtual:unity:puzzle [2023/01/31 15:18] – created jose | informatica:realidad_virtual:unity:puzzle [2023/01/31 17:21] (current) – jose | ||
---|---|---|---|
Line 8: | Line 8: | ||
{{: | {{: | ||
- | ====== URP Universal Render Pipeline ====== | + | Hay que jugar con la orientación. La flecha azul es la que manda. Cuando coges un objeto, lo coge por detrás, es decir, la flecha azul apunta hacía delante de ti y hay que girarlo añadiendo un " |
- | No sé para que sirve del todo, pero lo uso para dar luz a los materiales. | + | |
- | Instalación:\\ | + | {{:informatica: |
- | https:// | + | |
+ | Y así lo metemos en " | ||
- | Para que el material | + | {{: |
+ | |||
+ | Ahora creamos los scripts. Creamos una carpeta en Assets | ||
+ | |||
+ | El contenido del Script es el siguiente (tened | ||
+ | |||
+ | < | ||
+ | using UnityEngine; | ||
+ | using UnityEngine.Events; | ||
+ | using UnityEngine.XR.Interaction.Toolkit; | ||
+ | |||
+ | |||
+ | public class EncajarFoto : MonoBehaviour | ||
+ | { | ||
+ | [SerializeField] private Transform CorrectPuzzlePiece; | ||
+ | private XRSocketInteractor socket; | ||
+ | |||
+ | [Header(" | ||
+ | public UnityEvent onPuzzleCompletion; | ||
+ | |||
+ | private void Awake() => socket = GetComponent< | ||
+ | |||
+ | private void OnEnable() | ||
+ | { | ||
+ | socket.selectEntered.AddListener(ObjectSnapped); | ||
+ | } | ||
+ | |||
+ | private void OnDisable() | ||
+ | { | ||
+ | socket.selectEntered.RemoveListener(ObjectSnapped); | ||
+ | } | ||
+ | |||
+ | private void ObjectSnapped(SelectEnterEventArgs arg0) | ||
+ | { | ||
+ | var snappedObjectName = arg0.interactableObject; | ||
+ | if(snappedObjectName.transform.name == CorrectPuzzlePiece.name) | ||
+ | { | ||
+ | onPuzzleCompletion.Invoke(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | Arrastramos el script a " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Aquí tenemos la variable " | ||
+ | |||
+ | Arrastramos nuestra foto a " | ||
+ | |||
+ | {{: | ||
- | Luego hay que añadir "Gobal Volume" | ||
- | Tonemapping | ||
- | Bloom | ||
- | Vignette | ||
- | {{: | ||
- | ====== Luces ====== | ||
- | https:// |
informatica/realidad_virtual/unity/puzzle.1675178315.txt.gz · Last modified: 2023/01/31 15:18 by jose