private GameObject SpawnPlatform() { Vector2 platformPos = RandomCalculations.GetRandomPlatformSpawnPosition(PlatformListSortedByVerticalPosition.Last().transform.position, HorizontalSpawnRange, VerticalSpawnRange); GameObject spawnedPlatform = Instantiate(GetObjectToSpawn(), platformPos, Quaternion.identity, PlatformParentTransform); PlatformListSortedByVerticalPosition.Add(spawnedPlatform); return(spawnedPlatform); }
public GameObject GetObjectToSpawn() { return(RandomCalculations.GetRandomElemntOfList(spawnObjectsAndSpawnPercentage) ?? DefaultSpawnObject); }