예제 #1
0
        //void OnDrawGizmosSelected()
        void OnDrawGizmos()
        {
            Gizmos.color = Color.red;
            Vector3 offset = FogOfWarConversion.FogPlaneToWorld(mapOffset.x, mapOffset.y, 0, plane);
            Vector3 size   = FogOfWarConversion.FogPlaneToWorld(mapSize, mapSize, 0, plane);

            Gizmos.DrawWireCube(offset, size);

            Gizmos.color = new Color(1, 0, 0, 0.2f);
            Gizmos.DrawCube(offset, size);
        }
예제 #2
0
 void FillShape(FogOfWarShape shape)
 {
     if (antiFlicker)
     {
         // snap to nearest fog pixel
         shape.eyePosition = FogOfWarConversion.SnapWorldPositionToNearestFogPixel(FogOfWarConversion.WorldToFogPlane(_transform.position, FogOfWar.current.plane), FogOfWar.current.mapOffset, FogOfWar.current.mapResolution, FogOfWar.current.mapSize);
         shape.eyePosition = FogOfWarConversion.FogPlaneToWorld(shape.eyePosition.x, shape.eyePosition.y, _transform.position.y, FogOfWar.current.plane);
     }
     else
     {
         shape.eyePosition = _transform.position;
     }
     shape.foward = _transform.forward;
     shape.offset = offset;
     shape.radius = radius;
 }
예제 #3
0
 void FillShape(FogOfWar fow, FogOfWarShape shape)
 {
     if (antiFlicker)
     {
         // snap to nearest fog pixel
         shape.eyePosition = FogOfWarConversion.SnapWorldPositionToNearestFogPixel(fow, FogOfWarConversion.WorldToFogPlane(_transform.position, fow.plane), fow.mapOffset, fow.mapResolution, fow.mapSize);
         shape.eyePosition = FogOfWarConversion.FogPlaneToWorld(shape.eyePosition.x, shape.eyePosition.y, _transform.position.y, fow.plane);
     }
     else
     {
         shape.eyePosition = _transform.position;
     }
     shape.brightness     = brightness;
     shape.foward         = FogOfWarConversion.TransformFogPlaneForward(_transform, fow.plane);
     shape.absoluteOffset = absoluteOffset;
     shape.offset         = offset;
     shape.radius         = circleRadius;
     shape.size           = boxSize;
 }