Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

is it OK to use DestroyImmediate in game?

$
0
0
Hi! Right now i'm using DestroyImmediate to destroy duplicates of a game controller (which is a singleton) that has been set to DontDestroyOnLoad(). The reason why i need DestroyImmediate is that otherwise the Awake() and Start() functions of the duplicate scripts will run, which in my case is very time consuming. The reason for having duplicates of the game controller is that i otherwise would have to run the game from the start scene everytime just to test a certain level. According to the [reference][1] it's not recommended though, but is it still valid? [1]: http://docs.unity3d.com/ScriptReference/Object.DestroyImmediate.html

Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>