标题: 一个幻灯效果代码。。看不太懂 [打印本页] 作者: 雅雅 时间: 2013-6-29 20:34 标题: 一个幻灯效果代码。。看不太懂 using UnityEngine;
using System.Collections;
public class change : MonoBehaviour
{
public Texture[] picture;
public int i = 0;
public float waitTime = 2;
private float currentTime = 0;
void Start()
{
i = 0;
gameObject.renderer.material.mainTexture = picture;
currentTime = Time.time;
}
// Update is called once per frame
void Update()
{
if (Time.time > (currentTime + waitTime))
{
if (i < (picture.Length -1))
{
i++;
}
else
{
i = 0;
}