I am tring to put together an animated demo in unity and would like to make it loop. I have tried making all the animation keys loop but after one loop it losses timing. So i figured if I had a script that would reset the scene time back to 0 after say 15 seconds it would accomplish the same thing.
This can be placed in any object in the scene. Just reloads the current scene after the delay set in the Invoke call.
using UnityEngine;
public class SceneResetOnDelay : MonoBehaviour
{
void Start()
{
Invoke("ResetScene", 15f);
}
void ResetScene()
{
Application.LoadLevel(Application.loadedLevel);
}
}