![]() ![]() By default the screen grabbed image will also be written into the. Perhaps there are paid solutions that cover it all, but since it is so easy to write it yourself, why bother?Īnother "disadvantage" of all these scripts is that you need to attach them to some gameobject in your scene, while all I want is some editor code that has no impact on the game at all. CaptureScreenshot() can also be used from the Editor, for example in a custom EditorWindow. I tried only this one and it did not fit my needs. There are also some plugins available on the asset store that promise to be awesome tools. Now last thing it to add code that will allow you to test the logic ex by pressing K. But reading all the different posts and comments on the forums and answers, it seems to me that there are a lot of different use cases, making it impossible for Unity to come with a standard default way to capture screenshots that would be useful to all developers (and simple to configure and use). Unity make a screenshot from editor Raw ScreenCaptureEditor.cs This file contains bidirectional Unicode text that may be interpreted or compiled differently than what. To save the screenshot unity has a special method called ScreenCapture.CaptureScreenshot (path) The resolution will be the same as the resolution set in the Game view so if you have Free Aspect your resolution might not be something strange like 1164圆05. I read some post where a user complained that this should be a default thing to do in the editor, supported by Unity itself. The HPTM is almost entirely rendered in overlay, so this proved to be the only viable option.Ī possible implementation of all three these methods can be found here. The main advantage is that this method also captures the UI that is rendered as "Screenspace - Overlay". ScreenCapture.CaptureScreenshot which replaces the deprecated Application.CaptureScreenshot.Instead of using the default rendertarget you're reading from a custom render texture. ![]() A slight different way is using a RenderTexture but that is almost the same as using ReadPixels, since at some point you'll need that call anyway.Texture2D.ReadPixels can even capture a part of the screen.There are basically three methods that these scripts can use. In general, it works so far that I get a file on the disk. In the Project window, expand the Unity Technologies folder and select the Recorder folder. Tried to start Unity over Windows console command in batchmode and write a screenshot to the hard disk. In Unity Editor, open your Unity Project. It surprised me how many different solutions exist for this mundane task.Ī lot of people write scripts that take a camera in the scene and render a screenshot from that. Wrote a editor script that takes a screenshot with ReadPixels (). In the editor I can easily select the different resolutions and aspect ratios that are supported by the app, so I googled for the best way to take a screenshot from within the editor. I am working on a mobile app for the home poker tournament manager (HPTM) and while preparing the google play store for release I had to create some screenshots to display in the store.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |