public void UpdateProgressInfo()
    {
        LabatoryAct.DevelopingProduct TargetInfo = CallTargetLabatoryAct.CurrentDevelopingProduct;
        float CompletePercentage  = Mathf.CeilToInt(TargetInfo.CompletedPoint / (float)TargetInfo.ObjectInfo.RequiredPoint * 100f) * 0.01f;
        float CurrentGainingPoint = CallTargetLabatoryAct.ResearchPower / TargetInfo.ObjectInfo.RequiredResearchPower;

        ProgressBarObject.GetComponent <Image>().fillAmount = CompletePercentage;
        if (CompletePercentage >= 1f)
        {
            MainFunctionButton.transform.GetChild(0).gameObject.GetComponent <Text>().text = "Finish";
            MainFunctionButton.gameObject.GetComponent <Image>().color = new Color(0, 1f, 0, 1f);
            ProgressPercentageTextObject.GetComponent <Text>().text    = "+ " + (Mathf.CeilToInt(TargetInfo.ObjectInfo.Attractiveness.PerfectionPoint * 10f) * 0.1f).ToString() + " Points";
        }
        else
        {
            ProgressPercentageTextObject.GetComponent <Text>().text = (CompletePercentage * 100).ToString() + " %";
        }

        PassedTimeTextObject.GetComponent <Text>().text = CallTimeManager.GetPeriodString(CallTimeManager.TimeValue - TargetInfo.StartTime, "Short");
        RemainTimeTextObject.GetComponent <Text>().text = " / " + CallTimeManager.GetPeriodString((CallTimeManager.TimeValue - TargetInfo.StartTime) + (Mathf.CeilToInt(((float)TargetInfo.ObjectInfo.RequiredPoint - TargetInfo.CompletedPoint) / CurrentGainingPoint) * CallTimeManager.Hour), "Short");

        CompletedPointTextObject.GetComponent <Text>().text = (Mathf.CeilToInt(TargetInfo.CompletedPoint)).ToString();
        GainingPointTextObject.GetComponent <Text>().text   = "(+" + (Mathf.CeilToInt(CurrentGainingPoint)).ToString() + ")";
        RemainPointTextObject.GetComponent <Text>().text    = " / " + TargetInfo.ObjectInfo.RequiredPoint.ToString();
    }
예제 #2
0
    public void UpdateProgressInfo()
    {
        TechValue.ResearchState TargetResearchState = CallTechValue.GetResearchState(CurrnetResearchName);
        if (TargetResearchState == null)
        {
            ProgressPanelClear();
            return;
        }

        float CompletePercentage  = Mathf.CeilToInt(TargetResearchState.GainedWorkLoad / (float)TargetResearchState.TargetState.Info.RequiredWorkLoad * 100f) * 0.01f;
        float CurrentGainingPoint = 0f;

        foreach (var Labatory in TargetResearchState.LabatoryList)
        {
            LabatoryAct TargetLabatoryAct = Labatory.GetComponent <LabatoryAct>();

            CurrentGainingPoint += TargetLabatoryAct.ResearchPower;
        }

        ProgressBarImageObject.GetComponent <Image>().fillAmount = CompletePercentage;
        if (CompletePercentage >= 1)
        {
            UpdateCompleteState();
        }
        else
        {
            ProgressPercentageTextObject.GetComponent <Text>().text = (CompletePercentage * 100).ToString() + " %";
        }

        PassedTimeTextObject.GetComponent <Text>().text = CallTimeManager.GetPeriodString(CallTimeManager.TimeValue - TargetResearchState.StartTime, "Short");
        RemainTimeTextObject.GetComponent <Text>().text = " / " +
                                                          CallTimeManager.GetPeriodString((CallTimeManager.TimeValue - TargetResearchState.StartTime) + (Mathf.CeilToInt(((float)TargetResearchState.TargetState.Info.RequiredWorkLoad - TargetResearchState.GainedWorkLoad) / CurrentGainingPoint) * CallTimeManager.Hour), "Short");

        CompletedPointTextObject.GetComponent <Text>().text = (Mathf.CeilToInt(TargetResearchState.GainedWorkLoad)).ToString();
        GainingPointTextObject.GetComponent <Text>().text   = "(+" + (Mathf.CeilToInt(CurrentGainingPoint)).ToString() + ")";
        RemainPointTextObject.GetComponent <Text>().text    = " / " + TargetResearchState.TargetState.Info.RequiredWorkLoad.ToString();
    }