private void UndivideScreen() { _startInvulnerability = Time.time; _currentRealityLevel = _screens[1].realityLevel; Debug.Log ("realityLevel: " + _currentRealityLevel); int count = _screens.Count-1; foreach(Screen s in _screens) { s.DestroyScreen(); } _screens.Clear(); GenerateScreens(count); nb_track--; ScreenManager.instance.setTracksOnOff (); unsplitSound.Play(); }
private void LateUpdate() { if (difficulty==1) { if (_generatedBrics==4) { DivideScreen(); difficulty++; _generatedBrics = 0; } } else if (difficulty<5) { if (_generatedBrics==4) { DivideScreen(); difficulty++; _generatedBrics = 0; } } else if (_generatedBrics==4) { _generatedBrics = 0; foreach(Screen s in _screens) { if (_currentRealityLevel<RealityLevel.Middle) { s.realityLevel = (RealityLevel)((int)s.realityLevel+1); } } if (_screens.Count>1) { _currentRealityLevel = _screens[1].realityLevel; } } if (_flash && (Time.time-_startInvulnerability)>invulnerabilityTimer) { _flash = false; foreach (Screen s in _screens) { s.FlashPlayer(false); } } }