Hello,
I’ve found CSV reader for my project that work very well, but I wanted to expand the original code (found here: Lightweight CSV reader for Unity | Brave New Method ).
This is my code
`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Main: MonoBehaviour {
void Start ()
{
}
void OnMouseDown()
{
List<Dictionary<string,object>> data = CSVReader.Read ("test");
for(var i=0; i < data.Count; i++)
{
print ("id " + data*["id"] + " " +*
_ "message " + data*[“message”]);_
_ }_
_ }_
_ void OnMouseOver()_
_ {_
_ print (gameObject.name);_
_ }_
_}_
_`*_
At the moment this code prints the whole CSV content, but I want it to pick randomly a string, each time I execute it. I’ve made some research and tests, but invane, maybe because I’m not a programmer.
I think I should use the Random.Range method, but I don’t know how to refer to the strings inside the CSV.
I strongly hope that anybody here could help me