protected void CreateRound() { var round = trackers.Count > 0 ? trackers.Last().round + 1 : 0; var roundItem = AnimatedItem.CreateInstance <AnimatedItem>(); roundItem.prefab = roundPrefab; roundItem.calculateSize = true; roundItem.createOnInit = true; base.Add(roundItem); ValueReceiver.SendValue(roundItem.item.gameObject, round); var units = Game.rounds.GetEstimatedOrder(round - Game.rounds.round); trackers.Add(new() { round = round, index = items.Count, units = units, }); foreach (var unit in units) { var unitItem = AnimatedItem.CreateInstance <AnimatedItem>(); unitItem.prefab = unitPrefab; unitItem.calculateSize = true; unitItem.createOnInit = true; base.Add(unitItem); ValueReceiver.SendValue(unitItem.item.gameObject, unit); ValueReceiver.SendValue(unitItem.item.gameObject, round); } }
public virtual void OnCombatLog(string str) { var roundItem = AnimatedItem.CreateInstance <AnimatedItem>(); roundItem.prefab = logItem; roundItem.calculateSize = true; roundItem.createOnInit = true; base.Insert(0, roundItem); roundItem.item.gameObject.GetComponentInChildren <TMPro.TMP_Text>().text = str; }