public void PauseEvent(bool com) { if (com != paused) { paused = com; pauseCD = 1f; if (paused) { if (SCR_main.hCursor) { Cursor.visible = true; } pauseCover = SCR_gui.CreateScreenCover(2); SCR_gui.CreateIcon("Paused", Vector3.zero); optionPos = new Vector2(0.5f, 0.55f); SCR_gui.CreateOption("PausedResume", optionPos); optionPos += SCR_gui.optionSpacing; SCR_gui.CreateOption("ChangeSoundFX", optionPos); optionPos += SCR_gui.optionSpacing; if (SCR_main.hMusic) { SCR_gui.CreateOption("ChangeMusic", optionPos); optionPos += SCR_gui.optionSpacing; } SCR_gui.CreateOption("PausedExit", optionPos); Time.timeScale = 0f; } else { if (SCR_main.hCursor) { Cursor.visible = false; } if (pauseCover) { pauseCover.FadeOut(); } SCR_gui.RemoveIcon("Paused"); SCR_input.OptionCycle(3); Time.timeScale = 1f; } } }
void UpdateFlash() { flashCounter += SCR_main.counterMult; if (flashCounter >= 0.2f) { flashCounter = 0f; flashOn = !flashOn; DisplayFlash(); if (flashOn == false) { flashTotal--; if (flashTotal == 0) { if (destroyAll) { SCR_main.OptionAction(actionID); SCR_input.OptionCycle(2); SCR_input.OptionCycle(3); } else { SCR_input.OptionCycle(4); SCR_main main = GameObject.Find("MAIN").GetComponent <SCR_main>(); if (switchSoundFX) { main.AlterSetting(0); } else { if (switchMusic) { main.AlterSetting(1); } } SetSwitchText(); } } } } }
//////////////////// //OPTION ACTIONS //////////////////// public int Highlight(int com, Vector2 mPoint) { int action = 0; if (isActive) { bool mouseOver = false; if (mPoint.x > hitBox.xMin && mPoint.x < hitBox.xMax && mPoint.y > hitBox.yMin && mPoint.y < hitBox.yMax) { mouseOver = true; } if (com == 0) { /* * if(actionID==1){ * print ( "HitBox: "+hitBox.xMin+", "+hitBox.yMin+", "+hitBox.xMax+", "+hitBox.yMax+ * "Mouse: "+mPoint.x+", "+mPoint.y ); * } */ if (mouseOver) { if (highlighted == false) { HighlightEvent(true); action = 1; } } else { if (highlighted) { HighlightEvent(false); } } } if (com == 1) { if (mouseOver) { SCR_input.OptionCycle(2); Selected(); if (destroyAll) { action = 2; } else { action = 3; } } } } return(action); }