Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

ReflectionProbe.IsFinishedRendering

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public function IsFinishedRendering(renderId: int): bool;
public bool IsFinishedRendering(int renderId);

Parámetros

renderId An integer representing the RenderID as returned by the RenderProbe method.

Valor de retorno

bool True if the render has finished, false otherwise. See Also: timeSlicingMode

Descripción

Checks if a probe has finished a time-sliced render.


        
using UnityEngine;
using System.Collections;

public class UpdateProbeEvery2Seconds : MonoBehaviour { private int RenderId = -1; private ReflectionProbe TheProbe; public RenderTexture TargetTexture;

IEnumerator Start () { TheProbe = GetComponent<ReflectionProbe>(); // set the probe to render in time-slicing mode and make sure all faces of the cubemap render the same frame. TheProbe.timeSlicingMode = UnityEngine.Rendering.ReflectionProbeTimeSlicingMode.AllFacesAtOnce; while (true) { yield return new WaitForSeconds (2.0f);

// render the probe over several frames and blit into TargetTexture once finished. RenderId = TheProbe.RenderProbe(TargetTexture); } }

void Update() { if (TheProbe.IsFinishedRendering(RenderId)) { // Probe has finished rendering, do something with the render texture } } }