Exemplo n.º 1
0
    public override void Load(params object[] input)
    {
        BaseInfoRow baseInfo = SyncData.CurrentMainBase;

        ListUpgrade tranningType = baseInfo.TrainingUnit_ID;

        if (tranningType.IsDefined())
        {
            ITable table = dBReference[tranningType];
            int    level = SyncData.CurrentBaseUpgrade[tranningType].Level;

            ITableData typeInfo = table[level - 1];

            TranningProgress.Slider.MaxValue =
                fieldReflection.GetPublicField <int>(typeInfo, "TrainingTime") * baseInfo.TrainingQuality;

            AcceptBtn.Interactable = false;
            TranningProgress.gameObject.SetActive(true);
        }
        else
        {
            AcceptBtn.Interactable = true;
            TranningProgress.gameObject.SetActive(false);
        }
    }
Exemplo n.º 2
0
        private int GetUpgradeMaxTime()
        {
            ListUpgrade type = baseInfo.UpgradeWait_ID;

            if (type.IsDefined())
            {
                int        level       = SyncData.CurrentBaseUpgrade[type].Level;
                ITableData data        = dbRef[type][level - 1];
                int        upgradeTime = fieldReflection.GetPublicField <int>(data, "TimeInt");
                return(upgradeTime);
            }
            return(0);
        }
Exemplo n.º 3
0
    public override void Load(params object[] input)
    {
        MainbaseLevelBar.Value = SyncData.CurrentBaseUpgrade[ListUpgrade.MainBase].Level;
        MainbaseLevelBar.SetDefaultPlaceholder();

        BaseUpgradeRow resRef = SyncData.CurrentResearch;
        BaseUpgradeRow upgRef = SyncData.CurrentUpgrade;

        bool isUpgrade = upgRef != null?upgRef.ID.IsDefined() : false;

        bool isResearch = resRef != null?resRef.ID.IsDefined() : false;

        //Debug.Log(isUpgrade + " - " + isResearch);
        ITable table = null;

        if (isUpgrade)
        {
            table = WDOCtrl[upgRef.ID];

            ITableData upgInfo = table[upgRef.Level - 1];
            int        timeInt = fieldReflection.GetPublicField <int>(upgInfo, "TimeInt");
            UpgProgBar.Slider.MaxValue = timeInt;
        }

        if (isResearch)
        {
            table = WDOCtrl[resRef.ID];

            ITableData resInfo = table[upgRef.Level - 1];
            int        timeInt = fieldReflection.GetPublicField <int>(resInfo, "TimeInt");
            ResProgBar.Slider.MaxValue = timeInt;
        }

        UpgProgBar.gameObject.SetActive(isUpgrade);
        ResProgBar.gameObject.SetActive(isResearch);
    }
Exemplo n.º 4
0
 private T GetPublicValue <T>(object obj, string name)
 {
     return(fieldReflection.GetPublicField <T>(obj, name));
 }