protected override void ChooseThought() { bool containsMushroom = false; bool containsPotion = false; foreach (GameObject shelfSlot in ShelfSlots) { PickableItem contained = shelfSlot.GetComponentInChildren <PickableItem>(); if (contained != null) { if (contained.GetType() == typeof(Potion)) { containsPotion = true; } if (contained.GetType() == typeof(Mushroom)) { containsMushroom = true; } } } if (containsMushroom && containsPotion) { CurrentThoughtID = 0; } else if (containsMushroom) { CurrentThoughtID = 1; } else if (containsPotion) { CurrentThoughtID = 2; } }