Skip to main content
Cleanup
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

I have a game based on How to implement combining 2 ingredients to create a product. What is the best way to code this? (Unity)

So to go a bit more in depth, inIn my game, you can combine a variety of ingredients to make a product. For example, you could combine water and dirt to make mud.

What I am currently doing to achieve this is by listing each combination possibility that a particular ingredient has. The one thing iI managed to do to make it a little more efficient is that I managed to remove duplicates (So for example, if iI have coded ingredientA + IngredientB = Cheese, there isn't another entry for IngredientB + Ingredient A = Cheese).

The problem I have with my method is that it is very annoying adding new ingredients. If iI do so, I have to go back to every previous ingredient iI have coded, and add it's interaction with the ingredient(s) iI want to add.

The amount of ingredients I have means this is becoming increasingly time consuming.

Is there a better way to do this?

This is a Unity game, coded in C#. Let me know if you need any further info.

I have a game based on combining 2 ingredients to create a product. What is the best way to code this? (Unity)

So to go a bit more in depth, in my game, you can combine a variety of ingredients to make a product. For example, you could combine water and dirt to make mud.

What I am currently doing to achieve this is by listing each combination possibility that a particular ingredient has. The one thing i managed to do to make it a little more efficient is that I managed to remove duplicates (So for example, if i have coded ingredientA + IngredientB = Cheese, there isn't another entry for IngredientB + Ingredient A = Cheese).

The problem I have with my method is that it is very annoying adding new ingredients. If i do so, I have to go back to every previous ingredient i have coded, and add it's interaction with the ingredient(s) i want to add.

The amount of ingredients I have means this is becoming increasingly time consuming.

Is there a better way to do this?

This is a Unity game, coded in C#. Let me know if you need any further info.

How to implement combining 2 ingredients to create a product?

In my game, you can combine a variety of ingredients to make a product. For example, you could combine water and dirt to make mud.

What I am currently doing to achieve this is by listing each combination possibility that a particular ingredient has. The one thing I managed to do to make it a little more efficient is that I managed to remove duplicates (So for example, if I have coded ingredientA + IngredientB = Cheese, there isn't another entry for IngredientB + Ingredient A = Cheese).

The problem I have with my method is that it is very annoying adding new ingredients. If I do so, I have to go back to every previous ingredient I have coded, and add it's interaction with the ingredient(s) I want to add.

The amount of ingredients I have means this is becoming increasingly time consuming.

Is there a better way to do this?

Source Link

I have a game based on combining 2 ingredients to create a product. What is the best way to code this? (Unity)

So to go a bit more in depth, in my game, you can combine a variety of ingredients to make a product. For example, you could combine water and dirt to make mud.

What I am currently doing to achieve this is by listing each combination possibility that a particular ingredient has. The one thing i managed to do to make it a little more efficient is that I managed to remove duplicates (So for example, if i have coded ingredientA + IngredientB = Cheese, there isn't another entry for IngredientB + Ingredient A = Cheese).

The problem I have with my method is that it is very annoying adding new ingredients. If i do so, I have to go back to every previous ingredient i have coded, and add it's interaction with the ingredient(s) i want to add.

The amount of ingredients I have means this is becoming increasingly time consuming.

Is there a better way to do this?

This is a Unity game, coded in C#. Let me know if you need any further info.