So guys i have this problem. Should i create a list with all items? Its gonna be huge. If i create an array with just the names, i will have problem with the levels. What can i do?
You can put the script on your camera or in an empty gameobject. then you call the function which select the item from a script on you monster :
script on empty GameObject:
int[,] mytab = int[2,3]
public void PopRandomObject(int levelMonster)
{
generate a random number between lvl - 1 & +1;
generate a other one for the seconde dimension;
}
Script on you monter:
find the game object on the one is the first script;
Gameobject.find(“objectname”).getComponent().PopRandomObject(levelofthis monster)
the second script call the function which pop a random object in the first one.