public void EnableXRayVision() { if (_xRayShader == null) { _xRayShader = Shader.Find("Azee/XRayShader"); if (_xRayShader == null) { throw new Exception("Critical Error: \"Azee/XRayShader\" shader is missing. Make sure it is included in \"Always Included Shaders\" in ProjectSettings/Graphics."); } } ApplyDefaultXRayVisionColor(); DefineVarsIfMissing(); _xRayVisionState = XRayVisionState.TransitioningToXRay; if (_audioController) { _audioController.PlayClip(0); } if (_animator && !skipAnimation) { _animator.SetTrigger("showXRay"); } else { SwitchToXRayView(); } skipAnimation = false; }
public void DisableXRayVision() { DefineVarsIfMissing(); if (_audioController) { _audioController.PlayClip(1); } _xRayVisionState = XRayVisionState.TransitioningToNormal; if (_animator && !skipAnimation) { _animator.SetTrigger("hideXRay"); } else { SwitchToNormalView(); } skipAnimation = false; }
public void OnXRayHidden() { _xRayVisionState = XRayVisionState.Normal; }
public void OnXRayShown() { _xRayVisionState = XRayVisionState.XRay; }