Hi Folks,
I’m trying to load a 1.6 project into Unity 2.0 Pro and I get an error that frame is not a member of UnityEngine.Texture2D. Is there something that replaces that functionality?
Cheers,
Paul
Hi Folks,
I’m trying to load a 1.6 project into Unity 2.0 Pro and I get an error that frame is not a member of UnityEngine.Texture2D. Is there something that replaces that functionality?
Cheers,
Paul
Depends how you were using it. I’m assuming you were using it to load and display a video to texture, if so, you can now use a “MovieTexture” instead: Unity - Scripting API: MovieTexture
Thanks for the reply. Yes, one use of it was for a waterfall texture. I saw the ‘movietexture’ and I suppose that’s the replacement for that use. I also noticed that there isn’t a method of accessing which frame is currently being played or which frame to start playing the movietexture (I suspect that would be useful for synchronization of video with gameplay).
My other use for it was to use it for changing a status bar (like a volume slider for audio). Is there an equivalent UI object in 2.0?
Cheers,
Paul
Have you looked at the horizontal and vertical sliders in UnityGUI yet? You can create a custom skin to look like almost anything you can think of.
Thanks for the direction! I’ll check it out. So much new stuff in 2.0… I feel like a kid at Christmas.
Cheers,
Paul
For waterfall textures simply replace the texture in the material each frame:
var theTextures : Texture[];
renderer.material.mainTexture = theTextures[Random.Range(0, theTextures.Length)];
are we allowed to assume we’ll have more control in the MovieTexture in future versions of 2.0? Like go to frame/time, play at frame/time, different looping methods (back and forth, randomise), get total time of movie, event when movie has finished, etc?
Cheers.