Example #1
0
        void Update()
        {
            if (_isInFog == FogOfWar.GetFogOfWarTeam(team).IsInFog(_transform.position, minFogStrength))
            {
                return;
            }

            _isInFog = !_isInFog;

            if (_isInFog)
            {
                onFogEnter.Invoke();
            }
            else
            {
                onFogExit.Invoke();
            }
        }
Example #2
0
        void Update()
        {
            FogOfWar fow = FogOfWar.GetFogOfWarTeam(team);

            if (fow == null)
            {
                Debug.LogWarning("There is no Fog Of War team for team #" + team.ToString());
                return;
            }
            bool visible = !fow.IsInFog(_transform.position, minFogStrength);

            if (_renderer != null)
            {
                _renderer.enabled = visible;
            }
            if (_graphic != null)
            {
                _graphic.enabled = visible;
            }
            if (_canvas != null)
            {
                _canvas.enabled = visible;
            }
        }
 void OnRenderImage(RenderTexture source, RenderTexture destination)
 {
     FogOfWar.GetFogOfWarTeam(team).RenderFog(source, destination, _camera, _transform);
 }