using Core.Utilities; using KTGMGemClient; using System.Collections; using System.Collections.Generic; using UnityEngine; public class TowerPrice : Singleton { /// /// 场景内的基础Tower价格. /// public int baseTowerPrice = 10; /// /// 每购买成功一个Tower,需要增加的TowerPrice. /// public int addPriceTower = 0; /// /// 当前场景内动态TowerPrice. /// protected int currentTP = 0; protected int selfTpIdx = 0; /// /// 对手塔防的动态TowerPrice. /// protected int opponentTP = 0; protected int oppoTpIdx = 0; // Start is called before the first frame update void Start() { this.currentTP = this.baseTowerPrice; this.opponentTP = this.baseTowerPrice; } public int currentTowerPrice { get { return this.currentTP; } } public int opponentTowerPrice { get { return this.opponentTP; } } public void resetTowerPrice() { this.currentTP = this.baseTowerPrice; this.opponentTP = this.baseTowerPrice; } /// /// 场景内每购买成功一个Tower,基础购买价格需要增加的数据。 /// public void onTowerBuySuccess( bool opponent = false ) { if(opponent) { this.oppoTpIdx++; this.opponentTP = JsonDataCenter.GetGemCostFromIdx(oppoTpIdx) ; } else { this.selfTpIdx++; this.currentTP = JsonDataCenter.GetGemCostFromIdx(selfTpIdx); } } }