Skip to content

Commit 7baa3ef

Browse files
committed
Added VideoRecrod
1 parent fc7e985 commit 7baa3ef

214 files changed

Lines changed: 758 additions & 122 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CameraScreenShot/.idea/.idea.CameraScreenShot/.idea/indexLayout.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CameraScreenShot/00000000.png

30.2 KB
Loading

CameraScreenShot/Assets/Recorder/RenderTexture.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!84 &8400000
4+
RenderTexture:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_Name: RenderTexture
10+
m_ImageContentsHash:
11+
serializedVersion: 2
12+
Hash: 00000000000000000000000000000000
13+
m_ForcedFallbackFormat: 4
14+
m_DownscaleFallback: 0
15+
serializedVersion: 3
16+
m_Width: 2180
17+
m_Height: 1080
18+
m_AntiAliasing: 1
19+
m_MipCount: -1
20+
m_DepthFormat: 2
21+
m_ColorFormat: 8
22+
m_MipMap: 0
23+
m_GenerateMips: 1
24+
m_SRGB: 0
25+
m_UseDynamicScale: 0
26+
m_BindMS: 0
27+
m_EnableCompatibleFormat: 1
28+
m_TextureSettings:
29+
serializedVersion: 2
30+
m_FilterMode: 1
31+
m_Aniso: 0
32+
m_MipBias: 0
33+
m_WrapU: 0
34+
m_WrapV: 0
35+
m_WrapW: 0
36+
m_Dimension: 2
37+
m_VolumeDepth: 1

CameraScreenShot/Assets/Recorder/RenderTexture/RenderTexture.renderTexture.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CameraScreenShot/Assets/Recorder/Scripts.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using UnityEngine;
4+
5+
public class ScreenConrol : MonoBehaviour
6+
{
7+
8+
public KeyCode MakeScreenShotButton = KeyCode.C;
9+
public ScreenShot _screenShot;
10+
11+
12+
private void Update()
13+
{
14+
//Кнопка для нажатия
15+
if (Input.GetKeyDown(MakeScreenShotButton))
16+
{
17+
//делаем скриншот
18+
_screenShot.MakeScrn();
19+
}
20+
}
21+
}

CameraScreenShot/Assets/Recorder/Scripts/ScreenConrol.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CameraScreenShot/Assets/Scripts/ScreenShot.cs renamed to CameraScreenShot/Assets/Recorder/Scripts/ScreenShot.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections;
3-
using System.Collections.Generic;
4-
using UnityEditor.MemoryProfiler;
5-
using UnityEngine;
1+
using UnityEngine;
62
//разрешаем использовать скрипт только на камере
73
[RequireComponent(typeof(Camera))]
84
public class ScreenShot : MonoBehaviour
@@ -22,7 +18,6 @@ private void Awake()
2218

2319
ScrnCam.targetTexture=new RenderTexture(Width,Height,(int) ScrnCam.depth);
2420
}
25-
2621
ScrnCam.gameObject.SetActive(false);
2722
//если нет директории сохранения файла
2823
bool exists = System.IO.Directory.Exists(dataPath);
@@ -34,8 +29,7 @@ public void MakeScrn()
3429
{
3530
ScrnCam.gameObject.SetActive(true);
3631
}
37-
38-
private void LateUpdate()
32+
private void LateUpdate()
3933
{
4034
//проверяем, включена ли камера
4135
if (ScrnCam.gameObject.activeInHierarchy)
@@ -67,7 +61,7 @@ private string ScreenShotName()
6761

6862
//расположение скриншота
6963
return string.Format($"{dataPath}/" +
70-
$"_Number_{scrNumber}_data_" +
64+
$"Number_{scrNumber}_data_" +
7165
$"{System.DateTime.Now.ToString("yy-MM-dd_HH-mm-ss")}" +
7266
$"_screen_{Width}x{Height}.png");
7367

0 commit comments

Comments
 (0)