public SurvivalGameplayScene() : base("survival-gameplay") { StatusDisplay = new SurvivalDataDisplay(); _readyPopup = new PopupRequiringDismissal() { ID = "get-ready-popup" }; _pauseButton = new PauseButton(); _pauseDialog = new PauseDialog(); _noLivesDialog = new NoLivesDialog(); _tutorialDialog = new TutorialDialog(); _tutorialRunner = new TutorialRunner(); _rankingCoordinator = new SurvivalRankingCoordinator(CloseCurrentLevel, RegisterGameObject); _pauseDialog.InputSources.Add(_inputProcessor); _pauseDialog.ExitCallback = HandleDialogClose; _noLivesDialog.InputSources.Add(_inputProcessor); _noLivesDialog.ExitCallback = HandleDialogClose; _tutorialDialog.InputSources.Add(_inputProcessor); _tutorialDialog.ExitCallback = HandleDialogClose; _playerEventPopup.AnimationCompletionHandler = HandlePlayerEventAnimationComplete; }
void OnTriggerEnter(Collider other) { if ((other.tag == "Player") && (mCancelledObject)) { AudioManager manager = FindObjectOfType(typeof(AudioManager)) as AudioManager; PlayerMovement player = FindObjectOfType(typeof(PlayerMovement)) as PlayerMovement; PauseButton pauseButton = FindObjectOfType(typeof(PauseButton)) as PauseButton; if (manager) { manager.audio.Stop(); } mCancelledObject.mDisplayedMessageAlready = true; if (mCancelledObject.mPlayOnce) { Assets.CustomeScripts.InformationManager.UpdateTextBoxSummonerState(mCancelledObject.mTextBoxId); } if (mCancelledObject.mZoom) { Camera.main.GetComponent <TopDownCamera>().ZoomOut(); mCancelledObject.mZoom = false; mCancelledObject.GetComponent <ZoomArea>().enabled = false; } if (player) { player.gameObject.GetComponent <Stunable>().IsStunned = false; player.mShowGUI = true; } if (pauseButton) { pauseButton.mShowGUI = true; } } }
private void Pause_Item_Click(object sender, RoutedEventArgs e) { if (Common.transMode == 1) { if (Common.textHooker.Pause) { PauseButton.SetValue(FontAwesome.WPF.Awesome.ContentProperty, FontAwesomeIcon.Pause); } else { PauseButton.SetValue(FontAwesome.WPF.Awesome.ContentProperty, FontAwesomeIcon.Play); } Common.textHooker.Pause = !Common.textHooker.Pause; } else { if (IsPauseFlag) { PauseButton.SetValue(FontAwesome.WPF.Awesome.ContentProperty, FontAwesomeIcon.Play); } else { PauseButton.SetValue(FontAwesome.WPF.Awesome.ContentProperty, FontAwesomeIcon.Pause); } IsPauseFlag = !IsPauseFlag; } }
// handled by UI button (rename to OnPauseButtonPressed!) public void OnPauseButtonPressed() { Pause(); PauseMenu.SetActive(true); PauseButton.SetActive(false); SoundButton.SetActive(true); }
public void FixedUpdate() { if (PlayerController.isDead) { PauseButton.SetActive(false); } }
public void RestartScript() { SpideyScript = GameObject.Find("Spidey").GetComponent <SomeStuff>(); DbScript = GameObject.Find("Main Camera").GetComponent <DataBase>(); PauseScript = GameObject.Find("Pause Button").GetComponent <PauseButton>(); Player.transform.position = SpideyScript.StartPos; GameObject[] PumpkinDestroy; PumpkinDestroy = GameObject.FindGameObjectsWithTag("Block"); for (int i = 0; i < PumpkinDestroy.Length; i++) { Destroy(PumpkinDestroy[i]); } DbScript.PumpkinDistanceses(); DbScript.PlayerMoveUp = true; PauseScript.IsGamePaused = false; Invoke("CountDownClose", 6f); if (gameObject.name == "Restart Button II") { SoundScriptt = GameObject.Find("Sound Button").GetComponent <SoundScript>(); SpideyScript.anim.speed = 1f; PauseScript.IsGamePaused = false; SpideyScript.Score = 0; } }
public void Resume() { PauseWindow.SetActive(false); PauseButton.SetActive(true); MenuUI.SetActive(true); Time.timeScale = 1; }
public void Pause() { Pausemenu.SetActive(true); //pause menu will be shown PauseButton.SetActive(false); Time.timeScale = 0; // so that when you press pause butoon // everything in your game will stop }
public void Pause() { ButtonClickSound.playSound(); Pausemenu.SetActive(true); PauseButton.SetActive(false); Time.timeScale = 0; }
/// <summary> /// Sets the grid size and add buttons and labels on it. /// </summary> void InitBoard() { ColumnDefinition firstColumn = new ColumnDefinition();//pierwsza kolumna, w której znajdują się przyciski firstColumn.Width = new GridLength(90); Board.ColumnDefinitions.Add(firstColumn); for (int i = 0; i <= Board.Width / SIZE; i++)//ustala szerokość kolumn { ColumnDefinition column = new ColumnDefinition(); column.Width = new GridLength(SIZE); Board.ColumnDefinitions.Add(column); } for (int i = 0; i <= Board.Height / SIZE; i++)//ustala wysokość rzędów { RowDefinition row = new RowDefinition(); row.Height = new GridLength(SIZE); Board.RowDefinitions.Add(row); } InitPointLabel(); _ResetButton = new ResetButton(this, 0, 6); _SettingsButton = new SettingsButton(this, 0, 3); _StartButton = new StartButton(this, 0, 1); _LiveHandler = new LiveHandler(this, 0, 5); _PauseButton = new PauseButton(this, 0, 7); }
void ReleaseDesignerOutlets() { if (PauseButton != null) { PauseButton.Dispose(); PauseButton = null; } if (PlayButton != null) { PlayButton.Dispose(); PlayButton = null; } if (StopButton != null) { StopButton.Dispose(); StopButton = null; } if (TempoField != null) { TempoField.Dispose(); TempoField = null; } if (LayerCollection != null) { LayerCollection.Dispose(); LayerCollection = null; } }
void ReleaseDesignerOutlets() { if (PauseButton != null) { PauseButton.Dispose(); PauseButton = null; } if (ResetButton != null) { ResetButton.Dispose(); ResetButton = null; } if (StartButton != null) { StartButton.Dispose(); StartButton = null; } if (Surface != null) { Surface.Dispose(); Surface = null; } }
void ReleaseDesignerOutlets() { if (_viewForTowers != null) { _viewForTowers.Dispose(); _viewForTowers = null; } if (PauseButton != null) { PauseButton.Dispose(); PauseButton = null; } if (StartButton != null) { StartButton.Dispose(); StartButton = null; } if (StopButton != null) { StopButton.Dispose(); StopButton = null; } }
//This method hides the main panel and reveals and makes ready the panel for //each user by assigning values to all of the labels and buttons public void UserButtonClicked(int id) { MainPanel.SetActive(false); UserPanel.SetActive(true); Debug.Log("Button clicked = " + id); if (id == 0) { UserTitleText.text = "All Players"; } else { UserTitleText.text = id.ToString(); } VideoTransmitter video_transmitter = new VideoTransmitter(); Button temp_launch_button = LaunchButton.GetComponent <Button>(); temp_launch_button.onClick.AddListener(() => LaunchButtonClicked(id)); Button temp_play_button = PlayButton.GetComponent <Button>(); temp_play_button.onClick.AddListener(() => video_transmitter.Play(id)); Button temp_pause_button = PauseButton.GetComponent <Button>(); temp_pause_button.onClick.AddListener(() => video_transmitter.Pause(id)); }
// handled by UI button (rename to OnResumeButtonPressed!) public void OnResume() { Resume(); PauseMenu.SetActive(false); PauseButton.SetActive(true); SoundButton.SetActive(false); }
void Awake() { if (Instance == null) { Instance = this; } }
void Awake() { if (sharedInstance == null) { sharedInstance = this; } }
void Start() { stopped = false; paused = false; Tut = GameObject.Find("Tutorial Controller"); DontDestroyOnLoad(this.gameObject); level = 1; //UI = FindObjectOfType<Canvas>(); UI = GameObject.Find("ControlsOverlay"); power = "neutral"; joystick = FindObjectOfType <Joystick>(); joybutton = FindObjectOfType <JoyButton>(); pausebutton = FindObjectOfType <PauseButton>(); buttonOn = false; buttonDown = false; hasKey = false; animator.SetBool("Neutral", true); rigidbody = GetComponent <Rigidbody2D>(); controlsActive = true; for (int i = 0; i < Health; ++i) { Hearts[i].GetComponent <Image>().enabled = true; } buttonTimer = 0.0f; startTimer = false; setToSpawn(); }
void Update() { if (Input.GetKeyUp(KeyCode.Escape)) { PauseButton.SendMessage("OnClick"); } if (Game.Instance.TimerActive == true && Game.Instance.IsGameActive()) { touchingDown = Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Began; clickingDown = Input.GetMouseButtonDown(0); touchingUp = Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Ended; clickingUp = Input.GetMouseButtonUp(0); if (touchingDown || clickingDown) { if (tutorial.activeSelf == true && Time.timeSinceLevelLoad > 1) { tutorial.SetActive(false); } GetFirstTouch(touchingDown); } else if ((touchingUp || clickingUp) && canShoot) { GetSecondTouch(touchingUp); } } else // timer is pausing { canShoot = false; } }
private void Awake() { if (instance == null) { instance = this; } }
//Sets pauseMenu to false which hides it from the screen //Shows the pause button //Plays music //Runs game from current position public void Resume() { Pausemenu.SetActive(false); PauseButton.SetActive(true); AudioListener.pause = !AudioListener.pause; Time.timeScale = 1; }
public void Won() { PauseButton.SetActive(false); gameover = true; ShowMenu(-1); Invoke("ShowWonScreen", 2); }
public void ResumeGame() { ResumeButton.SetActive(false); PauseButton.SetActive(true); Time.timeScale = 1; Fader.color = new Color(Fader.color.r, Fader.color.g, Fader.color.b, 0); }
public void PauseGame() { PauseButton.SetActive(false); ResumeButton.SetActive(true); Time.timeScale = 0; Fader.color = new Color(Fader.color.r, Fader.color.g, Fader.color.b, 0.5f); }
void Update() { timer -= Time.deltaTime; Text time_text = TimerText.GetComponent <Text>(); if (HpCurrent <= 0) { cancelSpawn.CancelInvoke(); status_text.text = "YOU DIED!"; GameOverText.SetActive(true); PauseButton.SetActive(false); } else if (timer >= 0.0f) { time_text.text = timer.ToString("F1") + "'s"; } else { cancelSpawn.CancelInvoke(); time_text.text = "0.0's"; status_text.text = "TIME OUT!"; GameOverText.SetActive(true); PauseButton.SetActive(false); } }
void Update() { if (timer > 0) { timer -= Time.deltaTime; } if (Input.GetKeyDown(KeyCode.Mouse1) && timer <= 0) { if (weaponName == "knife") { MeleeAttack(knifeDamage, knifeRange); } else if (weaponName == "spear") { MeleeAttack(spearDamage, spearRange); } else if (weaponName == "javelin") { ThrowJavelin(javelinDamage, javelinForce); } timer = 0.5f; } if (Input.GetKeyDown(KeyCode.I)) { inventory.gameObject.SetActive(!inventory.gameObject.activeInHierarchy); craftingPanel.SetActive(!craftingPanel.gameObject.activeInHierarchy); PauseButton.GetInstance().SwitchPause(); } Collider[] overlaps = Physics.OverlapSphere(transform.position, 0.15f); for (int i = 0; i < overlaps.Length; i++) { if (overlaps[i].tag == "KelpBank") { isOverKelp = true; break; } if (i == overlaps.Length - 1) { isOverKelp = false; break; } } if (isOverKelp && HasRaft()) { speed = raftSpeed / 2; } else if (isOverKelp && !HasRaft()) { speed = originalSpeed / 2; } else if (!isOverKelp) { SetSpeeds(); } }
private void Awake() { if (instance != null) { return; } instance = this; }
public void Pause() { Pausemenu.SetActive(true); // so when pause menu is active // pause button will not be shown PauseButton.SetActive(false); Time.timeScale = 0; // when you click pause button // everything in your game will stop }
// Use this for initialization void Awake() { pauseButton = this.GetComponentInChildren <PauseButton>(); pauseMenuButtons = new List <PauseMenuButton>(this.GetComponentsInChildren <PauseMenuButton>()); pauseMenuButtons.ForEach(pauseMenuButton => pauseMenuButton.AddEventListener(this.gameObject)); pauseButton.AddEventListener(this.gameObject); menuContainer = this.transform.Find("MenuContainer"); }
public void Resume() { Panel.SetActive(false); PauseButton.SetActive(true); overCanvas.SetActive(true); buttonCanvas.SetActive(true); Time.timeScale = 1; }
void Start() { sizeX = Screen.width/12; sizeY = Screen.height; m = GetComponent<Music>(); pb = GetComponent<PauseButton>(); sb = GetComponent<SaveButton>(); m.sizeX = pb.sizeX = sb.sizeX = sizeX; m.sizeY = pb.sizeY = sb.sizeY = sizeY/5; m.offsetX = pb.offsetX = sb.offsetX = 10; sb.offsetY = 10 + sizeY/5; pb.offsetY = 20 + sizeY/5*2; m.offsetY = 30 + sizeY/5*3; }
void Awake() { platformsList = new List<FloatingPlatform>(); IEnumerable childPlatforms = GetComponentsInChildren<FloatingPlatform>(); gameManager = GameManagerScript.Instance(); foreach (FloatingPlatform platform in childPlatforms) { platformsList.Add(platform); platform.acceleration = acceleration; } pauseButton = GameObject.FindObjectOfType<PauseButton>(); Assert.IsTrue(gameManager); }
public void Start() { UnityAudio = UnityAudio.Find(); StopGame = false; RunningTutorial = true; PauseMenu = (new Nothing<PauseMenu>()); PauseButton = new PauseButton(); Fox = new Animal("Fox","fox_walking",4,"fox_singing",15,new UnityEngine.Vector3(-0.4f,-7.9f,-0.7f),new UnityEngine.Vector3(-0.4f,-7.9f,-0.7f),new UnityEngine.Vector3(-0.4f,-7.9f,-0.7f)); Foreground = UnityBackground.Find("GroundMid",0f); CurrentTrack = (new Nothing<Track.Item>()); CurrentCheckpoint = (new Nothing<UnityEngine.Transform>()); Button = new Button(); Bird = new Animal("Bird","bird_flying",4,"bird_singing",12,new UnityEngine.Vector3(3f,-7.9f,2f),new UnityEngine.Vector3(-3f,-7.9f,2f),new UnityEngine.Vector3(3f,-7.9f,2f)); Background = UnityBackground.Find("GroundBack",0f); AnimationEnd = false; }
// Use this for initialization void Start() { pb = GameObject.Find ("PauseButton").GetComponent<PauseButton>(); }
void Start() { pause = GameObject.FindGameObjectWithTag("PauseButton").GetComponent<PauseButton>(); }
void Start() { pause = GameObject.FindGameObjectWithTag("PauseButton").GetComponent<PauseButton>(); recognizer = GameObject.FindGameObjectWithTag("Recognizer").GetComponent<TapDetector>(); pause.renderer.enabled = false; menuPointer.renderer.enabled = false; //Save previous timeScale if(PlayerPrefs.HasKey("timeScale")) { savedTimeScale = PlayerPrefs.GetFloat("timeScale"); } }
void Start() { blinkTime = 0.0f; buttonTimer = 20.0f; buttonTimerLimit = 20.0f; canUsePowerUp = true; rCollision = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerCollision>(); runner = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerScript>(); pause = GameObject.FindGameObjectWithTag("PauseButton").GetComponent<PauseButton>(); typeIsSet = false; onStart = true; type = tag; collider.enabled = false; renderer.enabled = false; }