/*********************************************************************************** * Function Name: ExitBuildState * Description: Exit Build State and Enter Select Worker state for next player **********************************************************************************/ public void ExitBuildState() { //Reset worker + space selection GameManager.instance.ResetSelection(selectedWorker); selectedWorker = null; selectedSpace = null; //End current player's turn GameManager.instance.EndTurn(); //Enter worker selector state for other player WorkerSelector workerSelect = GetComponent <WorkerSelector>(); workerSelect.EnterState(); }
void InitializePlayerCompany() { GameObject newCompany = GameObject.Instantiate(Resources.Load <GameObject>("GameSystem/Company/Object/Player")); newCompany.transform.SetParent(CompanyManagerObject.transform); CompanyManager CompanyManagerCall = CompanyManagerObject.GetComponent <CompanyManager>(); WorkerSelector WorkerSelectorCall = GameObject.Find("WorkerManager").GetComponent <WorkerSelector>(); CompanyManagerCall.AddCompany(CompanyName, newCompany); CompanyManagerCall.PlayerCompanyName = CompanyName; newCompany.name = CompanyName; EconomyValue EconomyValueCall = CompanyManagerCall.GetPlayerCompanyValue().GetEconomyValue().GetComponent <EconomyValue>(); EconomyValueCall.Balance = 40000; WorkerSelector.Worker CEO = WorkerSelectorCall.AddCustomWorker(null, 3, 0, 0, 0, 0, 0); CompanyManagerCall.GetPlayerCompanyValue().GetEmployeeValue().GetComponent <EmployeeValue>().HireEmployee(CEO); WorkerSelectorCall.UnHiredList.Remove(CEO); }