public void Initialize(int totalLemmings, int minimumLemmings) { maximum = totalLemmings; minimum = minimumLemmings; for (int i = 0; i < totalLemmings; i++) { PlayerProgressUnit unit = Instantiate(fillUnitPrefab, holder); units.Add(unit); if (i == (totalLemmings - minimum - 1)) { target = Instantiate(fillTargetPrefab, holder); } } Reset(); }
//Start private void Start() { currentTimer = updateTimer; maximum = LevelController.Instance.CurrentMapSettings.LemmingsCount; minimum = LevelController.Instance.CurrentMapSettings.MinimumVictoryCount; targetFill = localProgressBar.fill; for (int i = 0; i < maximum; i++) { PlayerProgressUnit unit = Instantiate(fillUnitPrefab, holder); units.Add(unit); if (i == minimum - 1) { target = Instantiate(fillTargetPrefab, holder); } } Reset(); }