private void switchToNextCustomCamera() { var nextIndex = currentCameraIndex + 1; nextIndex = nextIndex % availableCams.Length; // CurrentCamera property will take care of callbacks for old/new cameras CurrentCamera = availableCams[nextIndex]; currentCameraIndex = nextIndex; }
public CustomCameraV() { // instance = this; UIex.tweener = tweener; this.Tick += OnTick; this.KeyUp += onKeyUp; this.KeyDown += onKeyDown; this.Aborted += onAborted; // Always use invariant culture (dot decimal separator) Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; this.LoadSettings(); availableCams = new CustomCamera[3]; availableCams[0] = new SmoothCamera(this, tweener); availableCams[1] = new LegacyCamera(this, tweener); availableCams[2] = new DriverSeatCamera(this, tweener); _currentCam = availableCams[currentCameraIndex]; }