void OnTriggerExit(Collider other) { if (!cameraInside || targetFog == null) { return; } if (other == targetCollider || other.gameObject.transform.GetComponentInChildren <Camera> () == targetFog.fogCamera) { cameraInside = false; if (enableProfileTransition && targetProfile != null) { targetFog.ClearTargetProfile(transitionDuration); } if (enableAlphaTransition) { targetFog.ClearTargetAlpha(transitionDuration); } if (enableFogColorTransition) { targetFog.ClearTargetColors(transitionDuration); } if (debugMode) { Debug.Log("Fog Volume exited by " + other.name); } } }
void OnTriggerExit(Collider other) { if (!cameraInside) { return; } if (other.gameObject.transform.GetComponentInChildren <Camera>() == fog.fogCamera) { cameraInside = false; fog.ClearTargetAlpha(transitionDuration); } }