Screen record in unity3d

2019-06-24 11:57发布

How to do screen record in unity? I want to record my screen(gameplay) during my running game. That should be play/stop , replay , save that recording on locally from device, open/load from my device (which is already we recorded).

In my game one camera which can capture native camera, and one 3d model.

I wish to record that both and use my functionality whenever i want.

Thank you in advance.

2条回答
唯我独甜
2楼-- · 2019-06-24 12:09

This is hard to implement, but not impossible. Because every frame or interval you need to capture screen shot of your camera view and store it in the list. You need good, (Smaller interval but not much. Because when it becomes smaller, needs more memory) interval value. If your interval is big raplay can be seen laggy.

While you play game your ram becomes full and os will terminate the app. So you need to fully cover memory optimization. Another solution is assets in Unity Asset store.

EZ Replay Manager can be used. (Keep in mind: I haven't tried it yet.)

Free

Pro

查看更多
贼婆χ
3楼-- · 2019-06-24 12:33

Check out this open-source project: https://github.com/getsocial-im/getsocial-capture. By default our project records Main Camera's rendered content. C# examples are in the repo.

You can record in 2 modes:

  1. Continuous mode - capture last X frames.
  2. Manual mode - capture frames on your own when needed. For example, record a timelapse of the level.

Once the recording is done, you can generate GIF, get raw bytes and do whatever you want. E.g. let your users share that GIF with friends.

Here's the recording of a game session from the test app. The recorded GIF shows up in the end:

GetSocial GIF Capture library, preview via <code>GetSocialCapturePreview</code>

查看更多
登录 后发表回答