Created
August 27, 2018 23:29
-
-
Save adeubank/b799ea1f0e99db97c0ec472317347f64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find a game object in the active scene | |
using System.Linq; | |
GameObject worldGameObject = | |
GameObject.FindGameObjectsWithTag("World").ToList().Find(o => o.scene == activeScene); | |
if (worldGameObject != null) | |
{ | |
Debug.Log("SetTrigger: SceneExit" + worldGameObject.name); | |
worldGameObject.GetComponent<Animator>().SetTrigger("SceneExit"); | |
} | |
else | |
{ | |
Debug.Log("Did not find a world game object in active scene." + activeScene.name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment