Estoy tratando de mostrar el efecto de las partículas en mi interfaz de usuario. Luego encontré esta publicación: Unity Particle Effects On Canvas Y seguí cada paso, pero las partículas no se muestran en el lienzo cuando hago clic en reproducir por alguna razón.
[Mis componentes de la cámara de partículas][1] [Mi jerarquía][2]
Simplemente seguí los pasos que se muestran en la publicación, por lo que mi script es básicamente idéntico:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Particle_Camera_Script : MonoBehaviour { // Here reference the camera component of the particles camera [SerializeField] private Camera particlesCamera; // Adjust the resolution in pixels [SerializeField] private Vector2Int imageResolution = new Vector2Int(256, 256); // Reference the RawImage in your UI [SerializeField] private RawImage targetImage; private RenderTexture renderTexture; private void Awake() { if (!particlesCamera) particlesCamera = GetComponent<Camera>(); renderTexture = new RenderTexture(imageResolution.x, imageResolution.y, 32); particlesCamera.targetTexture = renderTexture; targetImage.texture = renderTexture; } }Cualquier ayuda será muy apreciada. Gracias por leer esto. [1]: https://i.stack.imgur.com/alNAL.png [2]: https://i.stack.imgur.com/XtbtH.png
Probé el método @Iggy y parece funcionar bien. Solo tenía que descargar un paquete y luego estaba listo para comenzar. https://github.com/mob-sakai/ParticleEffectForUGUI
No sé por qué esta publicación no me gustó, pero a quien no le gustó al menos podría decirme por qué, para que al menos pueda mejorar.