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 pickledzebra · Jul 14, 2010 at 02:20 PM · hashmultidimarray

How to write Multidimensional Hashes?

I code in Unity's Javascript-like language.

I'm wondering if I can use multidimensional hashes and what the syntax would look like?

Essentially, I just want to create a hash that represents a relationship between two groups of objects, like so:

link{A}{alpha} = 1;
link{B}{beta} = 1;
link{C}{gamma} = 1;
...

cheers

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 pickledzebra · Jul 15, 2010 at 01:04 PM 0
Share

$$anonymous$$y apologies to everyone who took the time to answer this question or comment. $$anonymous$$y behavior was vile. I've had nothing but good instructive interaction with people here. I sincerely regret my bizarre outbursts.

1 Reply

· Add your reply
  • Sort: 
avatar image
4

Answer by skovacs1 · Jul 14, 2010 at 07:44 PM

I've never heard of a multidimensional hash before, but it seems like a multidimensional associative array. I googled javascript multidimensional hash and the first hit and the related comment in the second hit seem like what you're asking for, are they?

Unity js arrays can be indexed by strings or numbers just like in regular js, so you'd get code that looks like:

var hash = {};
hash["foo"] = {};
hash["foo"]["bar"] = {};
hash["foo"]["bar"]["bash"] = 1;

As noted in the first link that I posted, you should check for null values when indexing a multidimensional associative array.

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 pickledzebra · Jul 14, 2010 at 09:28 PM 0
Share

You've never heard of a multidimensional hash? That just seems like an obliquely "stupified" comment. Not particularly what I'm looding for, but thank's for the pointers.

I'm a LOT more insterested in iff CombineChildren works in an Editing setting.

I'll note not- given the hysterical nature of responses to this question.

avatar image Ricardo · Jul 15, 2010 at 11:52 AM 3
Share

I'm not sure what you don't understand about skovacs1 reply. He's suggesting that the exact behavior you want can be accomplished with a dictionary which in turn contains dictionaries. It's not a multi-dimentional hash, so his answer to your question is spot-on. I also fail to see what CombineChildren in an Editing setting has to do with your original question.

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

No one has followed this question yet.

Related Questions

What are the properties of a good key hash? 1 Answer

Removing element from a list after it's destroyed 2 Answers

Does Game objects names affect anything in build ?,does Game objects names affect anything? 1 Answer

Animation Master to Unity textures. 1 Answer

How is asset bundle crc and hash created? 0 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