void Gray() { WhiteCam.active = BlackCam.active = true; SelectionWindow.SetActiveRecursively(false); gameState = GameState.PlayGame; currentPlayMode = CurrentPlayMode.Grey; time = Time.timeSinceLevelLoad; CharWRender.active = CharBRender.active = true; TutorialWindow.SetActiveRecursively(true); }
void White() { WhiteCam.active = BlackCam.active = false; MainCam.active = true; ActivateBlackMode(false); ActivateWhiteMode(true); SelectionWindow.SetActiveRecursively(false); gameState = GameState.PlayGame; GameManager.currentPlayMode = CurrentPlayMode.White; time = Time.timeSinceLevelLoad; CharWRender.active = true; CharBRender.active = false; TutorialWindow.SetActiveRecursively(true); }
void Replay() { gameState = GameState.PlayGame; time = Time.timeSinceLevelLoad; Character.SetActiveRecursively(true); GameOverWindow.SetActiveRecursively(false); TutorialWindow.SetActiveRecursively(true); if (currentPlayMode == CurrentPlayMode.Black) { CharWRender.active = false; } if (currentPlayMode == CurrentPlayMode.White) { CharBRender.active = false; } }
void Awake() { BlackMat.color = new Color(BlackMat.color.r, BlackMat.color.g, BlackMat.color.b, 1f); WhiteMat.color = new Color(WhiteMat.color.r, WhiteMat.color.g, WhiteMat.color.b, 1f); gameState = GameState.OpeningWindow; OpeningWindow.SetActiveRecursively(true); GameOverWindow.SetActiveRecursively(false); SelectionWindow.SetActiveRecursively(false); TutorialWindow.SetActiveRecursively(false); BlackCam.camera.rect = new Rect(0.5f, 0, 0.5f, 1); WhiteCam.camera.rect = new Rect(0, 0, 0.5f, 1); MainCam.camera.rect = new Rect(0, 0, 1, 1); MainCam.active = true; BlackCam.active = WhiteCam.active = false; //fb = fbsuccess.GetComponent<UILabel>(); deathLbl.text = "You died: @ time(s)!"; timeLbl.text = "Your max time: @"; //White(); }
void GameOver() { deaths++; float timer = Time.timeSinceLevelLoad - time; if (timer > maxTime) { maxTime = timer; } string minutes = Mathf.Floor(maxTime / 60).ToString("00"); string seconds = (maxTime % 60).ToString("00"); gameState = GameState.GameOver; OpeningWindow.SetActiveRecursively(false); GameOverWindow.SetActiveRecursively(true); /* (fb.color == Color.red) * fbpost.SetActiveRecursively(false);*/ deathLbl.text = "You died: @ time(s)!"; timeLbl.text = "Your max time: @"; deathLbl.text = deathLbl.text.Replace("@", deaths.ToString()); timeLbl.text = timeLbl.text.Replace("@", minutes + " minutes " + seconds + " seconds"); TutorialWindow.SetActiveRecursively(false); }