Giter Site home page Giter Site logo

felipemcoliveira / scriptableobject-propertydrawer Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 50 KB

An unity editor extension, which enhances the scriptable object property.

License: MIT License

C# 100.00%
editor propertydrawer scriptableobject tooling unity unity3d unityeditor

scriptableobject-propertydrawer's Introduction

About

This package enhances the scriptable object property in the editor by adding two small buttons, one for creating scriptable object with a easy-to-use popup window which allows sub-asset creation and the second one for editing sub assets as unity doesn't provide a way to delete and to rename them.

Installing

To install this package, follow the instructions in Installing from a Git URL.

How to use

After the package has been added to you project, a button can be spotted beside any scriptable object property, by clicking it a popup windows is displayed then you can define the asset name, define where it should be saved, select the type for the new object from a list of valid types for this property and finally select how to create it, if you want to create it just as you defined (Create) or open a dialog so you can provide a path through a form as you normally do with files in your computer (Create As...) or create this file as sub-asset of the owning object (Create As SubAsset).

Create Asset Popup Window

If you create a sub asset, now the creating button has a friend, the editing button, which is represented by a pencil โœ๏ธ, because that's the way people represent editing, I guess. The editing button as well as the creating button display a popup window, but a simple one where you can rename the asset and delete it.

Edit Sub Asset Popup Window

Motivation

I really like to use strategy pattern but it's a little bit complicated to do it in unity if you encapsulate strategy within scriptable objects, because every class requires a menu item for create it and when you're setting multiples properties it's slow and boring to do it, so why not a custom editor tool for help us?

Not only did the creation process motivate me, but also the fact that Unity doesn't have any built-in features to allow us to create sub-assets increased my motivation to create this package.

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.