I am trying to restart a couple of tweens when I load a new scene. So far, I have this in MainMenuController.cs :
void Start () {
if (currentScene.name == "MainMenuScene") {
Debug.Log("In current scene");
tweenList[0] = mainMenuText.transform.DOShakePosition(5, 10)
.SetAutoKill(false).SetRecyclable(true);
tweenList[1] = playGameButton.transform.DOShakePosition(5, 10)
.SetAutoKill(false).SetRecyclable(true);
tweenList[2] = exitGameButton.transform.DOShakePosition(5, 10)
.SetAutoKill(false).SetRecyclable(true);
DOTween.RestartAll(false);
}
}
However, this does not start when I reload the scene using
public void ExitToMainMenu() {
SceneManager.LoadScene("MainMenuScene");
}
The above is called from another script. Is there some way to restart my tweens when the scene is loaded again?