/// <summary>
    /// Unity OnValidate.
    /// </summary>
    public void Awake()
    {
#if !UNITY_EDITOR
        Type type = Type.GetType(DepthSourceClassName);
        DepthDataSource = (IDepthDataSource)Activator.CreateInstance(type);
#endif
    }
示例#2
0
    private void Start()
    {
        var config = (DepthDataSourceConfig)Resources.Load("DepthDataSourceConfig");

        if (config != null && config.DepthDataSource != null)
        {
            s_DepthDataSource = config.DepthDataSource;
        }

        s_Instance          = this;
        s_AlwaysUpdateDepth = true;

        // Default texture, will be updated each frame.
        s_DepthTexture = new Texture2D(2, 2);

        foreach (DepthTarget target in s_DepthTargets)
        {
            if (target.DepthTargetMaterial != null)
            {
                SetDepthTexture(target);
                UpdateScreenOrientationOnMaterial(target.DepthTargetMaterial);
                SetAlphaForBlendedOcclusionProperties(target.DepthTargetMaterial);
            }
        }
    }
示例#3
0
    /// <summary>
    /// Unity OnValidate.
    /// </summary>
    public void Awake()
    {
        Type type = Type.GetType(DepthSourceClassName);

        DepthDataSource = (IDepthDataSource)Activator.CreateInstance(type);
    }