void Start()
 {
     _gameInstance = Game.getInstance();
     _structureManager = GetComponentInChildren<StructureManager>();
     _playerManager = PlayerManager.instance;
     _cameraTools = GameObject.Find("Camera").GetComponent("CameraTools") as CameraTools;
     _bk1 = new NailSpitterBase();
     loadPlayerPrefs();
     _gameInstance.GState = Game.GameState.Loading;
 }
Esempio n. 2
0
 public void HireVillager(Villager villager, StructureManager.Structure struc)
 {
     IEnumerable<PhysicalStructure> hiringList = GM.builderHelper.hiringPStructList.Where(x => x.structure == struc);
     if(hiringList.Count() > 0){
         PhysicalStructure hiringStruc = hiringList.First();
         if(struc.isHouse){
             villager.livesAt = hiringStruc.spotIndex;
         }else{
             villager.worksAt = hiringStruc.spotIndex;
         }
         struc.workers.Add(villager);
         if(hiringStruc.employeeList.Count == 0)
             struc.activeAmount++;
         hiringStruc.employeeList.Add(villager);
         if(hiringStruc.employeeList.Count == struc.workerCapacity)
             struc.fullyActiveAmount++;
     }
 }