Ejemplo n.º 1
0
        /// <returns> The previous level </returns>
        public BuildingDescription Upgrade(PlayerBuildingType type)
        {
            var prev = upgradeChain[type];

            upgradeChain[type] = prev.nextLevel;
            return(prev);
        }
Ejemplo n.º 2
0
        public void SetDisplay(PlayerBuildingType type, Vector2 basePosition)
        {
            var sobj = BuildingLevels.Instance.GetCurrLevel(type);

            typeText.text      = $"{sobj.readableName} - {sobj.level} 级";
            productText.text   = $"人口:{sobj.product[PropertyType.Population]}  资产:{sobj.product[PropertyType.Finance]}";
            costText.text      = $"人口:{sobj.buildCost[PropertyType.Population]}  资产:{sobj.buildCost[PropertyType.Finance]}";
            lockedText.enabled = !sobj.Unlocked;
            Debug.Log($"BA: {basePosition}");
            transform.position = basePosition - new Vector2(LeftOffset, 0);
            gameObject.SetActive(true);
        }
Ejemplo n.º 3
0
 public bool HasNextLevel(PlayerBuildingType type)
 {
     return(upgradeChain[type].nextLevel != null);
 }
Ejemplo n.º 4
0
        //public int GetCurrLevel(BuildingType type) {
        //    var sobj = upgradeChain[type];
        //    if(sobj.Unlocked)
        //        return sobj.level;
        //    return sobj.level - 1;
        //}

        public BuildingDescription GetCurrLevel(PlayerBuildingType type)
        {
            return(upgradeChain[type]);
        }