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 RecChemForbin · Apr 21, 2011 at 01:39 PM · rigidbodyinstantiateliststore

c# reference site? need help figuring out storing rigidbodies into List<>

I've been searching forums trying to find everything I can about using lists to take advantage of their dynamic quality instead of storing the rigidbodies into a set array.

Shooting bullets, want to store instantiated bullet rigidbody in List to keep info, check for parameters and destroy the object when parameters met

I'm just not able to fully see what I need to do here and would like any help finding a good site to review how Lists can be used/implemented.

Is there documentation in the Unity Scripting Reference (and if so what should I search for to find this)?

Any help pointing me in the right direction is very appreciated!

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

3 Replies

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

Answer by ShadowBroker · Apr 21, 2011 at 01:45 PM

In the Unity docs, you can change the script format from javascript to C#. Just klick at the button above the snippets.

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
avatar image
0
Best Answer

Answer by Molix · Apr 21, 2011 at 01:47 PM

List is part of .NET in System.Collections.Generic, so you can get info about it from MS or better yet from the Mono site since that is the implementation that matters.

As for your question you can just do something like:

private List<Rigidbody> firedBullets = new List<Rigidbody>();

void Fire() { // whatever stuff you do to fire firedBullets.Add( bullet.rigidbody ); }

void Update() { // do whatever you wanted to do with them foreach( Rigidbody rb in firedBullets ) { // } }

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 Jessy · Apr 21, 2011 at 02:27 PM 0
Share

I tried the mono site and found it to be useless. $$anonymous$$SDN FTW.

avatar image RecChemForbin · Apr 21, 2011 at 05:22 PM 0
Share

thanks $$anonymous$$olix...now off to read on some of this stuff

avatar image
0

Answer by ckfinite · Apr 21, 2011 at 01:43 PM

No, there is very little C# refrence in the Unity docs. You will need MSDN for that. Look at this:http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx.

Comment
Add comment · Show 1 · 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 RecChemForbin · Apr 21, 2011 at 05:15 PM 0
Share

will check this out thx!

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

A node in a childnode? 1 Answer

How to add GameObject to List using a constructor method 1 Answer

Instantiate rigidbody C# 1 Answer

How to add & remove specific gameobject from a list and instantiate them 1 Answer

Store Game Object Into List For Later Reinstantiation? 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