第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如果字符串?dāng)?shù)據(jù)數(shù)組不同,則遞增位置C#(Unity)

如果字符串?dāng)?shù)據(jù)數(shù)組不同,則遞增位置C#(Unity)

C#
慕勒3428872 2021-05-20 10:14:16
我需要有關(guān)我正在制作的記分牌的幫助。這是我想要達(dá)到的記分牌:我實(shí)際上有四個(gè)表,每個(gè)表都有自己的計(jì)分板,但是僅針對(duì)表1的此問題才是我所需要的,因此這是我如何創(chuàng)建這種計(jì)分板?,F(xiàn)在,到目前為止,我已經(jīng)做到了:if (gametable_no == 1){    for (int i = 0; i < tzPlayInfo.Instance.bc_gametable_history_list.Count; i++)    {        newString[0] += tzPlayInfo.Instance.bc_gametable_history_list[i].r;        newString[0] += ",";    }    string[] groupedString = newString[0].Split(',');    foreach (string allchars in groupedString)    {        int x = 0;        int y = 0;        GameObject o = Instantiate(prefab_big_road[0]) as GameObject;        o.transform.SetParent(pos_big_road[0]);        o.transform.localScale = Vector3.one;        o.transform.localPosition = new Vector3(2.0f, -5.0f, 0f);        o.transform.localPosition = new Vector3(o.transform.localPosition.x + x,            o.transform.localPosition.y + y, o.transform.localPosition.z);        if (allchars.Contains(playerwinnopairboth))        {            o.GetComponent<UISprite>().spriteName = "layout_player_bigline-01";            NGUITools.SetActive(o, true);        }        if (allchars.Contains(bankerwinnopairboth))        {            o.GetComponent<UISprite>().spriteName = "layout_banker_bigline-01";            NGUITools.SetActive(o, true);        }        if (allchars.Contains(tienopairboth))        {            o.GetComponent<UISprite>().spriteName = "layout_tie_bigline-01";            NGUITools.SetActive(o, true);        }    }}這段代碼只能這樣實(shí)現(xiàn):輸出是隨機(jī)生成的,例如,我有以下輸出數(shù)據(jù):Gametable 1 history : P  ,P  ,P  ,B   ,B P,P P,TBP我需要知道在角色改變的gametable 1 history data。例如:輸出必須是這樣的如果該值沒有改變,P  ,P  ,P則位置將僅在y軸上遞增;然后,如果下一個(gè)值有所不同,B   ,則它將移至x軸。有沒有一種方法可以檢測(cè)字符串?dāng)?shù)組中的字符是否與另一個(gè)值不同?
查看完整描述

2 回答

?
慕斯709654

TA貢獻(xiàn)1840條經(jīng)驗(yàn) 獲得超5個(gè)贊

缺少以下條件:


if (table.GetLength(0) < xIndex)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? break;

? ? ? ? ? ? }


? ? ? ? ? ? if (previousValue.Equals(newPreviousValue) && yIndex < table.GetLength(1))

? ? ? ? ? ? {

? ? ? ? ? ? ? ? yIndex += 1;

? ? ? ? ? ? ? ? table[xIndex, yIndex] = previousValue;

? ? ? ? ? ? }

? ? ? ? ? ? else

? ? ? ? ? ? {

? ? ? ? ? ? ? ? xIndex += 1;

? ? ? ? ? ? ? ? yIndex = 0;

? ? ? ? ? ? ? ? table[xIndex, yIndex] = previousValue;

? ? ? ? ? ? }

? ? ? ? ? ? newPreviousValue = previousValue;

所以不是table.GetLength(1) < yIndex它必須是yIndex < table.GetLength(1)。


查看完整回答
反對(duì) 回復(fù) 2021-05-23
  • 2 回答
  • 0 關(guān)注
  • 209 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)