Exemplo n.º 1
0
    void ClearInfoPanel()
    {
        TitleImageObject.GetComponent <Image>().sprite           = null;
        TitleImageObject.GetComponent <Image>().color            = new Color(1f, 1f, 1f, 0f);
        NameTextObject.GetComponent <Text>().text                = "";
        ProgressBarImageObject.GetComponent <Image>().fillAmount = 0f;

        ProgressPanelClear();

        ConfirmButtonTextObject.GetComponent <Text>().text       = "Start";
        ConfirmButtonObject.GetComponent <Button>().interactable = false;
    }
Exemplo n.º 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();
    }