Created
November 4, 2018 14:59
-
-
Save tsubaki/fdf49e4f5eb52d5fe26d604557399dda to your computer and use it in GitHub Desktop.
文字列のリストから、ボタンを押すたびに一行ずつ取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
public class Sample2 : MonoBehaviour | |
{ | |
[SerializeField] List<string> messages; | |
[SerializeField] UnityEngine.UI.Text messageBox; | |
private List<string>.Enumerator enumerator; | |
void Start() | |
{ | |
enumerator = messages.GetEnumerator(); | |
OnClick(); | |
} | |
public void OnClick() | |
{ | |
if( enumerator.MoveNext()) | |
messageBox.text = enumerator.Current; | |
} | |
} |
Author
tsubaki
commented
Nov 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment