public void CreateDummyList() { foreach (DemonSet g in m_OldDemonSets) { if (g != null) { DestroyImmediate(g.gameObject); } } m_OldDemonSets.Clear(); for (int i = 0; i < 30; i++) { GameObject go = Instantiate(m_DemonSetPrefab); go.transform.SetParent(m_InactiveContainer); DemonSet info = go.GetComponent <DemonSet>(); m_OldDemonSets.Add(info); } foreach (TextMeshProUGUI g in m_OldDemonHeaders) { if (g != null) { DestroyImmediate(g.gameObject); } } m_OldDemonHeaders.Clear(); for (int i = 0; i < 10; i++) { GameObject go = Instantiate(m_DemonHeaderPrefab); go.transform.SetParent(m_InactiveContainer); TextMeshProUGUI info = go.GetComponent <TextMeshProUGUI>(); m_DemonHeaders.Add(info); } foreach (DemonInfo g in m_OldDemonInfos) { if (g != null) { DestroyImmediate(g.gameObject); } } m_OldDemonInfos.Clear(); for (int i = 0; i < 30; i++) { GameObject go = Instantiate(m_DemonInfoPrefab); go.transform.SetParent(m_InactiveContainer); DemonInfo info = go.GetComponent <DemonInfo>(); m_OldDemonInfos.Add(info); } }
public void DisplayFusions(Demon target) { if (!canGen || target == null) { return; } canGen = false; List <DemonGroup> combos = isFuseMode ? GetDemonFusions(target) : GetDemonResults(target); m_CurrentDemonName.text = target.name; m_CurrentDemonIcon.sprite = Resources.Load <Sprite>(target.name); m_CurrentDemonPlaceholder.text = string.Empty; layout.Clear(); layoutState.Clear(); ClearList(0); ClearList(1); if (combos.Count > 0) { //results = results.OrderBy(o => (o.d1.rarityValue + o.d2.rarityValue)).ThenBy(o => o.d1.grade).ToList(); //int top = 0; //int offset = 0; int count = 0; for (int i = 0; i < combos.Count; i++) { if (combos[i].results.Count > 0) { TextMeshProUGUI header = GetHeader(); if (isFuseMode) { header.text = HeaderText(combos[i].results[0].d1.race, combos[i].results[0].d2.race); } else { header.text = HeaderText(target.race, combos[i].results[0].d1.race); } layout.Add(header.gameObject); layoutState.Add(0); //top += Mathf.FloorToInt((count - 1) / 2) * 120; //offset = -25 + (i * -150) - top; //header.rectTransform.anchoredPosition = new Vector2(105, offset); count = 0; combos[i].results = combos[i].results.OrderBy(o => (o.d1.rarityValue + o.d2.rarityValue)).ThenBy(o => o.d1.grade).ToList(); for (count = 0; count < combos[i].results.Count; count++) { DemonResult result = combos[i].results[count]; DemonSet set = GetSet(); if (result.d2.rarity > result.d1.rarity || !isFuseMode) { set.info1.Setup(result.d1); set.info2.Setup(result.d2); } else { set.info1.Setup(result.d2); set.info2.Setup(result.d1); } layout.Add(set.gameObject); layoutState.Add(1); //set.transform.localPosition = new Vector2(50 + (count % 2) * 250, (offset - 75) + Mathf.FloorToInt(count / 2) * -120); } } } } else if (combos.Count == 0) { if (target.name == "Kaminotoko" || target.name == "Kanbari" || target.name == "Kinmamon" || target.name == "Kama" || target.name == "Chupacabra" || target.name == "Hare of Inaba") { m_CurrentDemonPlaceholder.text = "Obtainable through multi-fusion."; } else { m_CurrentDemonPlaceholder.text = "Obtainable through gacha."; } //else if (target.name == "Pixie" || target.name == "Slime") //{ // m_CurrentDemonPlaceholder.text = "Obtainable through negotiation."; //} } SearchRarities(); m_CurrentDemonScroll.value = 1;; if (m_Histories.Count == 0 || m_Histories[m_Histories.Count - 1].demon != target) { DemonInfo historyDemon = GetInfo(m_HistoryParent); historyDemon.Setup(target); m_Histories.Add(historyDemon); } lastDemon = target; canGen = true; }