ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <1f66344f2f89470293d8b67d71308c07>:0)
์ผ๋จ ์ฝ๋๋
์ด๊ฒ ์๋๋ฐ ์ฌ๊ธฐ์ CardDataBase์์๋ Debug.log๋ก cardList[0].id๊ฐ์ ๊ฑฐ ๋ค ํธ์ถํด๋ ๋ฌธ์ ๊ฐ ์์์ด
๊ทธ๋ฐ๋ฐ ๊ผญ thisCard์์ thisCard[0] = CardDataBase.cardList[0];๋ถ๋ถ์ด๋ id = thisCard[0].cardId; ๋ถ๋ถ์์ ๊ณ์ OutofRange์๋ฌ๊ฐ ๋๋๋ฐ ๋ญ๊ฐ ๋ฌธ์ ค๊น?????
ํน์ ๋ชฐ๋ผ์ ์คํฌ๋ฆฝํธ ์คํ ์์๋ Card -> CardDataBase -> ThisCard๋ก ๋ฐ๊ฟ๋ดค๋๋ฐ ๊ทธ๋๋ ๊ณ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํด...
DataBase์์ ํ์ผ ์ฝ์ด ์ค๋ ๊ฑด ์๋ฌ ๋ค ํด๊ฒฐํ ์ํ์ธ๋ฐ ๋ค๋ฅธ ์คํฌ๋ฆฝํธ์์ ํธ์ถํ๋ฉด ์๋ฌ๊ฐ ๋... ๋ญ๊ฐ ๋ฌธ์ ์ธ์ง ๋ชจ๋ฅด๊ฒ ์ด.....
ThisCard.Start () (at Assets/Scripts/ThisCard.cs:40)
ThisCard.Start () (at Assets/Scripts/ThisCard.cs:46)
https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&t=seti&wt=none&l=auto&width=680&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=56px&ph=56px&ln=false&fl=1&fm=Hack&fs=14px&lh=133%25&si=false&es=2x&wm=false
https://colorscripter.com/
์
์ฌ์ดํธ๋ฅผ ์ด์ฉํ๋ฉด ์ฝ๋๋ฅผ ์ด์๊ฒ ์ฒจ๋ถํ ์ ์๋ต๋๋ค!
์์ ํ์ค๋ฏธ๋ค!
CardDataBase๋ Mono๋ฅผ ์์๋ฐ๋๊ฑฐ์ผ?
์ผ๋จ ์์ ๋ฐ์์ ๋ new ์ฐ์ง๋ง๋ผ๊ณ ๊ฒฝ๊ณ ๋ ์ ์์์๋ ์ผ๋ด ๋บ์ด! ํน์ ๋ชฐ๋ผ์ ์์ ๋ฐ์ ์ํ์์๋ ์คํํด๋ดค๋๋ฐ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํด...
ThisCard์ Start์์ Debug.Log(CardDataBase.cardList.Count) ํ๋ฉด ๋ช๋์??
0์ด๋ ...
ํ์ง๋ง CardDataBase์ Awake์์ Debugํ ๋ ์ ๋์จ๋ค๋๊ฑฐ์ง?
ใ ใ ใ ใ CardDataBase์์๋ ๋ด๊ฐ csv๋ txt์ ๋ง๋ค์ด์ Listํ์ํจ๊ฑฐ ์ ๋ถ ๋ค ์ถ๋ ฅ ์๋์!!
์ฌ๋ฆฐ ์ฝ๋์์ ์๋ ์ด์ ๊ฐ ๋ณด์ด์ง ์๋๋ฐ ๋ค๋ฅธ์ฝ๋์์ CardDataBase๋ฅผ ๊ฑด๋๋ฆฐ๋ค๋์ง, CardDataBase๊ฐ ThisCard๋ณด๋ค ๋ฆ๊ฒ ์์ฑ๋๋ค๋์ง ํ๋๊ฑด ์๋์ผ?
ThisCard๋ณด๋ค ๋ฆ๊ฒ ์คํ๋ ๊ฒ ๊ฐ์์ ์คํฌ๋ฆฝํธ ์คํ ์์๋ ํด ๋ค์ด๊ฐ์ ์ค์ ํ๋๋ฐ ๊ทธ๋๋ ์ด๋ ๊ฒ ๋ ์... ์ผ๋จ ๊ณ์ ๋ง์ ธ๋ด์ผ๊ฒ ๋ค...ใ ใ ใ