SQLite and Lists in C#

Hello everyone,

I’ve been creating a game and I’ve recently started using database to store data and wondering how to do it online and offline.

I am using SQLite 4 Unity 3d (and sincerely don’t know if it is the best way to store data in C#), and I’m able to save information as long as it is intenger, float, strings, etc.

But I recently needed to save a list of strings, or numbers, and I’ve been strulling a bit to understand the concept behind this (since I’m a newbie with database, XML, SQL, and anything related to saving data offline or online).

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace SQLite.models{
	public class PlayerClass{

		[PrimaryKey, AutoIncrement]
		public int level {get; set;}
		public float money {get; set;}

		private List<string> tanksOwnedName {get; set;}

		[SerializeField]
		 public string tanksOwnedNameJSON { 
			get {
					return StringSerializationAPI.Serialize(tanksOwnedName.GetType(), tanksOwnedName);
			}
			set {
					tanksOwnedName = (List<string>)StringSerializationAPI.Deserialize(tanksOwnedName.GetType(), value);
			}
		}
	}
}

What you can see above is a Player class where the player will own tanks in this case.

Can someone enlighten me with databases, does and donts, with storing data online and offline.

Many Thanks in advance to all of you.

for me the best way offline was creating a persistent file like txt, xml or samething like that… and in game using scriptable objects to store all data through all scenes… and when i use online services i send this data trough json utility. and that’s it! i already like u use this sqlite but what i see on this plugins it’s too complicate for simple things… i hope my answer helped you! any questions feel free to do it.