Created
July 31, 2018 10:45
-
-
Save friuns2/db28886c1850d02770e5ea19b1cbc6fa to your computer and use it in GitHub Desktop.
This file contains 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
void Update() | |
{ | |
foreach (var a in GetDontDestroyOnLoadScene().GetRootGameObjects()) | |
{ | |
if (a.name == "Imposter Camera") | |
{ | |
a.hideFlags = HideFlags.None; | |
} | |
} | |
} | |
private Scene GetDontDestroyOnLoadScene() | |
{ | |
GameObject temp = null; | |
try | |
{ | |
temp = new GameObject(); | |
DontDestroyOnLoad( temp ); | |
Scene dontDestroyOnLoad = temp.scene; | |
DestroyImmediate( temp ); | |
temp = null; | |
return dontDestroyOnLoad; | |
} | |
finally | |
{ | |
if( temp != null ) | |
DestroyImmediate( temp ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment