Giter VIP home page Giter VIP logo

dx-highlighter's Introduction

dx-highlighter

A Deus Ex/System Shock inspired pulsing bounds item highlighter

Tuc tuc tuc

Installation

You can use this repo directly via the Unity package manager:

  1. In Unity, go to Window > Package Manager
  2. Click on the "+" sign in the upper left corner > Add package from git URL
  3. Copy the address of this repository: https://github.com/nothke/dx-highlighter and hit Add

Alternatively, you can clone or download this repo and put it in the Packages folder in your Unity project.

How to Use

  1. Add dx_highlighter_canvas prefab to your scene;
  2. Reference DXHighlighter, located on that canvas object, in your script;
  3. When you want an entire GameObject highlighted, call highlighter.Highlight(myObject);. Alternatively, you can add individual Renderers with highlighter.AddRenderer(myRenderer);
  4. To "unhighlight" everything, call highlighter.ClearAll(), or to manually remove renderers highlighter.RemoveRenderer(myRenderer);

The highlighter will calculate screen-space bounds of the object and store it in highlighter.screenBounds. You can use that value for adding additional features, like item title on screen.

If you want to use the highlighter but with your custom rendering, you can tick manual update in the DXHighlighter component, and then call highlighter.CalculateBounds(). You can then obtain resulting screen-space bounds via highlighter.screenBounds.

Note: The highlighter is using Unity UI, which is not amazing on performance (but you can use your own rendering method ^)

dx-highlighter's People

Contributors

nothke 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.