Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Why do I have to explicitly cast my MovieTexture?

$
0
0
Shouldn't unity automatically know that the maintexture is a movietexture and allow access to Play()? It just seems a little clunky, but I'm by no means an expert programmer. Currently I have to use the following code and cast the texture as a MovieTexture before I can play it: MovieTexture movieTexture; // Use this for initialization void Start () { movieTexture = renderer.material.mainTexture as MovieTexture; movieTexture.Play (); } Thank you for any explanations!

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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