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 constructorpull/413/head
commit
34ea8c5d8e
|
@ -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"))
|
||||
|
|
Loading…
Reference in New Issue