Ejemplo n.º 1
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);
    }
Ejemplo n.º 2
0
    public void ConfirmButtonSelect()
    {
        string ButtonText = ConfirmButtonTextObject.GetComponent <Text>().text;

        if (ButtonText == "Start")
        {
            CallTargetLabatoryAct.StartResearch(CurrnetResearchName);
        }
        else if (ButtonText == "Change")
        {
            CallTargetLabatoryAct.StopResearch();
            CallTargetLabatoryAct.StartResearch(CurrnetResearchName);
        }
        else if (ButtonText == "Cancel")
        {
            CallTargetLabatoryAct.StopResearch();
        }

        DisplayResearchInfo();
    }