How can I create a string array in class?
Also I have to add or append values to that array.
I can use Firebase real-time database to store array values in database.
Not to a specific key.
I declared array as:
private string[] uiddata;
That array is useed in a for loop and add elements to the array as
public void Click()
{
_uid = int.Parse(_uidText.text);
for(int i = 0; i < uiddata.Length;i++)
{
uiddata.Add(_uid);
//_score = int.Parse(_scoreText.text);
_uidRef.SetValueAsync(_uid);
//_scoreRef.SetValueAsync(_score);
_uidRef.RunTransaction(data =>
{
data.Value =_uid ;
return TransactionResult.Success(data);
}).ContinueWith(task =>
{
if (task.Exception != null)
Debug.Log(task.Exception.ToString());
});
}
}
In the script above I try to add my value in the array but gives this error:
error CS1061: Type
string[]does not contain a definition forAddand no extension methodAddof typestring[]could be found. Are you missing an assembly reference?