private IEnumerator TPRandomToggleObject(int repeat) { while (repeat >= 0) { GameObject selectedObject = RandomSystem.PickObjectWithProbability(probabilityElements); selectedObject.SetActive(!selectedObject.activeSelf); repeat--; yield return(ExampleHelper.WaitSecond); } }