Assets/Scripts/MyListClass.cs(10,28): error CS0022: Wrong number of indexes 1' inside [ ], expected 2’
I wanna add an array string variable to a list. From some reason I get the error above. Does anyone know why? And how do I fix it?
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MyArrayClass : MonoBehaviour {
public string[,] myarray = new string[,]
{
{
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"bb",
"cc",
"dd",
"ee"
},
{
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
"gg",
"hh",
"ii",
"jj"
}
};
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MyListClass : MyArrayClass {
public List<string> mylist = new List<string>();
public string MyString;
// Use this for initialization
void Start () {
MyString = myarray[0][0];
mylist.Add (MyString);
Debug.Log (mylist);
}
}