Пример #1
0
    // 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);
        }
    }
Пример #2
0
    public bool Installation()
    {
        if (isInstall)
        {
            return(false);
        }

        gameObject.name = "#" + (CompanyValueCall.GetFacilityValue().GetComponent <FacilityValue>().InstalledFacilityAmount + 1).ToString() + " " + Info.Type;

        ValueCall.AttachedOnMouse = null;
        isInstall        = true;
        transform.parent = GameObject.Find("InstalledObject").transform;
        ChangeStructColor(new Color(0, 0, 0, 0));

        Value = CompanyValueCall.GetFacilityValue().GetComponent <FacilityValue>().AddFacilityInfo(gameObject);

        if (Info.Type != "Belt" && Info.Type != "VerticalBelt" && Info.Type != "Door")
        {
            GameObject.Find("ObjectInstaller").GetComponent <ObjInstantiater>().InstantiateNewObject(Info.Name);
        }

        return(true);
    }
Пример #3
0
    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;
    }