Quantcast
Channel: Answers for "GameObject instantiation in C# static constructor"
Viewing all articles
Browse latest Browse all 4

Answer by frarees

$
0
0
You can do that at editor time using things like [InitializeOnLoad][1]. Not sure if you can do that at runtime.. It needs somehow to get triggered by an instance on the scene. You could use [PostProcessSceneAttribute][2] to create an object before the scene gets built. [1]: http://docs.unity3d.com/Manual/RunningEditorCodeOnLaunch.html [2]: http://docs.unity3d.com/ScriptReference/Callbacks.PostProcessSceneAttribute.html

Viewing all articles
Browse latest Browse all 4

Trending Articles



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