public List<GameObject> runeList;
// 룬을 담을 리스트
public Dictionary<int, Rune> runeDictionary;
// 룬을 담은 딕셔너리
void Start() // 딕셔너리에 룬에 리스트를 넣어준다.
RuneDictionary = new Dictionary<int, Rune>();
for (int i = 0; i < RuneList.Count; ++i)
{
RuneDictionary.Add(RuneList[i].GetComponent<Rune>().RuneNumber, RuneList[i].GetComponent<Rune>());
}
// 룬을 업그레이드 시키는 함수
runeDictionary[Constant.WIND_RUNE].GetComponent<WindRune>().RuneDamage +=Constant.POWER_UP_DAMAGE;
룬을 업그레이드를 시키면 프리펩이 강화가 된다.
하지만 게임을 종료하면 그 룬은 강화가 된 상태로 게임이 종료 되는데
그럼 다음 게임 때 강화가 된 상태로 게임이 시작된다.
start에 룬리스트에 담겨있는 애들에 스크립트에 있는 Awake로 초기화를 시켜준다. ( Awake 안에 각 Rune 별로 초기화를 해두었다)
RuneList[i].GetComponent<Rune>().Awake();