// ==================================== FUNCTIONS ================================ // ------------------------------------------------------------------------------- // // ------------------------------------------------------------------------------- public void Show(UnitInstance _instance) { instance = _instance; OnDraw(); OnShow(); }
// ------------------------------------------------------------------------------- // OnInit // ------------------------------------------------------------------------------- public void OnInit(UnitInstance _instance, GameObject _window) { instance = _instance; window = _window.GetComponent <UnitDetailWindow>(); icon.sprite = instance.template.smallIcon; textGrade.text = instance.grade.ToString(); textLevel.text = instance.level.ToString(); button.onClick.AddListener(OnClick); }
// ------------------------------------------------------------------------------- // Constructor // ------------------------------------------------------------------------------- public CostModule(UnitInstance _instance) { instance = _instance; }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // PUBLIC FUNCTIONS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ------------------------------------------------------------------------------- // addUnit // ------------------------------------------------------------------------------- public void addUnit(UnitTemplate _template) { UnitInstance instance = new UnitInstance(game, _template); units.Add(instance); }