private bool DropRocket(EnemyRocket.type type) { EnemyRocket rocket = prefab.GetInstance(type); bool isNotNull = (rocket != null); if (isNotNull) { Vector2 source = new Vector2(Random.Range(-width, width), spawnY); Vector2 target = targets[Random.Range(0, targets.Count)]; rocket.transform.position = source; rocket.transform.rotation = Quaternion.FromToRotation(Vector2.down, target - source); rocket.Launch(target); } return(isNotNull); }
public int IncreaseScore(EnemyRocket.type type) { int amount; if (type == EnemyRocket.type.FAT) { amount = fatRocketValue; fatScoreCount++; } else { amount = thinRocketValue; thinScoreCount++; } levelScore += amount; totalScore += amount; totalScoreText.text = totalScore.ToString(); return(amount); }
public void UpdateCount(EnemyRocket.type type, int amount) { Text count = (type == EnemyRocket.type.FAT ? fatIncomingText : thinIncomingText); count.text = amount.ToString(); }