public void StopMoving() { transform.position = startPosition; for (int i = 0; i < usedCosmetic.Count; i++) { cosmeticsManager.ReturnElement(usedCosmetic[i]); } for (int i = 0; i < usedObstacles.Count; i++) { obstaclesManager.ReturnElement(usedObstacles[i]); } for (int i = 0; i < usedCoins.Count; i++) { coinsManager.ReturnRandomCoin(usedCoins[i]); } usedCosmetic = new List <GameObject>(); usedCosmeticPositions = new List <int>(); usedObstacles = new List <GameObject>(); usedObstaclesPositions = new List <int>(); usedCoins = new List <GameObject>(); }