Skip to content

Foldout as a Decorator for group variables in Unity Script Inspector

License

Notifications You must be signed in to change notification settings

zhaogd233/UnityFoldoutDecorator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityFoldoutDecorator --如何自定义atti 显示样式。

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

Preview

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:

[Foldout("Name", foldEverything = true, styled = true, readOnly = true)]

Example (same as image above):

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;
}

About

Foldout as a Decorator for group variables in Unity Script Inspector

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%