public void Init(UIDialogTraining _uiTraining, int _unitID) { uiTraining = _uiTraining; unitID = _unitID; at = TBDatabase.GetArmyType(unitID); ad = (at != null) ? at.GetDefine(1) : null; if (ad != null) { Price.text = ad.ResearchCost.ToString("#,##0"); } }
public void Add(ArmyDef def) { Defs.Add(def); def.prefab = Resources.Load("Prefabs/Army/" + Name + "_" + Defs.Count.ToString()) as GameObject; }