コード例 #1
0
    /// <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);
        }
    }
コード例 #2
0
    /// <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);
        }
    }