Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Attribute to display element title of array/list in inspector

License

Notifications You must be signed in to change notification settings

umm/element_title_attribute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Element Title Attribute

What

  • Provide [ElementTitle("Foo")] attribute
  • Display any SerializeField value to title of array/list elements in Inspector

Requirement

  • .NET 4.x / C# 6.0

Install

yarn add "umm/element_title_attribute#^1.0.0"

Usage

Before

using System;
using System.Collections.Generic;
using UnityEngine;

public class AnyMonoBehaviour : MonoBehaviour
{
    [SerializeField]
    private List<AnyStructure> AnyStructureList;
}

public enum AnyEnum
{
    Foo,
    Bar,
    Buz,
    Quz,
}

[Serializable]
public struct AnyStructure
{
    [SerializeField] private AnyEnum anyEnum;
}

After

using System;
using System.Collections.Generic;
using UnityEngine;

public class AnyMonoBehaviour : MonoBehaviour
{
    [SerializeField] [ElementTitle("anyEnum")] // Add ElementTitleAttribute
    private List<AnyStructure> AnyStructureList;
}

public enum AnyEnum
{
    Foo,
    Bar,
    Buz,
    Quz,
}

[Serializable]
public struct AnyStructure
{
    [SerializeField] private AnyEnum anyEnum;
}

License

Copyright (c) 2018 Tetsuya Mori

Released under the MIT license, see LICENSE.txt

About

Attribute to display element title of array/list in inspector

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages