Git Product home page Git Product logo

fog-of-war's Introduction

Unity Fog Of War

中文传送门

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

fog-of-war's People

Contributors

tunied avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.