/// <summary> /// Replaces the AR background material. /// </summary> private void ReplaceBackground() { if (ReplacementMaterial == null) { return; } if (FirstPersonCamera == null) { FirstPersonCamera = Camera.main.gameObject; } m_BackgroundRenderer = FirstPersonCamera.GetComponent <DemoARBackgroundRenderer>(); if (m_BackgroundRenderer != null) { m_BackgroundRenderer.SwapBackgroundMaterial(ReplacementMaterial); } }
/// <summary> /// Replaces the AR background material. /// </summary> private void ReplaceBackground() { if (ReplacementMaterial == null) { return; } if (FirstPersonCamera == null) { FirstPersonCamera = Camera.main.gameObject; } m_BackgroundRenderer = FirstPersonCamera.GetComponent <DemoARBackgroundRenderer>(); // Resets the fragment shader. ReplacementMaterial.SetFloat("_ShowColorOnly", 0f); if (m_BackgroundRenderer != null) { m_BackgroundRenderer.SwapBackgroundMaterial(ReplacementMaterial); } }