Skip to content

Instantly share code, notes, and snippets.

@tsubaki tsubaki/Sample.cs
Created Nov 4, 2018

Embed
What would you like to do?
ボタンを押すたびに一行ずつ表示
using System.Collections.Generic;
using UnityEngine;
public class Sample : MonoBehaviour
{
[SerializeField] List<string> messages;
[SerializeField] UnityEngine.UI.Text messageBox;
private int current = 0;
private void Start()
{
OnClick();
}
public void OnClick()
{
messageBox.text = messages[current];
current = Mathf.Min(current + 1, messages.Count - 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.