ZoeAppClass/Assets/Scripts/MitsukuFace.cs

81 lines
1.9 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MitsukuFace : MonoBehaviour
{
public Image img;
public AudioSource audio;
// Start is called before the first frame update
void Start()
{
}
IEnumerator chooseAnime() {
yield break;
}
public IEnumerator runAnimeGlass(string nameBase, string pasteName, int nbrframes, int startframe) {
int index = startframe;
audio.Play();
//Mitsuko Glass _ 293
while (index <= nbrframes)
{
string url;
if (index < 10)
{
url = nameBase + "00" + index.ToString();
}
else if (index < 100)
{
url = nameBase + "0" + index.ToString();
}
else
{
url = nameBase + index.ToString();
}
img.sprite = Resources.Load<Sprite>("Mitsuku/" + pasteName + "/" + url);
index += 1;
yield return new WaitForSecondsRealtime(0.04f);
}
yield break;
}
IEnumerator runAnimeGlassLess0(string nameBase, string pasteName, int nbrframes, int startframe)
{
int index = startframe;
//audio.Play();
//Mitsuko Glass _ 293
while (index <= nbrframes)
{
string url;
if (index < 10)
{
url = nameBase + "0" + index.ToString();
}else
{
url = nameBase + index.ToString();
}
img.sprite = Resources.Load<Sprite>("Mitsuku/" + pasteName + "/" + url);
index += 1;
yield return new WaitForSecondsRealtime(0.04f);
}
yield break;
}
}