public void AssignParent(InfiniteObject infiniteObject, ObjectType objectType) { switch (objectType) { case ObjectType.Platform: infiniteObject.SetParent(platformParent); break; case ObjectType.Scene: infiniteObject.SetParent(sceneParent); break; case ObjectType.Obstacle: infiniteObject.SetParent(obstacleParent); break; case ObjectType.Coin: infiniteObject.SetParent(coinParent); break; case ObjectType.PowerUp: infiniteObject.SetParent(powerUpParent); break; } }