Giter VIP home page Giter VIP logo

unityruntimescenegizmo's Introduction

Runtime Scene Gizmo for Unity

screenshot

Available on Asset Store: https://assetstore.unity.com/packages/tools/gui/runtime-scene-gizmo-123040

Forum Thread: https://forum.unity.com/threads/runtime-scene-gizmo-for-ugui-open-source.540011/

Support the Developer โ˜•

This plugin helps you display a runtime scene gizmo as a UI element in your Unity projects. An event is raised when a component of the gizmo is clicked.

INSTALLATION

There are 5 ways to install this plugin:

  • import RuntimeSceneGizmo.unitypackage via Assets-Import Package
  • clone/download this repository and move the Plugins folder to your Unity project's Assets folder
  • import it from Asset Store
  • (via Package Manager) add the following line to Packages/manifest.json:
    • "com.yasirkula.runtimescenegizmo": "https://github.com/yasirkula/UnityRuntimeSceneGizmo.git",
  • (via OpenUPM) after installing openupm-cli, run the following command:
    • openupm add com.yasirkula.runtimescenegizmo

HOW TO

Simply add Plugins/RuntimeSceneGizmo/Prefabs/GizmoRenderer to your UI canvas and position it as you like. Gizmo will always have 1:1 aspect ratio and, by default, will be placed at the top-right corner of GizmoRenderer. You can change the RenderTarget child object's pivot for a different placement.

To invoke a function when a gizmo component is clicked, use the On Component Clicked event of the GizmoRenderer object. Functions registered to this event should ideally take a GizmoComponent parameter (which is defined in RuntimeSceneGizmo namespace).

Gizmo's rotation will match the main camera's rotation but it is possible to change the reference object via GizmoRenderer's Reference Transform property.

GizmoRenderer will automatically create an instance of SceneGizmo prefab in your scene. SceneGizmo uses a camera to render the gizmo to a RenderTexture, which is then used by the GizmoRenderer to display the gizmo on the canvas. By default, SceneGizmo objects use layer 24 but this can be adjusted via SceneGizmoController.GIZMOS_LAYER constant.

See Plugins/RuntimeSceneGizmo/Demo/DemoScene for an example scene.

unityruntimescenegizmo's People

Contributors

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