public static GetInstance ( ) : DBCharsAndBuildings, | ||
리턴 | DBCharsAndBuildings, |
void Start() { inhabitants = new List <NPC> (); typeOfBuilding = Buildingtype.Apartement; DBCharsAndBuildings.GetInstance().RegistrationBuilding(this); StartCoroutine(SpawnDelay(spawnDelayTime)); }
public override Transform SearchWayToSatisfy() { target = DBCharsAndBuildings.GetInstance().FindClosestTargetBuilding(Buildingtype.Storage, owner.transform); isFed = true; return(target); }
public override Transform SearchWayToSatisfy() { if (myMaster.GetCargoStatus() >= myMaster.GetCargoCapacity()) { Transform storage = DBCharsAndBuildings.GetInstance().FindClosestTargetBuilding(Buildingtype.Storage, myMaster.transform); if (storage != null) { return(storage); } } return(workplaceTransform); }
// private Hunger hunger; void Start() { work = new WorkDesire(GetComponent <NPCAI>(), this); GetComponent <NPCAI>().AddDesire(work); // hunger = new Hunger(); bool jobSearchResult = Jobsearch(); if (!jobSearchResult) { StartCoroutine(JobDelay(jobSearchZyclusTime)); } citizenCounter++; citizenID = citizenCounter; DBCharsAndBuildings.GetInstance().RegistrationCitizen(this); }
bool Jobsearch() { List <IWorkplace> workplaceListe = DBCharsAndBuildings.GetInstance().GetWorkplaces(); Debug.Log("Suche Job"); foreach (IWorkplace workplace in workplaceListe) { if (workplace.HasJobsLeft()) { Debug.Log(workplace); job = workplace.GetJobType(); hisWorkplace = ((IBuilding)workplace).GetTransform(); work.SetWorkplacePosition(hisWorkplace); jobIdleTrigger = false; workplace.RegistrationWorker(this); return(true); } } return(false); }
void FixedUpdate() { if (hunger < 100) { hunger = hunger + hungerMultiplikator; //war 0,01334 } if (hunger >= 80 && !hungersnot) { Debug.Log("Over 80"); lager = DBCharsAndBuildings.GetInstance().FindClosestTargetBuilding(Buildingtype.Storage, transform); //gameObject.GetComponent<NPC>().SetTargetPosition(lager.transform.position); hungersnot = true; //geht zum Lagerhaus } if (hunger >= 100 && health > 0) { health = health - hungerMultiplikator; //beginnt zu sterben } if (health <= 0) { Destroy(gameObject); //stirbt //Explode (); } }
void OnDisable() { DBCharsAndBuildings.GetInstance().DeleteBuilding(this); }
void Start() { base.typeOfBuilding = Buildingtype.Fishery; DBCharsAndBuildings.GetInstance().RegistrationBuilding(this); }
// Use this for initialization void Start() { DBCharsAndBuildings.GetInstance().RegistrationBuilding(this); }