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
1
Question by AlucardJay · Oct 03, 2012 at 10:25 PM · arraylist

Difference between Static, Dynamic, and Built-In Arrays

the story so far ....

I should do some research before asking this question, but I was unaware of Built-In Arrays, only assuming there were 2 types of array : Static and Dynamic. I put the point out there that research I did revealed static arrays were slightly more efficient than List. Now built-in has thrown me i.e. are they only for ints/floats? or do built-in arrays exist for transform, vector3, etc? (It's just hard sometimes when one doesn't know of the existence of these functions/commands). I was kindly given a link by Fattie to : http://answers.unity3d.com/questions/198318/javascript-array-use-with-a-struct-.html

This came from a discussion here : http://answers.unity3d.com/questions/198318/javascript-array-use-with-a-struct-.html

Could anyone possibly elaborate on Built-In?

Elaborate how?

Built-in arrays are like this:

 var foo : GameObject[];

Is that what you mean by static arrays?

yes, and also like with my meshes i.e.

 verts = Vector3[24]; 
 uv = Vector2[24]; 
 tris = int[12];

These are what I assumed to be Static arrays. Then the dynamic (of which I don't use so this is probably wrong) myItems = Array(); (parenthesis rather than square brackets).

Comment
Add comment
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

1 Reply

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

Answer by Eric5h5 · Oct 03, 2012 at 10:44 PM

I think your question answers itself. :) The Unity docs refer to arrays like GameObject[] as built-in arrays, which is useful since "static array" could potentially be confused with the static keyword. There are a number of collections that could be referred to as dynamically-sized arrays, such as the JS Array class, ArrayList, and generic List.

Comment
Add comment · Show 2 · 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 AlucardJay · Oct 03, 2012 at 10:49 PM 0
Share

Thank you for the clarification. I was lost on the ter$$anonymous$$ology, but had the right idea (I think).

Basically a Built-In array is a static array.

I shall read some of the API and look closer for these references.

avatar image Eric5h5 · Oct 03, 2012 at 10:51 PM 0
Share

For example, the ToBuiltin function (if for some reason you were using the JS Array class).

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

10 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

Related Questions

A node in a childnode? 1 Answer

Reference all objects inside of an Array or List? 2 Answers

combine words of different scenes in a list or array; have each word link to a page 3 Answers

Different timer in a list of gameobject 2 Answers

Selection list from Array Unity - Random - GameObjects array 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