Skip to content

Commit

Permalink
Fixed bugs about an array.
Browse files Browse the repository at this point in the history
  • Loading branch information
yutokun committed Jan 29, 2017
1 parent ac0cfbc commit 9451ee2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Assets/VR Text Input/Scripts/KanjiConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ IEnumerator Convert () {
// Debug.Log ("変換文節の数:" + j.list.Count);
// Debug.Log ("候補の数:" + j.list [0].list [1].keys.Count);
// Debug.Log ("変化前の文字数" + j.list [0].list [0].ToString ().Length);
int numberOfCandidate = j.list [0].list [1].keys.Count;

//Aボタンの挙動を変更
isConverting = true;
Expand All @@ -104,10 +103,17 @@ IEnumerator Convert () {
}

for (int phrase = 0; phrase < j.list.Count; phrase++) {
foreach (var item in kanji) {
item.text = ""; //前回の変換結果が残ることがあるのでクリア
}
int numberOfCandidate = j.list [phrase].list [1].keys.Count; //変換候補の数
for (int i = 0; i < numberOfCandidate; i++) {
kanji [i].text = j.list [phrase].list [1].keys [i]; //変換候補をKanjiに表示
kanji [i].text = j.list [phrase].list [1].keys [i]; //変換候補をKanjiに並べる
}
yield return new WaitUntil (() => OVRInput.GetDown (OVRInput.RawButton.A));
if (current > numberOfCandidate) {
current = numberOfCandidate - 1;
}
textHandler.Send (j.list [phrase].list [1].keys [current], j.list [phrase].list [0].ToString ().Length - 2); //選んだ候補を入力
yield return null;
}
Expand Down

0 comments on commit 9451ee2

Please sign in to comment.