// Start is called before the first frame update void Start() { SimulationModelInit(); houseManager = GameObject.Find("Residence").GetComponent <HouseManager>(); gameManager = GameObject.Find("Game Manager").GetComponent <GameManager>(); strategy = GameObject.Find("Game Manager").GetComponent <Strategy>(); hospitalManager = GameObject.Find("Hospitals").GetComponent <HospitalManager>(); agentMoveScript = GetComponent <AgentMove>(); int randHospitalIdx = Random.Range(0, hospitalManager.hospitals.Count); hospitalToGo = hospitalManager.hospitals[randHospitalIdx]; hospitalScript = hospitalToGo.GetComponent <Hospital>(); if (Random.Range(0.0f, 1.0f) < initalInfectedRate) { status = health_status.infected; GetComponent <MeshRenderer>().material = orange; infectedTimeStamp = 0; houseManager.IncreInfected(); } else { status = health_status.healthy; } sympOnsetTime = Random.Range(5, 10); }
void Awake() { animator = GetComponent <Animator>(); move = GetComponent <AgentMove>(); health = GetComponent <AgentHealth>(); carry = GetComponent <AgentCarry>(); slice = GetComponent <AgentSlice>(); }
private void Start() { manager = FindObjectOfType <FriendStateManager>(); gunRenderer = GetComponentInChildren <MeshRenderer>(); barrell = gunRenderer.transform.GetChild(0); controller = GetComponent <AgentMove>(); audioSource = GetComponent <AudioSource>(); CeaseFire = false; }
private void Start() { manager = FindObjectOfType <EnemyStatemanager>(); fmanager = FindObjectOfType <FriendStateManager>(); gunRenderer = GetComponentInChildren <MeshRenderer>(); barrell = gunRenderer.transform.GetChild(0); robotRenderer = GetComponentInChildren <SkinnedMeshRenderer>(); controller = GetComponent <AgentMove>(); audioSource = GetComponent <AudioSource>(); ChooseNextPatrolPosition(); }
// Dictionary<string, float> dropTable = new Dictionary<string, float>(); private void Start() { audioSource = GetComponent <AudioSource>(); agentMove = GetComponent <AgentMove>(); gameManager = GameObject.FindGameObjectWithTag("Game Manager"); dataHandler = GameObject.FindGameObjectWithTag("Player").GetComponent <DataHandler>(); health = startHealth; gameObject.name = enemyName; if (this.gameObject.name == "Chicken King") { int bossKills = dataHandler.playerData.bossKills; if (bossKills == 0) { xpAmount = 2500; } } }
IEnumerator Init() { yield return(new WaitForSeconds(3)); startRoad = FindNearestStartRoad(transform.position); startPos = CalculateStartPos(transform.position, startRoad); for (int i = 0; i < pplPerHouse; i++) { float initPosX = Random.Range(transform.position.x - spawnOffset, transform.position.x + spawnOffset); float initPosZ = Random.Range(transform.position.z - spawnOffset, transform.position.z + spawnOffset); Vector3 initPos = new Vector3(initPosX, 0.5f, initPosZ); GameObject newPerson = Instantiate(personPrefab, initPos, personPrefab.transform.rotation); people.Add(newPerson); AgentMove agentMoveScript = newPerson.GetComponent <AgentMove>(); agentMoveScriptsList.Add(agentMoveScript); } for (int i = 0; i < pplPerHouse; i++) { int workPlaceIdx = Random.Range(0, workPlaceManager.workPlaces.Count); agentMoveScriptsList[i].Setup(gameObject, workPlaceManager.workPlaces[workPlaceIdx], 5); } }