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 DubstepDragon · Feb 27, 2014 at 02:51 PM · inventorylimitburgzergarcade

BurgZerg Arcade inventory system tutorials... Incomplete!!

There is an annoying issue that has been on my nerves for such a long time... The inventory system in the BurgZerg Arcade tutorials is very well done, however! there is one thing that is missing and annoys me plenty! :P That is the limitless inventory system. The inventory is limitless, bottomless, endless... Because I have been following the tutorials from beginning to end, and that Peter Laliberte is such a fantastic programmer, I cannot work out how his code is structured in order to limit the array for the inventory. This is VERY annoying...

Also the fact that items cannot be discarded in any way, only looted from chests... If anyone worked on the tutorials, and updated/upgraded his code, can you please aid me? My mind is spinning in triangles.

Sorry for the cheesy jokes and thanks in advance!

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
1
Best Answer

Answer by Flint Silver · Mar 06, 2014 at 09:14 AM

(I didn't see every episode, only someone)

Probably he used a List to create an InventorySystem, and probably he used C# (Because the tutorial I saw he wrote everything in C#). If so, you have to take the list and remove the element you need to delete:

 nameOfTheList.Remove(itemToRemove);

Hope it's correct and useful :)

Comment
Add comment · Show 3 · 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 DubstepDragon · Mar 06, 2014 at 01:44 PM 0
Share

Thank you very much! Do you perhaps know how to limit the array? I am not too good with arrays...

avatar image Flint Silver · Mar 06, 2014 at 04:08 PM 0
Share

I don't know if there is a limit, but you could add an if sentence, for example:

  void AddItem(GameObject Item)
     {
         if (InventoryItems.Count <= nmax)
         {
              InventoryItems.Add(Item);
         }
     }

... I found a link: $$anonymous$$SDN C# docs There you can found everything about list ( I think that List.Capacity it's what you need)

avatar image DubstepDragon · Mar 18, 2014 at 08:47 PM 0
Share

Fantastic! Thank you very much! :D

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

21 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

Related Questions

Inventory system using an array... 3 Answers

Limiting an inventory system + dragging items in inventory window... 0 Answers

Very simple inventory script... 0 Answers

Equipping a Healing Gem to give passive regen... 1 Answer

How to simplify my Equipment method? 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