// 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); } }
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; }