public override void Show() { base.Show(); // 저장된 랭킹데이터를 기반으로 랭킹슬롯 생성 및 초기화 List <RankData> rankDatas = GameManager.Instance.DataBase.SaveData.rankDatas; for (int i = 0; i < rankDatas.Count; i++) { RankSlot rankSlot = Instantiate(slotPrefabs, content); rankSlot.UpdateRankText(i + 1, rankDatas[i].stageCount, rankDatas[i].goldCount, rankDatas[i].killCount); } }
public void setSlotInfo(Sprite picture, string name, int score, int rank) { GameObject go; RankSlot rankSlot = null; go = Instantiate(slot) as GameObject; go.name = "slot"; rankSlot = go.GetComponent <RankSlot> (); go.transform.SetParent(parent, false); go.SetActive(false); rankSlot.setPicture(picture); rankSlot.setName(name); rankSlot.setScore(score); rankSlot.setRank(rank); slots.Add(rankSlot); }
public void Push(int strength, bool changeUnitOrder = true) { if (CombatInfo.IsImmobilized) { return; } int pushed = 0; foreach (var backUnit in Party.Units.FindAll(unit => unit.Rank > Rank).OrderBy(unit => unit.Rank)) { if (backUnit.CombatInfo.IsImmobilized) { break; } int backUnitTargetRank = Rank; int pushedTargetRank = Rank + backUnit.Size; RankSlot.Relocate(pushedTargetRank, changeUnitOrder); backUnit.RankSlot.Relocate(backUnitTargetRank); pushed += backUnit.Size; if (pushed >= strength) { break; } } Party.Units.Sort((x, y) => { if (x.Rank == y.Rank) { return(0); } if (x.Rank > y.Rank) { return(1); } else { return(-1); } }); }
public void Pull(int strength, bool changeUnitOrder = true) { if (CombatInfo.IsImmobilized) { return; } int pulled = 0; foreach (var frontUnit in Party.Units.FindAll(unit => unit.Rank < Rank).OrderByDescending(unit => unit.Rank)) { if (frontUnit.CombatInfo.IsImmobilized) { break; } int frontUnitTargetRank = frontUnit.Rank + Size; int pulledTargetRank = frontUnit.Rank; RankSlot.Relocate(pulledTargetRank, changeUnitOrder); frontUnit.RankSlot.Relocate(frontUnitTargetRank); pulled += frontUnit.Size; if (pulled >= strength) { break; } } Party.Units.Sort((x, y) => { if (x.Rank == y.Rank) { return(0); } if (x.Rank > y.Rank) { return(1); } else { return(-1); } }); }