https://github.com/giuliano-marinelli/unityfoldoutdecorator
Foldout as a Decorator for group variables in Unity Script Inspector
https://github.com/giuliano-marinelli/unityfoldoutdecorator
Last synced: 2 months ago
JSON representation
Foldout as a Decorator for group variables in Unity Script Inspector
- Host: GitHub
- URL: https://github.com/giuliano-marinelli/unityfoldoutdecorator
- Owner: giuliano-marinelli
- License: mit
- Created: 2021-09-03T18:25:08.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-20T12:21:32.000Z (over 3 years ago)
- Last Synced: 2025-03-29T10:51:17.690Z (3 months ago)
- Language: C#
- Size: 9.77 KB
- Stars: 45
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UnityFoldoutDecorator
Foldout as a Decorator for group variables in Unity Script Inspector with options for:* change foldout name.
* apply foldout to one or to many variables
* set variables as read only
* use styled or default editor versions
## How to
### Install
Download and copy the **Editor** and **Inspector** folders into your Project Assets.### Use
Just put the decorator above the variable and set the options you want:
```csharp
[Foldout("Name", foldEverything = true, styled = true, readOnly = true)]
```Example (same as image above):
```csharp
public class MyScript : MonoBehaviour
{
[Foldout("One styled with read only", foldEverything = false, styled = true, readOnly = true)]
public float speed = 1f;
public float retractSpeed = 1f;
[Foldout("Styled ones", styled = true)]
public float climbSpeed = 1f;
public float nodeDistance = 2f;
public float minDistance = 2f;
[Foldout("Only this", false)]
public int maxAmountNodes = 20;
public GameObject nodePrefab;
[Foldout("This and this", false)]
public LayerMask hookableLayer;
[Foldout("This and this", false)]
public LayerMask collibleLayer;[Foldout("A group")]
public Vector2 direction;
public GameObject player;
public GameObject spawn;[Foldout("Read only things", readOnly = true)]
public bool done = false;
public bool connected = false;
public bool retracting = false;
public bool climbing = false;
}
```