Merged in ClaudiuCodebase/unity-ui-extensions/Fixed-shader-not-found (pull request #33)

On Android the hardcoded path is not found and the code execution stops there because of NullPointerException in the Material constructor
pull/413/head
Claudiu Cornici 2018-08-28 09:26:36 +00:00 committed by Simon Jackson
commit 34ea8c5d8e
1 changed files with 7 additions and 4 deletions

View File

@ -70,11 +70,14 @@ namespace UnityEngine.UI.Extensions
if (pRenderer != null)
pRenderer.enabled = false;
Shader foundShader = Shader.Find("UI Extensions/Particles/Additive");
Material pMaterial = new Material(foundShader);
if (material == null)
material = pMaterial;
{
var foundShader = Shader.Find("UI Extensions/Particles/Additive");
if (foundShader)
{
material = new Material(foundShader);
}
}
currentMaterial = material;
if (currentMaterial && currentMaterial.HasProperty("_MainTex"))