public void InitializeAffinities(Action <RewardAffinity> callback) { for (int i = 0; i < (int)RewardAffinity.LENGTH; i++) { RewardAffinity affinity = (RewardAffinity)i; AffinityUI affinityUI = Instantiate(affinityPrefab, affinityParent); affinityUI.Initialize(affinity, callback); } }
public void Initialize(RewardAffinity affinity, Action <RewardAffinity> callback) { nameText.SetText(AffinityUI.AffinityToString(affinity)); this.callback = callback; this.affinity = affinity; }