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 TripodGRANNE · Jan 30, 2012 at 08:10 PM · javascriptarray

Increasing And Decreasing An Array Through A Variable

Hello, Im Trying To Make A Variable That Will Hold How Big An Array Is, I'd Like To Do This So That Way I Can Simply Increase And Decrease The Size Of The Array In the Inspector.

How Should I Go About Doing This?

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 Eric5h5 · Jan 30, 2012 at 08:50 PM 1
Share

Writing Each Word With Initial Caps Is Hard To Read And Silly.

avatar image myjean17 · Jan 31, 2012 at 07:03 PM 1
Share

Its Really Silly To Demean Others While Being A Hypocrite Yourself.

avatar image Eric5h5 · Jan 31, 2012 at 07:59 PM 1
Share

I'm not sure you know what "hypocrite" means. Or "demean" for that matter. That was a (sarcastic, yes) suggestion to avoid deliberately writing in a way that makes things harder to read, because the simple fact is, the more clearly you write, the more likely it is that people will read and understand your question, thereby increasing the chances of getting a helpful response. Going out of your way to make things more difficult for people who might help you is, by any standard, silly.

avatar image myjean17 · Feb 02, 2012 at 11:59 PM 0
Share

I understand your meaning, but sarcastic is not the attitude I would suggest taking in life.

avatar image Eric5h5 · Feb 03, 2012 at 12:11 AM 1
Share

It's sometimes warranted. I would suggest not generalizing an entire life attitude from a single comment.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by equalsequals · Jan 30, 2012 at 08:19 PM

This isn't possible with native arrays. An array ( [ ] ) capacity is declared only once, when creating a new array.

You should be able to explicitly declare how large your array is in the Inspector at any time, though, given the array is of a serializable type.

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 TripodGRANNE · Jan 30, 2012 at 08:30 PM 0
Share

Ive Seen It Done Using For Loops Before, I Had A Script Where You Could Change An Arrays Size Before Too. I $$anonymous$$now What Im Thinking Of Is Possible But I $$anonymous$$ight Be Explaining What Im talking About Wrong.

avatar image equalsequals · Jan 30, 2012 at 08:47 PM 0
Share

You could force it to do this by using a custom inspector for your class - if that's what you want.

avatar image
0

Answer by awesomeface · Jan 16, 2014 at 03:55 PM

Have you tried using an array that looks like this

 var array : float[];
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

8 People are following this question.

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

Related Questions

Add Array of Strings to info.plist 2 Answers

Have a 'Torch' script toggle on and off 1 Answer

Getting Error "No appropriate version of 'UnityEngine.GameObject.GetComponent' for the argument list '(UnityEngine.GameObject)' was found." 0 Answers

Can a script enable components? 2 Answers

A node in a childnode? 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