Created
April 17, 2015 13:14
-
-
Save suakig/1ab5845c25eae9a5eff5 to your computer and use it in GitHub Desktop.
CreateNextScore.cs
This file contains hidden or 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 UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
/// <summary> | |
/// 次の目標値を決めるクラス | |
/// </summary> | |
public class CreateNextScore : MonoBehaviour { | |
public float invokeTime = 1; //何秒に一回呼ぶか | |
public MinMaxSliderValue randRange; //乱数範囲設定 | |
private Text nextScore; | |
void Start () { | |
nextScore = transform.FindChild ("NextScore").GetComponent<Text>(); | |
Run (); | |
} | |
void Run () | |
{ | |
int rand = Random.Range ((int)randRange.minValue, (int)randRange.maxValue); | |
nextScore.text = "NextScore " + rand.ToString(); | |
Invoke ("Run", invokeTime); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment