/// <summary> /// Simple check for the use of the standard shader. /// </summary> /// <param name="rends"><see cref="Renderer[]"/> to check for the MRTK standard shader.</param> /// <returns>true when render is using the MRTK standard shader.</returns> private bool CheckForStandardShader(Renderer[] rends) { foreach (Renderer rend in rends) { if (!StandardShaderUtility.IsUsingMrtkStandardShader(rend.sharedMaterial) && rend.sharedMaterial.shader != MRTKtmp) { return(false); } } return(true); }
private static IEnumerable <Graphic> GetGraphicsWhichRequireScaleMeshEffect(Object[] targets) { var output = new List <Graphic>(); foreach (var target in targets) { Graphic[] graphics = (target as Canvas).GetComponentsInChildren <Graphic>(); foreach (var graphic in graphics) { if (StandardShaderUtility.IsUsingMrtkStandardShader(graphic.material) && graphic.GetComponent <ScaleMeshEffect>() == null) { output.Add(graphic); } } } return(output); }
private List <Graphic> GetGraphicsWhichRequireScaleMeshEffect(UnityEngine.Object[] targets) { graphicsWhichRequireScaleMeshEffect.Clear(); foreach (UnityEngine.Object target in targets) { Graphic[] graphics = (target as Canvas).GetComponentsInChildren <Graphic>(); foreach (Graphic graphic in graphics) { if (StandardShaderUtility.IsUsingMrtkStandardShader(graphic.material) && graphic.GetComponent <ScaleMeshEffect>() == null) { graphicsWhichRequireScaleMeshEffect.Add(graphic); } } } return(graphicsWhichRequireScaleMeshEffect); }
/// <summary> /// Simple check for the use of MRTK standard shader. /// </summary> /// <param name="rends"><see cref="Renderer[]"/> to check for the MRTK standard shader.</param> /// <returns>true when render is using the MRTK standard shader.</returns> private bool CheckForStandardShader(Renderer renderer) { return(StandardShaderUtility.IsUsingMrtkStandardShader(renderer.sharedMaterial) || renderer.sharedMaterial.shader == MRTKtmp); }