/// <summary> /// Gets the attachment at the specified slot and index. /// </summary> /// <param name="index">Attachment index</param> /// <param name="characterSlot">Index of the character slot we wish to get an attachment from</param> /// <returns>null if failed, otherwise the attachment.</returns> public Attachment GetAttachment(int index, int characterSlot = 0) { var ptr = NativeEntityMethods.GetAttachmentByIndex(this.GetIEntity(), index, characterSlot); if (ptr == IntPtr.Zero) { return(null); } return(Attachment.TryAdd(ptr, this)); }