Skip to content

Tunied/Fog-Of-War

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Fog Of War

URP Fog of War => https://github.com/Tunied/CE-FOW-URP

  • BuildIn 已经不在维护. 就旧项目一直在用. 这种方案比较麻烦的地方是所有Shader都要重写.
  • 另外 如果能升级到 URP 建议直接用URP Build-In is already history

中文传送门 - 已失效

inspire by AsehesL and smilehao and Ultimate Fog of War

Preview

How To Use

Init

fist CopyEngine Fog of War (CEFow) is not extend MonoBehaviour. so you need call

 CEFowFacade.instance.InitAsNew($propery);

when the game start.

the $propery you pass in is defined in CEFowProperty.cs file. check for more detail in that file.

Update

as the CEFow is not extend MonoBehaviour, so you need call

CEFowFacade.instance.Update();

the frequency of this function called is up to you, you can call it once pre frame or once pre second.

even you can call it only when some explorer changed.

it will not hit any performance issue for call it once pre frame. CEFow will only repaint the Fow texture when something really changed.

Explorer

there are two type of explorer , static and not static. check more detail with the demo project.

Stalker

CEFow provide a function

CEFowFacade.IsWorldPosInView($worldPosition)

let you check is the point in fog or not.

check more detail in DebugStalker.cs file

More

if you curiousness on how i made this,please check more info on my Blog

About

Unity Fog Of War for mobile

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published