public void SetWaveConfig(WaveScript waveScript) { _waveScript = waveScript; moveSpeed = waveScript.GetEnemiesSpeed(); waypoints = waveScript.GetWaypoints(); transform.position = waypoints[waypointIndex].position; }
void Start() { rnd = Random.Range(0, 1); rndRespawnTime = Random.Range(minRespawnTime * 60, maxRespawnTime * 60); Instantiate(enemyBoxes[rnd], transform.position, Quaternion.identity); player = GameObject.Find("Player"); Wscript = GameObject.Find("WaveText").GetComponent <WaveScript>(); }
void Start() { phealth = character.GetComponent <Health>(); score = 0; wave = new WaveScript(spawner); wave.setZombies(zombies); wave.setRoundStatus(roundStatus); pointsForSecond = PointsForSecond; }
private void UseWaveProperty(GameObject newRobot, bool isImposter, GameObject selectedSphere) { WaveScript script = newRobot.AddComponent <WaveScript> (); script.arCamera = arCamera; script.isImposter = isImposter; script.resultText = resultText; script.gestureButtonScript = holdButton.GetComponent <GestureButton> (); script.selectedSphere = selectedSphere; }
// Start is called before the first frame update override protected void Start() { base.Start(); animator = GetComponent <Animator>(); player = GameObject.FindGameObjectsWithTag("Player")[0].transform; waveScript = GameObject.Find("WaveManager").GetComponent <WaveScript>(); attackHash = Animator.StringToHash("Base Layer.Attack"); hitHash = Animator.StringToHash("Base Layer.Hit"); }
IEnumerator SpawnAllEnemiesOfTheWave(WaveScript waveScript) { for (int i = 0; i < waveScript.GetNumberOfEnemies(); i++) { var enemy = Instantiate( waveScript.GetEnemyPrefab(), waveScript.GetWaypoints()[0].position, Quaternion.identity); enemy.GetComponent <EnemyMovement>().SetWaveConfig(waveScript); yield return(new WaitForSeconds(waveScript.GetTimeBetweenSpawns())); } }
void Start() { WaveScript ws = this.GetComponentInParent <WaveScript>(); SessionManager sm = GetComponentInParent <SessionManager>(); if (spawnParent == null) { if (ws != null) { this.spawnParent = ws.transform; } else if (sm != null) { this.spawnParent = sm.transform; } else { this.spawnParent = gameObject.transform; } } updateVelMult(velocityMult); }
void Spawn(int wave) { Debug.LogFormat("Spawn wave {0}", wave); if (currentWave != null) { Debug.Log("ERROR: Event Controller Spawn()ed when currentwave gameobject wasn't null, don't expect this to happen. Make sure to despawn before spawning"); return; } //this.currentWave = Instantiate (this.wavelist[wave], this.transform.position, this.transform.rotation); this.currentWave = Instantiate(this.wavelist[wave], this.transform, true); EnemyScript[] enemies = currentWave.GetComponents <EnemyScript>(); foreach (EnemyScript e in enemies) { Debug.LogFormat("{0}: hpmax = {1}", e.name, e.healthMax); } this.currentWaveScript = this.currentWave.GetComponent <WaveScript> (); this.currentWaveScript.startHP = this.prevHealth; UICharSystem.instance.updateHealthBar(this.prevHealth); //Debug.Log(string.Format("set HP {0}", this.prevHealth)); UICharSystem.instance.currLevel.text = (wave + 1).ToString(); this.audioS.PlayOneShot(this.spawnSound); }
// Start is called before the first frame update void Start() { waveScript = GameObject.Find("WaveManager").GetComponent <WaveScript>(); waveScript.AddSpawner(this); }
List <int> poslist = new List <int>(); //リスポーン済みリスト void Start() { rnd = Random.Range(0, 1); player = GameObject.Find("Player"); Wscript = GameObject.Find("WaveText").GetComponent <WaveScript>(); }