public void OnDelete() { m_deleteProfile = ""; if (MyInputField != null) { m_deleteProfile = MyInputField.text; MyInputField.text = ""; } else { m_deleteProfile = m_savedProfiles [m_selectedIndex]; } if (m_deleteProfile == "") { m_message.text = "No profile selected to delete"; return; } if (!SaveObjManager.Instance.ProfileExists(m_deleteProfile)) { m_message.text = "Profile: " + m_deleteProfile + " does not exist"; return; } if (m_deleteProfile == "AutoSave") { m_message.text = "AutoSave cannot be deleted."; return; } string w = "Are you sure you want to permanently delete: " + m_deleteProfile + "?"; w += "\n Deleted saves cannot be recovered."; PauseGame.DisplayWarning(w, gameObject, m_delete); }
void Awake() { pg = GetComponent <PauseGame>(); sg = GetComponent <StartGame>(); btm = GetComponent <BackToMain>(); maxScore = PlayerPrefs.GetInt("high_score", 0); }
void Update() { if (_isPlaying) { Time.timeScale = 1f; _time += Time.deltaTime; timePlaying = System.TimeSpan.FromSeconds(_time); } if (!_haslost && !_hasWon) { if (Input.GetKeyDown(KeyCode.Escape)) { if (!_pause && _isPlaying) { _pause = true; _isPlaying = false; PauseGame?.Invoke(_pause); } else { _pause = false; _isPlaying = true; PauseGame?.Invoke(_pause); } } } }
private void Update() { if (PauseGame.IsPaused() || !isSpawning || StartOnAwake) { return; } switch (currentState) { case State.NewRound: StartNewRound(); break; case State.Playing: Play(); break; case State.Paused: WaitForClear(); break; case State.GameOver: // Debug.Log("GameOver!"); break; } if (spawnQue.Count > 0 && spawnTimer <= 0) { SpawnTest(); } else if (spawnTimer > 0) { spawnTimer -= Time.deltaTime; } }
private void Awake() { PauseGameScript = GameObject.Find("GameController").GetComponent <PauseGame>(); InventoryScript = GameObject.Find("Character").GetComponent <Inventory>(); GamePaused = PauseGame.GamePaused; lockViewScript = gameObject.GetComponent <LockView>(); }
// Use this for initialization void Start() { ui = uiManager.GetComponent <PauseGame>(); // swb = GameObject.FindGameObjectWithTag("Cathode Ray Tube").GetComponent<SemiWeaponBehavior>(); // bh = GameObject.FindGameObjectWithTag("Black Hole").GetComponent<BlackHole>(); }
// Use this for initialization void Start() { buttonZ = new Slowtime(); buttonX = new NormalizeTime(); buttonLeftMouse = new FireWeapon(); buttonESC = new PauseGame(); }
// Use this for initialization void Start() { resources = GameObject.FindGameObjectWithTag("Game Control").GetComponent <PlayerResources>(); eTime = GameObject.FindGameObjectWithTag("Game Control").GetComponent <ElapsedTime>(); PopManager = GameObject.FindGameObjectWithTag("Game Control").GetComponent <PopulationManager>(); pause = GameObject.FindGameObjectWithTag("Game Control").GetComponent <PauseGame>(); }
void Start() { // Initializers aspectUtil = FindObjectOfType <Camera>().GetComponent <AspectUtility>(); dArrow = GameObject.Find("Dialogue_Arrow"); dBox = GameObject.Find("Dialogue_Box"); dFrame = GameObject.Find("Dialogue_Frame").GetComponent <Image>(); dText = GameObject.Find("Dialogue_Text").GetComponent <Text>(); dPic = GameObject.Find("Dialogue_Picture").GetComponent <Image>(); imgStrobe = GameObject.Find("Dialogue_Arrow").GetComponent <ImageStrobe>(); mainCamera = FindObjectOfType <CameraFollow>(); oMan = FindObjectOfType <OptionsManager>(); pause = FindObjectOfType <PauseGame>(); pMove = FindObjectOfType <PlayerMovement>(); SFXMan = FindObjectOfType <SFXManager>(); touches = FindObjectOfType <TouchControls>(); uMan = FindObjectOfType <UIManager>(); bDialogueActive = false; bPauseDialogue = false; // UX -- Prevents immediately reopening a dialogue while moving / talking pauseTime = 0.333f; dArrowPoints = new float[4]; dFramePoints = new float[4]; dPicPoints = new float[4]; dTextPoints = new float[4]; ConfigureParameters(); }
/// <summary> /// TransferProperty transfers both properties and skills between player and target /// </summary> protected virtual void TransferProperty() { PauseGame.Resume(); CheckRemovals(); foreach (Property p in _mPropertyToTransfer) { Target.GetComponent <PropertyHolder>().TransferProperty(p, Player.GetComponent <PropertyHolder>()); } foreach (Property p in _mPropertiesToKeep) { Player.GetComponent <PropertyHolder>().TransferProperty(p, Target.GetComponent <PropertyHolder>()); } if (InfectUpgrade) { int i = 0; foreach (Ability a in _mSelected) { Player.GetComponent <AbilityControl>().AbsorbAbility(a, i); i++; } } _mTriggered = false; Target = null; EventManager.TriggerEvent(EventManager.TRANSFER_SPECIAL); }
private void Start() { pauseGame = GameObject.FindObjectOfType <PauseGame>(); AudioSource[] audioSources = GetComponents <AudioSource>(); rotatingSFX = audioSources[0]; shootingSFX = audioSources[1]; }
// Update is called once per frame void Update() { Horizontal = Input.GetAxis("Horizontal"); Vertical = Input.GetAxis("Vertical"); if (Horizontal != 0 || Vertical != 0) { OnMove(Horizontal, Vertical); } //Liberarse Trampa if (trapped) { //Izquierda if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow)) { Liberarse?.Invoke("Left"); } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow)) { Liberarse?.Invoke("Right"); } } //Pausar o despausar juego if (Input.GetButtonDown("Pause")) { PauseGame?.Invoke(); } }
/// <summary> /// Load the controls help screen /// </summary> private void controlsAction() { // Load the campaing level UnityEngine.SceneManagement.SceneManager.LoadScene("GamePlayScreen"); // If the game was paused, we continue it PauseGame.Unpause(); }
/// <summary> /// Load the first campaign level /// </summary> private void campaignAction() { // Load the campaing level UnityEngine.SceneManagement.SceneManager.LoadScene("ExplainScreenCampaign"); // If the game was paused, we continue it PauseGame.Unpause(); }
void Awake() { if (m_instance == null) { m_instance = this; } else if (m_instance != this) { Destroy(gameObject); return; } m_pauseMenuUI = transform.GetChild(0).gameObject; m_saveScreen = transform.GetChild(1).gameObject; m_loadScreen = transform.GetChild(2).gameObject; m_deadScreen = transform.GetChild(3).gameObject; m_warningScreen = transform.GetChild(4).gameObject; m_controlMap = transform.Find("KeyboardMap").gameObject; m_pauseMenuUI.SetActive(false); m_saveScreen.SetActive(false); m_loadScreen.SetActive(false); m_deadScreen.SetActive(false); m_warningScreen.SetActive(false); m_controlMap.SetActive(false); }
/// <summary> /// Button: Retry current scene /// </summary> public void Retry() { PauseGame.Unpause(); Scene scene = SceneManager.GetActiveScene(); SceneManager.LoadScene(scene.name); }
public virtual void UpdateState(Vector3 target, float xDegree, bool isMoving) { if (PauseGame.IsPaused()) { return; } this.target = target; xDeg = xDegree; isTargetMoving = isMoving; if (!transitioning) { return; } if (transitionTimeHolder >= 1) { transitioning = false; return; } tempYPositionOffset = Mathf.SmoothStep(tempYPositionOffset, yPositionOffset, transitionTimeHolder); tempXAngleOffset = Mathf.LerpAngle(tempXAngleOffset, xAngleOffset, transitionTimeHolder); tempZoomDistancecIdle = Mathf.SmoothStep(tempZoomDistancecIdle, zoomDistance.x, transitionTimeHolder); tempZoomDistanceMoving = Mathf.SmoothStep(tempZoomDistanceMoving, zoomDistance.y, transitionTimeHolder); transitionTimeHolder += Time.deltaTime * transitionStep; }
IEnumerator FinishDownload(WWWForm form) { WWW w = new WWW("http://angsila.cs.buu.ac.th/~58660001/pet/facebook.php", form); yield return(w); if (w.error != null) { print(w.error); //if there is an error, tell us } else { print("connection ok"); print(w.data); var N = JSON.Parse(w.data); if (N["status"].Value.Equals("1")) { print("Login Sucessful"); PauseGame p = new PauseGame(w.data); p.setItem(w.data); w.Dispose(); //clear our form in game Application.LoadLevel("mainGame"); } } //Work with the retrieved info. }
void Start() { _pause = GetComponent <PauseGame>(); _movement = GetComponent <PlayerMovement>(); _shoot = GetComponent <Shoot>(); _animator = GetComponentInChildren <Animator>(); }
public static void Notify(object sender, GameEventArgs e) { switch (e.type) { case START_GAME: StartGame?.Invoke(sender, e); break; case PAUSE_GAME: PauseGame?.Invoke(sender, e); break; case RESUME_GAME: ResumeGame?.Invoke(sender, e); break; case STOP_GAME: StopGame?.Invoke(sender, e); break; case RESTART_GAME: RestartGame?.Invoke(sender, e); break; case START_MINI_GAME: StartMiniGame?.Invoke(sender, e); break; case END_MINI_GAME: EndMiniGame?.Invoke(sender, e); break; } }
/// <summary> /// Use it for notify from EventTrigger Component. Requires to be component on GameObject! /// </summary> /// <param name="sender">The sender object.</param> /// <param name="e">Event arguments</param> public void Notify(string type) { switch (type) { case START_GAME: StartGame?.Invoke(null, new GameEventArgs(type)); break; case PAUSE_GAME: PauseGame?.Invoke(null, new GameEventArgs(type)); break; case RESUME_GAME: ResumeGame?.Invoke(null, new GameEventArgs(type)); break; case STOP_GAME: StopGame?.Invoke(null, new GameEventArgs(type)); break; case RESTART_GAME: RestartGame?.Invoke(null, new GameEventArgs(type)); break; case START_MINI_GAME: StartMiniGame?.Invoke(null, new GameEventArgs(type)); break; case END_MINI_GAME: EndMiniGame?.Invoke(null, new GameEventArgs(type)); break; } }
// Use this for initialization void Start() { // Initialize stats info currentStats = new StatsInfo(); currentStats.startTime = Time.time; totalStats = new StatsInfo(); totalStats.startTime = Time.time; // Get the Message Manager msgManager = GetComponent <MessageManager> (); // Get the Player player = GameObject.FindGameObjectWithTag("Player"); // Get the Ninja Controller ninjaController = player.GetComponent <NinjaController> (); ninjaController.setMessageManager(msgManager); // Get the Puzzles GameObject puzzle = GameObject.FindGameObjectWithTag("Puzzle"); if (puzzle != null) { // Find the puzzles if (puzzle.name.Equals("Fire Puzzle", System.StringComparison.CurrentCultureIgnoreCase)) { firePuzzle = puzzle; } else if (puzzle.name.Equals("Water Puzzle", System.StringComparison.CurrentCultureIgnoreCase)) { waterPuzzle = puzzle; } else if (puzzle.name.Equals("Combo Puzzle", System.StringComparison.CurrentCultureIgnoreCase)) { comboPuzzle = puzzle; } } // See if we need to find the pause UI if (pauseUI == null) { // Get the Pause UI pauseUI = GameObject.FindGameObjectWithTag("PauseUI"); } // See if we need to find the stats UI if (statsUI == null) { // Get the Stats UI statsUI = GameObject.FindGameObjectWithTag("StatsUI"); if (statsUI != null) { // Disable it for now statsUI.SetActive(false); } } // See if we need to find the ninja animation controller again if (ninjaAnimationController == null) { // Get the Ninja Animation Controller ninjaAnimationController = player.GetComponent <CyborgNinjaAnimationController> (); } // Get the pause script pauseScript = GetComponent <PauseGame> (); }
public void QuickLoad() { PauseGame.Pause(false); string w = "Load Last QuickSave? "; w += "\n All unsaved Progress will be lost."; WarningMessage.DisplayWarning(w, m_pauseMenuUI, quickLoad, "Warning", SetFirstOption); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { Canvas.SetActive(false); PauseGame.Unpause(); } }
void Start() { sr = GetComponent <SpriteRenderer>(); pauseObject = GetComponent <PauseGame>(); GOCanvas.enabled = false; Globals.difficulty = Difficulty.Easy; }
private void RaisePauseGame(bool pause) { _gamePaused = pause; if (PauseGame != null) { PauseGame.Invoke(_gamePaused); } }
public static void QuickLoad() { PauseGame.Pause(false); string w = "Load Last QuickSave? "; w += "\n All unsaved Progress will be lost."; PauseGame.DisplayWarning(w, Instance.m_pauseMenuUI, Instance.quickLoad, "Warning", Instance.SetFirstOption); }
// Start is called before the first frame update void Start() { jumpVideoScreen.SetActive(false); windowFrame.SetActive(false); bc = FindObjectOfType <BallController>(); pg = FindObjectOfType <PauseGame>(); }
void initializeParameters() { selectedButton = 0; buttonClicks = GetComponentInParent <PauseGame> (); menuButtons = GetComponentsInChildren <Button> (); }
public void OnTriggerEnter(Collider other) { //Display the win canvas TestItOutText.SetActive(false); WinCanvas.SetActive(true); PauseGame.GameWin(); }
void Awake() { Instance = this; }
void Awake(){ pauseGame = GetComponent<PauseGame>(); }
/* public void PickUpSacrifice(GameObject sacrifice) { print("pick up sacrafice"); sacrifice.SetActive (false); sacrifice.GetComponent<Sacrifice> ().SetOwner (gameObject); m_Sacrifice = sacrifice; } public void DropSacrifice(Vector3 away) { if (m_Sacrifice != null) { print("drop sacrafice"); m_Sacrifice.SetActive (true); m_Sacrifice.transform.position = transform.position; m_Sacrifice.transform.Translate (away * 2); m_Sacrifice.GetComponent<Sacrifice> ().SetOwner (null); m_Sacrifice = null; } } public void PlaceSacrifice() { if (m_Sacrifice != null) { print("place sacrafice in box"); m_Sacrifice.GetComponent<Sacrifice> ().SetOwner (null); m_Sacrifice = null; } } */ // Use this for initialization void Start () { m_PauseGame = GameObject.Find ("PauseGame").GetComponent<PauseGame> (); m_IdleSprite = GetComponent<SpriteRenderer> ().sprite; m_DebuffTimers = new Dictionary<Debuffs, float>(); m_PowerStateTimers = new Dictionary<PowerStates, float>(); m_DebuffTimers.Add(Debuffs.Slow, 0); m_DebuffTimers.Add(Debuffs.Stun, 0); m_PowerStateTimers.Add(PowerStates.Invulnerability, 0); m_PowerStateTimers.Add(PowerStates.SuperSpeed, 0); PlayerMovement control = gameObject.GetComponent<PlayerMovement>(); control._fMoveSpeed = m_MovementSpeed; animator = GetComponent<Animator> (); }