C# 如何获取列表上的值

C# 如何获取列表上的值,c#,unity3d,C#,Unity3d,但问题是它只会变成这样 private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list) { tzPlayInfo.Instance.gametable_history_list = list; string s1 = "";

但问题是它只会变成这样

private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list)
{
    tzPlayInfo.Instance.gametable_history_list = list;

    string s1 = "";

    for (int i = 0; i < list.Count; i++)
    {
        s1 += list[i].r;
        s1 += ",";
    }

    Debug.Log("This is a new history " + gametable_no + " = " + s1);
}
private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list)
{
    if (gametable_no != 1) // Because you're only interested in table 1
        return;

    tzPlayInfo.Instance.gametable_history_list = list;

    string s1 = "";

    for (int i = 0; i < list.Count; i++)
    {
        s1 += list[i].r;
        s1 += ",";
    }

    Debug.Log("This is a new history " + gametable_no + " = " + s1);
}
这是一个新的历史1=p

只有1个值。我想要整个新的历史1整个价值。
谢谢

您的函数被调用了4次。问题是为什么它被称为4次

简单的解决办法是:

s1 += list[0].r;
private void GametableHistory(bool success,Int32 gametable\u no,Int32 year,Int32 month,Int32 day,Int32 shoe\u no,bc\u gametable\u history列表)
{
if(gametable_no!=1)//因为您只对表1感兴趣
返回;
tzPlayInfo.Instance.gametable_history_list=list;
字符串s1=“”;
for(int i=0;i

我不知道unity中的
GameTables
/
GameTableHistory
。您创建了这个类吗?

您的函数被调用了4次。问题是为什么它被称为4次

简单的解决办法是:

s1 += list[0].r;
private void GametableHistory(bool success,Int32 gametable\u no,Int32 year,Int32 month,Int32 day,Int32 shoe\u no,bc\u gametable\u history列表)
{
if(gametable_no!=1)//因为您只对表1感兴趣
返回;
tzPlayInfo.Instance.gametable_history_list=list;
字符串s1=“”;
for(int i=0;i

我不知道unity中的
GameTables
/
GameTableHistory
。你创建了这个类吗?

卡拉离我这么近,我在这里做的就是这样

private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list)
{
    tzPlayInfo.Instance.gametable_history_list = list;

    string s1 = "";

    for (int i = 0; i < list.Count; i++)
    {
        s1 += list[i].r;
        s1 += ",";
    }

    Debug.Log("This is a new history " + gametable_no + " = " + s1);
}
private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list)
{
    if (gametable_no != 1) // Because you're only interested in table 1
        return;

    tzPlayInfo.Instance.gametable_history_list = list;

    string s1 = "";

    for (int i = 0; i < list.Count; i++)
    {
        s1 += list[i].r;
        s1 += ",";
    }

    Debug.Log("This is a new history " + gametable_no + " = " + s1);
}
if(游戏表编号==1)
{
对于(int i=0;i

谢谢你Kara Kara离我这么近我在这里做的就是这样

private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list)
{
    tzPlayInfo.Instance.gametable_history_list = list;

    string s1 = "";

    for (int i = 0; i < list.Count; i++)
    {
        s1 += list[i].r;
        s1 += ",";
    }

    Debug.Log("This is a new history " + gametable_no + " = " + s1);
}
private void GametableHistory(bool success, Int32 gametable_no, Int32 year, Int32 month, Int32 day, Int32 shoe_no, bc_gametable_history_list list)
{
    if (gametable_no != 1) // Because you're only interested in table 1
        return;

    tzPlayInfo.Instance.gametable_history_list = list;

    string s1 = "";

    for (int i = 0; i < list.Count; i++)
    {
        s1 += list[i].r;
        s1 += ",";
    }

    Debug.Log("This is a new history " + gametable_no + " = " + s1);
}
if(游戏表编号==1)
{
对于(int i=0;i

谢谢你Kara

你是如何得到4个输出的……例如……这是一个新的历史记录1、2、3、4?我们调用了方法
GametableHistory
4次了吗?如果是,那么只调用一次方法,使用appropiate
gametable\u no
你是如何得到4个输出的……例如……这是一个新的历史记录1、2、3、4?我们调用了吗方法
GametableHistory
4次?如果是,则使用appropiate
gametable\u no
仅调用该方法一次。我稍后需要其他表。实际上,现在我只想打印出第一个表,然后是第二个表。我如何获得该表,先生?该示例适用于您。该函数被
if
-子句中返回
。只有
gametable\u no==1
会被记录。是的,我知道。但是有什么东西我可以从
gametable\u no==1
中获得这些值吗.r
我创建了那些Classic,我不知道你想做什么。
gametable_no==1
是一个比较,它会给你一个
真的
假的
s1+=x
将你的变量
x
添加到你的字符串
s1
。我需要其他的表,实际上现在我只想打印出第一个表下一个是第二个表。我怎样才能得到它,先生?这个例子对你有用。这个函数在
if
-子句中用
return
来取消。只有
gametable\u no==1
会被记录。是的,我知道。但是有什么东西我可以从
gametable\u no==1
中得到这些值吗.r
我创建了那些Classic,我不确定你想做什么。
gametable_no==1
是一个比较,它给你一个
true
false
s1+=x
将变量
x
添加到字符串
s1