public override void MVCEnd(object obj) { base.MVCEnd(obj); mVCHelper.Unsubscribe(UIEvents.dataChanged, OnDataChanged); mVCHelper.Unsubscribe(UIEvents.backout, Backout); Pauser.UnpauseGame(); }
// Use this for initialization void Awake() { pauser = FindObjectOfType <Pauser>(); playTween = playButton.transform.parent.GetComponent <TweenHeight>(); UIEventListener.Get(playButton).onClick = OnPauseClick; UIEventListener.Get(quitButton).onClick = OnQuitClick; }
void Move() { if (Pauser.IsPaused()) { return; } HandleSnakeBodies(); CreateSnakeBody(); if (direction == Direction.Up) { transform.position += new Vector3(0, moveSpeed, 0); } else if (direction == Direction.Down) { transform.position += new Vector3(0, -moveSpeed, 0); } else if (direction == Direction.Right) { transform.position += new Vector3(moveSpeed, 0, 0); } else if (direction == Direction.Left) { transform.position += new Vector3(-moveSpeed, 0, 0); } lastMove = direction; Debug.Log("Player moved to " + transform.position); }
public void TakeScreenshot() { if (!LiveStreamRunning && !Program.XBox.Ping()) { new Settings().ShowDialog(); } DateTime now = DateTime.Now; listImages.Items.Add(new ListViewItem(now.ToString() + " " + now.Second.ToString() + "." + now.Millisecond.ToString(), imageList.Images.Count, listImages.Groups[0])); Pauser.Reset(); if (LiveStreamRunning) { Waiter.WaitOne(); } Image screenshot = Program.XBox.Screenshot(); Pauser.Set(); Images.Add(screenshot); imageList.Images.Add(screenshot); if (!checkLiveStream.Checked) { listImages.SelectedItems.Clear(); listImages.SelectedIndices.Clear(); listImages.Items[listImages.Items.Count - 1].Selected = true; } cmdSaveChecked.Enabled = true; cmdSaveSelected.Enabled = true; }
// Update is called once per frame void Update() { if (Pauser.IsPaused() && !Pauser.IsFirstPaused()) { return; } // Only handles input if (Input.GetKey("w") && lastMove != Direction.Down) { direction = Direction.Up; transform.eulerAngles = new Vector3(0, 0, 0); } else if (Input.GetKey("a") && lastMove != Direction.Right) { direction = Direction.Left; transform.eulerAngles = new Vector3(0, 0, 90); } else if (Input.GetKey("s") && lastMove != Direction.Up) { direction = Direction.Down; transform.eulerAngles = new Vector3(0, 0, 180); } else if (Input.GetKey("d") && lastMove != Direction.Left) { direction = Direction.Right; transform.eulerAngles = new Vector3(0, 0, 270); } }
// Use this for initialization void Start() { //unchanged starter pack of ammo (will be changed with setting screen) ammonum = 0; //set up for needed objects and scripts ableToShoot = true; world = GameObject.FindGameObjectWithTag("World").GetComponent("World") as World; mt = GameObject.FindGameObjectWithTag("World").GetComponent("ModifyTerrain") as ModifyTerrain; if (gameObject.tag == "BSpawnP1") { player = GameObject.FindGameObjectWithTag("Player1"); camera = GameObject.FindGameObjectWithTag("Player1Camera"); } if (gameObject.tag == "BSpawnP2") { player = GameObject.FindGameObjectWithTag("Player2"); camera = GameObject.FindGameObjectWithTag("Player2Camera"); } p1 = GameObject.FindGameObjectWithTag("P1Hit").GetComponent("PlayerController") as PlayerController; p2 = GameObject.FindGameObjectWithTag("P2Hit").GetComponent("PlayerController") as PlayerController; pause = GameObject.FindGameObjectWithTag("Pauser").GetComponent("Pauser") as Pauser; bullet = pause.sBullet; rocket = pause.sRocket; shotgun = pause.sShotgun; crocket = pause.sCRocket; cshotgun = pause.sCShotgun; missile = pause.sAirstrike; cmissile = pause.sCAirstrike; }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Submit")) { if (!isPause) { Pauser.Pause(); FadeManager.Instance.Pause(); isPause = true; isFreeze = true; } else { Pauser.Resume(); FadeManager.Instance.Resume(); isPause = false; isFreeze = false; } } if (!onceFlag) { StartCoroutine(Starting()); onceFlag = true; } if (isClear) { StartCoroutine(Clearing()); } }
// Update is called once per frame void Update() { if (GameManager.Instance.m_PlayMode != PlayMode.NoPlay) { if (Input.GetButtonDown("Pause")) { bool isPause = Pauser.s_TargetByTag[PauseTag.Pause].m_IsPause; if (!isPause) { Pauser.Pause(); GameManager.Instance.m_GameStarter.AddScene("Pause"); } // else // { //Pauser.Resume(); //GameManager.Instance.m_GameStarter.RemoveScene("Pause"); // } } } if (Input.GetKeyDown(KeyCode.L)) { bool isPause = Pauser.s_TargetByTag[PauseTag.Enemy].m_IsPause; if (!isPause) { Pauser.Pause(PauseTag.Enemy); } else { Pauser.Resume(PauseTag.Enemy); } } }
public void Command(Dictionary <string, string> command) { if (command ["command"] == "resume") { Pauser.Resume(command ["name"]); } }
/// <summary> /// ポーズ処理 /// </summary> private void Pause() { // ポーズするキーが押されたらポーズ if (Input.GetKeyDown(KeyCode.Escape)) //if (Input.GetKeyDown(KeyCode.Joystick1Button7)) { // ポーズしてなければポーズする if (!isPause) { // ポーズ中にする isPause = true; // ウィジェットを有効にする InitializeWidgetEnable(true); // 現在のメニューインデックスを初期化 currentMenuIndex = 0; // メニューウィジェットの初期化 InitializePauseMenuWidgetByCurrentIndex(); // ポーズ直前のタイムスケールを保存 prevTimeScale = Time.timeScale; // タイムスケールを0にする // // ここでタイムスケールの影響を受けるゲームオブジェクトは停止する //Time.timeScale = 0; // ポーズ Pauser.Pause(); } } }
/// <summary> /// トリガー検知 /// </summary> public void OnTriggerEnter(Collider col) { // タグ別に処理 string tag = col.transform.tag; switch (tag) { // プレイヤー case "Player": if (-1 == m_iCurrentSpeachIndex) { // 現在のセリフのインデックスを最初に合わせる m_iCurrentSpeachIndex = 0; col.GetComponent <AnimatorController>().AnimationChange(0); Pauser.Pause(); } break; } }
void Start() { pauser = GameObject.Find("LevelManager").GetComponent <Pauser>(); // Setting initial slot position. I'm doing an 8x5 grid, so we're going with these numbers Vector2 slotPosition = new Vector2(-350f, 200f); database = new ItemDatabase(); slotAmount = 40; inventoryPanel = GameObject.Find("InventoryPanel"); creditDisplay = GameObject.Find("CreditDisplay"); slotPanel = inventoryPanel.transform.FindChild("SlotPanel").gameObject; for (int i = 0; i < slotAmount; i++) { playerItems.Add(new Item()); playerSlots.Add(Instantiate(inventorySlot)); playerSlots[i].GetComponent <Slot>().id = i; playerSlots[i].transform.SetParent(slotPanel.transform, false); playerSlots[i].transform.localPosition = slotPosition; // If it's zero or not the 8th slot, move right. Otherwise, move down. if (i == 0 || (i + 1) % 8 != 0) { slotPosition = new Vector2(slotPosition.x + 100f, slotPosition.y); } else { slotPosition = new Vector2(-350f, slotPosition.y - 100f); } } LoadInventory(); creditDisplay.GetComponent <Text>().text = credits.ToString(); }
private void ToGo() { isPause = true; Pauser.Pause(); Vector3 targetEulerAngles = new Vector3(90.0f, 0.0f, 0.0f); if (tabletMoveState == TabletMoveState.before && Application.loadedLevelName != Scenes.EndScene.name) { tabletPC = Instantiate(tabletPCPrefab, tabletTransform.position, tabletTransform.rotation) as GameObject; tabletPC.transform.parent = tabletTransform; StartCoroutine(TabletMovement(tabletPCAxis, targetEulerAngles, true)); player.ShowMiniMap(false); ExamineIconManager.SetVisible(false); } if (tabletMoveState == TabletMoveState.after) { pauseState = PauseState.Run; tabletMoveState = TabletMoveState.before; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; } }
private void ShowPause() { if (Input.GetKeyDown(KeyCode.LeftControl)) { Pauser.Pause(); } }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Start")) { topMenu.GetComponent <SelectionController>().StartSelection(); Pauser.PauseGame(); } }
void Awake() { metaGame = GameObject.Find("MetaGame"); pauserScript = metaGame.GetComponent <Pauser>(); //mainMenu = GameObject.Find ("MainMenu"); //mainMenuScript = mainMenu.GetComponent<MenuScript>(); }
public void EndMessage() { VoiceStop(); //currentLine = 0; msgWindowInfo = currentTextName + "_End"; Pauser.Resume(); SetActive(false); }
public override void MVCSetup(object obj) { base.MVCSetup(obj); curLevelOfAdvancement = 0; mVCHelper.Subscribe(UIEvents.dataChanged, OnDataChanged); mVCHelper.Subscribe(UIEvents.backout, Backout); Pauser.PauseGame(); }
/// <summary> /// <see cref="TimeReferee"/>'s constructor. /// </summary> /// <param name="pause">How to pause the game whenever a player scores.</param> /// <param name="end">How to end the game.</param> /// <param name="subscribe">How to subscribe to the match scoring.</param> /// <param name="duration">The desired duration of the match in seconds.</param> /// <param name="onUpdate">Callback to be invoked every time the timer ticks.</param> public TimeReferee(Pauser pause, Action end, Action <Scorer> subscribe, uint duration, Action <uint> onUpdate) : base(pause, end, subscribe) { _tokenSource = new CancellationTokenSource(); _running = true; _onUpdate = onUpdate; _duration = duration; }
public override void MVCSetup(object obj) { Pauser.PauseGame(); base.MVCSetup(obj); selectionInfo = obj; mVCHelper.Subscribe(UIEvents.backout, BackoutOrExit); mVCHelper.Subscribe(UIEvents.execute, Select); }
IEnumerator Coroutine() { Time.timeScale = 0.3f; yield return(new WaitForSeconds(1)); Time.timeScale = 1; Pauser.SaveMaterials(); Application.LoadLevel("P" + playerNumber + "_FinishScreen"); }
void Awake() { getScore = GameObject.Find ("guiSetup").GetComponent<guiSetup> (); pauser = GameObject.Find ("Pauser").GetComponent<Pauser> (); score1 = PlayerPrefs.GetInt ("Score1"); score2 = PlayerPrefs.GetInt ("Score2"); score3 = PlayerPrefs.GetInt ("Score3"); score4 = PlayerPrefs.GetInt ("Score4"); }
// Update is called once per frame void Update() { if (Pauser.IsPause()) { return; } transform.position = new Vector3(transform.position.x, Mathf.Sin(Time.timeSinceLevelLoad * speed) * length, transform.position.z); }
// Use this for initialization void Start() { canFire = true; dropspot = transform.position; firstDrop = dropspot; p1 = GameObject.FindGameObjectWithTag("Player1"); p2 = GameObject.FindGameObjectWithTag("Player2"); pause = GameObject.FindGameObjectWithTag("Pauser").GetComponent("Pauser") as Pauser; }
void Awake() { if (INSTANCE != null && INSTANCE != this) { Destroy(gameObject); } INSTANCE = this; }
// Use this for initialization void Start() { if (m_isAwake) { Run(); } Pauser.Pause(); }
void OnLevelWasLoaded(int level) { Pauser.SceneChangeInitialize(); if (Application.loadedLevelName == Scenes.Menu.name || !player.ContainsItem(Items.Tablet) || AdvancedWriteMessageSingleton.instance.isWrite) { return; } Initialize(); }
IEnumerator Coroutine() { PlayerIcon.StopWebcam(); Time.timeScale = 0.6f; yield return(new WaitForSeconds(3)); Time.timeScale = 1; Pauser.SaveMaterials(); Application.LoadLevel("DrawFinishScreen"); }
IEnumerator Coroutine() { //PlayerIcon.StopWebcam(); Time.timeScale = 0.6f; yield return(new WaitForSeconds(3)); Time.timeScale = 1; Pauser.SaveMaterials(); UnityEngine.SceneManagement.SceneManager.LoadScene("P" + playerNumber + "_FinishScreen"); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
//共通演出等を実行し、各演出を管理するコルーチン protected IEnumerator PerformManagement() { GameManager gm = GameManager.Instance; //フェード var async = gm.m_GameStarter.AddScene("FadeScene"); while (async.isDone != false) { yield return(null); } //シーンのオブジェクトの作成を待つ(2フレ) yield return(null); yield return(null); //フェードイン bool fadeEnd = false; FadeSceneManager fadeMane = GameObject.Find("FadeSceneManager").GetComponent <FadeSceneManager>(); fadeMane.EndEvent.AddListener(() => { fadeEnd = true; }); fadeMane.FadeIn(); while (!fadeEnd) { yield return(null); } /*暗転状態で行いたい処理*/ //各オブジェクトの配置を初期化 if (!CommonRedy()) { yield break; } Redy(); m_PerformAnim.clip.SampleAnimation(m_ParformAnimRootObj, 0.0f); GameManager.Instance.m_PlayCamera.SetActive(false); m_Camera.gameObject.SetActive(true); Pauser.Resume(); yield return(null); //フェードアウト fadeEnd = false; fadeMane.FadeOut(); while (!fadeEnd) { yield return(null); } //演出スタート yield return(StartCoroutine(PlayerParform())); //後処理 EndPerform(); }
void Awake() { pauser = GameObject.Find("Pauser").GetComponent<Pauser>(); mancy = GameObject.Find("Mancy").GetComponent<Mancy>(); //collider2D.enabled = false; }
private BallControl playerControl; // Reference to the player control script. #endregion Fields #region Methods void Awake() { pauser = GameObject.Find("Pauser").GetComponent<Pauser>(); gameOver = GameObject.Find ("GM").GetComponent<GameOver> (); }
void Awake() { instance = this; camCS = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraFollow>(); playerT = GameObject.FindGameObjectWithTag("Player").transform; playerCS = playerT.GetComponent<PlayerControl>(); nurse = GameObject.Find ("Nurse").gameObject; nursePointer = GameObject.Find ("nurse_UIpointer").gameObject; nursePointerHead = GameObject.Find ("nurse_PointerHead").gameObject; deathPanel = GameObject.Find ("DeathPanel").gameObject; winPanel = GameObject.Find ("WinPanel").gameObject; optionsPanel = GameObject.Find ("OptionsPanel").gameObject; pauser = transform.Find ("Pauser").GetComponent<Pauser>(); //nursePointer.transform.parent = null; //nursePointer.GetComponent<OffscreenIndicator>().goToTrack = nurse; nursePointer.SetActive(false); nursePointerHead.SetActive(false); deathPanel.SetActive(false); winPanel.SetActive(false); optionsPanel.SetActive(false); }
void Awake() { //to create a singleton class if(gm == null) gm = GameObject.FindGameObjectWithTag ("GameController").GetComponent<GameMaster> (); pauser = gameObject.GetComponent<Pauser> (); cam = Camera.main; soundLevel = PlayerPrefs.GetFloat ("SoundLevel"); //getting sound level from player preference controlType = PlayerPrefs.GetString ("ControlType"); //getting control type from player preference Screen.sleepTimeout = SleepTimeout.NeverSleep; //stop screen from timing out HighScore.getHighScore (); //getting highScore into HighScore PlayGamesPlatform.Activate(); screenManager = gameObject.GetComponent<ScreenManager>(); }