This question was
closed Nov 06, 2020 at 08:05 PM by
codedbythet for the following reason:
The question is answered, right answer was accepted
Question by
codedbythet · Nov 06, 2020 at 03:23 PM ·
programmingscene-switchingtransitions
Left Center Right Scene Transistion
I am trying to build transitions where the main map has scene transitions to the Left and Right of the main scene.
It is kind of like left is scene 2, center is scene 1, and right is scene 3.
how can I apply a public statement that will allow dragging the scene( say 3) as the transition to scene and then +/1 the next sequential scenes?
public void LoadNextLevel()
{
StartCoroutine(LoadLevel(SceneManager.GetActiveScene().buildIndex +1));
}
Comment
I was able to resolve two ways. This is one way
public int SceneNum = 0;
public Animator transition;
public float transitionTime = 2f;
private void OnTriggerEnter2D(Collider2D other) {
if (other.gameObject.CompareTag("Player")) {
Scene$$anonymous$$anager.LoadScene(SceneNum);
LoadNextLevel();
}
}
public void LoadNextLevel()
{
StartCoroutine(LoadLevel());
}
IEnumerator LoadLevel()
{
transition.SetTrigger("Start");
yield return new WaitForSeconds(transitionTime);
}
}
Follow this Question
Related Questions
PROBLEM IN MOVING WITH C # 1 Answer
Question about Input.GetKey 1 Answer
Anyone wanna help? 0 Answers
How to have audio play once picked item up? 0 Answers
How do you create a game compatible or friendly for the oculus rift? 0 Answers