inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part3: 유니티 엔진

Data Manager #2

ArgumentException 에러가 생겼습니다.

1685

용현박

작성한 질문수 2

1

ArgumentException: An item with the same key has already been added. Key: 1

System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <1c8569827291471e9db0dcd976e97952>:0)

System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <1c8569827291471e9db0dcd976e97952>:0)

RPG.Data.StatData.MakeDict () (at Assets/02.Scrips/Data/Data.Contents.cs:28)

RPG.Managers.DataManager.Init () (at Assets/02.Scrips/Managers/DataManager.cs:21)

RPG.Managers.Managers.Init () (at Assets/02.Scrips/Managers/Managers.cs:53)

RPG.Managers.Managers.get_Instance () (at Assets/02.Scrips/Managers/Managers.cs:10)

RPG.Managers.Managers.get_Resource () (at Assets/02.Scrips/Managers/Managers.cs:23)

RPG.Scenes.BaseScene.Init () (at Assets/02.Scrips/Scenes/BaseScene.cs:22)

RPG.Scenes.GameScene.Init () (at Assets/02.Scrips/Scenes/GameScene.cs:14)

RPG.Scenes.BaseScene.Awake () (at Assets/02.Scrips/Scenes/BaseScene.cs:15)

 

이렇게 에러가 생겼는데 이미 Dictionary가 생겨났다는데 Init()함수 순서 문제인건지 모르겠습니다.

C# unity

답변 1

2

Rookiss

ArgumentException: An item with the same key has already been added. Key: 1

같은 키값 1로 두 번 추가해서 그런데 혹시 왜 그런지 breakpoint를 걸어보세요

0

용현박

이런 말씀 드리면 좀 그렇지만 감히 사랑한다 말씀드리고 싶습니다.

해결 완료되었습니다.

0

이한결

와 사랑해요 형

소스를 받을 수 있는 링크가 있을까요?

0

70

2

Pivot을 마우스로 클릭하고 드래그해도 움직이 않아서 혹시 아시는 부분이 있나 해서 문의 남깁니다.

0

59

1

ResourceManager 클래스 관련 질문

1

83

2

몬스터 HP 게이지바 이동

0

57

1

매니저 관련 질문이 있습니다.

0

112

2

비쥬얼 스튜디오에서 unity연결이 없습니다.

0

122

2

UI 기능 관련 질문이 있습니다!

0

102

2

픽셀 좌표 스크린 좌표

0

75

0

전체적으로 코드 읽는게 굉장히 오래 걸리네요...

0

136

2

카메라 #2 수업 캐릭터 쓰러짐 해결

0

122

1

플레이어 움직임이 끝날때, 기울어짐 현상

0

131

1

Input 적용과 관련하여 질문 있습니다.

0

115

1

디버그 불가.. Unity에 연결 불가

0

130

1

달리기 애니메이션 에러

0

135

2

오랜만에 게임을 만들다가 사운드 관련해서 뭔가 궁금한게 있어서 봤습니다

0

89

1

GetKey 오류

0

171

2

에셋을 어디에 올려두신지 알 수 있나요?

0

137

1

재귀호출? 오류나는데 왜 이래요 ?

0

234

6

Animation blending 파라미터 계산

0

98

1

newPos와 to지점이 겹쳐져야 하는거 아닌가요?

0

145

3

오브젝트 복제하니까 자꾸 이런게 뜨면서 꺼집니다

0

129

2

질문있습니다

0

183

2

아 이거 소스코드 같은거 없나요?

0

181

3

질문 드립니다. string.IsNullOrEmpty(name)

0

116

2