// Update is called once per frame private void Update() { if (_currentRound > -1) { if (_currentDoorEvent == null && _wait > 3.0f && Random.value > 0.6f && CatMeter.TotalNewspapers < CatMeter.MaxNewspapers) { _currentDoorEvent = Instantiate(_newsPaperDeliveryPrefab); _currentDoorEvent.SetSpawnPoint(_newsPaperDeliverySpawnPoint); _wait = 0.0f; } else if (_currentPhoneEvent == null && _wait > 3.0f && Random.value > 0.6f) { _currentPhoneEvent = Instantiate(_phoneCallEventPrefab); AddMessage(_currentPhoneEvent.Message()); _wait = 0.0f; } else { _wait += Time.deltaTime; } _roundCounter = Mathf.Max(_roundCounter - Time.deltaTime, 0.0f); UIManager.Instance().SetTimer(_roundCounter); if (_roundCounter <= 0.0f) { StartRound(); } } }
private void GameStart() { NewsPaperDelivery delivery = Instantiate(_newsPaperDeliveryPrefab); delivery.SetSpawnPoint(_newsPaperDeliverySpawnPoint); }