/// <summary> /// Unity OnValidate. /// </summary> public void Awake() { #if !UNITY_EDITOR Type type = Type.GetType(DepthSourceClassName); DepthDataSource = (IDepthDataSource)Activator.CreateInstance(type); #endif }
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); } } }
/// <summary> /// Unity OnValidate. /// </summary> public void Awake() { Type type = Type.GetType(DepthSourceClassName); DepthDataSource = (IDepthDataSource)Activator.CreateInstance(type); }