GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - EnjoyW0rld/QOL-Unity-Attributes: A quality of life attributes to enhance the Unity editor and make it more designer-friendly without creating separate editor scripts for your game components.

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
Editor
Editor
 
 
Runtime
Runtime
 
 
docs
docs
 
 
.gitignore
.gitignore
 
 
Editor.meta
Editor.meta
 
 
LICENSE
LICENSE
 
 
LICENSE.meta
LICENSE.meta
 
 
README.md
README.md
 
 
README.md.meta
README.md.meta
 
 
Runtime.meta
Runtime.meta
 
 
docs.meta
docs.meta
 
 
package.json
package.json
 
 
package.json.meta
package.json.meta
 
 

Repository files navigation

QOL Unity Attributes

Make your Unity Editor pretier and easily customizable without extra work with editor scripting

🔧 Repository is currently in active development

A collection of Quality-of-Life attributes for Unity designed to improve workflow and inspector usability.
This package focuses on conditional inspector logic such as showing or hiding fields based on parameters.

✨ Featured attributes

  • ShowIf: show or hide a variable based on another variable`s value
  • ReadOnly: make a variable to be read only
  • Button: add a button in the inspection for a specified function to be called on click
  • Break: add a simple colored line to divide variables visible in the editor.

📦 Installation

Option 1: Unity Package Manager (Git URL)

  1. Open Unity
  2. Go to Window → Package Manager
  3. Click the + button
  4. Select Add package from git URL
  5. Paste:

https://github.com/EnjoyW0rld/QOL-Unity-Attributes.git

Option 2: Direct download

You can download directly a .unitypackage file and simply drag and drop it into your project

📖 Documentation

ShowIf

Show if attribute showcase gif

Show if the attrbute has two constructors -

First constructor public ShowIfAttribute(string pValueToCompare, ComparisonType pComparer = ComparisonType.IsNotNull)
For the cases when it is needed to check if the target value is null or not, the comparison type can be omitted in most of the cases.

string pValueToCompare - pass a name with of the target variable you want to be compared

Second constructor public ShowIfAttribute(string pValueToCompare, ComparisonType pComparer, object pTargetValue)
This is a general constructor that includes all the cases possible in the current version of the ShowIf attribute.

object pTargetValue - value that variable will be compared with (for example 1, 2.5, true, false, etc.).

Choosing which comparison type to use is made through the enum list -

enum ComparisonType
        {
            Less,
            Equal,
            NotEqual,
            Bigger,
            IsNull,
            IsNotNull
        }

⚠️Known problems

  • ShowIf attribute can not compare the size of the array to the desired length
  • Can not fully customize the comparison mechanism (for example, show variable if the comparable variable is >3 and <10)

ReadOnly

Simply add the ReadOnly attribute to the variable, and you are good to go. Attribute should work with the most default and some Unity-specific variables.

Button

The button attribute allows you to include in the script editor window buttons to call specified functions.
Add to a variable [Button(..)] attribute to make the editor draw a button. The class comes with two constructors, where main is -

public ButtonAttribute(string pTargetFunction, string pDisplayName, bool pDoDrawUnder = false)

  • Where pTargetFunction is the name of the function to be called (the function needs to be without parameters).
  • pDisplay name is the text to be written on the button itself; this parameter can be omitted if you don`t need custom text on the button.
  • pDoDrawUnder is a bool determining if the button will be drawn on top (by default) of the variable this attribute is attached to or under.

Break

The break attribute simply creates a line of desired width in the editor to split your variables and make the editor more readable.
Currentrly it is possible to set up only colour and the width of the divider, in future more settings will be added.

🤝 Contributing

Found a bug or have a feature request? Open an issue or submit a pull request! Contributions are welcome.

📃 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A quality of life attributes to enhance the Unity editor and make it more designer-friendly without creating separate editor scripts for your game components.

Topics

attributestoolkittoolkit-unityunityunity-editorunity-extensionunity-package

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.