public GameObject SpawnBug(BUG_SIZE size, BUG_DIFFICULTY difficulty) { if (size.Equals(BUG_SIZE.SMALL)) { if (difficulty.Equals(BUG_DIFFICULTY.EASY)) { return(SpawnBug(BUG_SMALL_EASY)); } else if (difficulty.Equals(BUG_DIFFICULTY.NORMAL)) { return(SpawnBug(BUG_SMALL_NORMAL)); } else if (difficulty.Equals(BUG_DIFFICULTY.HARD)) { return(SpawnBug(BUG_SMALL_HARD)); } } else if (size.Equals(BUG_SIZE.MEDIUM)) { if (difficulty.Equals(BUG_DIFFICULTY.EASY)) { return(SpawnBug(BUG_MEDIUM_EASY)); } else if (difficulty.Equals(BUG_DIFFICULTY.NORMAL)) { return(SpawnBug(BUG_MEDIUM_NORMAL)); } else if (difficulty.Equals(BUG_DIFFICULTY.HARD)) { return(SpawnBug(BUG_MEDIUM_HARD)); } } else if (size.Equals(BUG_SIZE.LARGE)) { if (difficulty.Equals(BUG_DIFFICULTY.EASY)) { return(SpawnBug(BUG_LARGE_EASY)); } else if (difficulty.Equals(BUG_DIFFICULTY.NORMAL)) { return(SpawnBug(BUG_LARGE_NORMAL)); } else if (difficulty.Equals(BUG_DIFFICULTY.HARD)) { return(SpawnBug(BUG_LARGE_HARD)); } } return(null); }
private void ResetDirections() { directions.Clear(); directions.Add(BUG_DIRECTION.UP); directions.Add(BUG_DIRECTION.LEFT); directions.Add(BUG_DIRECTION.DOWN); directions.Add(BUG_DIRECTION.RIGHT); if (difficulty.Equals(BUG_DIFFICULTY.NORMAL) || difficulty.Equals(BUG_DIFFICULTY.EASY)) { // remove 1 int index = theGame.random(4); directions.RemoveAt(index); if (difficulty.Equals(BUG_DIFFICULTY.EASY)) { // REMOVE ANOTHER index = theGame.random(3); directions.RemoveAt(index); } } }