// 显示信息 public void ShowInfo(ICamp Camp) { //Debug.Log("显示兵营信息"); Show(); m_Camp = Camp; // 名称 m_CampNameTxt.text = m_Camp.GetName(); // 训练花费 m_TrainCostText.text = string.Format("AP:{0}", m_Camp.GetTrainCost()); // 训练中信息 ShowOnTrainInfo(); // Icon IAssetFactory Factory = PBDFactory.GetAssetFactory(); m_CampImage.sprite = Factory.LoadSprite(m_Camp.GetIconSpriteName()); // 升級功能 if (m_Camp.GetLevel() <= 0) { EnableLevelInfo(false); } else { EnableLevelInfo(true); m_CampLvTxt.text = string.Format("等级:" + m_Camp.GetLevel()); ShowWeaponLv(); // 显示武器等级 } }
public void ShowInfo(ICamp Camp) { Show(); m_Camp = Camp; // 名称 m_CampNameTxt.text = m_Camp.GetName(); // 训练花费 m_TrainCostTxt.text = string.Format("AP:{0}", m_Camp.GetTrainCost()); // 训练中信息 ShowOnTrainInfo(); // Icon IAssetFactory Factory = RTSFactory.GetAssetFactory(); m_CampImage.sprite = Factory.LoadSprite(m_Camp.GetIconSpriteName()); // 升级功能 if (m_Camp.GetLevel() <= 0) { EnableLevelInfo(false); } else { EnableLevelInfo(true); m_CampLvTxt.text = string.Format("等级:" + m_Camp.GetLevel()); m_WeaponLvTxt.text = string.Format("武器等级:" + m_Camp.GetWeaponLevel()); } }
// 顯示資訊 public void ShowInfo(ICamp Camp) { //Debug.Log("顯示兵營資訊"); Show (); m_Camp = Camp; // 名稱 m_CampNameTxt.text = m_Camp.GetName(); // 訓練花費 m_TrainCostText.text = string.Format("AP:{0}",m_Camp.GetTrainCost()); // 訓練中資訊 ShowOnTrainInfo(); // Icon IAssetFactory Factory = PBDFactory.GetAssetFactory(); m_CampImage.sprite = Factory.LoadSprite( m_Camp.GetIconSpriteName()); // 升級功能 if( m_Camp.GetLevel() <= 0 ) EnableLevelInfo(false); else { EnableLevelInfo(true); m_CampLvTxt.text = string.Format("等級:" + m_Camp.GetLevel()); ShowWeaponLv();// 顯示武器等級 } }
// 训练 private void OnTrainBtnClick() { int Cost = m_Camp.GetTrainCost(); if (CheckRule(Cost > 0, "无法训练") == false) { return; } // 是否足够 string Msg = string.Format("AP不足无法训练,需要{0}点AP", Cost); if (CheckRule(m_PBDGame.CostAP(Cost), Msg) == false) { return; } // 产生训练命令 m_Camp.Train(); ShowInfo(m_Camp); }
// 訓練 private void OnTrainBtnClick() { int Cost = m_Camp.GetTrainCost(); if (CheckRule(Cost > 0, "無法訓練") == false) { return; } // 是否足夠 string Msg = string.Format("AP不足無法訓練,需要{0}點AP", Cost); if (CheckRule(m_PBDGame.CostAP(Cost), Msg) == false) { return; } // 產生訓練命令 m_Camp.Train(); ShowInfo(m_Camp); }