**EDIT: I thought I was posting a comment, please change this to a comment instead of an answer. Sorry.**
Does anyone know how to destroy game objects from a dictionary?
Public Dictionary gridDictionary = new Dictionary ();
if(!gridDictionary.ContainsValue(pos)){
gridDictionary.Add((GameObject)Instantiate(blueGridPrefab, pos, transform.rotation),pos);
}else{
gameobject = gridDictionary.getKeyThatContains(pos)// ???? How do I do this
gameobject.Destroy();
}
↧