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
0
Question by caulfield85 · Dec 08, 2017 at 04:19 PM · listlists

List getting reversed?

Hi,

I have a list of a list of buttons and I've noticed that after I initially add items to the list, the order of them can get reversed. This is actually very important to my game and greatly affects some parts.

I have printed out the contents when they are first added, and then I have printed out the contents when I use them next. And they are reversed. As far as I know, I am not altering the list in the meantime.

Has anyone come across this before?


UPDATE:

After a bit of testing I have found out that the list isn't actually getting reversed, but some elements are being moved around

First time adding to list: alt text

Second time checking: alt text

secondtest1.png (8.1 kB)
secondstest2.png (8.0 kB)
Comment
Add comment · Show 5
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 UtopianKing · Dec 08, 2017 at 09:21 PM 0
Share

Can you paste the code for printing them?

avatar image caulfield85 UtopianKing · Dec 09, 2017 at 11:52 AM 0
Share

This is the first time I am printing them out

alt text

And this is the second time (identical code)

alt text

firstadded.png (4.7 kB)
secondtime.png (4.7 kB)
avatar image caulfield85 UtopianKing · Dec 09, 2017 at 11:53 AM 0
Share

And these are the results

First time:

alt text

Second time:

alt text

Sorry for putting these into two comments, but it wouldn't let me post all of this in one comment for some reason

firstaddedresults.png (8.7 kB)
secondtimeresults.png (8.4 kB)
avatar image Bunny83 caulfield85 · Dec 09, 2017 at 12:47 PM 0
Share

Do not post code in images. This make it impossible to refer to certain lines without retyping your code. UA has

 code highlighting

so use it. Also this information should be part of the question and not a comment to the question. Also you should include how buttons is actually declared-

Have you checked all references to buttons in your code? Are you sure you never change anything? If you use Visual Studio or $$anonymous$$onoDevelop you can simply rightclick your "buttons" variable and select "Find all references" (might be named different). This should give you a list of all positions in your code where you read or write to this variable.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

73 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

Related Questions

A node in a childnode? 1 Answer

Access list storing custom class variables from another script 1 Answer

Is there a way to remove array entries in the editor? 4 Answers

How do I make a list of lists? 2 Answers

from list of entries, select and add to scene beneath previous 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