void Update() { if (LevelBuilder.inst.levelBuilderIsShowing) { return; } if (GameManager.inst.CanDisplayDialogue() && Input.GetKeyDown(KeyCode.R)) { WebGLComm.inst.Debug("Reocrd attempt during state;" + replayState.ToString()); if (replayState == ReplayState.Ready) { PlayerDialogue.inst.playerPressedOKDelegate += StartRecording; PlayerDialogue.inst.playerPressedCancelDelegate += PlayerCanceled; PlayerDialogue.inst.ShowPlayerDialogue("Do you want to record yourself playing? Your video will be shared on VIMEO.COM", "Record replay!", camIcon); } else { StopRecording(); } } if (replayState == ReplayState.Recording) { videoTimer += Time.deltaTime; frames++; if (frames > framesToSkip) { frames = 0; RecordShot(shotIndex); shotIndex++; if (shotIndex > 300) { StopRecording(); } } blinkFrames++; if (blinkFrames % blinkInterval == 0) { ToggleBlink(); } } }