void Update() { if (Input.GetKeyDown(KeyCode.Space)) { onGameOver.Invoke(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Dot")) { addPoint.Invoke(); } }
public void OnSuccess(Puzzle puzzle, Slot slot) { remainingPuzzles--; if (remainingPuzzles == 0) { OnGameOver.Invoke(); } }
private void EnemyDied() { actualEnemyCount--; if (actualEnemyCount == 0) { EndGameEvent.Invoke(); } }
private void CheckOccupationLimit(SystemElementController hackedElement, VirusValue virus) { float occupation = elementList.PercentageOccupation(virus.Value); if (occupation >= OccupationLimit) { onGameOver.Invoke(); } }
public void OnPointerUp(PointerEventData eventData) { if (canBePressed) { trapIconRelesed.Invoke(); canBePressed = false; lastTimeRelesed = Time.timeSinceLevelLoad; cooldownTimerImage.fillAmount = 1; changeTimeScale.Invoke(1); } }
//Dev part //private void Update() //{ // if (Input.GetKeyDown(KeyCode.Mouse0)) // { // Shoot(); // } //} public void Shoot() { if (OnShootEvent != null) { OnShootEvent.Invoke(); } GameObject bullet = bulletController.GetBullet(); bullet.SetActive(true); bullet.transform.position = transform.position; var bulletClass = bullet.GetComponent <Bullet>(); bulletClass.GetComponent <Rigidbody>().AddForce(transform.forward * bulletClass.bulletData.SpeedModifier); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player" && Helper.distance(transform.position, collision.transform.position) < 1.3f) { audioSource.Play(); if (enemyController != null) { addPoints.Invoke(enemyController.enemiesCount); } SaveLoadDataController.LoadedData.playerLevel++; SaveLoadDataController.SaveData(); levelPassed.Invoke(); player.GetComponent <PlayerControler>().CanMove = false; } }
private void NextTurn() { OnBeforeTurnChange.Invoke(); activeVirus.Value.enabled = false; playerIndex = (playerIndex + 1) % players.Length; activeVirus.Value = players[playerIndex]; activeVirus.Value.enabled = true; if (playerIndex == 0) { currentTurn.Value++; } OnTurnChanged.Invoke(); }
//TODO: sprawdzić, czy da się wykonać kolorowanie i nadawanie koordynatów jednocześnie private IEnumerator ManageTiles(HexMapGenerator mapGenerator) { yield return(null); yield return(mapGenerator.GenerateMap()); hexTileList = mapGenerator.TileList; ColorTiles(); GenerateSystemElements(); var hexagonalCoordinateController = new HexagonalCoordinateController(hexTileList.First()); hexagonalCoordinateController.ApplyCoordinates(); yield return(new WaitForEndOfFrame()); onMapGeneratedEvent.Invoke(); }
private void Die() { audioSource.clip = dieSound; audioSource.Play(); if (addPoints != null) { addPoints.Invoke(Mathf.CeilToInt(actualUnitStatistic.MaxHP / 2f)); } if (playerDied != null) { playerDied.Invoke(); SaveLoadDataController.ClearData(); } DropLoot(); dead = true; gameObject.SetActive(false); }
public void GetDamage(int damage) { if (PlayerHitEvent != null) { PlayerHitEvent.Invoke(); } if (damage >= ActualHealthPoint) { ActualHealthPoint = 0; actualPercentOfHealth = 0; gameObject.SendMessage("Die"); } else { ActualHealthPoint -= damage; actualPercentOfHealth = (int)ActualHealthPoint * 100 / startingHealthPoint; } healthBar.fillAmount = actualPercentOfHealth / 100f; }
private void Die() { endGameEvent.Invoke(); }
private void Die() { EnemyDiedEvent.Invoke(); gameObject.SetActive(false); }
public void Invoke() { eventToInvoke.Invoke(); }
public void Play() { onImageSelected.Invoke(); SceneManager.LoadScene(gameSceneIndex); }
public void OnLeveOptions() { PlayerPrefs.SetInt(OptionsEnum.SoundsOn.ToString(), SoundsOn ? 1 : 0); PlayerPrefs.SetInt(OptionsEnum.SoundsVolume.ToString(), SoundsVolume); updateVolume.Invoke(); }