// Start is called before the first frame update void Start() { TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CompanyManagerCall = transform.parent.parent.gameObject.GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); FaciliyValueCall = CompanyValueCall.GetFacilityValue().GetComponent <FacilityValue>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); TotalStorableAmount = 0f; AvailableElectricityAmount = 0f; ElectricityInputValue = 20f; ElectricityInputRatio = 1f; ElectricFee = 0.001f; BlackOutTimeLimit = 200; BlackOutTimer = BlackOutTimeLimit; UsedElectricityAmount = 0f; StoreObjectCount = 0; Lack = false; CompanyValueCall.GetEconomyValue().GetComponent <EconomyValue>().AddPersistHistory(TimeManagerCall.GetNextMonth(0), TimeManagerCall.Month, "UpKeep", "Electric Fee", "Electric Fee", -Mathf.CeilToInt(UsedElectricityAmount * ElectricFee)); // CompanyValueCall.GetEconomyValue().GetComponent<EconomyValue>().AddHistory(TimeManagerCall.TimeValue, "UpKeep", // "Electric Fee", "Electric Fee", -Mathf.CeilToInt(UsedElectricityAmount * ElectricFee), true); if (CompanyValueCall.CompanyName == CompanyManagerCall.PlayerCompanyName) { PanelControllerCall.UpdateFactoryInfo("Electricity", TotalUsage, AvailableElectricityAmount); } }
// Start is called before the first frame update void Awake() { CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CompanyValueCall = CompanyManagerCall.GetPlayerCompanyValue(); TechValueCall = CompanyValueCall.GetTechValue().GetComponent <TechValue>(); ValueCall = GameObject.Find("BaseSystem").GetComponent <InGameValue>(); }
public float[] EvaluateCostomer(string BankName, CompanyValue CostomerValue) { float[] Result = new float[2]; // 0: Interest Rate 1: Maximum Loan Amount BankInfo TargetBankInfo = GetBankInfo(BankName); int ExistLoanValue = 0; if (CostomerValue.TotalValue < TargetBankInfo.CreditStandard) { Result = null; return(Result); } foreach (var Deal in TargetBankInfo.DealList) { if (Deal.CostomerValue == CostomerValue) { ExistLoanValue = Deal.LoanValue; break; } } float InterestReductionRatio = Mathf.Min(1f, CostomerValue.TotalValue * TargetBankInfo.InterestReductionRate); Result[0] = Mathf.Max(TargetBankInfo.InterestFloor, TargetBankInfo.InterestRate * (1 - InterestReductionRatio)); Result[1] = Mathf.Max(0, Mathf.Max(TargetBankInfo.MinimumLoanValue, TargetBankInfo.MaximumLoanValue * InterestReductionRatio) - ExistLoanValue); return(Result); }
private IEnumerable <CompanyValue> GenerateCollectionToReturn() { var currentDate = Historical.HistoricalValue.Last().Date; var currentPrice = Historical.HistoricalValue.Last().Price; var valuesToExtend = new List <CompanyValue>(Historical.HistoricalValue); for (int i = 0; i < ValuesToGenerate; i++) { AddNoiseToPriceStep(); currentDate += TimeStep; currentPrice += PriceStep; if (PriceStepShouldBeReversed(currentPrice)) { PriceStep *= -1; currentPrice += 2 * PriceStep; } var toAdd = new CompanyValue(currentDate, currentPrice); valuesToExtend.Add(toAdd); } return(valuesToExtend); }
public ConversationOptionData(string _text, int _id) { optionText = _text; optionType = OptionTrigger.None; optionTrait = CompanyValue.NULL; optionDestinationStepID = _id; }
// Start is called before the first frame update void Start() { CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); InstalledFacilityAmount = 0; }
void Start() { ClickCheckerCall = GameObject.Find("BaseSystem").GetComponent <ClickChecker>(); ValueCall = GameObject.Find("BaseSystem").GetComponent <InGameValue>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CompanyValueCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue(); NewsPanelControllerCall = NewsPanel.GetComponent <NewsPanelController>(); PlayerCompanyName = CompanyValueCall.CompanyName; SidePanelManager(); FloatingPanelManager(); NewsPanelControllerCall.CallPanelController = this; AlertPopUpPanel.GetComponent <AlertPopUpPanelController>().CallPanelController = this; NoteToolTipPanel.GetComponent <NoteToolTipPanelController>().CallPanelController = this; NoteToolTipPanel.GetComponent <NoteToolTipPanelController>().CallNotificationManager = GameObject.Find("NotificationManager").GetComponent <NotificationManager>(); SetUIScale(); Scaling(); NewsPanelControllerCall.UpdateTimeText(); }
public ConversationOptionData(string _text, int _id, CompanyValue _trait, OptionTrigger _type) { optionText = _text; optionDestinationStepID = _id; optionTrait = _trait; optionType = _type; }
// Start is called before the first frame update void Start() { ObjectActCall = gameObject.GetComponent <InstallableObjectAct>(); CompanyValueCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue(); ElectricityValueCall = CompanyValueCall.GetElectricityValue().GetComponent <ElectricityValue>(); CurrentChargingAmount = 0; }
// Start is called before the first frame update void Start() { CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); EconomyValueCall = CompanyValueCall.GetEconomyValue().GetComponent <EconomyValue>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); EconomyValueCall.AddPersistHistory(TimeManagerCall.GetNextMonth(0), TimeManagerCall.Month, "Real Estate", "Land Tax", "Land Tax", 0); // EconomyValueCall.AddHistory(TimeManagerCall.TimeValue, "Real Estate", "Land Tax", "Land Tax", 0, true); }
void Start() { CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); TimeManangerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); TechRecipeCall = GameObject.Find("BaseSystem").GetComponent <TechRecipe>(); GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); AvailableRecipe = new List <RecipeInfo>(); Initializing(); }
public CompanyValue GetPlayerCompanyValue() { CompanyValue result = null; foreach (var Info in CompanyList) { if (Info.Name == PlayerCompanyName) { result = Info.Object.GetComponent <CompanyValue>(); break; } } return(result); }
void Awake() { CallTimeManager = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CallCompanyManager = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CallCompanyValue = CallCompanyManager.GetPlayerCompanyValue(); CallElectricityValue = CallCompanyValue.GetElectricityValue().GetComponent <ElectricityValue>(); CallEmployeeValue = CallCompanyValue.GetEmployeeValue().GetComponent <EmployeeValue>(); CallGoodsValue = CallCompanyValue.GetGoodsValue().GetComponent <GoodsValue>(); CallFacilityValue = CallCompanyValue.GetFacilityValue().GetComponent <FacilityValue>(); ElectricityGraphPanelCarrier = GraphCarrier.transform.GetChild(0).gameObject; LaborForceGraphPanelCarrier = GraphCarrier.transform.GetChild(2).gameObject; ProcessGraphPanelCarrier = GraphCarrier.transform.GetChild(4).gameObject; ProcessGraphIndexPanel = ProcessGraphIndexCarrier.transform.parent.gameObject; }
// Start is called before the first frame update void Start() { CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); GoodsValueCall = CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>(); TimaManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); SalesValueCall = GameObject.Find("SalesManager").GetComponent <SalesValue>(); List <string> ItemList = new List <string>(); List <int> PriceList = new List <int>(); CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>().TotalCapacity = 9999999; switch (Name) { case "General Industry Co.": ItemList.Add("Paper roll"); PriceList.Add(1); Initializing(ItemList, PriceList); break; case "Federal Agency of Industry": ItemList.Add("Plastic mass"); ItemList.Add("Silicon mass"); PriceList.Add(2); PriceList.Add(3); Initializing(ItemList, PriceList); break; // case "Sasio" : // ItemList.Add("Packaged Calculator"); ItemList.Add("Calculator"); ItemList.Add("Calculating Circuit"); // List<string> NameList = new List<string>(); // NameList.Add("Packaged Cal-100"); NameList.Add("Cal-100"); NameList.Add("CM100"); // PriceList.Add(18); PriceList.Add(13); PriceList.Add(10); // GoodsRecipe GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent<GoodsRecipe>(); // TechValue TechValueCall = CompanyValueCall.GetTechValue().GetComponent<TechValue>(); // for(int i = 0; i < ItemList.Count; i++) // { // for(int j = 0; j < GoodsRecipeCall.RecipeArray.Count; j++) // { // if(GoodsRecipeCall.RecipeArray[j].OutputName == ItemList[i]) // { // GoodsRecipeCall.MakeCustomRecipe(ItemList[i], NameList[i], GoodsRecipeCall.RecipeArray[j].InputName, GoodsRecipeCall.RecipeArray[j].Attractiveness, Name); // SalesValueCall.AddSales(NameList[i], Name, PriceList[i]); // } // } // } // break; } StockManage(); }
public DealInfo StartNewDeal(CompanyValue TargetCompanyValue, string BankName, int LoanValue) { DealInfo NewDeal = new DealInfo(); NewDeal.CostomerValue = TargetCompanyValue; NewDeal.ServiceBank = GetBankInfo(BankName); NewDeal.LoanValue = LoanValue; NewDeal.InterestRate = EvaluateCostomer(BankName, NewDeal.CostomerValue)[0]; NewDeal.StartDate = TimeManagerCall.TimeValue; NewDeal.ServiceBank.DealList.Add(NewDeal); NewDeal.CostomerValue.GetEconomyValue().GetComponent <EconomyValue>().AddPersistHistory(TimeManagerCall.GetNextMonth(0) + (NewDeal.StartDate % TimeManagerCall.Month), TimeManagerCall.Month, "Upkeep", "Loan Interest", BankName + " Loan Interest", -Mathf.CeilToInt(NewDeal.InterestRate * NewDeal.LoanValue)); NewDeal.CostomerValue.GetEconomyValue().GetComponent <EconomyValue>().AddHistory(TimeManagerCall.TimeValue, "Loan", "Loan Money", BankName + " Loan Money", LoanValue); return(NewDeal); }
// Start is called before the first frame update void Start() { BaseSystem = GameObject.Find("BaseSystem"); ObjectActCall = gameObject.GetComponent <InstallableObjectAct>(); CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>(); CompanyValueCall = ObjectActCall.CompanyValueCall; TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); TechRecipeCall = BaseSystem.GetComponent <TechRecipe>(); TechValueCall = CompanyManagerCall.GetCompanyValue(CompanyValueCall.CompanyName).GetTechValue().GetComponent <TechValue>(); NotificationManagerCall = GameObject.Find("NotificationManager").GetComponent <NotificationManager>(); GoodsRecipeCall = BaseSystem.GetComponent <GoodsRecipe>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); CurrentResearchingTech = null; resultObject = new ResultObject(); }
// Start is called before the first frame update void Start() { ValueCall = GameObject.Find("BaseSystem").GetComponent <InGameValue>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CompanyManagerCall = transform.parent.parent.gameObject.GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); EconomyValueCall = CompanyValueCall.GetEconomyValue().GetComponent <EconomyValue>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); ActivatedLabor = 0; ActivatedRequiredLabor = 0; RotateTimeLimit = 200; RotateTimer = RotateTimeLimit; if (CompanyValueCall.CompanyName == CompanyManagerCall.PlayerCompanyName) { PanelControllerCall.UpdateFactoryInfo("Employee", TotalLabor, RequiredLabor); } }
// Start is called before the first frame update void Start() { isInstall = false; BaseSystem = GameObject.Find("BaseSystem"); ValueCall = BaseSystem.GetComponent <InGameValue>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); ClickCheckerCall = BaseSystem.GetComponent <ClickChecker>(); GroupActivationCall = BaseSystem.GetComponent <GroupActivation>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); EconomyValueCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetEconomyValue().GetComponent <EconomyValue>(); NotificationManagerCall = GameObject.Find("NotificationManager").GetComponent <NotificationManager>(); CompanyValueCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue(); WorkSpeed = 1f; IsWorking = false; GetWholeStructObject(); GetOriginalStructColor(); CheckInstallCondition(); }
public void AddConversationResponse(string _responsetext, int _responseID, CompanyValue _trait, OptionTrigger _type, Quest _quest) { GameObject btn = Instantiate(conversationOptionPrefab, conversationOptionContainer) as GameObject; btn.GetComponentInChildren <TextMeshProUGUI>().text = _responsetext; btn.GetComponent <Button>().onClick.AddListener(delegate { ConversationManager.instance.NextConversationStep(_responseID); }); if (_type == OptionTrigger.QuestAcceptance) { btn.GetComponent <Button>().onClick.AddListener(delegate { _quest.Accept(); }); } else if (_type == OptionTrigger.ObtainQuestReward) { btn.GetComponent <Button>().onClick.AddListener(delegate { _quest.ClaimReward(); }); } switch (_trait) { case CompanyValue.NULL: btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().enabled = false; break; case CompanyValue.ValueOne: btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().enabled = true; btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = perceptionIcon; btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().color = ValueOneColor; break; case CompanyValue.ValueTwo: btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().enabled = true; btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = managementIcon; btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().color = ValueTwoColor; break; case CompanyValue.ValueThree: btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().enabled = true; btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().sprite = coWorkerIcon; btn.transform.GetChild(1).GetChild(0).GetComponent <Image>().color = ValueThreeColor; break; default: Debug.LogError("Unknown Trait Type"); break; } }
// Start is called before the first frame update void Start() { ValueCall = GameObject.Find("BaseSystem").GetComponent <InGameValue>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CompanyManagerCall = transform.parent.parent.gameObject.GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); RealtimeIncome = 0; CurrentHistoryIndex = 0; PersistHistoryArray = new List <PersistHistory>(); AddNewMonthlyHistroy(); CalculateRealtimeIncome(); if (CompanyValueCall.CompanyName == CompanyManagerCall.PlayerCompanyName) { PanelControllerCall.UpdateFinanceInfo(RealtimeIncome, Balance); } }
void Awake() { CallCompanyValue = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue(); CallEconomyValue = CallCompanyValue.GetEconomyValue().GetComponent <EconomyValue>(); CallBankValue = GameObject.Find("BaseSystem").GetComponent <BankValue>(); CallTimeManager = GameObject.Find("TimeManager").GetComponent <TimeManager>(); CallNotificationManager = GameObject.Find("NotificationManager").GetComponent <NotificationManager>(); IncomePieGraphPanel = SummaryPanel.transform.GetChild(0).gameObject; IncomePieGraphCarrier = IncomePieGraphPanel.transform.GetChild(1).gameObject; ExpensePieGraphPanel = SummaryPanel.transform.GetChild(1).gameObject; ExpensePieGraphCarrier = ExpensePieGraphPanel.transform.GetChild(1).gameObject; SummaryReportPanel = SummaryPanel.transform.GetChild(2).gameObject; SummaryReportCarrier = SummaryReportPanel.transform.GetChild(0).gameObject; DetailReportCategoryPanel = DetailReportPanel.transform.GetChild(0).gameObject; DetailReportInnerPanel = DetailReportPanel.transform.GetChild(1).gameObject; DetailReportPanelCategoryDropdown = DetailReportCategoryPanel.transform.GetChild(1).gameObject; DetailReportCarrier = DetailReportInnerPanel.transform.GetChild(0).gameObject; BankListPanel = LoanPanel.transform.GetChild(1).GetChild(0).GetChild(0).GetChild(0).gameObject; LoanFunctionPanel = LoanPanel.transform.GetChild(1).GetChild(1).GetChild(0).gameObject; }
// Start is called before the first frame update void Start() { CompanyManagerCall = transform.parent.parent.gameObject.GetComponent <CompanyManager>(); CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>(); RecipeCall = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>(); TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>(); PanelControllerCall = GameObject.Find("Canvas").GetComponent <PanelController>(); // newGoods = new Goods(); // newGoods.ID = -1; // newGoods.Name = "None"; // newGoods.inMap = false; // newGoods.isMoving = false; // newGoods.GoodsObject = null; // GoodsArray.Add(newGoods); CurGoodsID = 0; TotalCapacity = 0; if (CompanyValueCall.CompanyName == CompanyManagerCall.PlayerCompanyName) { PanelControllerCall.UpdateFactoryInfo("Warehouse", GetStoredGoods().Count, TotalCapacity); } }
public void DisplayInfo() { InstallableObjectAct TargetBasicInfo = TargetObject.GetComponent <InstallableObjectAct>(); FacilityValue.FacilityInfo TargetValue = TargetBasicInfo.Value; CompanyValue CallCompnayValue = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue(); GoodsRecipe CallGoodsRecipe = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>(); InfoPanelCarrier.transform.GetChild(1).GetChild(0).gameObject.GetComponent <Text>().text = TargetInfo.Type; InfoPanelCarrier.transform.GetChild(1).GetChild(1).gameObject.GetComponent <Text>().text = TargetInfo.Name; InfoPanelCarrier.transform.GetChild(2).GetChild(0).gameObject.GetComponent <Text>().text = "Consume"; InfoPanelCarrier.transform.GetChild(2).GetChild(1).gameObject.GetComponent <Text>().text = "Electric : " + TargetValue.SuppliedElectricity.ToString() + " / Labor : " + TargetValue.SuppliedLabor.ToString(); InfoPanelCarrier.transform.GetChild(3).GetChild(0).gameObject.GetComponent <Text>().text = "Performance"; switch (TargetInfo.Type) { case "Door": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetBasicInfo.WorkSpeed).ToString() + " item/sec"; if (TargetObject.GetComponent <DoorAct>().TargetGoodsName != "None") { AdditionalInfoPanel.SetActive(true); AdditionalInfoPanel.transform.GetChild(0).GetChild(0).gameObject.GetComponent <Image>().sprite = Resources.Load <Sprite>("GameSystem/Goods/Sprite/" + CallGoodsRecipe.GetRecipe(TargetObject.GetComponent <DoorAct>().TargetGoodsName).Type); AdditionalInfoPanel.transform.GetChild(1).gameObject.GetComponent <Text>().text = TargetObject.GetComponent <DoorAct>().TargetGoodsName; } if (TargetObject.GetComponent <DoorAct>().DoorMode == "Ejector") { FunctionPanel.SetActive(true); ButtonCarrier.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Select Item"; } break; case "Processor": InfoPanelCarrier.transform.GetChild(1).GetChild(1).gameObject.GetComponent <Text>().text += " " + TargetObject.GetComponent <ProcessorAct>().ProcessorActorName; InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetObject.GetComponent <ProcessorAct>().WorkTime + TargetBasicInfo.WorkSpeed).ToString() + " item/sec"; InfoPanelCarrier.transform.GetChild(4).GetChild(0).gameObject.GetComponent <Text>().text = "Current Item"; if (TargetObject.GetComponent <ProcessorAct>().TargetGoodsRecipe != null) { AdditionalInfoPanel.SetActive(true); AdditionalInfoPanel.transform.GetChild(0).GetChild(0).gameObject.GetComponent <Image>().sprite = Resources.Load <Sprite>("GameSystem/Goods/Sprite/" + TargetObject.GetComponent <ProcessorAct>().TargetGoodsRecipe.Type); AdditionalInfoPanel.transform.GetChild(1).gameObject.GetComponent <Text>().text = TargetObject.GetComponent <ProcessorAct>().TargetGoodsRecipe.OutputName; } FunctionPanel.SetActive(true); ButtonCarrier.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Select Item"; break; case "Belt": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetObject.transform.GetChild(1).GetChild(0).gameObject.GetComponent <BeltAct>().BeltSpeed + TargetBasicInfo.WorkSpeed).ToString() + " item/sec"; break; case "Distributor": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetBasicInfo.WorkSpeed).ToString() + " item/sec"; break; case "QualityControlUnit": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetBasicInfo.WorkSpeed).ToString() + " item/sec"; FunctionPanel.SetActive(true); ButtonCarrier.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Set Standard"; break; case "Destroyer": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetBasicInfo.WorkSpeed).ToString() + " item/sec"; break; case "Labatory": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = (TargetBasicInfo.WorkSpeed).ToString() + " point/sec"; FunctionPanel.SetActive(true); if (TargetObject.GetComponent <LabatoryAct>().CurrentResearchingTech == null && TargetObject.GetComponent <LabatoryAct>().CurrentDevelopingProduct == null) { ButtonCarrier.transform.GetChild(0).GetChild(0).gameObject.SetActive(true); ButtonCarrier.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Research Technology"; ButtonCarrier.transform.GetChild(0).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Develop Product"; } else { if (TargetObject.GetComponent <LabatoryAct>().CurrentResearchingTech != null) { AdditionalInfoPanel.SetActive(true); AdditionalInfoPanel.transform.GetChild(1).gameObject.GetComponent <Text>().text = "Researching"; ButtonCarrier.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Research Technology"; } else if (TargetObject.GetComponent <LabatoryAct>().CurrentDevelopingProduct != null) { AdditionalInfoPanel.SetActive(true); AdditionalInfoPanel.transform.GetChild(0).GetChild(0).gameObject.GetComponent <Image>().sprite = Resources.Load <Sprite>("GameSystem/Goods/Sprite/" + TargetObject.GetComponent <LabatoryAct>().CurrentDevelopingProduct.ObjectInfo.Type); AdditionalInfoPanel.transform.GetChild(1).gameObject.GetComponent <Text>().text = TargetObject.GetComponent <LabatoryAct>().CurrentDevelopingProduct.Name; ButtonCarrier.transform.GetChild(1).GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = "Develop Product"; } } break; case "DayRoom": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = "x " + (TargetObject.GetComponent <DayRoomAct>().CurrentPerformance + TargetBasicInfo.WorkSpeed).ToString(); break; case "EnergyStorage": InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = TargetObject.GetComponent <EnergyStorageAct>().CurrentChargingAmount.ToString() + " point/tic"; break; case "EnergySupplier": ElectricityValue ElectricityValueCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue().GetElectricityValue().GetComponent <ElectricityValue>(); InfoPanelCarrier.transform.GetChild(3).GetChild(1).gameObject.GetComponent <Text>().text = "Usage : " + ElectricityValueCall.TotalUsage.ToString() + " / Capacity : " + ElectricityValueCall.ElectricityInputValue.ToString(); break; } }
// Start is called before the first frame update void Start() { ObjectActCall = gameObject.GetComponent <InstallableObjectAct>(); CompanyValueCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>().GetPlayerCompanyValue(); }
protected static string GetCompanyValue(Nomination nomination, CompanyValue companyValue) { return(nomination.CompanyValues.FirstOrDefault(cv => cv == companyValue)?.ToString() ?? string.Empty); }
// Start is called before the first frame update void Start() { CallCompanyValue = GameObject.Find("CompanyMananger").GetComponent <CompanyManager>().GetPlayerCompanyValue(); }
void SelectCompany() { List <Worker> TargetWorker = new List <Worker>(); foreach (var worker in UnHiredList) { List <GameObject> SelectedCompany = new List <GameObject>(); foreach (var company in CompanyManagerCall.GetAllCompanyObject()) { CompanyValue TempCompanyValueCall = company.GetComponent <CompanyValue>(); if (TempCompanyValueCall.TotalValue >= worker.ExpectCompanyValue && TempCompanyValueCall.TotalValue != 0) { foreach (var CompanyName in worker.LeaveFactoryList) { if (TempCompanyValueCall.CompanyName == CompanyName) { continue; } } SelectedCompany.Add(company); } } if (SelectedCompany.Count > 0) { CompanyValue CompanyValueCall = SelectedCompany[Random.Range(0, SelectedCompany.Count - 1)].GetComponent <CompanyValue>(); EmployeeValue EmployeeValueCall = CompanyValueCall.GetEmployeeValue().GetComponent <EmployeeValue>(); int HiringRate = 2; if (EmployeeValueCall.RequiredLabor <= EmployeeValueCall.TotalLabor) { HiringRate *= 10 * Mathf.CeilToInt(EmployeeValueCall.TotalLabor - EmployeeValueCall.RequiredLabor + 1); } if (CompanyValueCall.TotalValue > worker.ExpectCompanyValue) { HiringRate *= 1 * Mathf.CeilToInt(CompanyValueCall.TotalValue / worker.ExpectCompanyValue); } if (CompanyValueCall.TotalValue <= worker.ExpectCompanyValue) { HiringRate *= 4 * Mathf.CeilToInt(worker.ExpectCompanyValue / CompanyValueCall.TotalValue); } if (Random.Range(0, HiringRate) == 0) { EmployeeValueCall.HireEmployee(worker); TargetWorker.Add(worker); // Debug.Log(worker.Name + " is Hired on " + CompanyValueCall.CompanyName); } // else Debug.Log(worker.Name + " doesnt go anywhere"); } if (--worker.TrialCount < 0) { TargetWorker.Add(worker); } else { worker.ExpectCompanyValue -= 0.5f; } } for (int i = 0; i < TargetWorker.Count; i++) { UnHiredList.Remove(TargetWorker[i]); } }
public void AddOption(ConversationStepData _destStep, string _text, ConversationStepData _parentStep, CompanyValue _value, OptionTrigger _trigger) { if (!conversationSteps.Contains(_parentStep)) { AddStep(_parentStep); } if (!conversationSteps.Contains(_destStep)) { AddStep(_destStep); } ConversationOptionData newOption; if (_destStep == null) { newOption = new ConversationOptionData(_text, -1, _value, _trigger); } else { newOption = new ConversationOptionData(_text, _destStep.stepID, _value, _trigger); } _parentStep.myOptions.Add(newOption); }