private void SetShaderForSecsEx(Material mat, float time, PostEffectImage component) { if (mat != null) { component.PostEffectMaterial = mat; _defautShaderShouldBeRestored = Time.fixedTime + time; } }
void OnTriggerEnter(Collider other) { if (PostEffectMaterialAfterPicking.HasProperty("_TimeStarted")) { PostEffectMaterialAfterPicking.SetFloat("_TimeStarted", Time.time); } PostEffectImage.SetShaderForSecs(PostEffectMaterialAfterPicking, SecondsOfShaderEffect); }