Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garettbass/UnityExtensions.InspectInline
Enables you to inspect and edit object references, and easily embed such objects as subassets.
https://github.com/garettbass/UnityExtensions.InspectInline
Last synced: 3 months ago
JSON representation
Enables you to inspect and edit object references, and easily embed such objects as subassets.
- Host: GitHub
- URL: https://github.com/garettbass/UnityExtensions.InspectInline
- Owner: garettbass
- License: mit
- Created: 2018-10-03T23:03:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-22T15:42:06.000Z (over 3 years ago)
- Last Synced: 2024-08-03T05:20:04.752Z (6 months ago)
- Language: C#
- Size: 238 KB
- Stars: 43
- Watchers: 6
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity-open-source-on-github - UnityExtensions.InspectInline - Enables you to inspect and edit object references (Inspector)
README
# UnityExtension.InspectInline
![Before & After](Before-After.png)
## Installation
Just clone this repo somewhere inside your Unity project's `Assets` folder.
## `InspectInlineAttribute`
Apply the `InspectInlineAttribute` to member variables that reference objects derived from `UnityEngine.Object` (e.g. `UnityEngine.ScriptableObject` subclasses). It provides the following configuration options:
* `bool canEditRemoteTarget` - Enable inline editing of the referenced object even if it resides in a different asset file.
* `bool canCreateSubasset` - Directs the `InspectInlineDrawer` to embed the referenced object as a subasset in the same asset file.
```cs
public class SampleAsset : ScriptableObject
{[InspectInline(canEditRemoteTarget = true)]
public SampleSubasset remoteTarget;[InspectInline(canCreateSubasset = true)]
public SampleSubassetWithVectorAndColorValues concreteSubasset;[InspectInline(canCreateSubasset = true)]
public SampleSubasset polymorphicSubasset;}
```## `InspectInlineDrawer`
This subclass of `UnityEditor.PropertyDrawer` draws the object selection field, and when the referenced object is not `null`, it also draws the associated inspector for that object immediately below the object selection field.