Making a cart in unity? - unity3d

I am trying to make a cart that checks if the right item have been placed inside. I dont know how i would build this the best way. The way i would build this is by making the cart check for gameobjects names and then check if its the right one.
The result of doing it the way i would have done it, Is alot of werid names and also making it hard to add more items due to it almost being fully hardcoded.
First i thougt of using tags but i already use them for my pickup system and since you cant have more then one for some reason i cant.

You can try storing the products in a List. Each product would (inherit maybe) from the a Product.cs and each time you add one product in the cart, update the List.
Also you can check if is the right one before calling the cartList.Add() based on a string field(or int maybe?) in the Product.cs.
You can also store all the Product.cs in the Start method, either in a List or a dictionary, and check if it’s the right one before adding to cartList.
Sorry for the vague answer, I fast-typed on my phone. I hope this helps.

Related

how to mark/check a checkbox in Moodle

I have a lot of checkboxes and their names are generated with the help of the resource id they are associated with, which in turn is fetched from the database.
$mform->addElement('checkbox', 'incres'.$coursename.$sec->section.$record3->instance);
The second parameter is the name of the checkbox.
I need to know how to mark this checkbox as checked.I have a feeling this can be done by the setDefault method but I cant figure out how. I tried
$mform->setDefault('reqdres'.$coursename.$sec->section.$record3->instance,1);
But that doesnt work. I dont wish to use Javascript or the advancecheckbox element for this since that will require me doing a lot of changes in other dependant modules
Did you try using the Advanced Check Box? $mform->setDefault() should work with this.

Instantsearch filter by custom function

Due to certain limitations I am not able to index categories and subcategories so I need a way to be able to filter a list of manually created items. It's actually a two part thing:
1: I am filtering the visible results via a toggle switch
2: I now have a submenu (also manually created) with multiple items which need to be sortable as well.
So when I click on any item it filters. The behavior should be the same as in this demo.
This part, to be specific:
The issue I'm facing is that I don't know if this is possible at all. Yes, I looked at the obvious places but could not find anything helpful. Again, the list is created manually so I'd need some custom function to highjack the instantsearch results, I guess.
Any help is much appreciated.

creating interface for adding n number of products to a category using umbraco

I know this question has been asked many times i went through all of them but couldn't find the right solution hence writing my problem here may be again...
I want to create CMS for category-Products solution..i think the name itself is quite explanatory..
Every category can have n number of products in to it.
but i couldnt get how can i do this via umbraco.
i know, i can access child not via inline razor macro but how to access child node contents ...or may be some other right way!!
Please dont give me links to Run away modules..i have already visited them ...and could understand very little...
Any suggestion will be helpful.
Create (if you haven't already) two different document types; one called Category, the other called Product. (You'll also want to add the appropriate properties.) In the Structure tab of Category, be sure to allow Product (and don't forget to allow Category under whatever type it will live). From here, you should be able to create Category nodes, and then beneath each of them, Product nodes.

Avoid adding duplicate entry in iPhone contacts

After adding an entry in iPhone contacts successfully, now I want to restrict the application to add the same entry again. (As it makes another entry in iPhone Contacts with same data).
Any simple way to accomplish this? or any work around?
Any simple way to accomplish this? or any work around?
Unless I misunderstand what you're trying to do, the simple solution would seem to be searching the contacts for the information that you're about to add. If you find the same data, don't add it again. If you find something similar, such as a contact with the same name, ask the user if they want to create another contact with that name or update the existing one.

Add new field in existing built in Application of iPhone

Hope you all are fine and are in your best of moods.
I herewith one doubt to ask you, kindly help me by giving its solution.
I need to add one custom field in existing built in Contact Application of iPhone.
I mean i need to allow user to set different icon or Logo for different contact.
so i need to add one field namely icon or Logo in existing application.
But I don't know how to do this, weather it is possible or not or is there any alternate solution for that or not???
kindly post your Answers.
Thanks in Advance.
You cannot add fields to the built in Address Book datastore. You could perhaps achieve your goals by one of two solutions:
make a copy of the data and add your data to that. You will hit sync problems
Use some property (perhaps ABPropertyID) of the AB information to key a local database referencing your icons.
I'm assuming what you actually want to do is add an icon to the address book app - there is certainly no way to do that.