// Start is called before the first frame update void Start() { GameObject deathCounter = GameObject.Find("Death_counter"); deathCounterScript = deathCounter.GetComponent <DeathCounter>(); StartCoroutine("WaitAndDie"); }
private void Awake() { // singleton design pattern if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); if (serverThread == null) { serverThread = new Thread(() => RunServer()); serverThread.Start(); Debug.Log("Starting server"); } } spawner = GameObject.Find("BlockSpawner").GetComponent <BlockSpawner>(); if (spawner == null) { serverThread.Join(); serverThread = null; Debug.Log("Spawner is required."); } deathCounter = GetComponent <DeathCounter>(); }
// Use this for initialization void Start() { //_walkingSpeed = 3; _walkingSpeed = 5; _runningSpeed = 5; _jumpForce = 1000; _deathCounter = DeathCounter.Instance; //_lastCheckPoint = new CheckPoint(this.transform.position, 0); //_playerController = FindObjectOfType<PlayerController>(); this.gameObject.AddComponent <CheckPoint>(); _lastCheckPoint = this.gameObject.GetComponent <CheckPoint>(); _lastCheckPoint.index = 0; _lastCheckPoint.Position = this.transform.position; IsWalking = false; IsRunning = false; IsJumping = false; IsGrounded = false; IsDead = false; arrayCaixas = FindObjectsOfType(typeof(BoxCheckpoint)) as BoxCheckpoint[]; arrayPlataformasMoveis = FindObjectsOfType(typeof(PlataformSlider)) as PlataformSlider[]; }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } instance = this; DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
private void Awake() { if (Instance) { Destroy(gameObject); } else { Instance = this; } DontDestroyOnLoad(gameObject); }
private void Start() { deathCounter = FindObjectOfType <DeathCounter>(); if (photonView.IsMine) { } else { GetComponent <PlayerMovement>().enabled = false; } _playerCreator = GameObject.Find("MultiplayerManager").GetComponent <PhotonPlayerCreator>(); }
public Form1() { InitializeComponent(); var configPath = AppDomain.CurrentDomain.BaseDirectory; configPath = System.IO.Path.Combine(configPath, "ds3DeathCount.conf"); var fileTarget = System.IO.File.ReadAllText(configPath); this.fileTarget = fileTarget.Trim(); MessageBox.Show(this.fileTarget); using (var file = new System.IO.StreamWriter(this.fileTarget)) { file.Write(this.lblDeaths.Text); } try { DeathCounter = new DeathCounter(); } catch (NoAdminPrivilegesException) { if (language == 0) { DialogResult ok = MessageBox.Show("Insufficient permissions. Try it again with admin rights.", "Error"); } if (language == 1) { DialogResult ok = MessageBox.Show("Permisos insuficientes. Inténtalo de nuevo ejecutándo como administrador.", "Error"); } Environment.Exit(0); } catch (NoProcessFoundException) { if (language == 0) { DialogResult ok = MessageBox.Show("The game is not running. Start the game and load a savegame before launching the application.", "Error"); } if (language == 1) { DialogResult ok = MessageBox.Show("El juego no esta en funcionamiento. Inicia el juego y selecciona una partida antes de ejecutar la aplicación", "Error"); } Environment.Exit(0); } //starts the process that count deaths every .5 seconds new Thread(new ThreadStart(runThread)).Start(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }
private void Awake() { if (SceneManager.GetActiveScene().name == "Scrolling Background_current") { DontDestroyOnLoad(FindObjectOfType <Canvas>()); DontDestroyOnLoad(FindObjectOfType <Camera>()); if (dcInstance == null) { DontDestroyOnLoad(this); dcInstance = this; } player = GameObject.FindWithTag("Player"); score = 0; frameCount = 0; } }
public override BattleState GetNextState() { BattleState nextState; if (IveLost()) { nextState = currentBattleStatesFactory.CreateEndGameState(winnerFactory: currentBattleStatesFactory); } else if (DeathCounter.AreCardsDyingToFew()) { nextState = currentBattleStatesFactory.CreateIsGameTiedState(); } else { nextState = currentBattleStatesFactory.CreateBeginTurnState(); } return(nextState); }
void Start() { _rigidbody = GetComponent <Rigidbody2D>(); resetPos = transform.position; _PlayerHealth = GetComponent <PlayerHealth>(); direction = 1; timer = maxTimeBetweenBullets; BulletManager = GetComponent <BulletManager>(); BulletManager.Init(); deathCounter = GetComponent <DeathCounter>(); deathCounter.Init(); animator = GetComponent <Animator>(); }
// Use this for initialization void Start() { _walkingSpeed = 3; _runningSpeed = 5; _jumpForce = 20; _deathCounter = DeathCounter.Instance; //_lastCheckPoint = new CheckPoint(this.transform.position, 0); _playerController = FindObjectOfType <PlayerController>(); this.gameObject.AddComponent <CheckPoint>(); _lastCheckPoint = this.gameObject.GetComponent <CheckPoint>(); _lastCheckPoint.index = 0; _lastCheckPoint.position = this.transform.position; IsWalking = false; IsRunning = false; IsJumping = false; IsGrounded = false; IsDead = false; }
public Form1() { InitializeComponent(); try { DeathCounter = new DeathCounter(); } catch (NoAdminPrivilegesException) { if (language == 0) { DialogResult ok = MessageBox.Show("Insufficient permissions. Try it again with admin rights.", "Error"); } if (language == 1) { DialogResult ok = MessageBox.Show("Permisos insuficientes. Inténtalo de nuevo ejecutándo como administrador.", "Error"); } Environment.Exit(0); } catch (NoProcessFoundException) { if (language == 0) { DialogResult ok = MessageBox.Show("The game is not running. Start the game and load a savegame before launching the application.", "Error"); } if (language == 1) { DialogResult ok = MessageBox.Show("El juego no esta en funcionamiento. Inicia el juego y selecciona una partida antes de ejecutar la aplicación", "Error"); } Environment.Exit(0); } //starts the process that count deaths every .5 seconds new Thread(new ThreadStart(runThread)).Start(); }
void Start() { textDied.text = ""; alive = true; GameObject deathObjectCounter = GameObject.FindWithTag("DeathCounter"); if (deathObjectCounter != null) { deathCounter = deathObjectCounter.GetComponent <DeathCounter>(); } if (deathCounter == null) { Debug.Log("Ne moze naci'GameController' skriptu"); } controller = GetComponent <Controller2D>(); gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight); print("Gravity: " + gravity + " Jump Velocity: " + maxJumpVelocity); animator = GetComponent <Animator>(); animator.SetBool("heDead", false); }
IEnumerator HandleDeath() { dead = true; deathTime = Time.time; // Increment death counter DeathCounter deathCounter = GameObject.Find("DeathCount").GetComponent <DeathCounter> (); deathCounter.AddDeath(); // Disable movement mv.enabled = false; // Stop us from being locked into the knocked down animation anim.SetBool("Knocked Down", false); // Gib player anim.SetTrigger("Dead"); // Show "You died" message deathMessage.SetActive(true); for (int i = 0; i < 4; i++) { yield return(new WaitForSeconds(0.5f)); music.pitch -= 0.2f; } yield return(new WaitForSeconds(0.5f)); music.Stop(); // Wait for a bit (or for button press) yield return(new WaitForSeconds(deathMessageLength - 0.5f)); // Reload level RestartLevel(); }
// Start is called before the first frame update void Start() { GameObject go = GameObject.Find("GameState"); if (go == null) { go = new GameObject(); go.name = "GameState"; go.AddComponent <GameState>(); } GameObject dc = GameObject.Find("Death_counter"); if (dc == null) { dc = Instantiate(Death_counter); dc.name = "Death_counter"; } else { DeathCounter dcScript = dc.GetComponent <DeathCounter>(); dcScript.loadDeath(); } }
private void Awake() { instance = this; }
private void Start() { this.deathCount = 0; instance = this; }
// Start is called before the first frame update void Start() { gamePlayer = FindObjectOfType <PlayerController>(); deathCounter = FindObjectOfType <DeathCounter>(); }
private void Awake() { _playerMovement = FindObjectOfType <PlayerMovement>(); _deathCounter = FindObjectOfType <DeathCounter>(); }
public override void ExecuteAction() { Camera.main.backgroundColor = deckColor; DeathCounter.ResetDeathCount(); }
void Proceed() { answeredThePopUp = true; DeathCounter.ResetDeathCountAndMakeItMoreTolerant(); customPopUp.ClosePopUpOnTop(); }
private void Start() { bestScoreText.text = "Best Score: " + DeathCounter.GetCounter().ToString(); }
void Awake() { instance = this; }
// Start is called before the first frame update void Start() { deathCounter = FindObjectOfType <DeathCounter>(); }