public class GlobalValues : MonoBehaviour
{
public int countCompsAdded {get; set; }
internal ComputerStructForSend[] Computers = new ComputerStructForSend[5];
}
public class SendData : GlobalValues
{
public void testFunc()
{
countCompsAdded++;
Debug.Log(countCompsAdded);
Computers[countCompsAdded].cpu = Field[0].text;
Computers[countCompsAdded].ram = Field[1].text;
Computers[countCompsAdded].hardcount = Field[2].text;
Computers[countCompsAdded].count = Field[3].text;
Computers[countCompsAdded].year = Field[4].text;
}
}
public class VisibleTest : SendData
{
void Start()
{
Debug.Log(Computers[1].cpu);
Debug.Log(Computers[1].ram);
}
}
[System.Serializable]
public struct ComputerStructForSend
{
public string cpu;
public string ram;
public string hardtype;
public string hardcount;
public string count;
public string year;
}