public void StopWave() { Debug.Log("Terminando oleada"); playing = false; foreach (Enemy enemy in newWave.enemies) { Debug.Log("Enemy in time: " + enemy.timeOfSpawn); } newLevel.AddWave(newWave); gameLevels.AddLevel(newLevel); Debug.Log("Saving game level data :" + newLevel.levelNumber); DataPrincess.Save(gameLevels); }
public void DestroyEnemy() { totalLevelEnemies--; enemiesText.text = totalLevelEnemies.ToString(); Debug.Log("Calling destroy" + totalLevelEnemies.ToString()); if (totalLevelEnemies == 0) { if (_info.unlockedLevels == currentLevel.levelNumber) { _info.unlockedLevels++; } DataPrincess.Save(_info); SceneManager.LoadScene("VictoryLevel"); } }
// Use this for initialization void Start() { DataPrincess.Delete(); _info = DataPrincess.Load(); GoldValue.text = _info.gold.ToString(); _bombs [0].CoolBtn.gameObject.SetActive(true); _bombs [0].DmgBtn.gameObject.SetActive(true); _caldero.DmgBtn.gameObject.SetActive(true); _caldero.CoolBtn.gameObject.SetActive(true); HealthBtn.gameObject.SetActive(true); Check(); SetNewPrice(0); SetNewPrice(1); SetNewPrice(2); SetNewPrice(3); SetNewPrice(4); SetNewPrice(5); }
// Use this for initialization void Start() { _info = DataPrincess.Load(); gameLevels = DataPrincess.LoadGameLevels(); DataSender _sender = GameObject.FindObjectOfType <DataSender>(); if (_sender != null) { currentLevel = gameLevels.FindLevel(_sender.level); Debug.Log("Loading Level: " + _sender.level.ToString()); } else { currentLevel = gameLevels.FindLevel(1); } wavesText.text = waveNumber + "/" + currentLevel.numberOfWaves; SpawnLevel(currentLevel); }
void Start() { pi = DataPrincess.Load(); for (int i = 0; i < _btnLevels.Length; i++) { if (i <= pi.unlockedLevels - 1) { _btnLevels [i].interactable = true; } else { _btnLevels [i].interactable = false; } } if (pi.fireShot) { _ammoImages [1].interactable = true; } else { _ammoImages [1].interactable = false; } if (pi.iceShot) { _ammoImages [2].interactable = true; } else { _ammoImages [2].interactable = false; } if (pi.bombShot) { _ammoImages [3].interactable = true; } else { _ammoImages [3].interactable = false; } _ammoImages[0].GetComponent <Image>().color = Color.yellow; _ammoSelect.SetActive(false); }
//Add all the button and input listeners void Start() { enemyList = new List <GameObject> (); enemy1Button.onClick.AddListener(() => SpawnEnemy(EnemyType.Normal)); enemy2Button.onClick.AddListener(() => SpawnEnemy(EnemyType.Fast)); enemy3Button.onClick.AddListener(() => SpawnEnemy(EnemyType.Brute)); enemy4Button.onClick.AddListener(() => SpawnEnemy(EnemyType.FlyingNormal)); startButton.onClick.AddListener(() => StartWave()); stopButton.onClick.AddListener(() => StopWave()); waveInput.text = "1"; numberOfWavesInput.text = "1"; levelInput.text = "1"; gameLevels = DataPrincess.LoadGameLevels(); ReadGameLevels(gameLevels); }
// Use this for initialization void Start() { _info = DataPrincess.Load(); isPressing = false; guides = new GameObject[20]; for (int i = 0; i < 20; i++) { guides [i] = Instantiate(marker, ShootPoint.position, Quaternion.identity) as GameObject; guides [i].transform.SetParent(ShootPoint); } DataSender _sender = GameObject.FindObjectOfType <DataSender>(); if (_sender != null) { bullet = _bullets [_sender._bulletType]; _selectedType = _sender._bulletType; } else { bullet = _bullets [0]; } GamePropertiesScript gps = new GamePropertiesScript(); //Assigning properties based on GameProperties script g = gps.gravity; minTime = gps.bulletMinTime; maxTime = gps.bulletMaxTime; minDistance = gps.bulletMinDistance; maxDistance = gps.bulletMaxDistance; MaxCooldown = gps.currentBulletCooldown; if (_info.ally1) { _allies [0].gameObject.SetActive(true); } else { //_allies [0].gameObject.SetActive (false); } if (_info.ally2) { _allies [1].gameObject.SetActive(true); } else { //_allies [1].gameObject.SetActive (false); } if (_info.ally3) { _allies [2].gameObject.SetActive(true); } else { //_allies [2].gameObject.SetActive (false); } switch (_selectedType) { case 0: MaxCooldown -= _info.NormalBulletCooldown * 0.1f; break; case 1: MaxCooldown -= _info.FireBulletCooldown * 0.1f; break; case 2: MaxCooldown -= _info.IceBulletCooldown * 0.1f; break; case 3: MaxCooldown -= _info.BombBulletCooldown * 0.1f; break; } maxHealth = gps.currentPlayerMaxHP + (_info.PlayerHP * 10) - 10; _health = maxHealth; x1 = -gps.bulletMinDistance; target.gameObject.SetActive(false); }
public void SaveNewData() { DataPrincess.Save(_info); SceneManager.LoadScene("LevelSelection"); }