Skip to content

Unity extension that lets you assign any Object field by choosing it from the scene view.

License

Notifications You must be signed in to change notification settings

RoyTheunissen/Scene-View-Picker

Repository files navigation

Roy Theunissen License: MIT GitHub Follow Twitter

Unity extension to allow you to assign Object fields by picking it from the scene view

About the Project

Sometimes scene hierarchies get complex and you get in a frustrating situation where you need to assign a field and you know exactly where it is in the scene, but it's hard to point out in the hierarchy. I figured: why not make something to allow you to assign fields by pointing where the object is in the scene? That's exactly what this is.

Video

Example

Getting Started

  • Add the package to your Unity project (tips on how to install it are in the Installation section)
  • Open a script with fields derived from Object
  • Click the new button next to the hierarchy picker
    • Left Click to pick the desired object from the scene
    • Middle Click to pick from nearby objects when they are cluttered together
    • Right Click to cancel

Extras

  • If you want a callback whenever a field is assigned via picking, add the [PickCallback("OnPicked")] attribute
    • You can specify the name of a method to be called
    • This method can be parameterless or have two parameters of the same type of the field
    • In the latter case, the previous and current value are provided

Installation

Package Manager

Go to Edit > Project Settings > Package Manager. Under 'Scoped Registries' make sure there is an OpenUPM entry.

If you don't have one: click the + button and enter the following values:

  • Name: OpenUPM
  • URL: https://package.openupm.com

Then under 'Scope(s)' press the + button and add com.roytheunissen.

It should look something like this:
image


All of my packages will now be available to you in the Package Manager in the 'My Registries' section and can be installed from there.

Git Submodule

You can check out this repository as a submodule into your project's Assets folder. This is recommended if you intend to contribute to the repository yourself

OpenUPM

The package is available on the openupm registry. It's recommended to install it via openupm-cli.

openupm add com.roytheunissen.sceneviewpicker

Manifest

You can also install via git URL by adding this entry in your manifest.json

"com.roytheunissen.sceneviewpicker": "https://github.com/RoyTheunissen/Scene-View-Picker.git"

Unity Package Manager

from Window->Package Manager, click on the + sign and Add from git: https://github.com/RoyTheunissen/Scene-View-Picker.git

Contact

Roy Theunissen

[email protected]

About

Unity extension that lets you assign any Object field by choosing it from the scene view.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages