5 namespace HKI.Core.Misc
17 [SerializeField] KeyCode CaptureKey = KeyCode.F8;
18 [SerializeField]
string ScreenShotsPath =
"Screenshots";
19 [SerializeField]
string Name =
"Screen";
22 [SerializeField] KeyCode CaptureKeyForHudFree = KeyCode.F9;
32 if (Input.GetKeyDown(CaptureKey))
33 StartCoroutine(CaptureScreenshoot(
false));
35 if (Input.GetKeyDown(CaptureKeyForHudFree))
36 StartCoroutine(CaptureScreenshoot(
true));
44 if (HudFreeScreenShotHideObjects != null && withoutHUD)
46 oldStatus =
new bool[HudFreeScreenShotHideObjects.Length];
48 for (
int i = 0; i < oldStatus.Length; i++)
50 oldStatus[i] = HudFreeScreenShotHideObjects[i].activeSelf;
51 HudFreeScreenShotHideObjects[i].SetActive(
false);
58 if (!Directory.Exists(ScreenShotsPath))
59 Directory.CreateDirectory(ScreenShotsPath);
61 ScreenCapture.CaptureScreenshot(ScreenShotsPath +
"/" + Name +
"_" + count.ToString() +
".png");
64 if (HudFreeScreenShotHideObjects != null && withoutHUD)
66 for (
int i = 0; i < oldStatus.Length; i++)
67 HudFreeScreenShotHideObjects[i].SetActive(oldStatus[i]);
IEnumerator CaptureScreenshoot(bool withoutHUD)
GameObject [] HudFreeScreenShotHideObjects
This MonoBehaviour creates screenshots by pressing a key. Currently this script only works inside the...