HUGE CHANGES !!!!Add Assembly definitions for code!!!!
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Configuration",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:56dd35f9b6f21364494ed8365264cbf6"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80de51a1f88203a4cb129a5922de311f
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using uWindowCapture;
|
||||
|
||||
public class UwcConfigurator : MonoBehaviour {
|
||||
private UwcWindowTexture uwcWindowTexture;
|
||||
|
||||
void Start() {
|
||||
uwcWindowTexture = GetComponent<UwcWindowTexture>();
|
||||
UpdateConfigs();
|
||||
}
|
||||
|
||||
void SwitchToDesktopCapture() {
|
||||
uwcWindowTexture.type = WindowTextureType.Desktop;
|
||||
uwcWindowTexture.desktopIndex = JsonConfiguration.GetInt("CaptureDesktopNumber");
|
||||
}
|
||||
public void UpdateConfigs()
|
||||
{
|
||||
if (JsonConfiguration.HasKey("CaptureMode")) {
|
||||
int rawCaptureMode = JsonConfiguration.GetInt("CaptureMode");
|
||||
|
||||
if (rawCaptureMode > 3 || rawCaptureMode < 0) {
|
||||
JsonConfiguration.SetInt("CaptureMode", (int) uwcWindowTexture.captureMode);
|
||||
} else
|
||||
uwcWindowTexture.captureMode = (CaptureMode) JsonConfiguration.GetInt("CaptureMode");
|
||||
} else
|
||||
JsonConfiguration.SetInt("CaptureMode", (int) uwcWindowTexture.captureMode);
|
||||
|
||||
if (JsonConfiguration.HasKey("CaptureFramerate"))
|
||||
uwcWindowTexture.captureFrameRate = JsonConfiguration.GetInt("CaptureFramerate");
|
||||
else
|
||||
JsonConfiguration.SetInt("CaptureFramerate", uwcWindowTexture.captureFrameRate);
|
||||
|
||||
if (!JsonConfiguration.HasKey("CaptureDesktopNumber"))
|
||||
JsonConfiguration.SetInt("CaptureDesktopNumber", 0);
|
||||
|
||||
if (JsonConfiguration.HasKey("CaptureDesktop") && JsonConfiguration.GetBoolean("CaptureDesktop"))
|
||||
SwitchToDesktopCapture();
|
||||
else
|
||||
JsonConfiguration.SetBoolean("CaptureDesktop", false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ca064e37a912ac49a2b617a99d67189
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user