private Bird AddBird(Habitat habitat, Sex sex, Age age) { // Bird bird = new Bird(this, habitat, sex, age, birdIDCounter); Bird bird = new Bird(this, sex, age, birdIDCounter); birdIDCounter++; habitat.InsertInhabitant(bird); bird.CurrentHabitat = habitat; Inhabitants.Add(bird); return(bird); }
protected GameObject CreatePerson() { GameObject newPerson = Instantiate(personPrefab) as GameObject; var personScript = newPerson.GetComponent <Citizen> (); var paramedicScript = newPerson.AddComponent <Citizen_PublicServant_Paramedic>(); personScript.CreateSpecial(Special.SpecialType.Doctor); paramedicScript.HomeBuilding = gameObject.GetComponent <Building>(); newPerson.transform.position = gameObject.transform.position; WorldObjects.People.Add(paramedicScript); WorldObjects.Targets.Add(newPerson); Inhabitants.Add(newPerson); return(newPerson); }
protected GameObject CreatePerson() { GameObject newPerson = Instantiate(personPrefab) as GameObject; var personScript = newPerson.GetComponent <Citizen> (); var personPolice = newPerson.AddComponent <Citizen_PublicServant_PoliceOfficer>(); personScript.CreateSpecial(Special.SpecialType.Police); newPerson.GetComponent <Citizen_PublicServant_PoliceOfficer> (); personPolice.HomeBuilding = gameObject.GetComponent <Building_PublicService_PoliceStation>(); newPerson.transform.position = gameObject.transform.position; WorldObjects.People.Add(personPolice); WorldObjects.Targets.Add(newPerson); Inhabitants.Add(newPerson); InactiveOfficers.Add(newPerson); return(newPerson); }
protected void CreateRobber() { GameObject newPerson = Instantiate(personPrefab) as GameObject; var personScript = newPerson.GetComponent <Citizen> (); var RobberScript = newPerson.AddComponent <Citizen_Criminal_Robber> (); personScript.CreateSpecial(Special.SpecialType.Robber); RobberScript.HomeBuilding = gameObject.GetComponent <Building> (); newPerson.transform.position = gameObject.transform.position; PeopleInside.Add(newPerson); WorldObjects.People.Add(RobberScript); Inhabitants.Add(newPerson); RobberScript.RobbingSpeed = 3f; }
protected GameObject CreateMafia() { GameObject newPerson = Instantiate(personPrefab) as GameObject; var personScript = newPerson.GetComponent <Citizen> (); var newMafia = newPerson.AddComponent <Citizen_Criminal_Mafia>(); newMafia.HomeBuilding = gameObject.GetComponent <Building> (); personScript.CreateSpecial(Special.SpecialType.Mafia); newPerson.transform.position = gameObject.transform.position; WorldObjects.People.Add(newMafia); WorldObjects.Targets.Add(newPerson); Inhabitants.Add(newPerson); newMafia.GunDamage = 40f; return(newPerson); }
protected GameObject CreatePerson() { GameObject newPerson = Instantiate(personPrefab) as GameObject; var personScript = newPerson.GetComponent <Citizen> (); var firefighterScript = newPerson.AddComponent <Citizen_PublicServant_FireFighter>(); InitializeCitizenStats(firefighterScript); personScript.CreateSpecial(Special.SpecialType.Firefighter); firefighterScript.waterParticle = newPerson.GetComponentInChildren <ParticleSystem> (); newPerson.transform.position = gameObject.transform.position; WorldObjects.People.Add(firefighterScript); WorldObjects.Targets.Add(newPerson); InactiveFireFighters.Add(newPerson); Inhabitants.Add(newPerson); return(newPerson); }
protected virtual GameObject CreatePerson() { //print ("Creating person from: " + gameObject.name); int rand = Random.Range(0, 100); GameObject newPerson = Instantiate(personPrefab) as GameObject; var citizenScript = newPerson.GetComponent <Citizen> (); var personScript = newPerson.AddComponent <Citizen_Civilian>(); var civilian = newPerson.GetComponent <Citizen_Civilian> (); //newPerson.AddComponent<HostileCitizenTarget> (); //This must be as an event instead if (rand == 42) { citizenScript.CreateSpecial(Special.SpecialType.BonusCitizen); } else { citizenScript.CreateCitizen(); } PeopleInside.Add(newPerson); newPerson.transform.position = gameObject.transform.position; personScript.HomeBuilding = this; WorldObjects.People.Add(civilian); WorldObjects.Targets.Add(newPerson); Inhabitants.Add(newPerson); return(newPerson); }