Код: Выделить всё
public IEnumerator Animthingy(GameObject Object)
{
yield return new WaitForSeconds(1.5f);
AudioSource.PlayClipAtPoint(DoorOpen, Object.transform.parent.gameObject.transform.position, 2f);
anim.SetBool("IsOpen", true);
anim.SetBool("Activated", true);
AudioSource.PlayClipAtPoint(DoorClose, Object.transform.parent.gameObject.transform.position, 2f);
anim.Play("DoorOpen");
anim.SetBool("Activated", false);
yield return new WaitForSeconds(3f);
AudioSource.PlayClipAtPoint(DoorOpen2, Object.transform.parent.gameObject.transform.position, 2f);
yield return new WaitForSeconds(3f);
AudioSource.PlayClipAtPoint(DoorClose, Object.transform.parent.gameObject.transform.position, 2f);
yield return new WaitForSeconds(1.5f);
AudioSource.PlayClipAtPoint(DoorClose2, Object.transform.parent.gameObject.transform.position, 2f);
yield return new WaitForSeconds(1f);
Debug.Log("closing");
anim.Play("DoorClose");
AudioSource.PlayClipAtPoint(DoorOpen, Object.transform.parent.gameObject.transform.position, 2f);
yield break;
}
Подробнее здесь: https://stackoverflow.com/questions/781 ... tion-calls