Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by tantix · Mar 20, 2021 at 01:25 PM · inspectorlists

Modifying Lists via the inspector

Serialized Lists<> seem to be displayed inconsistently in the inspector. In some cases, I have +/- buttons to add/remove elements, and the elements can be dragged to reorder:

good list

In others, I get neither of these:

alt text

In both cases, the fields are Lists of ScriptableObjects, albeit different SO's. Any idea what determines how Lists are displayed in the inspector? The former is far more convenient, so it would be nice to always get that version.

goodlist.png (16.6 kB)
badlist.png (28.4 kB)
Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tantix · Mar 21, 2021 at 05:45 PM 0
Share

Also (and possibly relatedly?), any idea why the second script above would be toggleable (has a checkmark), while the first isn't?

avatar image jackmw94 · Mar 21, 2021 at 06:01 PM 0
Share

Mind posting your chunk data / resource data code? There might be some clues in there :)

avatar image tantix · Mar 21, 2021 at 06:24 PM 0
Share

ChunkManager.cs:

 public class ChunkManager : MonoBehaviour {
   public bool allowRotation = false;
   [SerializeField] private List<ChunkData> chunkDatas = null;
   private Dictionary<int, List<ChunkData>> chunkDatasByCount;
 ...

Faction.cs:

 public abstract class Faction : MonoBehaviour  {
  
   // Inspector inputs.
   public Counter counterPrefab;
   [Tooltip("Prefab for the non-UI resource meter")]
   public ResourceStore meterPrefab;
 
   [SerializeField] private List<BuildingData> buildingDatas = null;
   [SerializeField] private List<ResourceData> resourceDatas = null;
 ...

PlayerFaction.cs:

 public class PlayerFaction : Faction  {
 ...

Also, https://issuetracker.unity3d.com/issues/arrays-are-not-reorderable-by-default-when-serializefield-or-serializereference-attributes-are-used seems to be the same issue, and it looks like this was resolved in 2020.2.0b4. I'm running 2020.2.1f1. Would the latter contain any fixes live in the former?

avatar image logicandchaos · Mar 21, 2021 at 08:03 PM 0
Share

I think it's an issue with the ChunkData file that one has no script toggle and is displaying weird :P You should include all the code for it in your original post.

avatar image Hellium · Mar 21, 2021 at 09:55 PM 1
Share

The toggle next to the script name has nothing to do with the lists. A component can be enabled or disabled (checkbox visible) only if it implements several functions like Start, Update, FixedUpdate and few other functions.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tantix · Mar 24, 2021 at 01:59 PM

Looks like going to 2021.1.0f1 resolved this.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

pre populate nullable type list items in inspector 0 Answers

Is it possible to choose from preinitialized lists in the inspector? 1 Answer

Methods list in inspector 0 Answers

Creating a custom inspector utilizing a list of class instances with serialization? 1 Answer

Unity Inspector limiting display of nested lists. 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges