void Start() { if (GrayIfBeaten && LevelProgress.GetInstance().IsLevelBeaten(LevelName)) { GameObject checkmark = Instantiate(checkMarkPrefab, transform); checkmark.transform.parent = transform; checkmark.transform.position = checkmark.transform.position - new Vector3(0, 5f, 0); checkmark.transform.localScale = new Vector3(.25f, .25f, .25f); } }
void Update() { if (CurrentLevelMode == LevelMode.PLAY) { currentTime += Time.deltaTime; } // check for victory condition if (CurrentLevelMode == LevelMode.PLAY && Cars.All(x => x.GotToGoal)) { LevelProgress.GetInstance().LogLevelBeaten(); CurrentLevelMode = LevelMode.WIN; } // clean up any invalid states if (!CanHighlightTowers && CurrentBuildState.HighlightedTower) { CurrentBuildState.HighlightedTower = null; } if (!IsInPlaceMode && CurrentBuildState.HighlightedPosition != null) { CurrentBuildState.HighlightedPosition = null; } }