Project: Play a small-window video in a 3d scene, click on the video, and zoom in to full screen video. Then click on the video and zoom out for the original small window of the video to continue playing the video.
1.unity3d, play video in three-dimensional scene, put the video component under the corresponding plane, adjust its position, zoom, rotate.
2. Place the world-space UI canvas Button on the plane attached to the video, in the same size, in a transparent state, noting that the Ugui image component cannot remove,button the clicked effect can be set to none.
3. Play the video in full screen, you need to join the screen UI Canvas, add the child node raw image component, and then add the aspect ratio fitter component to adapt the RAW image UI to the screen, proportional to the aspect ratio of the video.
4. Important: The phone vertical screen shows the video as normal video (such as 1024*720), the mobile phone horizontal screen display video is clockwise rotation of the video, such as (720*1024).
The texture of 5.raw image gets the texture of the original video for each frame, and the material is also set to the material of the original video so that the video can be displayed on the screen UI.
6. After the full screen button is the child node of the raw image, anchors settings, click Alt Set the position full parent UI. Also set the effect of the button on the original video.
7. Two buttons simply accept the button-down trigger control, and do not care whether the object being controlled or not. In fact, the video only has to be loaded to make the button trigger valid.
8.Button State flow control, the attached game object whether disable or enable should go back to the initial state, accept the trigger of the click, and then send a message.
9.button the message receiver, only the corresponding state response is migrated state instead of the global event direct migration to perform the next state.
3d Video switch to full screen playback