Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
6
Question by magicaxis-2 · Jul 26, 2011 at 07:00 AM · arrayinspectortexture2djagged

How do I make a public array of arrays appear in the inspector?

If you make an array of textures like this:

 public Texture2D[] lightattacklist;

A folder appears in the inspector, which you can drag textures into to assign them after setting the sizes :)

However, I need to make an array of arrays of textures, like this:

 public Texture2D[][] allanimationslist;

This creates nothing in the inspector. How do I make the inspector give me a folder of folders full of textures? If impossible, how else could I assign textures within the script?

Thanks :D

Comment
Add comment · Show 1
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 biohazard · Jul 26, 2011 at 07:07 AM 0
Share

array of arrays...ARRAYCEPTION ._.

1 Reply

· Add your reply
  • Sort: 
avatar image
38
Best Answer

Answer by Herman-Tulleken · Jul 26, 2011 at 07:21 AM

As simple workaround is to define a wrapper class for an array of lists, like this:

 [Serializable]
 public class TextureList
 {
     public Texture2D[] textures;

 }

 public TextureList[] textureLists;

Not quite as convenient, but it works.

Comment
Add comment · Show 10 · 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
avatar image magicaxis-2 · Jul 26, 2011 at 08:15 AM 0
Share

Genius! thanks dude :D

avatar image Molgore · May 17, 2015 at 07:10 AM 0
Share

[System.Serializable] not [Serializable]

avatar image BudgieKnight Molgore · May 21, 2015 at 07:25 AM 0
Share

This question was answered four years ago, so things might have changed a fair bit.

avatar image GrandCash Molgore · Feb 23, 2019 at 01:19 PM 1
Share

Actually, if you declare 'using System;' at the top, you may use plain '[Serializable]'. I like that way better

avatar image gaps Molgore · Jul 25, 2020 at 11:50 AM 0
Share

Not only this does not answer the question at all, as it is also partially wrong.

Please remove the answer and write it as a comment to the answer above, which was what I believe you meant to do in the fist place.

avatar image Guhanesh · Nov 23, 2017 at 08:14 AM 0
Share

and textureLists.textures to access those

avatar image compact127 · Mar 25, 2018 at 09:33 PM 0
Share

If i place a game objects in the arrays, how can i access its properties like it's transform?

avatar image WaqasHaiderDev · May 28, 2020 at 11:27 PM 0
Share

This solution works perfectly and I thank @Herman-Tulleken for this. However I had to struggle to access the elements with this approach so this is the solution I found on another post here. https://answers.unity.com/questions/231715/is-there-any-way-to-view-2d-arrays-in-the-inspecto.html

Basically you simply need to call

 textureList[row index].textures[column index]

e.g.

 textureList[2].textures[5]

will access 3rd array and then will access its 6th element.

Show more comments

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

18 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

Related Questions

Public Array with a class not showing in Inspcetor 1 Answer

Array elements are empty in the inspector? 1 Answer

How to show an array of custom objects in Inspector? 2 Answers

Inspector Doesn't Update Array Elements When Updated In Array Constructor 1 Answer

Calling an object from Array/List 1 Answer


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