i have 2 animation clip, the first one plays automatically and the dialog box plays in timer.
so how do i play the second animation when the dialog box ended, i marked the location down below in the codes.
i really dont know the code for this one. i searched for days so being desperate i came here.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class TextBox : MonoBehaviour {
public GameObject textbox;
public Text thetext;
public TextAsset textfile;
public string[] textline;
public int currentline;
public int endline;
void Start()
{
if (textfile != null)
{
textline = (textfile.text.Split('
'));
}
if (endline == 0)
{
endline = textline.Length - 1;
}
}
void Update ()
{
thetext.text = textline [currentline];
if (Input.GetKeyDown (KeyCode.Space))
{
currentline += 1;
}
if (currentline > endline)
{
textbox.SetActive (false);
//IM GOING TO PUT THE CODE HERE
}
}
public void ReloadScript(TextAsset thetext)
{
if (thetext != null)
{
textline = new string[1];
textline = (thetext.text.Split('
'));
}
}
}