using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Start_gif : MonoBehaviour {
//gif载体image
public Image image_show;
//序列帧精灵sprites 排好序
public Sprite[] sprite_arr;
float time_demo;
private int number=0;
[SerializeField]
//播放速度
private float speed= 0.03f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
time_demo += Time.deltaTime;
if (time_demo > speed)
{
image_show.GetComponent<Image>().sprite = sprite_arr[number];
number += 1;
if (number > sprite_arr.Length-1)
{
number -= sprite_arr.Length - 1;
}
time_demo -= speed;
}
}
}