protected virtual void Activate() { if (acting) //avoid infinite recursion { return; } acting = true; ActionHistory.Action activation = null; activation = delegate(GameObject actor) { CarriedItem slot = actor.GetComponent <CarriedItem>(); PickableItem item = slot.carriedItem; item.Activate(); return(false); }; activation(slotTaken.gameObject); slotTaken.gameObject.GetComponent <Movement>().actionHistory.Add(activation); acting = false; }