so I want to enable the vignette effect in Post Processing whenever my health is low. I have already edited the vignette effect to appear red, I just need it to be enabled whenever my health is below 20 for example. is there any way to do this? here is my health script:
using UnityEngine;
using System.Collections;
public class PlayerHealth4 : MonoBehaviour
{
public int maxHealth = 100;
public int curHealth = 100;
//initialization
void Start() { }
// Update
void Update()
{
if (curHealth < 1)
{
Application.LoadLevel("level4_hell");
}
}
void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "EnemyBullet")
{
curHealth -= 20;
Destroy(col.other);
}
}
}
thanks for any help.
↧