Т.е. есть массив, который хранит в себе названия сцен ( StartEff.massEff [StartEff.controlEff-- ] [ 0 ] ).
и есть IEnumerator, который выполняет через 30 сек тот бред, что я написала (((
Синтаксис:
Используется csharp
class StartEff // формируем список воспроизведения
{
public static List<List<string>> massEff = new List<List<string>>();
public static int controlEfft = 0;
}
{
public static List<List<string>> massEff = new List<List<string>>();
public static int controlEfft = 0;
}
////////////////////
Навесила просто на канву в каждой сцене.
Синтаксис:
Используется csharp
public class ControlEff : MonoBehaviour {
void Start () {
PLAY();
}
public void PLAY()
{
try
{
if ( StartEfft.massEff [ StartEfft.controlEff ] [ 0 ] != null )
{
StartCoroutine( Play_effect( ) );
if ( StartEff.controlEff == 0 ) {
StartEff.controlEff++;
SceneManager.LoadScene( StartEff.massEff [ StartEff.controlEff-- ] [ 0 ] );
}
}
}
catch
{
}
}
IEnumerator Play_effect ( )
{
yield return new WaitForSeconds( 30f );
try
{
if ( StartEff.controlEff < StartEff.massEff.Count && StartEffect.controlEffectPlay != 0 )
{
StartEff.controlEff++;
SceneManager.LoadScene( StartEff.massEff [ StartEff.controlEff-- ] [ 0 ] );
}
else {
StartEff.controlEff = 0;
}
}
catch
{
}
}
void Start () {
PLAY();
}
public void PLAY()
{
try
{
if ( StartEfft.massEff [ StartEfft.controlEff ] [ 0 ] != null )
{
StartCoroutine( Play_effect( ) );
if ( StartEff.controlEff == 0 ) {
StartEff.controlEff++;
SceneManager.LoadScene( StartEff.massEff [ StartEff.controlEff-- ] [ 0 ] );
}
}
}
catch
{
}
}
IEnumerator Play_effect ( )
{
yield return new WaitForSeconds( 30f );
try
{
if ( StartEff.controlEff < StartEff.massEff.Count && StartEffect.controlEffectPlay != 0 )
{
StartEff.controlEff++;
SceneManager.LoadScene( StartEff.massEff [ StartEff.controlEff-- ] [ 0 ] );
}
else {
StartEff.controlEff = 0;
}
}
catch
{
}
}
////////////////////
В итоге, все работает не так, как я ожидала, я так поняла, что IEnumerator зацикливается и все виснет....
Прошу помощи!!!!