// Use this for initialization void Start() { target = GameObject.Find("Path").transform.GetChild(1); agent = GetComponent <NavMeshAgent> (); agent.speed = speed; GameObject healthBar = GameObject.Find("HealthBar"); houseHealth = healthBar.GetComponent <HouseHealth>(); /*Zugriff aufs Script Gate Health*/ }
/// <summary> /// Switches the target waypoint to the next waypoint, and destroies enemy object if all waypoints passed /// </summary> private void goToNextWayPoint() { wavepointIndex++; if (wavepointIndex < wayPoints.Length) { target = wayPoints[wavepointIndex]; } else { WaveSpawner.enemiesAlive--; //Update number of enemies alive HouseHealth.takeDamage(this.damage); Destroy(gameObject); } }
private void Start() { if (FindObjectOfType <HouseHealth>() != null) { house = FindObjectOfType <HouseHealth>(); } else { Debug.LogWarning("No object of type " + typeof(HouseHealth) + " could be found."); } if (burnTillCompletion == CompletionAmount.All) { burnCompletion = 100; } if (tasksTillCompletion == CompletionAmount.All) { taskCompletion = 100; } }
/// <summary> /// Resets the game state. That is: Resets all static variables to their default values /// </summary> private void resetStaticGameState() { //Reset house health HouseHealth.resetHealth(); //Reset money Player.restMoney(); //Reset enemies alive WaveSpawner.resetEnemiesAlive(); //Hide end of game menu gameObject.SetActive(false); //Reset lost state Player.restLostState(); //Reset game speed ApplicationActions.instance.unpause(); //Reset node list Node.goList = new List <Node>(); }
// Use this for initialization void Start() { houseHealth = houseHealthBar.GetComponent <HouseHealth>(); isAlive = true; }