Preview image of screenshot in handmenu
parent
b7dbe4c03e
commit
e2a9832c80
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 63b8e2894030847768ae446c0f6e011b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1 +1 @@
|
|||
2024-06-21T15:02:41.9357660Z
|
||||
2024-07-15T13:48:15.1894300Z
|
File diff suppressed because it is too large
Load Diff
|
@ -2,14 +2,12 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Screenshot : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
[SerializeField]
|
||||
RawImage _previewImg;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
|
@ -28,10 +26,29 @@ public class Screenshot : MonoBehaviour
|
|||
StartCoroutine(TakeScreenshot());
|
||||
}
|
||||
|
||||
public void OnClickPreview()
|
||||
{
|
||||
StartCoroutine(CreatePreview());
|
||||
}
|
||||
|
||||
public void DestroyPreviewTexture()
|
||||
{
|
||||
if (_previewImg.texture == true)
|
||||
{
|
||||
Destroy(_previewImg.texture);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerator TakeScreenshot()
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
string timpStamp = DateTime.Now.ToString("ddMMyyyyHHmmssffff");
|
||||
ScreenCapture.CaptureScreenshot("snapshot_" + timpStamp + ".png");
|
||||
}
|
||||
|
||||
IEnumerator CreatePreview()
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
_previewImg.texture = ScreenCapture.CaptureScreenshotAsTexture();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@ EditorBuildSettings:
|
|||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/1.0-SBB.unity
|
||||
guid: 6a1144d40bbf04513a9929856271d4e7
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Test-HandInteraction.unity
|
||||
guid: 6560c631efa4b492689f76d06071d916
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/1.0-SBB.unity
|
||||
guid: 6a1144d40bbf04513a9929856271d4e7
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Test-Scene.unity
|
||||
guid: 5739d873cf7d24221bea4b568b59f9c1
|
||||
|
|
|
@ -140,6 +140,9 @@ PlayerSettings:
|
|||
bundleVersion: 0.1
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: be340e3c48769439d8d18a5a2bccd498, type: 2}
|
||||
- {fileID: 11400000, guid: bfa1182bd221b4ca89619141f66f1260, type: 2}
|
||||
- {fileID: -8196854396901781169, guid: 1a4c68ca72a83449f938d669337cb305, type: 2}
|
||||
- {fileID: -64324148185763206, guid: a9a6963505ddf7f4d886008c6dc86122, type: 2}
|
||||
metroInputSource: 0
|
||||
wsaTransparentSwapchain: 0
|
||||
m_HolographicPauseOnTrackingLoss: 1
|
||||
|
|
Loading…
Reference in New Issue