// Update is called once per frame
 void FixedUpdate()
 {
     if (ObjectActCall.isInstall && !isInitialized)
     {
         isInitialized           = true;
         ObjectActCall.IsWorking = true;
         CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>().AddStorage(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();
    }
Beispiel #3
0
    public bool CompleteResearch(ResearchState TargetResearch)
    {
        TargetResearch.TargetState.Completed = true;

        CheckTechPossible();

        foreach (var FacilityName in TargetResearch.TargetState.Info.UnlockFacility)
        {
            if (FacilityName == "None")
            {
                break;
            }
            TechRecipe.FacilityInfo TargetFacility = TechRecipeCall.GetFacilityInfo(FacilityName);
            FacilityList.Add(TargetFacility);
        }

        foreach (var ActorName in TargetResearch.TargetState.Info.UnlockActor)
        {
            if (ActorName == "None")
            {
                break;
            }
            TechRecipe.ProcessActorInfo TargetActor = TechRecipeCall.GetProcessActorInfo(ActorName);
            ActorList.Add(TargetActor);
        }

        switch (TargetResearch.TargetState.Info.UpgradeValueType)
        {
        case "Work":
            CompanyValueCall.GetEmployeeValue().GetComponent <EmployeeValue>().WorkEifficiency = TargetResearch.TargetState.Info.UpgradeValueAmount;
            break;

        case "Energy":
            CompanyValueCall.GetElectricityValue().GetComponent <ElectricityValue>().EnergyEfficiency = TargetResearch.TargetState.Info.UpgradeValueAmount;
            break;

        case "Organize":
            CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>().OrganizeEfficiency = TargetResearch.TargetState.Info.UpgradeValueAmount;
            break;
        }

        ResearchPanelUpdate(TargetResearch);

        int limit = TargetResearch.LabatoryList.Count;

        for (int i = 0; i < limit; i++)
        {
            LabatoryAct TargetLabatoryAct = TargetResearch.LabatoryList[0].GetComponent <LabatoryAct>();

            TargetLabatoryAct.StopResearch();
        }

        ResearchStateList.Remove(TargetResearch);
        TargetResearch = null;

        return(true);
    }
Beispiel #4
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;
    }
Beispiel #5
0
    public bool DeleteObject()
    {
        CompanyValueCall.GetGoodsValue().GetComponent <ElectricityValue>().DeleteElectricityInput(gameObject);

        return(true);
    }