소스 검색

Allow Skin.AddAttachment to overwrite safely

Allow Skin.AddAttachment to overwrite an existing attachment as intended.
( For more info, see the Remarks section of: http://msdn.microsoft.com/en-us/library/k7z0zy8k%28v=vs.110%29.aspx )
John 11 년 전
부모
커밋
9e69a711b5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      spine-csharp/src/Skin.cs

+ 1 - 1
spine-csharp/src/Skin.cs

@@ -45,7 +45,7 @@ namespace Spine {
 
 		public void AddAttachment (int slotIndex, String name, Attachment attachment) {
 			if (attachment == null) throw new ArgumentNullException("attachment cannot be null.");
-			attachments.Add(new KeyValuePair<int, String>(slotIndex, name), attachment);
+			attachments[new KeyValuePair<int, String>(slotIndex, name)] = attachment;
 		}
 
 		/// <returns>May be null.</returns>