26 lines
482 B
C#
26 lines
482 B
C#
using UnityEngine;
|
|
using UnityStandardAssets.ImageEffects;
|
|
|
|
public class DisableEffectUnderWater : MonoBehaviour
|
|
{
|
|
public SunShafts _SunShaftsEffect;
|
|
|
|
public string TagThatDisables = "Water";
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.gameObject.tag == TagThatDisables)
|
|
{
|
|
_SunShaftsEffect.enabled = false;
|
|
}
|
|
}
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
if (other.gameObject.tag == TagThatDisables)
|
|
{
|
|
_SunShaftsEffect.enabled = true;
|
|
}
|
|
}
|
|
}
|