// Called when start protectedvoidCheckResources() { bool isSupported = CheckSupport(); if (isSupported == false) { NotSupported(); } }
// Called in CheckResources to check support on this platform protectedboolCheckSupport() { if (SystemInfo.supportsImageEffects == false || SystemInfo.supportsRenderTextures == false) { Debug.LogWarning("This platform does not support image effects or render textures."); returnfalse; } returntrue; }
// Called when the platform doesn't support this effect protectedvoidNotSupported() { enabled = false; } protectedvoidStart() { CheckResources(); }
// Called when need to create the material used by this effect protected Material CheckShaderAndCreateMaterial(Shader shader, Material material) { if (shader == null) { returnnull; } if (shader.isSupported && material && material.shader == shader) return material; if (!shader.isSupported) { returnnull; } else { material = new Material(shader); material.hideFlags = HideFlags.DontSave; if (material) return material; else returnnull; } } }