void OnEnable () { reloading = false; GameObject ob = GameObject.Find ("PauseHandler"); if(ob != null) pause = ob.GetComponent<Pause> (); }
void OnLevelWasLoaded(int l) { if (respawned) { lives--; Respawn(); } GameObject ob = GameObject.Find ("PauseHandler"); if(ob != null) pause = ob.GetComponent<Pause> (); if (l == 0) Destroy(gameObject); if (l == 3) { transform.position = new Vector2(19.88f ,-65.53f); } if (l == 2) { transform.position = new Vector2(18.44f, -9.5f); } if (l == 4) { transform.position = new Vector2(20.3f, -53.9f); } }
// 初期化 void Start() { pause = GameObject.Find("Pause"); pauseScript = pause.GetComponent<Pause>(); _renderer = GetComponent<Renderer>(); offset = _renderer.sharedMaterial.mainTextureOffset; }
// Use this for initialization void Start() { pause = transform.parent.transform.parent.gameObject.GetComponent<Pause>(); resume = GameObject.Find("Resume").gameObject; reset = GameObject.Find("Reset").gameObject; menu = GameObject.Find("Main Menu").gameObject; }
// Use this for initialization void Start () { blockState = FindObjectOfType<BlockState>(); pauseScript = FindObjectOfType<Pause>(); anim = GetComponent<Animator>(); cam = FindObjectOfType<CameraShake>(); }
void Start () { UiRoot = GameObject.Find("Canvas"); DontDestroyOnLoad(UiRoot); pauseScript = FindObjectOfType<Pause>(); textbox = GameObject.FindGameObjectWithTag("Textbox"); ActiveMenu = defaultMenu; }
// Use this for initialization void Start () { UI = GameObject.FindGameObjectWithTag("GameManager").GetComponent<UIManager>(); pauseScript = FindObjectOfType<Pause>(); inventory = gameObject.GetComponent<Inventory>(); fire1 = 0; fire2 = 0; }
// Use this for initialization void Start() { pauseScript = FindObjectOfType<Pause>(); textbox = GameObject.FindGameObjectWithTag("Textbox"); player = GameObject.FindGameObjectWithTag("Player"); col = GetComponent<CircleCollider2D>(); cam = FindObjectOfType<CameraController>(); }
// 初期化 void Start() { pause = GameObject.Find("Pause"); pauseScript = pause.GetComponent<Pause>(); renderer = GetComponentInChildren<Renderer>(); //renderer.enabled = false; trapFlag = false; gimmickFlag = false; // ギミックを非有効に gimmickCount = 0; // startActionTurn = 1; }
public void displayInstructions() { display = true; GameObject gui = GameObject.FindGameObjectWithTag ("Gui"); pause = gui.GetComponent<Pause> (); //stop them going into pause mode cause it could get screwy otherwise pause.enabled = false; //stop the time-step, otherwise enemies will move Time.timeScale = 0; }
void Awake() { pause = pauseButton.GetComponent<Pause>(); createPlatform = gameObject.GetComponent<CreatePlatform>(); left = Left.transform.rotation; right = Right.transform.rotation; towards = Towards.transform.rotation; animator = GetComponent<Animator>(); }
// 初期化 void Start() { pause = GameObject.Find("Pause"); pauseScript = pause.GetComponent<Pause>(); gimmickFlag = false; // ギミックが有効か判断するフラグに偽を保存 startActionTurn = 4; // ギミックを動かし始めるターン数を1に gimmickCount = 0; // ギミックが有効になってからのターン数を0に growCount = 0; // 初期の成長段階 movePossibleFlag = true; // 移動可能フラグを真に moveCount = 0; }
// 初期化 void Start() { pause = GameObject.Find("Pause"); pauseScript = pause.GetComponent<Pause>(); renderer = GetComponentInChildren<Renderer>(); gimmickFlag = true; //ギミックが有効かどうか startActionTurn = 0; //ギミックが動き出すターン数 gimmickCount = 0; //ギミックが動いた回数 gimmickActionCount = 0; // ギミックに触れてからのターン数を0で初期化 gimmickDrawFlag = true; // ギミックを表示するかのフラグを真に moveCount = 0; }
void Awake() { instance = this; foreach (Transform t in transform) t.gameObject.SetActive(false); buttons = new List<Text>(); buttonAnimation = new List<PauseScale>(); buttons.Add(transform.FindChild("Resume").GetComponent<Text>()); buttons.Add(transform.FindChild("MainMenu").GetComponent<Text>()); buttons.Add(transform.FindChild("Quit").GetComponent<Text>()); for (int i = 0; i < buttons.Count; i++) { buttonAnimation.Add(buttons[i].GetComponent<PauseScale>()); } playerDisplay = transform.FindChild("PlayerDisplay").GetComponent<Text>(); }
public SpawnDrop spawnDrop; //where player starts the game #endregion Fields #region Methods void Awake() { jgs = GameObject.FindGameObjectWithTag(TagsAndLayers.gameController).GetComponent<JumpGameState>(); musicController = GameObject.FindGameObjectWithTag(TagsAndLayers.musicController).GetComponent<MusicController>(); gameTimer = GameObject.FindGameObjectWithTag(TagsAndLayers.gameTimer).GetComponent<GameTimer>(); deathArea = GameObject.FindGameObjectWithTag(TagsAndLayers.deathArea).GetComponent<DeathArea>(); spawnDrop = GameObject.FindGameObjectWithTag(TagsAndLayers.spawnDrop).GetComponent<SpawnDrop>(); menuScreen = GameObject.FindGameObjectWithTag(TagsAndLayers.menuController).GetComponent<MenuScreen>(); pause = Camera.main.GetComponent<Pause>(); crosshair = Camera.main.GetComponent<Crosshair>(); objectSpawners = GameObject.FindGameObjectsWithTag(TagsAndLayers.objectSpawner); jumppadPillars = GameObject.FindGameObjectsWithTag(TagsAndLayers.jumppadPillar); player = GameObject.FindGameObjectWithTag(TagsAndLayers.player); }
private void Awake() { orderMgr = FindObjectOfType<SpriteOrderLayerManager>(); battleMgr = FindObjectOfType<BattleManager>(); itemMgr = FindObjectOfType<ItemManager>(); bgmMgr = FindObjectOfType<BgmManager>(); isRun = true; pauseUI = FindObjectOfType<Pause>(); isDefenceTurn = true; PlayerData.instance.CheckInstance(); GameEventManager.instance.CheckInstance(); StartCoroutine(SceneFader.Instance.FadeIn(0.6f)); GameObject.FindObjectOfType<SceneFader>().transform.SetParent(Camera.main.transform, true); }
public virtual void ActionCallback(MediaSessionEventData eventData) { Console.WriteLine("MS_" + eventData.ActionType); if (string.Equals(eventData.ActionType, "Play", StringComparison.InvariantCultureIgnoreCase)) { Play?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "Pause", StringComparison.InvariantCultureIgnoreCase)) { Pause?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "Stop", StringComparison.InvariantCultureIgnoreCase)) { Stop?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "SeekBackward", StringComparison.InvariantCultureIgnoreCase)) { SeekBackward?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "SeekForward", StringComparison.InvariantCultureIgnoreCase)) { SeekForward?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "SeekTo", StringComparison.InvariantCultureIgnoreCase)) { SeekTo?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "PreviousTrack", StringComparison.InvariantCultureIgnoreCase)) { PreviousTrack?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "NextTrack", StringComparison.InvariantCultureIgnoreCase)) { NextTrack?.Invoke(this, eventData); } else if (string.Equals(eventData.ActionType, "SkipAd", StringComparison.InvariantCultureIgnoreCase)) { SkipAd?.Invoke(this, eventData); } else { throw new ArgumentOutOfRangeException(); } AnyEvent?.Invoke(this, eventData); }
public void saveGame(bool optionSelect) { if (optionSelect) { saveLoad.SetPositions(transform.position.x, transform.position.y, transform.position.z); saveLoad.sectorName = actualSectorLoad; saveLoad.SavePlayerSlot(gameSlot); PlayerAnimatorUpdate(false, true); Invoke("stopSavingAnim", 4f); } else { anim.SetBool("Saved", false); Pause.UnpausePlayer(playerController); unFreezeMoves(); } }
// Use this for initialization void Start() { pausescript = GameObject.FindGameObjectWithTag("GamePauser").GetComponent <Pause>(); if (level5) { GameObject alias = GameObject.Find("RightController").gameObject; alias.SetActive(false); pausescript.MenuOff(); //VRTK.VRTK_SDKManager.instance.UnloadSDKSetup(); // SceneManager.LoadScene("finaldungeon"); //SteamVR_LoadLevel.Begin("finaldungeon"); pausescript.MenuOn(); pausescript.MenuOff(); //alias.SetActive(true); //alias.SetActive(false); //alias.SetActive(true); //alias.SetActive(false); //alias.SetActive(true); StartCoroutine(fixer()); } if (AllItems) { ItemInventory.hasMicrocontroller = true; ItemInventory.hasTNT = true; ItemInventory.hasStopwatch = true; ItemInventory.hasBattery = true; ItemInventory.hasSnorkel = true; ItemInventory.hasAtlas = true; ItemInventory.hasDiskette = true; ItemInventory.hasHeadphones = true; ItemInventory.hasRAM = true; ItemInventory.hasPottery = true; ItemInventory.hasSprocket = true; ItemInventory.hasSnibbet = true; ItemInventory.hasCrucible = true; ItemInventory.hasStatuette = true; ItemInventory.hasToytrain = true; ItemInventory.hasVintagephone = true; ItemInventory.hasGoblet = true; ItemInventory.hasBaseballcap = true; ItemInventory.has3doconsole = true; ItemInventory.hasHuntinghorn = true; ItemInventory.hasOldbottle = true; } }
void Start() { popup = GameObject.FindGameObjectWithTag("PopupManager").GetComponent <PopupManager>(); popdiag = GameObject.FindGameObjectWithTag("PopupDiag"); pausescript = GameObject.FindGameObjectWithTag("GamePauser").GetComponent <Pause>(); weaponContainer1 = GameObject.FindGameObjectWithTag("WeaponContainer"); //scriptofSwitchWeapons = weaponContainer1.GetComponent<SwitchWeapons>(); //scriptofSwitchWeapons.Persistence(); //weaponScreen = GameObject.FindGameObjectWithTag("WeaponScreen"); // weaponinventoryScript = GameObject.FindGameObjectWithTag("Player").GetComponent<WeaponInventory>(); //weaponinventoryScript.wScreenActive = false; //weaponScreen.SetActive(false); //scriptofSwitchWeapons.Persistence(); //scriptofSwitchWeapons.PutAwayPickaxe(); if (!levelUpScreen) { levelUpScreen = GameObject.Find("LevelUpScreen"); } levelUpScreen.SetActive(false); player = GameObject.FindGameObjectWithTag("Player"); if (GameModeScript.GameMode == 1) { } if (pixelationOff) { } if (diedNOTportal) { diedNOTportal = false; } //StartCoroutine(seconddialogue()); GameObject.FindGameObjectWithTag("Music").GetComponent <RandomMusic>().PlayMusic(); //Debug.Log("LevelProgression working" + gameObject.name); if (GameObject.FindGameObjectWithTag("Player").transform.Find("Controller (left)").GetComponent <ViveController>().holdingObject) { GameObject.FindGameObjectWithTag("Player").transform.Find("Controller (left)").gameObject.GetComponent <FixControllerModel>().FixModel(); } if (!GameObject.FindGameObjectWithTag("Player").transform.Find("Controller (right)").GetComponent <ViveController>().holdingObject) { GameObject.FindGameObjectWithTag("Player").transform.Find("Controller (right)").gameObject.GetComponent <FixControllerModel>().FixModel(); } }
private void SavePause_Click(object sender, EventArgs e) { Exacta.Menu.db = new DataContext(Exacta.Menu.connectionString); if (NewPause) { Pause pause = new Pause(); GetPauseFDP(pause); try { Tables.TblPauses.InsertOnSubmit(pause); Exacta.Menu.db.SubmitChanges(); MessageBox.Show("New Pause has been added!"); LoadPause(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } NewPause = false; } else { if (dgvPause.Rows.Count == 0) { return; } var dialog = MessageBox.Show("Do you want to update Pause?", "Pause Update!", MessageBoxButtons.YesNo); if (dialog == DialogResult.No) { return; } Pause pause = Exacta.Menu.db.GetTable <Pause>().Single(cl => cl.Id.ToString() == SelectedPause); try { GetPauseFDP(pause); Exacta.Menu.db.SubmitChanges(); MessageBox.Show("Pause " + richTextBox1.Text.ToString() + " has been updated!"); LoadPause(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } LoadPause(); }
// Use this for initialization void Start() { //used to know when to allow movement GameObject gui = GameObject.FindGameObjectWithTag("Gui"); pause = gui.GetComponent<Pause>(); //constructs a plane facing up that is the same level as the water //GameObject water = GameObject.Find ("Water"); horoPlane = new Plane (Vector3.up, new Vector3(0, 0.5f, 0)); verticalPlane = new Plane (Vector3.forward, new Vector3 (0, 0, 78)); //Get tongue object script to control rotation //tongue = GameObject.FindGameObjectWithTag ("Tongue").GetComponent<Tongue> (); tongue = GameObject.Find ("Tongue").GetComponent<NewTongue> (); //Starts with old control style }
// Use this for initialization void Start() { player = GetComponent <Rigidbody2D>(); pauseScript = FindObjectOfType <Pause>(); attackScript = GetComponent <PlayerAttacking>(); if (!playerExists) { playerExists = true; DontDestroyOnLoad(transform.gameObject); } else { Destroy(gameObject); } }
public static IEnumerable <Skift> Process(IEnumerable <Rad> rader) { var res = new List <Skift>(); Skift skift = null; Pause pause = null; foreach (var rad in rader) { switch (rad.Type) { case RadType.VaktStart: { if (skift != null) { skift.Slutt = rad.Tidspunkt.AddMinutes(-1); res.Add(skift); } skift = new Skift() { VaktNr = rad.VaktId, Start = rad.Tidspunkt }; } break; case RadType.PauseStart: { pause = new Pause() { Start = rad.Tidspunkt }; } break; case RadType.PauseSlutt: { pause.Slutt = rad.Tidspunkt; skift.Pauser.Add(pause); } break; } } skift.Slutt = skift.Start.AddHours(8); // Avslutt siste skift res.Add(skift); return(res); }
private void FixedUpdate() { if (!active) { return; } if (Pause.gamePaused()) { transform.rotation = Quaternion.identity; } else { transform.rotation = lastRotation; lastRotation = Quaternion.Euler(0f, (transform.rotation.eulerAngles.y + speed) % 360f, 0f); } }
private void Pause_Click(object sender, EventArgs e) { Pause.Focus(); Pause.Select(); if (pause) { timer.Stop(); pause = false; } else { timer.Start(); pause = true; } pictureBox1.Focus(); }
private void Init() { _keyboardHook.KeyDownEvent += (x, y) => { _keyStatusManager.SetKeyDown(y.KeyCode); if (y.KeyCode == Keys.S && _keyStatusManager.IsAllDown(Keys.LControlKey, Keys.LMenu)) { Stop?.Invoke(); } if (y.KeyCode == Keys.B && _keyStatusManager.IsAllDown(Keys.LControlKey, Keys.LMenu)) { Start?.Invoke(); } if (y.KeyCode == Keys.P && _keyStatusManager.IsAllDown(Keys.LControlKey, Keys.LMenu)) { Pause?.Invoke(); } if (y.KeyCode == Keys.R && _keyStatusManager.IsAllDown(Keys.LControlKey, Keys.LMenu)) { Resume?.Invoke(); } if (y.KeyCode == Keys.Q && _keyStatusManager.IsAllDown(Keys.LControlKey, Keys.LMenu)) { Restart?.Invoke(); } }; _keyboardHook.KeyUpEvent += (x, y) => { _keyStatusManager.SetKeyUp(y.KeyCode); }; _mouseHook.MouseDownEvent += (x, y) => { if (y.Button == MouseButtons.Left && _keyStatusManager.IsAllDown(Keys.LControlKey, Keys.LMenu)) { Position?.Invoke(y.Location); } }; }
protected override void Update() { if (!Pause.gamePaused() && health.getHealth() > 0f) { NavMeshHit closestHit; if (NavMesh.SamplePosition(gameObject.transform.position, out closestHit, 500, 1)) { gameObject.transform.position = closestHit.position; } nav.enabled = true; base.Update(); } else { nav.enabled = false; } }
private void Update() { if (!Pause.isPaused()) { this.timePlaying += Time.deltaTime; // Remove dead zombies from list. this.cleanZombieList(); // Update the game mode object. if (this.gameMode != null) { this.gameMode.updateGameMode(); } this.trySpawnZombies(); } }
// Use this for initialization void Start() { isDead = false; player.GetComponent <Pause>().isDead = false; addPoint = true; if (levelEditor) { testM = GameObject.Find("TestManager").GetComponent <TestManager>(); } if (!testM) { pc = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); pause = GameObject.FindGameObjectWithTag("Player").GetComponent <Pause>(); levelSpeeds = LevelSpeed.FindObjectsOfType <LevelSpeed>(); } }
private void LateUpdate() { // Only show Entities that at the depth being rendered. foreach (EntityBase e in this.list) { e.toggleRendererVisability( e.depth == this.worldRenderer.getDepthRendering()); } if (!Pause.isPaused()) { // Update the Entities. for (int i = this.list.Count - 1; i >= 0; i--) { this.list[i].onLateUpdate(); } } }
private void Start() { pause = FindObjectOfType <Pause>(); playerCam = FindObjectOfType <CameraController>(); player = FindObjectOfType <PlayerController>(); rectTransform = GetComponent <RectTransform>(); offScreenPos = rectTransform.anchoredPosition; rectTransform.anchoredPosition = offScreenPos; timer = 0.0f; GetSceneData(); }
private void Interface_Load(object sender, EventArgs e) { SubtitleDisplayBox.Hide(); StartPrompt.Hide(); MoreThanOne.Hide(); StartButton.Hide(); CountDown.Hide(); NotPaused.Hide(); gettingPaused1.Hide(); gettingPaused2.Hide(); gettingPaused3.Hide(); gettingPaused4.Hide(); Paused.Hide(); pictureBox1.Hide(); pictureBox2.Hide(); Password.Hide(); Pause.Hide(); }
// Use this for initialization void Start () { player = GetComponent<Rigidbody2D>(); pauseScript = FindObjectOfType<Pause>(); attackScript = GetComponent<PlayerAttacking>(); if (!playerExists) { playerExists = true; DontDestroyOnLoad(transform.gameObject); } else { Destroy(gameObject); } }
private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (!Pause.Paused) { Pause.PauseGame(); audioSource.PlayOneShot(pause); pauseUI.SetActive(true); } else { Pause.UnPauseGame(); audioSource.PlayOneShot(unpause); pauseUI.SetActive(false); } } }
private void OnTriggerEnter(Collider other) { if (other.tag == "SandWall" || other.tag == "Fence") { Destroy(other.gameObject); } if (other.tag == "Hero" && SceneManager.GetActiveScene().name == "Maze1") { Pause.DoPause(); GameObject.Find("UI").GetComponent <StartOptions>().ChangeScene(2); } if (other.tag == "Hero" && SceneManager.GetActiveScene().name == "Maze2") { Pause.DoPause(); GameObject.Find("UI").GetComponent <GameOverScript>().EnableCreditsScreen(GameObject.Find("EventSystem").GetComponent <GameLevelManager>().getScore()); } }
void Awake() { if (instance == null) { instance = this; } else { Debug.LogWarning("Singleton Error! : " + this.name); Destroy(this); } SaveManager.FirstLoad(GlobalData.isNewStart); viewer = GameObject.Find("Canvas").transform.Find("MapViewer").GetComponent <MapViewer>(); player = GameObject.Find("Player").GetComponent <Player>(); pause = GameObject.Find("Canvas").transform.Find("Pause").GetComponent <Pause>(); player.MakePalette(); OnUsingSkill = new voidFunc[5]; }
public void Play_OnClick() { mainPanel.SetActive(false); settingsPanel.SetActive(false); upgradePanel.SetActive(false); //This loads a test scene. To add a scene, go into File > Build Settings and drop a scene in. Then, put the corresponding number below (first scene is 0, second 1, etc) //Note that loadscenemode.additive should be used so that Upgrade functionality is retained. Remember to disable any menu objects/UI above before loading the scene SceneManager.LoadScene(1, LoadSceneMode.Additive); mainCamera.SetActive(false); Pause PauseScript = GetComponent <Pause>(); PauseScript.playing = true; PauseScript.lastCurrency = upgradeControl.GetComponent <UpgradeControl>().currency; }
public static PauseEntity Create(Pause pause) { return(new PauseEntity { Oid = pause.Oid ?? 0, OperationId = pause.OperationId, OperationName = pause.OperationName, Source = pause.Source.ToString(), CancellationSource = pause.CancellationSource?.ToString(), CreatedAt = pause.CreatedAt, EffectiveSince = pause.EffectiveSince, State = pause.State.ToString(), Initiator = pause.Initiator, CancelledAt = pause.CancelledAt, CancellationEffectiveSince = pause.CancellationEffectiveSince, CancellationInitiator = pause.CancellationInitiator }); }
protected void Death() { if (!enemy) // is player { GameObject gc = GameObject.FindGameObjectWithTag("GameController"); Pause dead = gc.GetComponent <Pause>(); dead.gameOver = true; } if (deathClip != null) { AudioDeath.Play(0); spriteR.enabled = false; // simulate death (i dont want to destory the object before playing sound) if (gameObject.GetComponent <EnemyShoot>() != null) { gameObject.GetComponent <EnemyShoot>().stopShooting = true; // disables the phantom bullets } if (hasDrop) // if (drop[0] != null) didn't work to well so f**k it { for (int i = 0; i < drop.Length; i++) { Instantiate(drop[i], transform.position, Quaternion.identity); // look at all this wasted potential. I have a total of 1 enemy that drops an item after death } } if (animeDeath != null) // if death animation doesnt equal null { Instantiate(animeDeath, transform.position, Quaternion.identity); } transform.position = new Vector2(transform.position.x, transform.position.y + 10); if (enemy) { Destroy(gameObject, AudioDeath.clip.length); // kills object after some time } } else { if (enemy) { Destroy(gameObject); } } invincible = true; // now it wont flash red to ruin the illusion of it actually dying. }
void Start() { rabbitRB = GetComponent <Rigidbody> (); anim = GetComponent <Animator> (); pauseScript = GameObject.Find("Canvas").GetComponent <Pause> (); if (Prefabs.wolf == null) { print("PlayerCollisions: No wolf prefab"); } if (Prefabs.loseSeconds == null) { print("PlayerCollisions: No loseSeconds prefab"); } GameObject uiBarGameObject = GameObject.Find("Full Bar"); uiBar = uiBarGameObject.GetComponent <UIBar> (); }
/// <summary> /// Gets a value indicating whether alert is displayed or not. /// </summary> /// <param name="throwWhenNotDisplayed">Indicate whether <see cref="NoAlertPresentException"/> should be thrown if alert is not displayed.</param> /// <returns>True if alert is displayed. False if alert is not displayed and <paramref name="throwWhenNotDisplayed"/> is set to false.</returns> /// <exception cref="NoAlertPresentException">Thrown when an alert is not found and <paramref name="throwWhenNotDisplayed"/> is true.</exception> public bool IsDisplayed(bool throwWhenNotDisplayed = false) { Pause.PauseExecution(Pause.ScriptWaitDuration.Long); try { _SwitchToAlert(); Logging.Logging.WriteVerboseLogEntry(GetType().ToString(), "Alert is displayed."); return(true); } catch (NoAlertPresentException) { Logging.Logging.WriteVerboseLogEntry(GetType().ToString(), "Alert is not displayed."); if (throwWhenNotDisplayed) { throw; } return(false); } }
private StepMode OnPause(DebugInformation e) { // If we've been running (not stepping) and got here (through Break), revert to stepping Stop(); IsRunning = false; Pause?.Invoke(e); // We've now handed control over to the UI. Keep the debugger thread // waiting until the UI gets back to us: waitForInterface.WaitOne(); // ... then start the cycle over: waitForInterface.Reset(); IsRunning = true; Continue?.Invoke(); return(nextStep); }
private bool isEnemyShooting = true; // flag allows or not to shoot spawning enemy void Awake() { if (instance == null) instance = this; else if (instance != this) Destroy(gameObject); DontDestroyOnLoad(gameObject); nextGoldenScore = goldenScore; // initial first golden Score scoreText.text = "0"; hierarchyGuard = new GameObject("HierarchyGuard").transform; // Get references bulletTime = GetComponent<BulletTime>(); medalAwardingFor = GetComponent<MedalAwardingFor>(); pause = GetComponent<Pause>(); }
// Update is called once per frame void Update() { if (Input.GetKey("escape")) { Time.timeScale = 0f; //EyeMovement script1 = gameObject.GetComponent<EyeMovement>(); //script1.enabled = false; Pause script2 = gameObject.GetComponent <Pause>(); script2.enabled = true; //HideCourser script3 = gameObject.GetComponent<HideCourser>(); //script3.enabled = false; Screen.showCursor = true; pauseactiv = true; } }
/// <summary> /// 静态构造函数只会被执行一次 /// </summary> static EkLogManager() { var writeTask = new Task(obj => { //开启线程写入日志 while (true) { Pause.WaitOne(1000, true); //阻塞当前线程执行 var temp = new List <string[]>(); //temp[0] 存放日志路径,temp[1]存放日志内容 foreach (var logItem in LogQueue) { var logPath = logItem.Item1; //日志路径 var logMergeContent = string.Concat(logItem.Item2, Environment.NewLine, "----------------------------------------------------------------------------------------------------------------------", Environment.NewLine); //日志内容 var logArr = temp.FirstOrDefault(d => d[0].Equals(logPath)); if (logArr != null) { logArr[1] = string.Concat(logArr[1], logMergeContent); } else { logArr = new[] { logPath, logMergeContent }; temp.Add(logArr); } LogQueue.TryDequeue(out var _); //出队列 } //日志写入 foreach (var item in temp) { WriteText(item[0], item[1]); } } }, null, TaskCreationOptions.LongRunning); writeTask.Start(); }
void Awake() { manage = this; vibroToggle.isOn = (PlayerPrefs.GetInt("VibrationActive") == 0) ? true : false; Steeringwheel.isOn = (PlayerPrefs.GetInt("SteeringWheel") == 0) ? true : false; buttonControltgl.isOn = (PlayerPrefs.GetInt("ButtonMode") == 0) ? true : false; musicToggle.isOn = (PlayerPrefs.GetInt("Soundtrack") == 0) ? true : false; if (SceneManager.GetActiveScene().name == "battle_online") { Traffic.SetActive(true); traff.isOn = true; traff.interactable = false; //traff.isOn = (PlayerPrefs.GetInt("Traffic") == 0) ? true : false; people.isOn = (PlayerPrefs.GetInt("PeopleAI") == 0) ? true : false; } if (SceneManager.GetActiveScene().name == "city_single") { print("PauseCitySingle"); Traffic.SetActive(true); traff.isOn = true; traff.interactable = false; people.isOn = (PlayerPrefs.GetInt("PeopleAI") == 0) ? true : false; } if (SceneManager.GetActiveScene().name == "city_online") { Traffic.SetActive(false); traff.interactable = false; //traff.isOn = (PlayerPrefs.GetInt("Traffic") == 0) ? true : false; traff.isOn = false; people.isOn = (PlayerPrefs.GetInt("PeopleAI") == 0) ? true : false; } if (SceneManager.GetActiveScene().name == "level_top_speed_test") { Traffic.SetActive(true); traff.isOn = true; traff.interactable = false; people.isOn = (PlayerPrefs.GetInt("PeopleAI") == 0) ? true : false; //traff.isOn = (PlayerPrefs.GetInt("Traffic") == 0) ? true : false; } }
public override int GetHashCode() { int hash = 1; if (CustomState.Length != 0) { hash ^= CustomState.GetHashCode(); } if (dataCase_ == DataOneofCase.GenericDialog) { hash ^= GenericDialog.GetHashCode(); } if (dataCase_ == DataOneofCase.Pause) { hash ^= Pause.GetHashCode(); } if (dataCase_ == DataOneofCase.AdviceOverlay) { hash ^= AdviceOverlay.GetHashCode(); } if (dataCase_ == DataOneofCase.AdviceInterjection) { hash ^= AdviceInterjection.GetHashCode(); } if (dataCase_ == DataOneofCase.ConversationInterjection) { hash ^= ConversationInterjection.GetHashCode(); } if (CallToActionAsset.Length != 0) { hash ^= CallToActionAsset.GetHashCode(); } if (CallToActionButtonIdentifier.Length != 0) { hash ^= CallToActionButtonIdentifier.GetHashCode(); } hash ^= (int)dataCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
// Use this for initialization void Start () { textbox = GameObject.FindGameObjectWithTag("Textbox"); pauseScript = FindObjectOfType<Pause>(); DontDestroyOnLoad(transform.gameObject); if (!cameraExists) { cameraExists = true; DontDestroyOnLoad(transform.gameObject); } else { Destroy(gameObject); } cam = GetComponent<Camera>(); verExtent = cam.orthographicSize; horExtent = verExtent * Screen.width / Screen.height; }
// 初期化 void Start() { pause = GameObject.Find("Pause"); pauseScript = pause.GetComponent<Pause>(); gimmickFlag = true; // ギミックが有効か判断するフラグに真を保存 startActionTurn = 1; // ギミックを動かし始めるターン数を1に gimmickCount = 0; // ギミックが有効になってからのターン数を0に movePossibleFlag = true; // 移動可能フラグを真に moveCount = 0; motionCount = 1; GetComponent<Animator>().SetInteger("MotionCount", motionCount); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // Puts whatever the current keyboard state is into this variable to be used later _kbstate = Keyboard.GetState(); _gpstate = GamePad.GetState(PlayerIndex.One); if (bulletTimer < GameVariables.bTimer) { bulletTimer += gameTime.ElapsedGameTime.TotalSeconds; if (bulletTimer >= GameVariables.bTimer) { bulletTimer = GameVariables.bTimer; } } // Finite state machine for the menu, the game, the pause screen, // and the game over screen switch (gameState) { #region The Start Menu case GameState.Menu: switch (buttonState) // Press button to alter which item is highlighted to { // to change where player will go on the menu // If the "Play" button is highlighted case Highlighted.Play: { if (SingleKeyPress(Keys.D) || _gpstate.ThumbSticks.Left.X == 1 || _gpstate.DPad.Right == ButtonState.Pressed) // Press "D" to move right to the Credits option if (bulletTimer == GameVariables.bTimer) { buttonState = Highlighted.Credits; } if (SingleKeyPress(Keys.Enter) || _gpstate.Buttons.Start == ButtonState.Pressed || _gpstate.Buttons.A == ButtonState.Pressed) // Press "Enter" to start the game gameState = GameState.GameManager; break; } // If the "Credits" button is highlighted case Highlighted.Credits: { if (SingleKeyPress(Keys.D) || _gpstate.ThumbSticks.Left.X == 1 || _gpstate.DPad.Right == ButtonState.Pressed) // Press "D" to move right to the Quit option buttonState = Highlighted.Quit; else if (SingleKeyPress(Keys.A) || _gpstate.ThumbSticks.Left.X == -1 || _gpstate.DPad.Left == ButtonState.Pressed) // Press "A" to move left to the Play option buttonState = Highlighted.Play; if (SingleKeyPress(Keys.Enter) || _gpstate.Buttons.Start == ButtonState.Pressed || _gpstate.Buttons.A == ButtonState.Pressed) // Press "Enter" to enter the credits menu gameState = GameState.Credits; break; } // If the "Quit" button is highlighted case Highlighted.Quit: { if (SingleKeyPress(Keys.A) || _gpstate.ThumbSticks.Left.X == -1 || _gpstate.DPad.Left == ButtonState.Pressed) // Press "A" to move Left to the Credits option buttonState = Highlighted.Credits; if (SingleKeyPress(Keys.Enter) || _gpstate.Buttons.Start == ButtonState.Pressed || _gpstate.Buttons.A == ButtonState.Pressed) // Press "Enter" to quit the game this.Exit(); break; } } break; #endregion #region The Game case GameState.GameManager: MediaPlayer.Pause(); // Stop the music from playing from the menu timer -= gameTime.ElapsedGameTime.TotalSeconds; // Start the timer up for later use if (SingleKeyPress(Keys.Escape) || SingleKeyPress(Keys.P) || _gpstate.Buttons.Start == ButtonState.Pressed) { // If "P" or "Escape" is press opent he pause menu gameState = GameState.Pause; } // To move the player if (_kbstate.IsKeyDown(Keys.W) || _gpstate.ThumbSticks.Left.Y > 0 || _gpstate.DPad.Up == ButtonState.Pressed) // Press "W" to move up { _p.YValue -= _p.moveSpeed; _p.DState = GamePiece.Direction.Up; } if (_kbstate.IsKeyDown(Keys.A) || _gpstate.ThumbSticks.Left.X < 0 || _gpstate.DPad.Left == ButtonState.Pressed) // Press "A" to move left { _p.XValue -= _p.moveSpeed; _p.DState = GamePiece.Direction.Left; } if (_kbstate.IsKeyDown(Keys.S) || _gpstate.ThumbSticks.Left.Y < 0 || _gpstate.DPad.Down == ButtonState.Pressed) // Press "S" to move down { _p.YValue += _p.moveSpeed; _p.DState = GamePiece.Direction.Down; } if (_kbstate.IsKeyDown(Keys.D) || _gpstate.ThumbSticks.Left.X > 0 || _gpstate.DPad.Right == ButtonState.Pressed) // Press "D" to move right { _p.XValue += _p.moveSpeed; _p.DState = GamePiece.Direction.Right; } if (bulletTimer == GameVariables.bTimer) { if (SingleKeyPress(Keys.Space) || _gpstate.Triggers.Right == 1) { if (ammo > 0) { _b.Active = true; AddProjectile(new Vector2(_p.XValue, _p.YValue)); ammo--; } } bulletTimer = 0; //bulletTimer -= gameTime.ElapsedGameTime.TotalSeconds; } foreach (DartCollectible dc in dcs) { if (_p.CheckCollision(dc) == true && dc.GetSetCollected != true && ammo +5 <= 20 ) { ammo += GameVariables.dartCollectibleWorth; dc.GetSetCollected = true; } } updateScore(); //troll code //if (_kbstate.IsKeyDown(Keys.Space)) //{ // AddProjectile(new Vector2(_p.XValue, _p.YValue)); //{ //makes sure bullets dont fly off the screen UpdateProjectiles(); //checks if bullets collide with zombies bulletCollision(); //Screen"wrap", more like a big wall ScreenWrap(); ScreenWall(_p); // For each zombie activate their AI's and make sure they don't run into one another for (int i = 0; i < _zs.Count; i++) { _zs.ElementAt(i).AI(_p, gameTime.ElapsedGameTime.TotalSeconds); ScreenWall(_zs.ElementAt(i)); for (int j = 0; j < _zs.Count; j++) { if (j != i) { _zs.ElementAt(i).HitOtherZomibe(_zs.ElementAt(j)); } } } //***game over condition(s) goes here*** if (score >= 300 && extracted == false) { extraction = true; currentMaptile.extraction = true; } if (extraction == true) { currentMaptile.GetSetZombieList.Clear(); currentMaptile.SpawnZombies(10); foreach (Zombie z in currentMaptile.GetSetZombieList) { _zs.Add(z); } extracted = true; extraction = false; } #if DEBUG if (SingleKeyPress(Keys.NumPad0) == true) { gameState = GameState.GameOver; } #endif break; #endregion #region The Pause Menu case GameState.Pause: switch (highlight) { // If the Resume button is highlighted case Pause.Resume: { if (SingleKeyPress(Keys.D) || _gpstate.ThumbSticks.Left.X == 1 || _gpstate.DPad.Right == ButtonState.Pressed) // Press "D" to move right to the Quit option highlight = Pause.Quit; if (SingleKeyPress(Keys.Enter) || _gpstate.Buttons.Start == ButtonState.Pressed || _gpstate.Buttons.A == ButtonState.Pressed) // Press "Enter" to go back to the game gameState = GameState.GameManager; break; } // If the Quit button is highlighted case Pause.Quit: { if (SingleKeyPress(Keys.A) || _gpstate.ThumbSticks.Left.X == -1 || _gpstate.DPad.Left == ButtonState.Pressed) // Press "A" to move left to the Resume option highlight = Pause.Resume; if (SingleKeyPress(Keys.Enter) || _gpstate.Buttons.Start == ButtonState.Pressed || _gpstate.Buttons.A == ButtonState.Pressed) // Press "Enter" to exit the game { Reset(); // Reset the game before exiting gameState = GameState.Menu; } break; } } break; #endregion //***pust to options conditions here***// #region The GameOver Screen case GameState.GameOver: if (SingleKeyPress(Keys.Enter) || _gpstate.Buttons.Start == ButtonState.Pressed || _gpstate.Buttons.A == ButtonState.Pressed) { //reset the values of the game Reset(); gameState = GameState.Menu; } //***quick quit from game over conditons could go here if needed***// break; #endregion #region The Credits Screen case GameState.Credits: if (SingleKeyPress(Keys.Escape) || _gpstate.Buttons.B == ButtonState.Pressed || _gpstate.Buttons.Back == ButtonState.Pressed) // Press "Escape" to exit the Credits screen { gameState = GameState.Menu; } break; #endregion } // Set the current keyboard state into the previous keyboard variable _prevKbState = _kbstate; base.Update(gameTime); }
public void triggerThirdTiltStartEvent() { if (this.ThirdTiltStartEvent != null) { this.ThirdTiltStartEvent(this, EventArgs.Empty); } GetComponent<Animator>().speed = 0; currentPause = Pause.ThirdTilt; print("GO TO THE LEFT SIDE"); if (sideTracker.GetComponent<SideTracker>().GetFullFloorSide() != FloorSide.Left) { gameController.ActivateLeftUpOutsideState (); } else { gameController.ActivateRightUpOutsideState (); } }
public PauseForm(Pause origPause) { _origPause = origPause; _tempPause = _origPause.GetCopy() as Pause; InitializeComponent(); }
public void triggerSecondTiltEndEvent() { if (this.SecondTiltEndEvent != null) { this.SecondTiltEndEvent(this, EventArgs.Empty); } GetComponent<Animator>().speed = stormSpeed; currentPause = Pause.NoPause; }
public void triggerThirdTiltEndEvent() { //bgMusic.playing = false; if (this.ThirdTiltEndEvent != null) { this.ThirdTiltEndEvent(this, EventArgs.Empty); } GetComponent<Animator>().speed = stormSpeed; currentPause = Pause.NoPause; light1.GetComponent<Animator>().SetTrigger("shouldBrighten"); light2.GetComponent<Animator>().SetTrigger("shouldBrighten"); gameController.isOgopogAppearanceTriggerEnabled = true; }
public void triggerInitialPauseEndEvent() { AudioManager.Main.PlayNewSound("BoatHorn"); if (this.InitialPauseEndEvent != null) { this.InitialPauseEndEvent(this, EventArgs.Empty); } GetComponent<Animator>().speed = normalSpeed; currentPause = Pause.NoPause; }
public void triggerFirstTiltEndEvent() { AudioManager.Main.PlayNewSound("ScaryAmbient",true); if (this.FirstTiltEndEvent != null) { this.FirstTiltEndEvent(this, EventArgs.Empty); } GetComponent<Animator>().speed = stormSpeed; currentPause = Pause.NoPause; }
public void triggerFinalPauseStartEvent() { if (this.FinalPauseStartEvent != null) { this.FinalPauseStartEvent(this, EventArgs.Empty); } GetComponent<Animator>().speed = 0; currentPause = Pause.Final; }
// Use this for initialization void Start () { effectObject = GameObject.Find("Offbeat"); fxParticles = new GameObject[2]; fxParticles[0] = Instantiate(FXParticles); fxParticles[1] = Instantiate(FXParticles); fxParticlesControl = new CustomParticles[2]; fxParticlesControl[0] = fxParticles[0].GetComponent<CustomParticles>(); fxParticlesControl[1] = fxParticles[1].GetComponent<CustomParticles>(); touches = new Vector3[2]; deadBunnies =0; fxPointer = 0; latestTouch = 0; time = 0; god = GameObject.Find("God").GetComponent<GodDeath>(); pause = GameObject.Find("Pause").GetComponent<Pause>(); uint bunnyCount = 0; float distanceCoef = (700.0f / 500.0f); beat = 0.66666f; float expectedBunnyLifetime = GetJumpTimeFromLinearTime((350.0f / (250.0f)) * distanceCoef, beat); int latestColor = 0; Color []colors = new Color[3]{ new Color(0,1.0f,59 / 255.0f), new Color(0,255 / 255.0f,187 / 255.0f), new Color(97 / 255.0f,0,255 / 255.0f), }; float realDuration = 0; float []angles = new float[5]{Mathf.PI / 2.0f, 4.6f, 2.65f, 5.6f, 1.4f}; for (int i = 0; i < 5; i++) { float endTime = i * beat + expectedBunnyLifetime; GameObject bunny = (GameObject) Instantiate(bunnyPrefab); BunnyJump bunnyJumpS = bunny.GetComponent<BunnyJump>(); bunnyJumpS.startTime = 2 * i * 0.66666f + 1.0f * 0.666666f + (i == 0 ? 0 : 2.0f * 0.66666f);; bunnyJumpS.expectedBunnyLifetime = expectedBunnyLifetime; bunnyJumpS.beat = beat; bunnyJumpS.god = god; bunnyJumpS.angle = angles[i]; bunnyJumpS.wiggleSpace = 0.1f; bunnyJumpS.velocityMod = false; int randomColor = Random.Range(0,3); while(randomColor == latestColor || randomColor == GlobalData.godIndex) { randomColor = Random.Range(0,3); } latestColor = randomColor; bunnyJumpS.color = colors[randomColor]; bunnyJumpS.Startingu(); bunnyJumpS.Init(); bunnyCount++; bunnies.Add(bunnyJumpS); } cameraMiss = Camera.main.GetComponent<MissFrame>(); cameraShake = Camera.main.GetComponent<Shake>(); }
void Start() { cScale = GetComponent<Transform>().localScale; cT = this.gameObject.transform; if(timeSource == null) timeSource = GameObject.Find("Audio Manager").GetComponent<AudioSource>(); if(GameObject.Find("Pause")) pause = GameObject.Find("Pause").GetComponent<Pause>(); switch(GlobalData.selectedGod) { case GlobalData.Gods.RHINO: animations = SpriteManager.GetInstance().spritesArrays["rhino_dance"]; moves = SpriteManager.GetInstance().spritesArrays["rhino_moves_normal"]; doubleMoves = SpriteManager.GetInstance().spritesArrays["rhino_moves_double"]; break; case GlobalData.Gods.BEAR: animations = SpriteManager.GetInstance().spritesArrays["bear_dance"]; moves = SpriteManager.GetInstance().spritesArrays["bear_moves_normal"]; doubleMoves = SpriteManager.GetInstance().spritesArrays["bear_moves_double"]; break; case GlobalData.Gods.BULL: animations = SpriteManager.GetInstance().spritesArrays["bull_dance"]; moves = SpriteManager.GetInstance().spritesArrays["bull_moves_normal"]; doubleMoves = SpriteManager.GetInstance().spritesArrays["bull_moves_double"]; break; } cR = this.GetComponent<SpriteRenderer>(); cR.sprite = animations[0]; beat = GlobalData.beat; touchCount = 0; timeOfMove = -beat; freq = 1.0f / timeSource.clip.frequency; }