1
2
Assets/AVProLiveCamera.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 236351d716bcbf24aae1016b3cbebe81
|
||||
2
Assets/AVProLiveCamera/Demos.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 14bbad8fb9df5b640878a1899629e4d8
|
||||
@ -0,0 +1,631 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Demos
|
||||
{
|
||||
public class AVProLiveCameraCameraExplorerDemo : MonoBehaviour
|
||||
{
|
||||
internal class UIData
|
||||
{
|
||||
public Vector2 scrollPos;
|
||||
public Vector2 scrollVideoInputPos;
|
||||
public bool showSettings;
|
||||
public bool showModes;
|
||||
public bool showFrameRates;
|
||||
public Material material;
|
||||
}
|
||||
|
||||
public GUISkin _guiSkin;
|
||||
public bool _updateDeviceSettings = false;
|
||||
private List<UIData> _instances = new List<UIData>(16);
|
||||
private Vector2 _horizScrollPos = Vector2.zero;
|
||||
|
||||
private GUIStyle _buttonStyle;
|
||||
|
||||
private Texture _zoomedTexture = null;
|
||||
private AVProLiveCameraDevice _zoomedDevice = null;
|
||||
private const float ZoomTime = 0.25f;
|
||||
private float _zoomTimer;
|
||||
private bool _zoomUp;
|
||||
private Rect _zoomSrcDest;
|
||||
private Material _zoomedMaterial;
|
||||
|
||||
private static int _propApplyGamma;
|
||||
private static Shader _shaderGammaConversion;
|
||||
private static Shader _shaderGammaConversionTransparent;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (_propApplyGamma == 0)
|
||||
{
|
||||
_propApplyGamma = Shader.PropertyToID("_ApplyGamma");
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Application.runInBackground = true;
|
||||
|
||||
if (_shaderGammaConversion == null)
|
||||
{
|
||||
_shaderGammaConversion = Shader.Find("Hidden/AVProLiveCamera/IMGUI");
|
||||
}
|
||||
if (_shaderGammaConversionTransparent == null)
|
||||
{
|
||||
_shaderGammaConversionTransparent = Shader.Find("Hidden/AVProLiveCamera/IMGUI Transparent");
|
||||
}
|
||||
|
||||
EnumerateDevices(true);
|
||||
|
||||
int numDevices = AVProLiveCameraManager.Instance.NumDevices;
|
||||
for (int i = 0; i < numDevices; i++)
|
||||
{
|
||||
AVProLiveCameraDevice device = AVProLiveCameraManager.Instance.GetDevice(i);
|
||||
|
||||
// Optionally update various camera internals, depending on which features are required
|
||||
device.UpdateHotSwap = AVProLiveCameraManager.Instance._supportHotSwapping;
|
||||
device.UpdateFrameRates = true;
|
||||
device.UpdateSettings = _updateDeviceSettings;
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
for (int i = 0; i < _instances.Count; i++)
|
||||
{
|
||||
UIData uidata = _instances[i];
|
||||
if (uidata.material != null)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
Material.DestroyImmediate(uidata.material);
|
||||
#else
|
||||
Material.Destroy(uidata.material);
|
||||
#endif
|
||||
uidata.material = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void EnumerateDevices(bool logDevices)
|
||||
{
|
||||
// Enumerate all cameras
|
||||
int numDevices = AVProLiveCameraManager.Instance.NumDevices;
|
||||
if (logDevices)
|
||||
{
|
||||
print("num devices: " + numDevices);
|
||||
}
|
||||
for (int i = 0; i < numDevices; i++)
|
||||
{
|
||||
AVProLiveCameraDevice device = AVProLiveCameraManager.Instance.GetDevice(i);
|
||||
|
||||
if (logDevices)
|
||||
{
|
||||
// Enumerate video inputs (only for devices with multiple analog input sources, eg TV cards)
|
||||
print("device " + i + ": " + device.Name + " (" + device.GUID + ") has " + device.NumVideoInputs + " videoInputs");
|
||||
for (int j = 0; j < device.NumVideoInputs; j++)
|
||||
{
|
||||
print(" videoInput " + j + ": " + device.GetVideoInputName(j));
|
||||
}
|
||||
|
||||
// Enumerate camera modes
|
||||
print("device " + i + ": " + device.Name + " (" + device.GUID + ") has " + device.NumModes + " modes");
|
||||
for (int j = 0; j < device.NumModes; j++)
|
||||
{
|
||||
AVProLiveCameraDeviceMode mode = device.GetMode(j);
|
||||
print(" mode " + j + ": " + mode.Width + "x" + mode.Height + " @" + mode.FPS.ToString("F2") + "fps [" + mode.Format + "]");
|
||||
}
|
||||
|
||||
// Enumerate camera settings
|
||||
print("device " + i + ": " + device.Name + " (" + device.GUID + ") has " + device.NumSettings + " video settings");
|
||||
for (int j = 0; j < device.NumSettings; j++)
|
||||
{
|
||||
AVProLiveCameraSettingBase settingBase = device.GetVideoSettingByIndex(j);
|
||||
switch (settingBase.DataTypeValue)
|
||||
{
|
||||
case AVProLiveCameraSettingBase.DataType.Boolean:
|
||||
{
|
||||
AVProLiveCameraSettingBoolean settingBool = (AVProLiveCameraSettingBoolean)settingBase;
|
||||
print(string.Format(" setting {0}: {1}({2}) value:{3} default:{4} canAuto:{5} isAuto:{6}", j, settingBase.Name, settingBase.PropertyIndex, settingBool.CurrentValue, settingBool.DefaultValue, settingBase.CanAutomatic, settingBase.IsAutomatic));
|
||||
}
|
||||
break;
|
||||
case AVProLiveCameraSettingBase.DataType.Float:
|
||||
{
|
||||
AVProLiveCameraSettingFloat settingFloat = (AVProLiveCameraSettingFloat)settingBase;
|
||||
print(string.Format(" setting {0}: {1}({2}) value:{3} default:{4} range:{5}-{6} canAuto:{7} isAuto:{8}", j, settingBase.Name, settingBase.PropertyIndex, settingFloat.CurrentValue, settingFloat.DefaultValue, settingFloat.MinValue, settingFloat.MaxValue, settingBase.CanAutomatic, settingBase.IsAutomatic));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_instances.Add(new UIData()
|
||||
{
|
||||
scrollPos = Vector2.zero,
|
||||
scrollVideoInputPos = Vector2.zero,
|
||||
showSettings = false,
|
||||
showModes = false,
|
||||
showFrameRates = false,
|
||||
material = null
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateCameras()
|
||||
{
|
||||
{
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
GL.IssuePluginEvent(AVProLiveCameraPlugin.GetRenderEventFunc(), AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateAllTextures);
|
||||
#else
|
||||
GL.IssuePluginEvent(AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateAllTextures);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Update all cameras
|
||||
int numDevices = AVProLiveCameraManager.Instance.NumDevices;
|
||||
for (int i = 0; i < numDevices; i++)
|
||||
{
|
||||
AVProLiveCameraDevice device = AVProLiveCameraManager.Instance.GetDevice(i);
|
||||
|
||||
// Update the actual image
|
||||
device.Update(false);
|
||||
device.Render();
|
||||
}
|
||||
}
|
||||
|
||||
private static Shader GetRequiredShader(AVProLiveCameraDevice device)
|
||||
{
|
||||
Shader result = null;
|
||||
|
||||
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
||||
{
|
||||
if (device != null && device.SupportsTransparency)
|
||||
{
|
||||
result = _shaderGammaConversionTransparent;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = _shaderGammaConversion;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static Material UpdateMaterial(AVProLiveCameraDevice device, Material material)
|
||||
{
|
||||
// Get required shader
|
||||
Shader currentShader = null;
|
||||
if (material != null)
|
||||
{
|
||||
currentShader = material.shader;
|
||||
}
|
||||
Shader nextShader = GetRequiredShader(device);
|
||||
|
||||
// If the shader requirement has changed
|
||||
if (currentShader != nextShader)
|
||||
{
|
||||
// Destroy existing material
|
||||
if (material != null)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
Material.DestroyImmediate(material);
|
||||
#else
|
||||
Material.Destroy(material);
|
||||
#endif
|
||||
material = null;
|
||||
}
|
||||
|
||||
// Create new material
|
||||
if (nextShader != null)
|
||||
{
|
||||
material = new Material(nextShader);
|
||||
if (material.HasProperty(_propApplyGamma))
|
||||
{
|
||||
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
||||
{
|
||||
material.EnableKeyword("APPLY_GAMMA");
|
||||
}
|
||||
else
|
||||
{
|
||||
material.DisableKeyword("APPLY_GAMMA");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return material;
|
||||
}
|
||||
|
||||
private void UpdateMaterials()
|
||||
{
|
||||
for (int i = 0; i < _instances.Count; i++)
|
||||
{
|
||||
AVProLiveCameraDevice device = AVProLiveCameraManager.Instance.GetDevice(i);
|
||||
UIData uidata = _instances[i];
|
||||
uidata.material = UpdateMaterial(device, uidata.material);
|
||||
}
|
||||
}
|
||||
|
||||
private int _lastFrameCount;
|
||||
void OnRenderObject()
|
||||
{
|
||||
if (_lastFrameCount != Time.frameCount)
|
||||
{
|
||||
_lastFrameCount = Time.frameCount;
|
||||
|
||||
UpdateCameras();
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
UpdateMaterials();
|
||||
|
||||
// Handle mouse click to unzoom
|
||||
if (_zoomedTexture != null)
|
||||
{
|
||||
if (_zoomUp)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0) &&
|
||||
_zoomTimer > 0.1f) // Add a threshold here so the OnGUI mouse event doesn't conflict with this one
|
||||
{
|
||||
_zoomUp = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_zoomTimer = Mathf.Min(ZoomTime, _zoomTimer + Time.deltaTime);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_zoomTimer <= 0.0f)
|
||||
{
|
||||
_zoomedTexture = null;
|
||||
_zoomedDevice = null;
|
||||
}
|
||||
_zoomTimer = Mathf.Max(0f, _zoomTimer - Time.deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void NewDeviceAdded()
|
||||
{
|
||||
EnumerateDevices(false);
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (_guiSkin != null)
|
||||
{
|
||||
if (_buttonStyle == null)
|
||||
{
|
||||
_buttonStyle = _guiSkin.FindStyle("LeftButton");
|
||||
}
|
||||
GUI.skin = _guiSkin;
|
||||
}
|
||||
if (_buttonStyle == null)
|
||||
{
|
||||
_buttonStyle = GUI.skin.button;
|
||||
}
|
||||
|
||||
_horizScrollPos = GUILayout.BeginScrollView(_horizScrollPos, false, false);
|
||||
GUILayout.BeginHorizontal();
|
||||
for (int i = 0; i < AVProLiveCameraManager.Instance.NumDevices; i++)
|
||||
{
|
||||
GUILayout.BeginVertical("box", GUILayout.MaxWidth(300));
|
||||
|
||||
AVProLiveCameraDevice device = AVProLiveCameraManager.Instance.GetDevice(i);
|
||||
UIData uiData = _instances[i];
|
||||
|
||||
GUI.enabled = device.IsConnected;
|
||||
|
||||
Rect cameraRect = GUILayoutUtility.GetRect(300, 168);
|
||||
if (GUI.Button(cameraRect, ""))
|
||||
{
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
_zoomedTexture = device.OutputTexture;
|
||||
_zoomedDevice = device;
|
||||
_zoomSrcDest = cameraRect;
|
||||
_zoomedMaterial = uiData.material;
|
||||
_zoomUp = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Thumbnail image
|
||||
if (device.OutputTexture != null && _zoomedTexture != device.OutputTexture)
|
||||
{
|
||||
if (uiData.material != null)
|
||||
{
|
||||
DrawTexture(cameraRect, device.OutputTexture, ScaleMode.ScaleToFit, uiData.material);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.DrawTexture(cameraRect, device.OutputTexture, ScaleMode.ScaleToFit, device.SupportsTransparency);
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.Box("Camera " + i + ": " + device.Name);
|
||||
if (!device.IsRunning)
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.color = Color.green;
|
||||
if (GUILayout.Button("Start"))
|
||||
{
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
device.Start(-1);
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Box(string.Format("{0}x{1} {2}", device.CurrentWidth, device.CurrentHeight, device.CurrentFormat));
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Box(string.Format("Capture {0}hz Display {1}hz", device.CaptureFPS.ToString("F2"), device.DisplayFPS.ToString("F2")));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.color = Color.red;
|
||||
if (GUILayout.Button("Stop"))
|
||||
{
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
device.Close();
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
GUI.enabled = device.CanShowConfigWindow();
|
||||
if (GUILayout.Button("Configure", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
device.ShowConfigWindow();
|
||||
}
|
||||
}
|
||||
GUI.enabled = true;
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
if (device.NumVideoInputs > 0)
|
||||
{
|
||||
GUILayout.Label("Select a video input:");
|
||||
uiData.scrollVideoInputPos = GUILayout.BeginScrollView(uiData.scrollVideoInputPos, false, false);
|
||||
for (int j = 0; j < device.NumVideoInputs; j++)
|
||||
{
|
||||
if (GUILayout.Button(device.GetVideoInputName(j)))
|
||||
{
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
// Start selected device
|
||||
device.Close();
|
||||
device.Start(-1, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
GUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
if (device.Deinterlace != GUILayout.Toggle(device.Deinterlace, "Deinterlace", GUILayout.ExpandWidth(true)))
|
||||
{
|
||||
device.Deinterlace = !device.Deinterlace;
|
||||
if (device.IsRunning)
|
||||
{
|
||||
device.Close();
|
||||
device.Start(-1, -1);
|
||||
}
|
||||
}
|
||||
device.AllowTransparency = GUILayout.Toggle(device.AllowTransparency, "Transparent", GUILayout.ExpandWidth(true));
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
device.FlipX = GUILayout.Toggle(device.FlipX, "Flip X", GUILayout.ExpandWidth(true));
|
||||
device.FlipY = GUILayout.Toggle(device.FlipY, "Flip Y", GUILayout.ExpandWidth(true));
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
uiData.scrollPos = GUILayout.BeginScrollView(uiData.scrollPos, false, false);
|
||||
|
||||
if (device.NumSettings > 0)
|
||||
{
|
||||
GUI.color = Color.cyan;
|
||||
uiData.showSettings = GUILayout.Toggle(uiData.showSettings, "Settings ▶", GUILayout.ExpandWidth(true));
|
||||
GUI.color = Color.white;
|
||||
if (uiData.showSettings)
|
||||
{
|
||||
device.UpdateSettings = GUILayout.Toggle(device.UpdateSettings, "Update Settings", GUILayout.ExpandWidth(true));
|
||||
|
||||
for (int j = 0; j < device.NumSettings; j++)
|
||||
{
|
||||
AVProLiveCameraSettingBase settingBase = device.GetVideoSettingByIndex(j);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.enabled = !settingBase.IsAutomatic;
|
||||
if (GUILayout.Button("D", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
settingBase.SetDefault();
|
||||
}
|
||||
GUI.enabled = true;
|
||||
GUILayout.Label(settingBase.Name, GUILayout.ExpandWidth(false));
|
||||
GUI.enabled = !settingBase.IsAutomatic;
|
||||
switch (settingBase.DataTypeValue)
|
||||
{
|
||||
case AVProLiveCameraSettingBase.DataType.Boolean:
|
||||
AVProLiveCameraSettingBoolean settingBool = (AVProLiveCameraSettingBoolean)settingBase;
|
||||
settingBool.CurrentValue = GUILayout.Toggle(settingBool.CurrentValue, "", GUILayout.ExpandWidth(true));
|
||||
break;
|
||||
case AVProLiveCameraSettingBase.DataType.Float:
|
||||
AVProLiveCameraSettingFloat settingFloat = (AVProLiveCameraSettingFloat)settingBase;
|
||||
settingFloat.CurrentValue = GUILayout.HorizontalSlider(settingFloat.CurrentValue, settingFloat.MinValue, settingFloat.MaxValue, GUILayout.ExpandWidth(true));
|
||||
|
||||
GUI.enabled = settingBase.CanAutomatic;
|
||||
settingBase.IsAutomatic = GUILayout.Toggle(settingBase.IsAutomatic, "", GUILayout.Width(32.0f));
|
||||
GUI.enabled = true;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
GUI.enabled = true;
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Defaults"))
|
||||
{
|
||||
for (int j = 0; j < device.NumSettings; j++)
|
||||
{
|
||||
AVProLiveCameraSettingBase settingBase = device.GetVideoSettingByIndex(j);
|
||||
settingBase.SetDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUI.color = Color.cyan;
|
||||
uiData.showModes = GUILayout.Toggle(uiData.showModes, "Modes ▶", GUILayout.ExpandWidth(true));
|
||||
GUI.color = Color.white;
|
||||
if (uiData.showModes)
|
||||
{
|
||||
for (int j = 0; j < device.NumModes; j++)
|
||||
{
|
||||
AVProLiveCameraDeviceMode mode = device.GetMode(j);
|
||||
bool isSelected = (device.CurrentMode == mode);
|
||||
if (isSelected)
|
||||
{
|
||||
GUI.color = Color.green;
|
||||
}
|
||||
if (GUILayout.Button("" + mode.Width + "x" + mode.Height + " [" + mode.Format + "]", _buttonStyle))
|
||||
{
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
// Start selected device
|
||||
device.Close();
|
||||
Debug.Log("Selecting mode: " + j);
|
||||
device.Start(mode);
|
||||
}
|
||||
}
|
||||
if (isSelected)
|
||||
{
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (device.IsRunning && device.CurrentMode != null)
|
||||
{
|
||||
GUI.color = Color.cyan;
|
||||
uiData.showFrameRates = GUILayout.Toggle(uiData.showFrameRates, "Frame Rates ▶", GUILayout.ExpandWidth(true));
|
||||
GUI.color = Color.white;
|
||||
if (uiData.showFrameRates)
|
||||
{
|
||||
for (int j = 0; j < device.CurrentMode.FrameRates.Length; j++)
|
||||
{
|
||||
bool isSelected = (device.CurrentMode.FrameRateIndex == j);
|
||||
if (isSelected)
|
||||
{
|
||||
GUI.color = Color.green;
|
||||
}
|
||||
if (GUILayout.Button(device.CurrentMode.FrameRates[j].ToString("F2") + "hz ", _buttonStyle))
|
||||
{
|
||||
device.CurrentMode.FrameRateIndex = j;
|
||||
if (_zoomedTexture == null)
|
||||
{
|
||||
// Start selected device
|
||||
AVProLiveCameraDeviceMode mode = device.CurrentMode;
|
||||
device.Close();
|
||||
Debug.Log("Selecting mode: " + j);
|
||||
device.Start(mode);
|
||||
}
|
||||
}
|
||||
if (isSelected)
|
||||
{
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.EndScrollView();
|
||||
|
||||
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndScrollView();
|
||||
|
||||
// Show zoomed camera image
|
||||
if (_zoomedTexture != null)
|
||||
{
|
||||
Rect fullScreenRect = new Rect(0f, 0f, Screen.width, Screen.height);
|
||||
|
||||
float t = Mathf.Clamp01(_zoomTimer / ZoomTime);
|
||||
t = Mathf.SmoothStep(0f, 1f, t);
|
||||
Rect r = new Rect();
|
||||
r.x = Mathf.Lerp(_zoomSrcDest.x, fullScreenRect.x, t);
|
||||
r.y = Mathf.Lerp(_zoomSrcDest.y, fullScreenRect.y, t);
|
||||
r.width = Mathf.Lerp(_zoomSrcDest.width, fullScreenRect.width, t);
|
||||
r.height = Mathf.Lerp(_zoomSrcDest.height, fullScreenRect.height, t);
|
||||
|
||||
if (_zoomedMaterial != null)
|
||||
{
|
||||
DrawTexture(r, _zoomedTexture, ScaleMode.ScaleToFit, _zoomedMaterial);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.DrawTexture(r, _zoomedTexture, ScaleMode.ScaleToFit, _zoomedDevice.SupportsTransparency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawTexture(Rect screenRect, Texture texture, ScaleMode scaleMode, Material material)
|
||||
{
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
{
|
||||
float textureWidth = texture.width;
|
||||
float textureHeight = texture.height;
|
||||
|
||||
float aspectRatio = (float)textureWidth / (float)textureHeight;
|
||||
Rect sourceRect = new Rect(0f, 0f, 1f, 1f);
|
||||
switch (scaleMode)
|
||||
{
|
||||
case ScaleMode.ScaleAndCrop:
|
||||
{
|
||||
float screenRatio = screenRect.width / screenRect.height;
|
||||
if (screenRatio > aspectRatio)
|
||||
{
|
||||
float adjust = aspectRatio / screenRatio;
|
||||
sourceRect = new Rect(0f, (1f - adjust) * 0.5f, 1f, adjust);
|
||||
}
|
||||
else
|
||||
{
|
||||
float adjust = screenRatio / aspectRatio;
|
||||
sourceRect = new Rect(0.5f - adjust * 0.5f, 0f, adjust, 1f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ScaleMode.ScaleToFit:
|
||||
{
|
||||
float screenRatio = screenRect.width / screenRect.height;
|
||||
if (screenRatio > aspectRatio)
|
||||
{
|
||||
float adjust = aspectRatio / screenRatio;
|
||||
screenRect = new Rect(screenRect.xMin + screenRect.width * (1f - adjust) * 0.5f, screenRect.yMin, adjust * screenRect.width, screenRect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
float adjust = screenRatio / aspectRatio;
|
||||
screenRect = new Rect(screenRect.xMin, screenRect.yMin + screenRect.height * (1f - adjust) * 0.5f, screenRect.width, adjust * screenRect.height);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ScaleMode.StretchToFill:
|
||||
break;
|
||||
}
|
||||
Graphics.DrawTexture(screenRect, texture, sourceRect, 0, 0, 0, 0, GUI.color, material);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 8c2b450a9ff3efa4eaeb0bbce06b7e0a
|
||||
MonoImporter:
|
||||
importerVersion: 1
|
||||
executionOrder: 300
|
||||
662
Assets/AVProLiveCamera/Demos/BackgroundDemo.unity
Normal file
@ -0,0 +1,662 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
SceneSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PVSData:
|
||||
m_PVSObjectsArray: []
|
||||
m_PVSPortalsArray: []
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: .25
|
||||
backfaceThreshold: 100
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: .00999999978
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: .5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 0}
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!127 &3
|
||||
LevelGameManager:
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_LightProbes: {fileID: 0}
|
||||
m_Lightmaps: []
|
||||
m_LightmapsMode: 1
|
||||
m_BakedColorSpace: 0
|
||||
m_UseDualLightmapsInForward: 0
|
||||
m_LightmapEditorSettings:
|
||||
m_Resolution: 50
|
||||
m_LastUsedResolution: 0
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_BounceBoost: 1
|
||||
m_BounceIntensity: 1
|
||||
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
|
||||
m_SkyLightIntensity: 0
|
||||
m_Quality: 0
|
||||
m_Bounces: 1
|
||||
m_FinalGatherRays: 1000
|
||||
m_FinalGatherContrastThreshold: .0500000007
|
||||
m_FinalGatherGradientThreshold: 0
|
||||
m_FinalGatherInterpolationPoints: 15
|
||||
m_AOAmount: 0
|
||||
m_AOMaxDistance: .100000001
|
||||
m_AOContrast: 1
|
||||
m_LODSurfaceMappingDistance: 1
|
||||
m_Padding: 0
|
||||
m_TextureCompression: 0
|
||||
m_LockAtlas: 0
|
||||
--- !u!196 &5
|
||||
NavMeshSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
agentRadius: .5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: .400000006
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
accuratePlacement: 0
|
||||
minRegionArea: 2
|
||||
widthInaccuracy: 16.666666
|
||||
heightInaccuracy: 10
|
||||
tileSizeHint: 0
|
||||
m_NavMesh: {fileID: 0}
|
||||
--- !u!1 &388216232
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 388216233}
|
||||
m_Layer: 0
|
||||
m_Name: Scene
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &388216233
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 388216232}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 467570699}
|
||||
- {fileID: 1070519234}
|
||||
- {fileID: 1272989668}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
--- !u!1 &467570695
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 467570699}
|
||||
- 33: {fileID: 467570698}
|
||||
- 65: {fileID: 467570697}
|
||||
- 23: {fileID: 467570696}
|
||||
- 114: {fileID: 467570700}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &467570696
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 467570695}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!65 &467570697
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 467570695}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &467570698
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 467570695}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &467570699
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 467570695}
|
||||
m_LocalRotation: {x: .0431016572, y: .560662985, z: .485635698, w: .669296145}
|
||||
m_LocalPosition: {x: -19.2999992, y: 0, z: 34.0999985}
|
||||
m_LocalScale: {x: 17.7022991, y: 17.7023048, z: 17.7023067}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 388216233}
|
||||
m_RootOrder: 0
|
||||
--- !u!114 &467570700
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 467570695}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d4bdfefe1f4eb024290dff9bd495c741, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &891186130
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 891186135}
|
||||
- 33: {fileID: 891186134}
|
||||
- 64: {fileID: 891186133}
|
||||
- 23: {fileID: 891186132}
|
||||
- 114: {fileID: 891186131}
|
||||
m_Layer: 0
|
||||
m_Name: BackgroundQuad
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &891186131
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 891186130}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0127c5b720f8b0e41ba028a98f32e5a3, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 1853813574}
|
||||
_mesh: {fileID: 891186132}
|
||||
_texturePropertyName: _MainTex
|
||||
--- !u!23 &891186132
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 891186130}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: c0e82b9b62861fd42b64a9b40658734f, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!64 &891186133
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 891186130}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_SmoothSphereCollisions: 0
|
||||
m_Convex: 0
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &891186134
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 891186130}
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &891186135
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 891186130}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
--- !u!1 &1070519232
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1070519234}
|
||||
- 108: {fileID: 1070519233}
|
||||
m_Layer: 0
|
||||
m_Name: Directional light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &1070519233
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1070519232}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: .5
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 0
|
||||
m_Resolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: .0500000007
|
||||
m_Softness: 4
|
||||
m_SoftnessFade: 1
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_ActuallyLightmapped: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 1
|
||||
m_ShadowSamples: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
m_IndirectIntensity: 1
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
--- !u!4 &1070519234
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1070519232}
|
||||
m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381661, w: .875426114}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 388216233}
|
||||
m_RootOrder: 1
|
||||
--- !u!1 &1272989664
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1272989668}
|
||||
- 33: {fileID: 1272989667}
|
||||
- 65: {fileID: 1272989666}
|
||||
- 23: {fileID: 1272989665}
|
||||
- 114: {fileID: 1272989669}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &1272989665
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1272989664}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!65 &1272989666
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1272989664}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &1272989667
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1272989664}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1272989668
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1272989664}
|
||||
m_LocalRotation: {x: -.277639687, y: .872926652, z: .195401758, w: .350333422}
|
||||
m_LocalPosition: {x: 23, y: 6.4000001, z: 34.0999985}
|
||||
m_LocalScale: {x: 17.7022991, y: 17.7023048, z: 17.7023067}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 388216233}
|
||||
m_RootOrder: 2
|
||||
--- !u!114 &1272989669
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1272989664}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d4bdfefe1f4eb024290dff9bd495c741, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1311781458
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1311781460}
|
||||
- 114: {fileID: 1311781459}
|
||||
m_Layer: 0
|
||||
m_Name: LiveCameraManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1311781459
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1311781458}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: edba0400f2985f145bfd6428f24d2110, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_supportHotSwapping: 0
|
||||
_supportInternalFormatConversion: 1
|
||||
_shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
_shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
_shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
_shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
_shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
_shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
_shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
_shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
_shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada, type: 3}
|
||||
--- !u!4 &1311781460
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1311781458}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
--- !u!1 &1615292674
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1615292676}
|
||||
- 114: {fileID: 1615292675}
|
||||
- 114: {fileID: 1615292677}
|
||||
m_Layer: 0
|
||||
m_Name: Demo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1615292675
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615292674}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ad43af36df273084f8ac3b1fa71ae729, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 1853813574}
|
||||
_liveCameraManager: {fileID: 1311781459}
|
||||
_guiSkin: {fileID: 11400000, guid: eb821627fb1a0c044a6fd7a6dabe3147, type: 2}
|
||||
--- !u!4 &1615292676
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615292674}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
--- !u!114 &1615292677
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1615292674}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 93971dd2c54fc5a46adae88ce8a1c7dd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_title: Background
|
||||
_description: This demo shows how to use a shader to always draw the AVProLiveCamera
|
||||
feed in the background behind all other content. This is useful for augmented
|
||||
reality.
|
||||
--- !u!1 &1853813573
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1853813575}
|
||||
- 114: {fileID: 1853813574}
|
||||
m_Layer: 0
|
||||
m_Name: LiveCamera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1853813574
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1853813573}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1015dbb0b69fdd446b617191771ffcce, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_deviceSelection: 0
|
||||
_desiredDeviceNames:
|
||||
- Logitech HD Pro Webcam C920
|
||||
- Decklink Video Capture
|
||||
- Logitech Webcam Pro 9000
|
||||
_desiredDeviceIndex: 0
|
||||
_modeSelection: 0
|
||||
_desiredAnyResolution: 1
|
||||
_desiredResolutions:
|
||||
- {x: 1920, y: 1080}
|
||||
- {x: 1280, y: 720}
|
||||
- {x: 640, y: 360}
|
||||
- {x: 640, y: 480}
|
||||
_desiredModeIndex: -1
|
||||
_maintainAspectRatio: 0
|
||||
_desiredFrameRate: 0
|
||||
_desiredFormatAny: 1
|
||||
_desiredTransparencyFormat: 0
|
||||
_desiredFormat: 4
|
||||
_videoInputSelection: 0
|
||||
_desiredVideoInputs: 0600000003000000
|
||||
_desiredVideoInputIndex: 0
|
||||
_playOnStart: 0
|
||||
_deinterlace: 0
|
||||
_allowTransparency: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
_updateHotSwap: 0
|
||||
_updateFrameRates: 0
|
||||
_updateSettings: 0
|
||||
--- !u!4 &1853813575
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1853813573}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
--- !u!1 &2100879869
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 2100879874}
|
||||
- 20: {fileID: 2100879873}
|
||||
- 81: {fileID: 2100879870}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &2100879870
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100879869}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &2100879873
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100879869}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: .110294104, g: .110294104, b: .110294104, a: .0196078438}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: .300000012
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_HDR: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: .0219999999
|
||||
--- !u!4 &2100879874
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100879869}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
4
Assets/AVProLiveCamera/Demos/BackgroundDemo.unity.meta
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8959a3c97de238b429512756c923ad53
|
||||
DefaultImporter:
|
||||
userData:
|
||||
201
Assets/AVProLiveCamera/Demos/CameraExplorerDemo.unity
Normal file
@ -0,0 +1,201 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
SceneSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PVSData:
|
||||
m_PVSObjectsArray: []
|
||||
m_PVSPortalsArray: []
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: .25
|
||||
backfaceThreshold: 100
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: .00999999978
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientLight: {r: .197816864, g: .218168095, b: .23880595, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: .5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 0}
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!127 &3
|
||||
LevelGameManager:
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_LightProbes: {fileID: 0}
|
||||
m_Lightmaps: []
|
||||
m_LightmapsMode: 1
|
||||
m_BakedColorSpace: 0
|
||||
m_UseDualLightmapsInForward: 0
|
||||
m_LightmapEditorSettings:
|
||||
m_Resolution: 50
|
||||
m_LastUsedResolution: 0
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_BounceBoost: 1
|
||||
m_BounceIntensity: 1
|
||||
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
|
||||
m_SkyLightIntensity: 0
|
||||
m_Quality: 0
|
||||
m_Bounces: 1
|
||||
m_FinalGatherRays: 1000
|
||||
m_FinalGatherContrastThreshold: .0500000007
|
||||
m_FinalGatherGradientThreshold: 0
|
||||
m_FinalGatherInterpolationPoints: 15
|
||||
m_AOAmount: 0
|
||||
m_AOMaxDistance: .100000001
|
||||
m_AOContrast: 1
|
||||
m_LODSurfaceMappingDistance: 1
|
||||
m_Padding: 0
|
||||
m_TextureCompression: 0
|
||||
m_LockAtlas: 0
|
||||
--- !u!1 &12
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 20}
|
||||
- 20: {fileID: 21}
|
||||
- 81: {fileID: 34}
|
||||
- 114: {fileID: 13}
|
||||
- 114: {fileID: 14}
|
||||
- 114: {fileID: 15}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &13
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8c2b450a9ff3efa4eaeb0bbce06b7e0a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_guiSkin: {fileID: 11400000, guid: eb821627fb1a0c044a6fd7a6dabe3147, type: 2}
|
||||
_updateDeviceSettings: 0
|
||||
--- !u!114 &14
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: edba0400f2985f145bfd6428f24d2110, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_supportHotSwapping: 0
|
||||
_supportInternalFormatConversion: 1
|
||||
_shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
_shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
_shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
_shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
_shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
_shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
_shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
_shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
_shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada, type: 3}
|
||||
--- !u!114 &15
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 93971dd2c54fc5a46adae88ce8a1c7dd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_title: Camera Explorer
|
||||
_description: The demo allows you to explore all of the cameras connected to the
|
||||
system. This demo doesn`t use any of the drag `n drop components (except the
|
||||
required AVProLiveCameraManager component) and demonstrates how easily the a
|
||||
demo can be written using a few lines of scripting. The demo is created by a
|
||||
single 120 line script file, most of which is GUI related. The demo also supports
|
||||
hot-swapping, allowing detection of device removal or connection.
|
||||
--- !u!4 &20
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -5.12457037, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!20 &21
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: .141791046, g: .141791046, b: .141791046, a: .0196078438}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: .300000012
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 100
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_HDR: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: .0219999999
|
||||
--- !u!81 &34
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
--- !u!196 &48
|
||||
NavMeshSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
agentRadius: .5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: .400000006
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
accuratePlacement: 0
|
||||
minRegionArea: 2
|
||||
widthInaccuracy: 16.666666
|
||||
heightInaccuracy: 10
|
||||
tileSizeHint: 0
|
||||
m_NavMesh: {fileID: 0}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 73ac7f3f82bc7a046b28b1ff30066b81
|
||||
243
Assets/AVProLiveCamera/Demos/CameraGrabDemo.unity
Normal file
@ -0,0 +1,243 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
SceneSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PVSData:
|
||||
m_PVSObjectsArray: []
|
||||
m_PVSPortalsArray: []
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: .25
|
||||
backfaceThreshold: 100
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: .00999999978
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: .5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 0}
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!127 &3
|
||||
LevelGameManager:
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_LightProbes: {fileID: 0}
|
||||
m_Lightmaps: []
|
||||
m_LightmapsMode: 1
|
||||
m_BakedColorSpace: 0
|
||||
m_UseDualLightmapsInForward: 0
|
||||
m_LightmapEditorSettings:
|
||||
m_Resolution: 50
|
||||
m_LastUsedResolution: 0
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_BounceBoost: 1
|
||||
m_BounceIntensity: 1
|
||||
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
|
||||
m_SkyLightIntensity: 0
|
||||
m_Quality: 0
|
||||
m_Bounces: 1
|
||||
m_FinalGatherRays: 1000
|
||||
m_FinalGatherContrastThreshold: .0500000007
|
||||
m_FinalGatherGradientThreshold: 0
|
||||
m_FinalGatherInterpolationPoints: 15
|
||||
m_AOAmount: 0
|
||||
m_AOMaxDistance: .100000001
|
||||
m_AOContrast: 1
|
||||
m_LODSurfaceMappingDistance: 1
|
||||
m_Padding: 0
|
||||
m_TextureCompression: 0
|
||||
m_LockAtlas: 0
|
||||
--- !u!1 &5
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 6}
|
||||
- 20: {fileID: 7}
|
||||
- 81: {fileID: 8}
|
||||
- 114: {fileID: 13}
|
||||
- 114: {fileID: 11}
|
||||
- 114: {fileID: 15}
|
||||
- 114: {fileID: 12}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!20 &7
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: .089663595, g: .0954245925, b: .104477584, a: .0196078438}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: .300000012
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 100
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_HDR: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: .0219999999
|
||||
--- !u!81 &8
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
--- !u!114 &11
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0a335bb4a52eaa74d869f7e12790b858, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 13}
|
||||
_scaleMode: 2
|
||||
_color: {r: 1, g: 1, b: 1, a: 1}
|
||||
_depth: 0
|
||||
_fullScreen: 1
|
||||
_x: 0
|
||||
_y: 0
|
||||
_width: 1
|
||||
_height: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
--- !u!114 &12
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: edba0400f2985f145bfd6428f24d2110, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_supportHotSwapping: 0
|
||||
_supportInternalFormatConversion: 0
|
||||
_shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
_shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
_shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
_shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
_shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
_shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
_shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
_shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
_shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada, type: 3}
|
||||
--- !u!114 &13
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1015dbb0b69fdd446b617191771ffcce, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_deviceSelection: 0
|
||||
_desiredDeviceNames:
|
||||
- Logitech Webcam Pro 9000
|
||||
- Decklink Video Capture
|
||||
_desiredDeviceIndex: -1
|
||||
_modeSelection: 0
|
||||
_desiredAnyResolution: 1
|
||||
_desiredResolutions:
|
||||
- {x: 1280, y: 720}
|
||||
- {x: 640, y: 480}
|
||||
_desiredModeIndex: -1
|
||||
_maintainAspectRatio: 0
|
||||
_desiredFrameRate: 0
|
||||
_desiredFormatAny: 1
|
||||
_desiredTransparencyFormat: 0
|
||||
_desiredFormat: 4
|
||||
_videoInputSelection: 0
|
||||
_desiredVideoInputs:
|
||||
_desiredVideoInputIndex: 0
|
||||
_playOnStart: 1
|
||||
_deinterlace: 0
|
||||
_allowTransparency: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
_updateHotSwap: 0
|
||||
_updateFrameRates: 0
|
||||
_updateSettings: 0
|
||||
--- !u!196 &14
|
||||
NavMeshSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
agentRadius: .5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: .400000006
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
accuratePlacement: 0
|
||||
minRegionArea: 2
|
||||
widthInaccuracy: 16.666666
|
||||
heightInaccuracy: 10
|
||||
tileSizeHint: 0
|
||||
m_NavMesh: {fileID: 0}
|
||||
--- !u!114 &15
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8fe2a09a366a1ec4cbe1afa8968d5075, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_camera: {fileID: 13}
|
||||
2
Assets/AVProLiveCamera/Demos/CameraGrabDemo.unity.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ad90cf118427b141a4517986b716f0d
|
||||
261
Assets/AVProLiveCamera/Demos/DefaultCameraDemo.unity
Normal file
@ -0,0 +1,261 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
SceneSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PVSData:
|
||||
m_PVSObjectsArray: []
|
||||
m_PVSPortalsArray: []
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: .25
|
||||
backfaceThreshold: 100
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: .00999999978
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: .5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 0}
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!127 &3
|
||||
LevelGameManager:
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_LightProbes: {fileID: 0}
|
||||
m_Lightmaps: []
|
||||
m_LightmapsMode: 1
|
||||
m_BakedColorSpace: 0
|
||||
m_UseDualLightmapsInForward: 0
|
||||
m_LightmapEditorSettings:
|
||||
m_Resolution: 50
|
||||
m_LastUsedResolution: 0
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_BounceBoost: 1
|
||||
m_BounceIntensity: 1
|
||||
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
|
||||
m_SkyLightIntensity: 0
|
||||
m_Quality: 0
|
||||
m_Bounces: 1
|
||||
m_FinalGatherRays: 1000
|
||||
m_FinalGatherContrastThreshold: .0500000007
|
||||
m_FinalGatherGradientThreshold: 0
|
||||
m_FinalGatherInterpolationPoints: 15
|
||||
m_AOAmount: 0
|
||||
m_AOMaxDistance: .100000001
|
||||
m_AOContrast: 1
|
||||
m_LODSurfaceMappingDistance: 1
|
||||
m_Padding: 0
|
||||
m_TextureCompression: 0
|
||||
m_LockAtlas: 0
|
||||
--- !u!1 &5
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 6}
|
||||
- 20: {fileID: 7}
|
||||
- 81: {fileID: 8}
|
||||
- 114: {fileID: 13}
|
||||
- 114: {fileID: 11}
|
||||
- 114: {fileID: 12}
|
||||
- 114: {fileID: 15}
|
||||
- 114: {fileID: 16}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!20 &7
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: .089663595, g: .0954245925, b: .104477584, a: .0196078438}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: .300000012
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 100
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_HDR: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: .0219999999
|
||||
--- !u!81 &8
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
--- !u!114 &11
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0a335bb4a52eaa74d869f7e12790b858, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 13}
|
||||
_scaleMode: 2
|
||||
_color: {r: 1, g: 1, b: 1, a: 1}
|
||||
_depth: 5
|
||||
_fullScreen: 1
|
||||
_x: 0
|
||||
_y: 0
|
||||
_width: 1
|
||||
_height: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
--- !u!114 &12
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: edba0400f2985f145bfd6428f24d2110, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_supportHotSwapping: 0
|
||||
_supportInternalFormatConversion: 1
|
||||
_shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
_shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
_shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
_shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
_shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
_shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
_shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
_shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
_shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada, type: 3}
|
||||
--- !u!114 &13
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1015dbb0b69fdd446b617191771ffcce, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_deviceSelection: 0
|
||||
_desiredDeviceNames:
|
||||
- Logitech Webcam Pro 9000
|
||||
- Decklink Video Capture
|
||||
_desiredDeviceIndex: 0
|
||||
_modeSelection: 0
|
||||
_desiredAnyResolution: 1
|
||||
_desiredResolutions:
|
||||
- {x: 1280, y: 720}
|
||||
- {x: 640, y: 480}
|
||||
_desiredModeIndex: -1
|
||||
_maintainAspectRatio: 0
|
||||
_desiredFrameRate: 0
|
||||
_desiredFormatAny: 1
|
||||
_desiredTransparencyFormat: 0
|
||||
_desiredFormat: 4
|
||||
_videoInputSelection: 0
|
||||
_desiredVideoInputs:
|
||||
_desiredVideoInputIndex: 0
|
||||
_playOnStart: 0
|
||||
_deinterlace: 0
|
||||
_allowTransparency: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
_updateHotSwap: 0
|
||||
_updateFrameRates: 0
|
||||
_updateSettings: 0
|
||||
--- !u!196 &14
|
||||
NavMeshSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
agentRadius: .5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: .400000006
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
accuratePlacement: 0
|
||||
minRegionArea: 2
|
||||
widthInaccuracy: 16.666666
|
||||
heightInaccuracy: 10
|
||||
tileSizeHint: 0
|
||||
m_NavMesh: {fileID: 0}
|
||||
--- !u!114 &15
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 93971dd2c54fc5a46adae88ce8a1c7dd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_title: Default Camera
|
||||
_description: This is the most basic demo as it requires no scripting at all. The
|
||||
demo simply draws the default camera on the system to the screen using the Unity
|
||||
GUI.
|
||||
--- !u!114 &16
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ad43af36df273084f8ac3b1fa71ae729, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 13}
|
||||
_liveCameraManager: {fileID: 12}
|
||||
_guiSkin: {fileID: 11400000, guid: eb821627fb1a0c044a6fd7a6dabe3147, type: 2}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 72eafba68ee153c468671ca31619a900
|
||||
2
Assets/AVProLiveCamera/Demos/GUI.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 3b6604afd73dc004ca8fdf810f5b7d8f
|
||||
1549
Assets/AVProLiveCamera/Demos/GUI/ConfigSkin.guiskin
Normal file
2
Assets/AVProLiveCamera/Demos/GUI/ConfigSkin.guiskin.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: eb821627fb1a0c044a6fd7a6dabe3147
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/Inconsolata.otf
Normal file
13
Assets/AVProLiveCamera/Demos/GUI/Inconsolata.otf.meta
Normal file
@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1102003ee10456942bffb2b369d6a7b8
|
||||
TrueTypeFontImporter:
|
||||
serializedVersion: 2
|
||||
fontSize: 16
|
||||
fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
forceTextureCase: -2
|
||||
renderMode: 0
|
||||
style: 0
|
||||
includeFontData: 1
|
||||
use2xBehaviour: 0
|
||||
fontNames: []
|
||||
customCharacters:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/black.png
Normal file
|
After Width: | Height: | Size: 167 B |
47
Assets/AVProLiveCamera/Demos/GUI/black.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41dc463a61e06694b85593cb70e17848
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/gray.png
Normal file
|
After Width: | Height: | Size: 163 B |
47
Assets/AVProLiveCamera/Demos/GUI/gray.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 89756d2e84d7799499b64043123ddf38
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/gray25.png
Normal file
|
After Width: | Height: | Size: 163 B |
47
Assets/AVProLiveCamera/Demos/GUI/gray25.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fa7bcd58e1876e41952c9349da60879
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/gray50.png
Normal file
|
After Width: | Height: | Size: 163 B |
47
Assets/AVProLiveCamera/Demos/GUI/gray50.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6b9f1741e3bb6241aab55422ae1f133
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/gray80.png
Normal file
|
After Width: | Height: | Size: 163 B |
47
Assets/AVProLiveCamera/Demos/GUI/gray80.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ccce2d09cdddb2d4da068267090c1548
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/spectrum.png
Normal file
|
After Width: | Height: | Size: 234 B |
47
Assets/AVProLiveCamera/Demos/GUI/spectrum.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be0cffc23968d704980274205bc44645
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/transpBlack.png
Normal file
|
After Width: | Height: | Size: 167 B |
47
Assets/AVProLiveCamera/Demos/GUI/transpBlack.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fbbedb31432e4d408b2e3fbd0dbd862
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Demos/GUI/transpWhite.png
Normal file
|
After Width: | Height: | Size: 168 B |
47
Assets/AVProLiveCamera/Demos/GUI/transpWhite.png.meta
Normal file
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8b5fb4ca0fdd2c4eadc7cbe065543a4
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
780
Assets/AVProLiveCamera/Demos/GUIDemo.unity
Normal file
@ -0,0 +1,780 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
SceneSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PVSData:
|
||||
m_PVSObjectsArray: []
|
||||
m_PVSPortalsArray: []
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: .25
|
||||
backfaceThreshold: 100
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: .00999999978
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: .5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 0}
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!127 &3
|
||||
LevelGameManager:
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_LightProbes: {fileID: 0}
|
||||
m_Lightmaps: []
|
||||
m_LightmapsMode: 1
|
||||
m_BakedColorSpace: 0
|
||||
m_UseDualLightmapsInForward: 0
|
||||
m_LightmapEditorSettings:
|
||||
m_Resolution: 50
|
||||
m_LastUsedResolution: 0
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_BounceBoost: 1
|
||||
m_BounceIntensity: 1
|
||||
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
|
||||
m_SkyLightIntensity: 0
|
||||
m_Quality: 0
|
||||
m_Bounces: 1
|
||||
m_FinalGatherRays: 1000
|
||||
m_FinalGatherContrastThreshold: .0500000007
|
||||
m_FinalGatherGradientThreshold: 0
|
||||
m_FinalGatherInterpolationPoints: 15
|
||||
m_AOAmount: 0
|
||||
m_AOMaxDistance: .100000001
|
||||
m_AOContrast: 1
|
||||
m_LODSurfaceMappingDistance: 1
|
||||
m_Padding: 0
|
||||
m_TextureCompression: 0
|
||||
m_LockAtlas: 0
|
||||
--- !u!196 &5
|
||||
NavMeshSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
agentRadius: .5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: .400000006
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
accuratePlacement: 0
|
||||
minRegionArea: 2
|
||||
widthInaccuracy: 16.666666
|
||||
heightInaccuracy: 10
|
||||
tileSizeHint: 0
|
||||
m_NavMesh: {fileID: 0}
|
||||
--- !u!1 &295334171
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 295334173}
|
||||
- 114: {fileID: 295334172}
|
||||
- 114: {fileID: 295334174}
|
||||
m_Layer: 0
|
||||
m_Name: Demo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &295334172
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 295334171}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 93971dd2c54fc5a46adae88ce8a1c7dd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_title: uGUI
|
||||
_description: This demo uses the uGUI component to draw an AVProLiveCamera to the
|
||||
Unity GUI canvas
|
||||
--- !u!4 &295334173
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 295334171}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 90}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
--- !u!114 &295334174
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 295334171}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ad43af36df273084f8ac3b1fa71ae729, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 1853813574}
|
||||
_liveCameraManager: {fileID: 1311781459}
|
||||
_guiSkin: {fileID: 11400000, guid: eb821627fb1a0c044a6fd7a6dabe3147, type: 2}
|
||||
--- !u!1 &492034146
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 492034150}
|
||||
- 114: {fileID: 492034149}
|
||||
- 114: {fileID: 492034148}
|
||||
- 114: {fileID: 492034147}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &492034147
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 492034146}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_AllowActivationOnStandalone: 0
|
||||
--- !u!114 &492034148
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 492034146}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_AllowActivationOnMobileDevice: 0
|
||||
--- !u!114 &492034149
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 492034146}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 5
|
||||
--- !u!4 &492034150
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 492034146}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
--- !u!1 &1052703744
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 1052703747}
|
||||
- 222: {fileID: 1052703746}
|
||||
- 114: {fileID: 1052703745}
|
||||
m_Layer: 0
|
||||
m_Name: AVPro Live Camera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1052703745
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1052703744}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0da62b8b54c37da4a8826e97a78df85f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_liveCamera: {fileID: 1853813574}
|
||||
m_UVRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
_setNativeSize: 0
|
||||
_keepAspectRatio: 1
|
||||
_defaultTexture: {fileID: 0}
|
||||
--- !u!222 &1052703746
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1052703744}
|
||||
--- !u!224 &1052703747
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1052703744}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1936782191}
|
||||
m_RootOrder: 0
|
||||
m_AnchorMin: {x: .5, y: .5}
|
||||
m_AnchorMax: {x: .5, y: .5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 1036, y: 624}
|
||||
m_Pivot: {x: .5, y: .5}
|
||||
--- !u!1 &1260960674
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 1260960675}
|
||||
- 223: {fileID: 1260960678}
|
||||
- 114: {fileID: 1260960677}
|
||||
- 114: {fileID: 1260960676}
|
||||
m_Layer: 5
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1260960675
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1260960674}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 1936782191}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!114 &1260960676
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1260960674}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &1260960677
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1260960674}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
--- !u!223 &1260960678
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1260960674}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_RenderMode: 1
|
||||
m_Camera: {fileID: 2100879873}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 1
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!1 &1311781458
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1311781460}
|
||||
- 114: {fileID: 1311781459}
|
||||
m_Layer: 0
|
||||
m_Name: LiveCameraManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1311781459
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1311781458}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: edba0400f2985f145bfd6428f24d2110, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_supportHotSwapping: 0
|
||||
_supportInternalFormatConversion: 1
|
||||
_shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
_shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
_shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
_shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
_shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
_shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
_shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
_shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
_shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada, type: 3}
|
||||
--- !u!4 &1311781460
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1311781458}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
--- !u!1 &1349168039
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 1349168042}
|
||||
- 222: {fileID: 1349168041}
|
||||
- 114: {fileID: 1349168040}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1349168040
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1349168039}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1}
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 14
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 10
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: Button
|
||||
--- !u!222 &1349168041
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1349168039}
|
||||
--- !u!224 &1349168042
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1349168039}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1627917853}
|
||||
m_RootOrder: 0
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: .5, y: .5}
|
||||
--- !u!1 &1627917852
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 1627917853}
|
||||
- 222: {fileID: 1627917856}
|
||||
- 114: {fileID: 1627917855}
|
||||
- 114: {fileID: 1627917854}
|
||||
m_Layer: 5
|
||||
m_Name: Button
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1627917853
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1627917852}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1349168042}
|
||||
m_Father: {fileID: 1936782191}
|
||||
m_RootOrder: 1
|
||||
m_AnchorMin: {x: .5, y: .5}
|
||||
m_AnchorMax: {x: .5, y: .5}
|
||||
m_AnchoredPosition: {x: 435.5, y: -371}
|
||||
m_SizeDelta: {x: 165, y: 78}
|
||||
m_Pivot: {x: .5, y: .5}
|
||||
--- !u!114 &1627917854
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1627917852}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1}
|
||||
m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1}
|
||||
m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: .100000001
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1627917855}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!114 &1627917855
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1627917852}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!222 &1627917856
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1627917852}
|
||||
--- !u!1 &1853813573
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1853813575}
|
||||
- 114: {fileID: 1853813574}
|
||||
m_Layer: 0
|
||||
m_Name: LiveCamera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1853813574
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1853813573}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1015dbb0b69fdd446b617191771ffcce, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_deviceSelection: 0
|
||||
_desiredDeviceNames:
|
||||
- Logitech HD Pro Webcam C920
|
||||
- Decklink Video Capture
|
||||
- Logitech Webcam Pro 9000
|
||||
_desiredDeviceIndex: -1
|
||||
_modeSelection: 0
|
||||
_desiredAnyResolution: 1
|
||||
_desiredResolutions:
|
||||
- {x: 1920, y: 1080}
|
||||
- {x: 1280, y: 720}
|
||||
- {x: 640, y: 360}
|
||||
- {x: 640, y: 480}
|
||||
_desiredModeIndex: -1
|
||||
_maintainAspectRatio: 0
|
||||
_desiredFrameRate: 0
|
||||
_desiredFormatAny: 1
|
||||
_desiredTransparencyFormat: 0
|
||||
_desiredFormat: 4
|
||||
_videoInputSelection: 0
|
||||
_desiredVideoInputs: 0600000003000000
|
||||
_desiredVideoInputIndex: 0
|
||||
_playOnStart: 0
|
||||
_deinterlace: 0
|
||||
_allowTransparency: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
_updateHotSwap: 0
|
||||
_updateFrameRates: 0
|
||||
_updateSettings: 0
|
||||
--- !u!4 &1853813575
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1853813573}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
--- !u!1 &1936782188
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 224: {fileID: 1936782191}
|
||||
- 222: {fileID: 1936782190}
|
||||
- 114: {fileID: 1936782189}
|
||||
m_Layer: 5
|
||||
m_Name: Panel
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1936782189
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1936782188}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: .204584777, g: .349140972, b: .632352948, a: .392156869}
|
||||
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!222 &1936782190
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1936782188}
|
||||
--- !u!224 &1936782191
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1936782188}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1052703747}
|
||||
- {fileID: 1627917853}
|
||||
m_Father: {fileID: 1260960675}
|
||||
m_RootOrder: 0
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -33, y: 15}
|
||||
m_SizeDelta: {x: -771, y: -206}
|
||||
m_Pivot: {x: .5, y: .5}
|
||||
--- !u!1 &2100879869
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 2100879874}
|
||||
- 20: {fileID: 2100879873}
|
||||
- 81: {fileID: 2100879870}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &2100879870
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100879869}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &2100879873
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100879869}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: .110294104, g: .110294104, b: .110294104, a: .0196078438}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: .300000012
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_HDR: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: .0219999999
|
||||
--- !u!4 &2100879874
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 2100879869}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
4
Assets/AVProLiveCamera/Demos/GUIDemo.unity.meta
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53ab13897a3dfd44ea5420ed9e0956c0
|
||||
DefaultImporter:
|
||||
userData:
|
||||
2
Assets/AVProLiveCamera/Demos/MaterialMappingDemo.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 96c680413dbb26841956448d7fde3c21
|
||||
609
Assets/AVProLiveCamera/Demos/MaterialMappingDemo.unity
Normal file
@ -0,0 +1,609 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
SceneSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PVSData:
|
||||
m_PVSObjectsArray: []
|
||||
m_PVSPortalsArray: []
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: .25
|
||||
backfaceThreshold: 100
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: .00999999978
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientLight: {r: .197816864, g: .218168095, b: .23880595, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: .5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 0}
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!127 &3
|
||||
LevelGameManager:
|
||||
m_ObjectHideFlags: 0
|
||||
--- !u!157 &4
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_LightProbes: {fileID: 0}
|
||||
m_Lightmaps: []
|
||||
m_LightmapsMode: 1
|
||||
m_BakedColorSpace: 0
|
||||
m_UseDualLightmapsInForward: 0
|
||||
m_LightmapEditorSettings:
|
||||
m_Resolution: 50
|
||||
m_LastUsedResolution: 0
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_BounceBoost: 1
|
||||
m_BounceIntensity: 1
|
||||
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
|
||||
m_SkyLightIntensity: 0
|
||||
m_Quality: 0
|
||||
m_Bounces: 1
|
||||
m_FinalGatherRays: 1000
|
||||
m_FinalGatherContrastThreshold: .0500000007
|
||||
m_FinalGatherGradientThreshold: 0
|
||||
m_FinalGatherInterpolationPoints: 15
|
||||
m_AOAmount: 0
|
||||
m_AOMaxDistance: .100000001
|
||||
m_AOContrast: 1
|
||||
m_LODSurfaceMappingDistance: 1
|
||||
m_Padding: 0
|
||||
m_TextureCompression: 0
|
||||
m_LockAtlas: 0
|
||||
--- !u!1 &5
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 13}
|
||||
- 108: {fileID: 36}
|
||||
m_Layer: 0
|
||||
m_Name: Directional light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &7
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 15}
|
||||
- 33: {fileID: 27}
|
||||
- 23: {fileID: 23}
|
||||
m_Layer: 0
|
||||
m_Name: MovingSphere
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &9
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 17}
|
||||
- 33: {fileID: 28}
|
||||
- 23: {fileID: 24}
|
||||
m_Layer: 0
|
||||
m_Name: GroundPlane
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &10
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 18}
|
||||
m_Layer: 0
|
||||
m_Name: Scene
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &11
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 19}
|
||||
- 33: {fileID: 29}
|
||||
- 23: {fileID: 25}
|
||||
m_Layer: 0
|
||||
m_Name: Cube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &12
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 20}
|
||||
- 20: {fileID: 21}
|
||||
- 81: {fileID: 34}
|
||||
- 114: {fileID: 47}
|
||||
- 114: {fileID: 45}
|
||||
- 114: {fileID: 44}
|
||||
- 114: {fileID: 43}
|
||||
- 114: {fileID: 46}
|
||||
- 114: {fileID: 49}
|
||||
- 114: {fileID: 50}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &13
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_LocalRotation: {x: .312182873, y: -.252416253, z: .643252194, w: .651962042}
|
||||
m_LocalPosition: {x: -.039727211, y: -1.38006473, z: -3.30654716}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 18}
|
||||
m_RootOrder: 2
|
||||
--- !u!4 &15
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 7}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -11.6859341, y: -1.15999997, z: -1.63695955}
|
||||
m_LocalScale: {x: 2, y: 2, z: 2}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 18}
|
||||
m_RootOrder: 4
|
||||
--- !u!4 &17
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 9}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -5.0832119, y: -7.68132067, z: 7.11912489}
|
||||
m_LocalScale: {x: 91.2526932, y: 3.77962542, z: 23.1667786}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 18}
|
||||
m_RootOrder: 3
|
||||
--- !u!4 &18
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 10}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 19}
|
||||
- {fileID: 1149800889}
|
||||
- {fileID: 13}
|
||||
- {fileID: 17}
|
||||
- {fileID: 15}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
--- !u!4 &19
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 11}
|
||||
m_LocalRotation: {x: -.405039281, y: .0907986313, z: -.0404641367, w: -.90887922}
|
||||
m_LocalPosition: {x: 1.95000005, y: -6.48000002, z: -1.29999995}
|
||||
m_LocalScale: {x: 4.72751474, y: 4.72751427, z: 4.72751427}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 18}
|
||||
m_RootOrder: 0
|
||||
--- !u!4 &20
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -5.12457037, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
--- !u!20 &21
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: .692247748, g: .750983894, b: .843283594, a: .0196078438}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: .300000012
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 100
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_HDR: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: .0219999999
|
||||
--- !u!23 &23
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 7}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 5fc1a71e55ce15e4d97e8e5778771e99, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!23 &24
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 9}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 910a2dff7334ff4478c38439fd536ff1, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!23 &25
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 11}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 5fc1a71e55ce15e4d97e8e5778771e99, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &27
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 7}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &28
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 9}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &29
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 11}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!81 &34
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
--- !u!108 &36
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 5}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: .430000007
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_Strength: .344000012
|
||||
m_Bias: .0500000007
|
||||
m_Softness: 4
|
||||
m_SoftnessFade: 1
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_ActuallyLightmapped: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 1
|
||||
m_ShadowSamples: 1
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
m_IndirectIntensity: 1
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
--- !u!114 &43
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ab0eec4b8427f0d479209659cc24a999, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_sphere: {fileID: 15}
|
||||
_speed: .300000012
|
||||
--- !u!114 &44
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b3f963f7811140b46977bceaf97cc51f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 47}
|
||||
_material: {fileID: 2100000, guid: 5fc1a71e55ce15e4d97e8e5778771e99, type: 2}
|
||||
_texturePropertyName: _MainTex
|
||||
--- !u!114 &45
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0a335bb4a52eaa74d869f7e12790b858, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 47}
|
||||
_scaleMode: 2
|
||||
_color: {r: 1, g: 1, b: 1, a: 1}
|
||||
_depth: 0
|
||||
_fullScreen: 0
|
||||
_x: 0
|
||||
_y: .875
|
||||
_width: .125
|
||||
_height: .125
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
--- !u!114 &46
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: edba0400f2985f145bfd6428f24d2110, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_supportHotSwapping: 0
|
||||
_supportInternalFormatConversion: 1
|
||||
_shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
_shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
_shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
_shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
_shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
_shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
_shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
_shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
_shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada, type: 3}
|
||||
--- !u!114 &47
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1015dbb0b69fdd446b617191771ffcce, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_deviceSelection: 0
|
||||
_desiredDeviceNames:
|
||||
- Logitech Webcam Pro 9000
|
||||
- Decklink Video Capture
|
||||
_desiredDeviceIndex: 0
|
||||
_modeSelection: 0
|
||||
_desiredAnyResolution: 1
|
||||
_desiredResolutions:
|
||||
- {x: 1280, y: 720}
|
||||
- {x: 640, y: 480}
|
||||
_desiredModeIndex: -1
|
||||
_maintainAspectRatio: 0
|
||||
_desiredFrameRate: 0
|
||||
_desiredFormatAny: 1
|
||||
_desiredTransparencyFormat: 0
|
||||
_desiredFormat: 4
|
||||
_videoInputSelection: 0
|
||||
_desiredVideoInputs:
|
||||
_desiredVideoInputIndex: 0
|
||||
_playOnStart: 0
|
||||
_deinterlace: 0
|
||||
_allowTransparency: 1
|
||||
_flipX: 0
|
||||
_flipY: 0
|
||||
_updateHotSwap: 0
|
||||
_updateFrameRates: 0
|
||||
_updateSettings: 0
|
||||
--- !u!196 &48
|
||||
NavMeshSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
agentRadius: .5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: .400000006
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
accuratePlacement: 0
|
||||
minRegionArea: 2
|
||||
widthInaccuracy: 16.666666
|
||||
heightInaccuracy: 10
|
||||
tileSizeHint: 0
|
||||
m_NavMesh: {fileID: 0}
|
||||
--- !u!114 &49
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 93971dd2c54fc5a46adae88ce8a1c7dd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_title: Material Mapping
|
||||
_description: 'This demo shows how to integrate AVProLiveCamera into your 3D scene. No
|
||||
scripting is required as you can just use either of the 2 included components:
|
||||
AVProLiveCameraMaterialApply, AVProLiveCameraMeshApply.'
|
||||
--- !u!114 &50
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 12}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ad43af36df273084f8ac3b1fa71ae729, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
_liveCamera: {fileID: 47}
|
||||
_liveCameraManager: {fileID: 46}
|
||||
_guiSkin: {fileID: 11400000, guid: eb821627fb1a0c044a6fd7a6dabe3147, type: 2}
|
||||
--- !u!1 &1149800888
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 4
|
||||
m_Component:
|
||||
- 4: {fileID: 1149800889}
|
||||
- 33: {fileID: 1149800893}
|
||||
- 23: {fileID: 1149800891}
|
||||
m_Layer: 0
|
||||
m_Name: Sphere
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1149800889
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1149800888}
|
||||
m_LocalRotation: {x: 0, y: -.257712901, z: 0, w: .966221571}
|
||||
m_LocalPosition: {x: -4.82999992, y: -5.02199984, z: -1.29999995}
|
||||
m_LocalScale: {x: 4.7275157, y: 4.72751379, z: 4.72751427}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 18}
|
||||
m_RootOrder: 1
|
||||
--- !u!23 &1149800891
|
||||
Renderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1149800888}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 0
|
||||
m_LightmapIndex: 255
|
||||
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 5fc1a71e55ce15e4d97e8e5778771e99, type: 2}
|
||||
m_SubsetIndices:
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_UseLightProbes: 0
|
||||
m_LightProbeAnchor: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &1149800893
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1149800888}
|
||||
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: cb94fe34c6daf5648b6897d447486722
|
||||
@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Demos
|
||||
{
|
||||
public class AVProLiveCameraMaterialMappingDemo : MonoBehaviour
|
||||
{
|
||||
public Transform _sphere;
|
||||
private float _t = 0.0f;
|
||||
public float _speed = 1.0f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_sphere != null)
|
||||
{
|
||||
_t += Time.deltaTime * _speed;
|
||||
float t = Mathf.PingPong(_t, 5.0f) / 5.0f;
|
||||
t = Mathf.SmoothStep(0, 1, t);
|
||||
//t = Mathf.SmoothStep(0, 1, t);
|
||||
//t = Mathf.SmoothStep(0, 1, t);
|
||||
float x = Mathf.Lerp(25.33046f, -25.0f, t);
|
||||
_sphere.position = new Vector3(x, _sphere.position.y, _sphere.position.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: ab0eec4b8427f0d479209659cc24a999
|
||||
@ -0,0 +1,87 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: DemoShiny
|
||||
m_Shader: {fileID: 4, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: []
|
||||
m_CustomRenderQueue: -1
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _BumpMap
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 5f2eadb05f184a944ba5c187ca9cbdc8, type: 3}
|
||||
m_Scale: {x: 5, y: 5}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _DecalTex
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _ParallaxMap
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _Cube
|
||||
second:
|
||||
m_Texture: {fileID: 8900000, guid: 078ad85ef67da7a4e89beb4b275b54db, type: 2}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
data:
|
||||
first:
|
||||
name: _Shininess
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _InvFade
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _Parallax
|
||||
second: .0390298516
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _Emission
|
||||
second: {r: 0, g: 0, b: 0, a: 0}
|
||||
data:
|
||||
first:
|
||||
name: _SpecColor
|
||||
second: {r: .711294293, g: .751809001, b: .768656731, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _TintColor
|
||||
second: {r: .5, g: .5, b: .5, a: .5}
|
||||
data:
|
||||
first:
|
||||
name: _ReflectColor
|
||||
second: {r: 1, g: 1, b: 1, a: .5}
|
||||
--- !u!1002 &2100001
|
||||
EditorExtensionImpl:
|
||||
serializedVersion: 6
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 5fc1a71e55ce15e4d97e8e5778771e99
|
||||
@ -0,0 +1,29 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: DemoYellow
|
||||
m_Shader: {fileID: 7, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats: {}
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: .840187848, b: .725490212, a: 1}
|
||||
--- !u!1002 &2100001
|
||||
EditorExtensionImpl:
|
||||
serializedVersion: 6
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 910a2dff7334ff4478c38439fd536ff1
|
||||
BIN
Assets/AVProLiveCamera/Demos/MaterialMappingDemo/fabricbumps.gif
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 5f2eadb05f184a944ba5c187ca9cbdc8
|
||||
TextureImporter:
|
||||
importerVersion: 2
|
||||
maxTextureSize: 1024
|
||||
textureFormat: -1
|
||||
grayscaleToAlpha: 0
|
||||
npotScale: 1
|
||||
generateCubemap: 0
|
||||
isReadable: 0
|
||||
textureType: 1
|
||||
mipmaps:
|
||||
generation: 1
|
||||
correctGamma: 0
|
||||
border: 0
|
||||
filter: 0
|
||||
fadeout: 0
|
||||
fadeoutStart: 1
|
||||
fadeoutEnd: 3
|
||||
bumpmap:
|
||||
generation: 1
|
||||
external: 1
|
||||
bumpyness: 0.1277311
|
||||
filter: 0
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
anisoLevel: -1
|
||||
mipmapBias: -1
|
||||
wrapMode: -1
|
||||
5
Assets/AVProLiveCamera/Demos/Materials.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3388031e2a15e0649981799779b66d68
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
28
Assets/AVProLiveCamera/Demos/Materials/FillBackground.mat
Normal file
@ -0,0 +1,28 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: FillBackground
|
||||
m_Shader: {fileID: 4800000, guid: 14851b8a808c53b49bb32085e4dc0f75, type: 3}
|
||||
m_ShaderKeywords: []
|
||||
m_CustomRenderQueue: -1
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats: {}
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0e82b9b62861fd42b64a9b40658734f
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
5
Assets/AVProLiveCamera/Demos/Scripts.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7173f72e9e0f002439cfdcba33e882f7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
26
Assets/AVProLiveCamera/Demos/Scripts/AutoRotate.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Demos
|
||||
{
|
||||
[RequireComponent(typeof(Transform))]
|
||||
public class AutoRotate : MonoBehaviour
|
||||
{
|
||||
private float x, y, z;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
float s = 32f;
|
||||
x = Random.Range(-s, s);
|
||||
y = Random.Range(-s, s);
|
||||
z = Random.Range(-s, s);
|
||||
}
|
||||
void Update()
|
||||
{
|
||||
this.transform.Rotate(x * Time.deltaTime, y * Time.deltaTime, z * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Assets/AVProLiveCamera/Demos/Scripts/AutoRotate.cs.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d4bdfefe1f4eb024290dff9bd495c741
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
194
Assets/AVProLiveCamera/Demos/Scripts/QuickDeviceMenu.cs
Normal file
@ -0,0 +1,194 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Demos
|
||||
{
|
||||
public class QuickDeviceMenu : MonoBehaviour
|
||||
{
|
||||
public AVProLiveCamera _liveCamera;
|
||||
public AVProLiveCameraManager _liveCameraManager;
|
||||
public GUISkin _guiSkin;
|
||||
private Vector2 _scrollResolutions = Vector2.zero;
|
||||
private bool _isHidden = false;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
ToggleVisible();
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleVisible()
|
||||
{
|
||||
_isHidden = !_isHidden;
|
||||
this.useGUILayout = !_isHidden; // NOTE: this reduces garbage generation to zero
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
if (_isHidden)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GUI.skin = _guiSkin;
|
||||
|
||||
if (_liveCameraManager.NumDevices > 0)
|
||||
{
|
||||
GUILayout.BeginArea(new Rect(0f, 0f, Screen.width, Screen.height));
|
||||
if (GUILayout.Button("Press SPACE to hide/show QuickDeviceMenu (improves performance)", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
ToggleVisible();
|
||||
}
|
||||
GUILayout.EndArea();
|
||||
|
||||
// NOTE: This is just a spacing element to leave space for the above message
|
||||
GUILayout.Label(" ");
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Select device
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Button("SELECT DEVICE");
|
||||
for (int i = 0; i < _liveCameraManager.NumDevices; i++)
|
||||
{
|
||||
string name = _liveCameraManager.GetDevice(i).Name;
|
||||
|
||||
GUI.color = Color.white;
|
||||
if (_liveCamera.Device != null && _liveCamera.Device.IsRunning)
|
||||
{
|
||||
if (_liveCamera.Device.Name == name)
|
||||
{
|
||||
GUI.color = Color.green;
|
||||
}
|
||||
}
|
||||
|
||||
if (GUILayout.Button(name))
|
||||
{
|
||||
_liveCamera._deviceSelection = AVProLiveCamera.SelectDeviceBy.Index;
|
||||
_liveCamera._desiredDeviceIndex = i;
|
||||
_liveCamera.Begin();
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
GUILayout.EndVertical();
|
||||
|
||||
if (_liveCamera.Device != null && _liveCamera.Device.IsRunning)
|
||||
{
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Button("RESOLUTION");
|
||||
_scrollResolutions = GUILayout.BeginScrollView(_scrollResolutions, false, false, GUIStyle.none, GUI.skin.verticalScrollbar);
|
||||
List<string> usedNames = new List<string>(32);
|
||||
for (int i = 0; i < _liveCamera.Device.NumModes; i++)
|
||||
{
|
||||
AVProLiveCameraDeviceMode mode = _liveCamera.Device.GetMode(i);
|
||||
string name = string.Format("{0}x{1}", mode.Width, mode.Height);
|
||||
if (!usedNames.Contains(name))
|
||||
{
|
||||
GUI.color = Color.white;
|
||||
if (_liveCamera.Device.CurrentWidth == mode.Width && _liveCamera.Device.CurrentHeight == mode.Height)
|
||||
{
|
||||
GUI.color = Color.green;
|
||||
}
|
||||
|
||||
usedNames.Add(name);
|
||||
if (GUILayout.Button(name))
|
||||
{
|
||||
_liveCamera._modeSelection = AVProLiveCamera.SelectModeBy.Index;
|
||||
_liveCamera._desiredModeIndex = i;
|
||||
_liveCamera.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
GUILayout.EndScrollView();
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Select frame rate
|
||||
usedNames.Clear();
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Button("FPS");
|
||||
for (int i = 0; i < _liveCamera.Device.NumModes; i++)
|
||||
{
|
||||
string matchName = string.Format("{0}x{1}", _liveCamera.Device.CurrentWidth, _liveCamera.Device.CurrentHeight);
|
||||
|
||||
AVProLiveCameraDeviceMode mode = _liveCamera.Device.GetMode(i);
|
||||
|
||||
string resName = string.Format("{0}x{1}", mode.Width, mode.Height);
|
||||
if (resName == matchName)
|
||||
{
|
||||
foreach (float frameRate in mode.FrameRates)
|
||||
{
|
||||
string name = string.Format("{0}", frameRate.ToString("F2"));
|
||||
if (!usedNames.Contains(name))
|
||||
{
|
||||
GUI.color = Color.white;
|
||||
if (_liveCamera.Device.CurrentFrameRate.ToString("F2") == frameRate.ToString("F2"))
|
||||
{
|
||||
GUI.color = Color.green;
|
||||
}
|
||||
|
||||
usedNames.Add(name);
|
||||
if (GUILayout.Button(name))
|
||||
{
|
||||
_liveCamera._modeSelection = AVProLiveCamera.SelectModeBy.Index;
|
||||
_liveCamera._desiredModeIndex = i;
|
||||
_liveCamera._desiredFrameRate = frameRate;
|
||||
_liveCamera.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Select format
|
||||
usedNames.Clear();
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Button("FORMAT");
|
||||
for (int i = 0; i < _liveCamera.Device.NumModes; i++)
|
||||
{
|
||||
string matchName = string.Format("{0}x{1}", _liveCamera.Device.CurrentWidth, _liveCamera.Device.CurrentHeight);//, _liveCamera.Device.CurrentFrameRate.ToString("F2"));
|
||||
|
||||
AVProLiveCameraDeviceMode mode = _liveCamera.Device.GetMode(i);
|
||||
|
||||
string resName = string.Format("{0}x{1}", mode.Width, mode.Height);//, mode.FPS.ToString("F2"));
|
||||
if (resName == matchName)
|
||||
{
|
||||
string name = string.Format("{0}", mode.Format);
|
||||
if (!usedNames.Contains(name))
|
||||
{
|
||||
GUI.color = Color.white;
|
||||
if (_liveCamera.Device.CurrentDeviceFormat == mode.Format)
|
||||
{
|
||||
GUI.color = Color.green;
|
||||
}
|
||||
|
||||
usedNames.Add(name);
|
||||
if (GUILayout.Button(name))
|
||||
{
|
||||
_liveCamera._modeSelection = AVProLiveCamera.SelectModeBy.Index;
|
||||
_liveCamera._desiredModeIndex = i;
|
||||
_liveCamera.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GUI.color = Color.white;
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Label("No webcam / capture devices found");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad43af36df273084f8ac3b1fa71ae729
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
2
Assets/AVProLiveCamera/Demos/Shared.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b74d90960cdf23c458316e24071c41dd
|
||||
14
Assets/AVProLiveCamera/Demos/Shared/DemoInfo.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Demos
|
||||
{
|
||||
public class DemoInfo : MonoBehaviour
|
||||
{
|
||||
public string _title;
|
||||
public string _description;
|
||||
}
|
||||
}
|
||||
7
Assets/AVProLiveCamera/Demos/Shared/DemoInfo.cs.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93971dd2c54fc5a46adae88ce8a1c7dd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
9
Assets/AVProLiveCamera/Docs.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 00b1f707248166f44af361952d4e0134
|
||||
folderAsset: yes
|
||||
timeCreated: 1530212878
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/AVProLiveCamera/Docs/AVProLiveCamera-UserManual.pdf
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 4eb7bcacdee87bd4cba19dba292c795a
|
||||
2
Assets/AVProLiveCamera/Editor.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: cf69c5cb9dee2344181e287f64b91f28
|
||||
471
Assets/AVProLiveCamera/Editor/AVProLiveCameraEditor.cs
Normal file
@ -0,0 +1,471 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Editor
|
||||
{
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(AVProLiveCamera))]
|
||||
public class AVProLiveCameraEditor : UnityEditor.Editor
|
||||
{
|
||||
private AVProLiveCamera _camera;
|
||||
private SerializedProperty _propDeviceSelection;
|
||||
private SerializedProperty _propDesiredDeviceNames;
|
||||
private SerializedProperty _propDesiredDeviceIndex;
|
||||
private SerializedProperty _propDeinterlace;
|
||||
private SerializedProperty _propPlayOnStart;
|
||||
private SerializedProperty _propClockMode;
|
||||
private SerializedProperty _propPreferPreviewPin;
|
||||
private SerializedProperty _propFlipX;
|
||||
private SerializedProperty _propFlipY;
|
||||
private SerializedProperty _propAllowTransparency;
|
||||
private SerializedProperty _propYCbCrRange;
|
||||
private SerializedProperty _propHotSwap;
|
||||
private SerializedProperty _propFrameRates;
|
||||
private SerializedProperty _propSettings;
|
||||
|
||||
private static bool _preview = true;
|
||||
private static bool _showSettings = false;
|
||||
|
||||
private const string SettingsPrefix = "AVProLiveCamera-LiveCameraEditor-";
|
||||
|
||||
public override bool RequiresConstantRepaint()
|
||||
{
|
||||
return (_camera != null && _camera.isActiveAndEnabled && _camera.Device != null && _preview);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
_camera = (this.target) as AVProLiveCamera;
|
||||
_propDeviceSelection = serializedObject.FindProperty("_deviceSelection");
|
||||
_propDesiredDeviceNames = serializedObject.FindProperty("_desiredDeviceNames");
|
||||
_propDesiredDeviceIndex = serializedObject.FindProperty("_desiredDeviceIndex");
|
||||
_propPlayOnStart = serializedObject.FindProperty("_playOnStart");
|
||||
_propDeinterlace = serializedObject.FindProperty("_deinterlace");
|
||||
_propClockMode = serializedObject.FindProperty("_clockMode");
|
||||
_propPreferPreviewPin = serializedObject.FindProperty("_preferPreviewPin");
|
||||
_propFlipX = serializedObject.FindProperty("_flipX");
|
||||
_propFlipY = serializedObject.FindProperty("_flipY");
|
||||
_propAllowTransparency = serializedObject.FindProperty("_allowTransparency");
|
||||
_propYCbCrRange = serializedObject.FindProperty("_yCbCrRange");
|
||||
_propHotSwap = serializedObject.FindProperty("_updateHotSwap");
|
||||
_propFrameRates = serializedObject.FindProperty("_updateFrameRates");
|
||||
_propSettings = serializedObject.FindProperty("_updateSettings");
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
_camera = null;
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
private static void LoadSettings()
|
||||
{
|
||||
_preview = EditorPrefs.GetBool(SettingsPrefix + "ExpandPreview", true);
|
||||
_showSettings = EditorPrefs.GetBool(SettingsPrefix + "ExpandSettings", false);
|
||||
}
|
||||
|
||||
private static void SaveSettings()
|
||||
{
|
||||
EditorPrefs.SetBool(SettingsPrefix + "ExpandPreview", _preview);
|
||||
EditorPrefs.SetBool(SettingsPrefix + "ExpandSettings", _showSettings);
|
||||
}
|
||||
|
||||
private void DrawLiveControls()
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
if (_camera.Device != null && _camera.Device.IsActive)
|
||||
{
|
||||
GUILayout.BeginVertical(GUI.skin.box);
|
||||
_preview = GUILayout.Toggle(_preview, "Live Preview");
|
||||
|
||||
AVProLiveCameraDevice device = _camera.Device;
|
||||
|
||||
if (_preview && device.OutputTexture != null)
|
||||
{
|
||||
Rect textureRect = GUILayoutUtility.GetRect(64.0f, 64.0f, GUILayout.MinWidth(64.0f), GUILayout.MinHeight(64.0f));
|
||||
GUI.DrawTexture(textureRect, device.OutputTexture, ScaleMode.ScaleToFit, false);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
if (GUILayout.Button("Select Texture", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
Selection.activeObject = device.OutputTexture;
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
GUILayout.Label("Device: " + device.Name);
|
||||
GUILayout.Label(string.Format("Mode: {0}x{1} {2}", device.CurrentWidth, device.CurrentHeight, device.CurrentFormat));
|
||||
|
||||
if (device.FramesTotal > 30)
|
||||
{
|
||||
GUILayout.Label("Displaying at " + device.DisplayFPS.ToString("F1") + " fps");
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.Label("Displaying at ... fps");
|
||||
}
|
||||
|
||||
if (device.IsRunning)
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("Stop Device"))
|
||||
{
|
||||
device.Close();
|
||||
}
|
||||
if (device.IsPaused)
|
||||
{
|
||||
if (GUILayout.Button("Unpause Stream"))
|
||||
{
|
||||
device.Play();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GUILayout.Button("Pause Stream"))
|
||||
{
|
||||
device.Pause();
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GUILayout.Button("Start Device"))
|
||||
{
|
||||
_camera.Begin();
|
||||
}
|
||||
}
|
||||
|
||||
GUI.enabled = device.CanShowConfigWindow();
|
||||
if (GUILayout.Button("Show Config Window"))
|
||||
{
|
||||
device.ShowConfigWindow();
|
||||
}
|
||||
GUI.enabled = true;
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
GUILayout.BeginVertical(GUI.skin.box);
|
||||
_showSettings = GUILayout.Toggle(_showSettings, "Show Device Settings");
|
||||
if (_showSettings && device.NumSettings > 0)
|
||||
{
|
||||
EditorGUILayout.PrefixLabel("Device Settings", EditorStyles.boldLabel);
|
||||
EditorGUI.BeginChangeCheck();
|
||||
for (int j = 0; j < device.NumSettings; j++)
|
||||
{
|
||||
AVProLiveCameraSettingBase settingBase = device.GetVideoSettingByIndex(j);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.enabled = !settingBase.IsAutomatic;
|
||||
if (GUILayout.Button("D", GUILayout.ExpandWidth(false)))
|
||||
{
|
||||
settingBase.SetDefault();
|
||||
}
|
||||
GUI.enabled = true;
|
||||
GUILayout.Label(settingBase.Name, GUILayout.ExpandWidth(false), GUILayout.MaxWidth(96.0f));
|
||||
GUI.enabled = !settingBase.IsAutomatic;
|
||||
switch (settingBase.DataTypeValue)
|
||||
{
|
||||
case AVProLiveCameraSettingBase.DataType.Boolean:
|
||||
AVProLiveCameraSettingBoolean settingBool = (AVProLiveCameraSettingBoolean)settingBase;
|
||||
settingBool.CurrentValue = GUILayout.Toggle(settingBool.CurrentValue, "", GUILayout.ExpandWidth(true));
|
||||
break;
|
||||
case AVProLiveCameraSettingBase.DataType.Float:
|
||||
AVProLiveCameraSettingFloat settingFloat = (AVProLiveCameraSettingFloat)settingBase;
|
||||
float sliderValue = GUILayout.HorizontalSlider(settingFloat.CurrentValue, settingFloat.MinValue, settingFloat.MaxValue, GUILayout.ExpandWidth(true));
|
||||
if (GUI.enabled)
|
||||
settingFloat.CurrentValue = sliderValue;
|
||||
|
||||
GUILayout.Label(((long)settingFloat.CurrentValue).ToString(), GUILayout.Width(32.0f), GUILayout.ExpandWidth(false));
|
||||
GUI.enabled = settingBase.CanAutomatic;
|
||||
settingBase.IsAutomatic = GUILayout.Toggle(settingBase.IsAutomatic, "", GUILayout.Width(32.0f));
|
||||
GUI.enabled = true;
|
||||
break;
|
||||
|
||||
}
|
||||
GUI.enabled = true;
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
if (GUILayout.Button("Defaults"))
|
||||
{
|
||||
for (int j = 0; j < device.NumSettings; j++)
|
||||
{
|
||||
AVProLiveCameraSettingBase settingBase = device.GetVideoSettingByIndex(j);
|
||||
settingBase.SetDefault();
|
||||
}
|
||||
}
|
||||
if (EditorGUI.EndChangeCheck() || (Time.frameCount % 30) == 0)
|
||||
{
|
||||
// This is an expensive function call so we want to limit it
|
||||
device.Update_Settings();
|
||||
}
|
||||
}
|
||||
//EditorGUILayout.Toggle("Running:", device.IsRunning);
|
||||
GUILayout.EndVertical();
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawDeviceSelection()
|
||||
{
|
||||
GUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.PropertyField(_propDeviceSelection, new GUIContent("Device Select By"));
|
||||
|
||||
AVProLiveCamera.SelectDeviceBy newDeviceSelection = _camera._deviceSelection;
|
||||
switch (newDeviceSelection)
|
||||
{
|
||||
case AVProLiveCamera.SelectDeviceBy.Default:
|
||||
break;
|
||||
case AVProLiveCamera.SelectDeviceBy.Name:
|
||||
if (_camera._deviceSelection != newDeviceSelection && _camera._desiredDeviceNames.Count == 0)
|
||||
{
|
||||
_propDesiredDeviceNames.arraySize++;
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
_propDesiredDeviceNames.GetArrayElementAtIndex(0).stringValue = "Enter Device Name";
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
EditorGUILayout.BeginVertical();
|
||||
for (int index = 0; index < _camera._desiredDeviceNames.Count; index++)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
|
||||
/*EditorGUILayout.BeginHorizontal(GUILayout.Width(96));
|
||||
if (index != 0)
|
||||
{
|
||||
if (GUILayout.Button("Up"))
|
||||
{
|
||||
string temp = _camera._desiredDeviceNames[index - 1];
|
||||
_camera._desiredDeviceNames[index - 1] = _camera._desiredDeviceNames[index];
|
||||
_camera._desiredDeviceNames[index] = temp;
|
||||
HandleUtility.Repaint();
|
||||
}
|
||||
}
|
||||
if (index + 1 < _camera._desiredDeviceNames.Count)
|
||||
{
|
||||
if (GUILayout.Button("Down"))
|
||||
{
|
||||
string temp = _camera._desiredDeviceNames[index + 1];
|
||||
_camera._desiredDeviceNames[index + 1] = _camera._desiredDeviceNames[index];
|
||||
_camera._desiredDeviceNames[index] = temp;
|
||||
HandleUtility.Repaint();
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();*/
|
||||
|
||||
if (GUILayout.Button("-"))
|
||||
{
|
||||
_propDesiredDeviceNames.DeleteArrayElementAtIndex(index);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
SerializedProperty propDesiredDeviceName = _propDesiredDeviceNames.GetArrayElementAtIndex(index);
|
||||
EditorGUILayout.PropertyField(propDesiredDeviceName, new GUIContent(""), GUILayout.ExpandWidth(true));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
if (GUILayout.Button("+"))
|
||||
{
|
||||
_propDesiredDeviceNames.arraySize++;
|
||||
this.Repaint();
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
break;
|
||||
case AVProLiveCamera.SelectDeviceBy.Index:
|
||||
{
|
||||
EditorGUILayout.PropertyField(_propDesiredDeviceIndex, new GUIContent(" "));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SerializedProperty propModeSelection = serializedObject.FindProperty("_modeSelection");
|
||||
EditorGUILayout.PropertyField(propModeSelection, new GUIContent("Mode Select By"));
|
||||
|
||||
AVProLiveCamera.SelectModeBy newResolutionSelection = _camera._modeSelection;
|
||||
switch (newResolutionSelection)
|
||||
{
|
||||
case AVProLiveCamera.SelectModeBy.Default:
|
||||
break;
|
||||
case AVProLiveCamera.SelectModeBy.Resolution:
|
||||
if (_camera._modeSelection != newResolutionSelection && _camera._desiredResolutions.Count == 0)
|
||||
{
|
||||
serializedObject.FindProperty("_desiredResolutions").arraySize++;
|
||||
}
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
GUILayout.Label("Resolution", EditorStyles.boldLabel);
|
||||
|
||||
SerializedProperty propDesiredAnyResolution = serializedObject.FindProperty("_desiredAnyResolution");
|
||||
EditorGUILayout.PropertyField(propDesiredAnyResolution, new GUIContent("Automatic Resolution"));
|
||||
if (!propDesiredAnyResolution.boolValue)
|
||||
{
|
||||
for (int index = 0; index < _camera._desiredResolutions.Count; index++)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("-"))
|
||||
{
|
||||
serializedObject.FindProperty("_desiredResolutions").DeleteArrayElementAtIndex(index);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
SerializedProperty propResX = serializedObject.FindProperty("_desiredResolutions").GetArrayElementAtIndex(index).FindPropertyRelative("x");
|
||||
EditorGUILayout.PropertyField(propResX, new GUIContent(""), GUILayout.Width(64f));
|
||||
|
||||
EditorGUILayout.LabelField("x", "", GUILayout.Width(24));
|
||||
|
||||
SerializedProperty propResY = serializedObject.FindProperty("_desiredResolutions").GetArrayElementAtIndex(index).FindPropertyRelative("y");
|
||||
EditorGUILayout.PropertyField(propResY, new GUIContent(""), GUILayout.Width(64f));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
if (GUILayout.Button("+"))
|
||||
{
|
||||
serializedObject.FindProperty("_desiredResolutions").arraySize++;
|
||||
this.Repaint();
|
||||
}
|
||||
|
||||
SerializedProperty propMaintainAspect = serializedObject.FindProperty("_maintainAspectRatio");
|
||||
EditorGUILayout.PropertyField(propMaintainAspect);
|
||||
}
|
||||
|
||||
GUILayout.Label("Frame Rate", EditorStyles.boldLabel);
|
||||
|
||||
SerializedProperty propDesiredFrameRate = serializedObject.FindProperty("_desiredFrameRate");
|
||||
EditorGUILayout.PropertyField(propDesiredFrameRate, new GUIContent("Frame Rate"));
|
||||
if (propDesiredFrameRate.floatValue <= 0f)
|
||||
{
|
||||
GUILayout.Label("Highest frame rate will be used");
|
||||
}
|
||||
|
||||
GUILayout.Label("Format", EditorStyles.boldLabel);
|
||||
|
||||
SerializedProperty propDesiredFormatAny = serializedObject.FindProperty("_desiredFormatAny");
|
||||
EditorGUILayout.PropertyField(propDesiredFormatAny, new GUIContent("Automatic Format"));
|
||||
|
||||
if (!propDesiredFormatAny.boolValue)
|
||||
{
|
||||
SerializedProperty propDesiredFormat = serializedObject.FindProperty("_desiredFormat");
|
||||
EditorGUILayout.PropertyField(propDesiredFormat, new GUIContent("Specific Format"));
|
||||
}
|
||||
else
|
||||
{
|
||||
SerializedProperty propSupportsTransparency = serializedObject.FindProperty("_desiredTransparencyFormat");
|
||||
EditorGUILayout.PropertyField(propSupportsTransparency, new GUIContent("Transparency"));
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
break;
|
||||
case AVProLiveCamera.SelectModeBy.Index:
|
||||
{
|
||||
SerializedProperty propDesiredModeIndex = serializedObject.FindProperty("_desiredModeIndex");
|
||||
EditorGUILayout.PropertyField(propDesiredModeIndex, new GUIContent(" "));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SerializedProperty propInputSelection = serializedObject.FindProperty("_videoInputSelection");
|
||||
EditorGUILayout.PropertyField(propInputSelection, new GUIContent("Video Input Select By"));
|
||||
|
||||
AVProLiveCamera.SelectDeviceBy newVideoInputSelection = _camera._videoInputSelection;
|
||||
switch (newVideoInputSelection)
|
||||
{
|
||||
case AVProLiveCamera.SelectDeviceBy.Default:
|
||||
break;
|
||||
case AVProLiveCamera.SelectDeviceBy.Name:
|
||||
if (_camera._videoInputSelection != newVideoInputSelection && _camera._desiredVideoInputs.Count == 0)
|
||||
{
|
||||
_camera._desiredVideoInputs.Add(AVProLiveCameraPlugin.VideoInput.Video_Serial_Digital);
|
||||
}
|
||||
EditorGUILayout.BeginVertical();
|
||||
for (int index = 0; index < _camera._desiredVideoInputs.Count; index++)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (GUILayout.Button("-"))
|
||||
{
|
||||
serializedObject.FindProperty("_desiredVideoInputs").DeleteArrayElementAtIndex(index);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
SerializedProperty propDesiredVideoInput = serializedObject.FindProperty("_desiredVideoInputs").GetArrayElementAtIndex(index);
|
||||
EditorGUILayout.PropertyField(propDesiredVideoInput, new GUIContent(" "));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
if (GUILayout.Button("+"))
|
||||
{
|
||||
serializedObject.FindProperty("_desiredVideoInputs").arraySize++;
|
||||
this.Repaint();
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
break;
|
||||
case AVProLiveCamera.SelectDeviceBy.Index:
|
||||
{
|
||||
SerializedProperty propDesiredVideoInputIndex = serializedObject.FindProperty("_desiredVideoInputIndex");
|
||||
EditorGUILayout.PropertyField(propDesiredVideoInputIndex, new GUIContent(" "));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_propPreferPreviewPin);
|
||||
EditorGUILayout.PropertyField(_propClockMode);
|
||||
EditorGUILayout.PropertyField(_propDeinterlace);
|
||||
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
if (GUILayout.Button("Select Device"))
|
||||
{
|
||||
_camera.Begin();
|
||||
}
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (_camera == null)
|
||||
return;
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
DrawLiveControls();
|
||||
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_propPlayOnStart);
|
||||
}
|
||||
|
||||
DrawDeviceSelection();
|
||||
|
||||
GUI.enabled = true;
|
||||
|
||||
EditorGUILayout.PropertyField(_propAllowTransparency);
|
||||
EditorGUILayout.PropertyField(_propYCbCrRange);
|
||||
EditorGUILayout.PropertyField(_propFlipX);
|
||||
EditorGUILayout.PropertyField(_propFlipY);
|
||||
EditorGUILayout.PropertyField(_propHotSwap);
|
||||
EditorGUILayout.PropertyField(_propFrameRates);
|
||||
EditorGUILayout.PropertyField(_propSettings);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
EditorUtility.SetDirty(_camera);
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: b02279f9635348941bc04813c75c85da
|
||||
@ -0,0 +1,56 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Editor
|
||||
{
|
||||
[CustomEditor(typeof(AVProLiveCameraManager))]
|
||||
public class AVProLiveCameraManagerEditor : UnityEditor.Editor
|
||||
{
|
||||
private AVProLiveCameraManager _manager;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
_manager = (this.target) as AVProLiveCameraManager;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
_manager = null;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (_manager == null)
|
||||
return;
|
||||
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
|
||||
int numDevices = _manager.NumDevices;
|
||||
EditorGUILayout.PrefixLabel("Devices: ");
|
||||
for (int deviceIndex = 0; deviceIndex < numDevices; deviceIndex++)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
AVProLiveCameraDevice device = _manager.GetDevice(deviceIndex);
|
||||
EditorGUILayout.LabelField(deviceIndex.ToString() + ") " + device.Name, "");
|
||||
if (device.IsRunning)
|
||||
EditorGUILayout.LabelField("Display at " + device.DisplayFPS.ToString("F1") + " FPS", "");
|
||||
else
|
||||
EditorGUILayout.LabelField("Stopped", "");
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: fe8ef0a86b6c724419b47464ac009053
|
||||
@ -0,0 +1,95 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2015-2020 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor for the AVProLiveCameraMaterialApply component
|
||||
/// </summary>
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(AVProLiveCameraMaterialApply))]
|
||||
public class AVProLiveCameraMaterialApplyEditor : UnityEditor.Editor
|
||||
{
|
||||
private readonly static GUIContent _guiTextTextureProperty = new GUIContent("Texture Property");
|
||||
//private readonly static string DefaultTextureUniformName = "_MainTex";
|
||||
private readonly static string HDRPTextureUniformName = "_BaseColorMap";
|
||||
|
||||
private SerializedProperty _propLiveCamera;
|
||||
private SerializedProperty _propMaterial;
|
||||
private SerializedProperty _propTexturePropertyName;
|
||||
private GUIContent[] _materialTextureProperties = new GUIContent[0];
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
_propLiveCamera = serializedObject.FindProperty("_liveCamera");
|
||||
_propMaterial = serializedObject.FindProperty("_material");
|
||||
_propTexturePropertyName = serializedObject.FindProperty("_texturePropertyName");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(Application.isPlaying);
|
||||
|
||||
EditorGUILayout.PropertyField(_propLiveCamera);
|
||||
EditorGUILayout.PropertyField(_propMaterial);
|
||||
|
||||
bool isHDRP = false;
|
||||
int texturePropertyIndex = -1;
|
||||
|
||||
// TODO: don't do this every frame (expensive)
|
||||
if (_propMaterial.objectReferenceValue != null)
|
||||
{
|
||||
Material mat = (Material)(_propMaterial.objectReferenceValue);
|
||||
MaterialProperty[] matProps = MaterialEditor.GetMaterialProperties(new Material[] { mat } );
|
||||
|
||||
List<GUIContent> items = new List<GUIContent>(8);
|
||||
foreach (MaterialProperty matProp in matProps)
|
||||
{
|
||||
if (matProp.type == MaterialProperty.PropType.Texture)
|
||||
{
|
||||
if (matProp.name == _propTexturePropertyName.stringValue)
|
||||
{
|
||||
texturePropertyIndex = items.Count;
|
||||
}
|
||||
if (matProp.name == HDRPTextureUniformName)
|
||||
{
|
||||
isHDRP = true;
|
||||
}
|
||||
items.Add(new GUIContent(matProp.name));
|
||||
}
|
||||
}
|
||||
_materialTextureProperties = items.ToArray();
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(_propTexturePropertyName, _guiTextTextureProperty);
|
||||
|
||||
if (isHDRP && _propTexturePropertyName.stringValue != HDRPTextureUniformName)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Select _BaseColorMap for HDRP", MessageType.Info);
|
||||
}
|
||||
if (texturePropertyIndex < 0)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Texture property name '" + _propTexturePropertyName.stringValue + "' not found in material", MessageType.Warning);
|
||||
}
|
||||
|
||||
int newTexturePropertyIndex = EditorGUILayout.Popup(texturePropertyIndex, _materialTextureProperties);
|
||||
if (newTexturePropertyIndex >=0 && newTexturePropertyIndex != texturePropertyIndex)
|
||||
{
|
||||
_propTexturePropertyName.stringValue = _materialTextureProperties[newTexturePropertyIndex].text;
|
||||
}
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 464bc47a03461a74b800245c53727e36
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
@ -0,0 +1,96 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2015-2020 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor for the AVProLiveCameraMaterialApply component
|
||||
/// </summary>
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(AVProLiveCameraMeshApply))]
|
||||
public class AVProLiveCameraMeshApplyEditor : UnityEditor.Editor
|
||||
{
|
||||
private readonly static GUIContent _guiTextTextureProperty = new GUIContent("Texture Property");
|
||||
//private readonly static string DefaultTextureUniformName = "_MainTex";
|
||||
private readonly static string HDRPTextureUniformName = "_BaseColorMap";
|
||||
|
||||
private SerializedProperty _propLiveCamera;
|
||||
private SerializedProperty _propMesh;
|
||||
private SerializedProperty _propTexturePropertyName;
|
||||
private GUIContent[] _materialTextureProperties = new GUIContent[0];
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
_propLiveCamera = serializedObject.FindProperty("_liveCamera");
|
||||
_propMesh = serializedObject.FindProperty("_mesh");
|
||||
_propTexturePropertyName = serializedObject.FindProperty("_texturePropertyName");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(Application.isPlaying);
|
||||
|
||||
EditorGUILayout.PropertyField(_propLiveCamera);
|
||||
EditorGUILayout.PropertyField(_propMesh);
|
||||
|
||||
bool isHDRP = false;
|
||||
int texturePropertyIndex = -1;
|
||||
|
||||
// TODO: don't do this every frame (expensive)
|
||||
if (_propMesh.objectReferenceValue != null)
|
||||
{
|
||||
MeshRenderer renderer = (MeshRenderer)(_propMesh.objectReferenceValue);
|
||||
Material[] materials = renderer.sharedMaterials;
|
||||
MaterialProperty[] matProps = MaterialEditor.GetMaterialProperties(materials);
|
||||
|
||||
List<GUIContent> items = new List<GUIContent>(16);
|
||||
foreach (MaterialProperty matProp in matProps)
|
||||
{
|
||||
if (matProp.type == MaterialProperty.PropType.Texture)
|
||||
{
|
||||
if (matProp.name == _propTexturePropertyName.stringValue)
|
||||
{
|
||||
texturePropertyIndex = items.Count;
|
||||
}
|
||||
if (matProp.name == HDRPTextureUniformName)
|
||||
{
|
||||
isHDRP = true;
|
||||
}
|
||||
items.Add(new GUIContent(matProp.name));
|
||||
}
|
||||
}
|
||||
_materialTextureProperties = items.ToArray();
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(_propTexturePropertyName, _guiTextTextureProperty);
|
||||
|
||||
if (isHDRP && _propTexturePropertyName.stringValue != HDRPTextureUniformName)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Select _BaseColorMap for HDRP", MessageType.Info);
|
||||
}
|
||||
if (texturePropertyIndex < 0)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Texture property name '" + _propTexturePropertyName.stringValue + "' not found in material", MessageType.Warning);
|
||||
}
|
||||
|
||||
int newTexturePropertyIndex = EditorGUILayout.Popup(texturePropertyIndex, _materialTextureProperties);
|
||||
if (newTexturePropertyIndex >=0 && newTexturePropertyIndex != texturePropertyIndex)
|
||||
{
|
||||
_propTexturePropertyName.stringValue = _materialTextureProperties[newTexturePropertyIndex].text;
|
||||
}
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3faa838331f2b8f43b2b498095867a61
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
@ -0,0 +1,152 @@
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_5)
|
||||
#define UNITY_FEATURE_UGUI
|
||||
#endif
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
#if UNITY_FEATURE_UGUI
|
||||
using UnityEngine.UI;
|
||||
using UnityEditor.UI;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2014-2018 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Editor class used to edit UI Images.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(AVProLiveCameraUGUIComponent), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class AVProLiveCameraUGUIComponentEditor : GraphicEditor
|
||||
{
|
||||
SerializedProperty m_Camera;
|
||||
SerializedProperty m_UVRect;
|
||||
SerializedProperty m_DefaultTexture;
|
||||
SerializedProperty m_SetNativeSize;
|
||||
SerializedProperty m_KeepAspectRatio;
|
||||
GUIContent m_UVRectContent;
|
||||
|
||||
[MenuItem("GameObject/UI/AVPro Live Camera uGUI", false, 0)]
|
||||
public static void CreateGameObject()
|
||||
{
|
||||
GameObject parent = Selection.activeGameObject;
|
||||
RectTransform parentCanvasRenderer = (parent != null) ? parent.GetComponent<RectTransform>() : null;
|
||||
if (parentCanvasRenderer)
|
||||
{
|
||||
GameObject go = new GameObject("AVPro Live Camera");
|
||||
go.transform.SetParent(parent.transform, false);
|
||||
go.AddComponent<RectTransform>();
|
||||
go.AddComponent<CanvasRenderer>();
|
||||
go.AddComponent<AVProLiveCameraUGUIComponent>();
|
||||
Selection.activeGameObject = go;
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorUtility.DisplayDialog("AVPro Live Camera", "You must make the AVPro Live Camera uGUI object as a child of a Canvas.", "Ok");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool RequiresConstantRepaint()
|
||||
{
|
||||
AVProLiveCameraUGUIComponent rawImage = target as AVProLiveCameraUGUIComponent;
|
||||
return (rawImage != null && rawImage.HasValidTexture());
|
||||
}
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
|
||||
// Note we have precedence for calling rectangle for just rect, even in the Inspector.
|
||||
// For example in the Camera component's Viewport Rect.
|
||||
// Hence sticking with Rect here to be consistent with corresponding property in the API.
|
||||
m_UVRectContent = new GUIContent("UV Rect");
|
||||
|
||||
m_Camera = serializedObject.FindProperty("m_liveCamera");
|
||||
m_UVRect = serializedObject.FindProperty("m_UVRect");
|
||||
m_SetNativeSize = serializedObject.FindProperty("_setNativeSize");
|
||||
m_KeepAspectRatio = serializedObject.FindProperty("_keepAspectRatio");
|
||||
|
||||
m_DefaultTexture = serializedObject.FindProperty("_defaultTexture");
|
||||
|
||||
SetShowNativeSize(true);
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(m_Camera);
|
||||
EditorGUILayout.PropertyField(m_DefaultTexture);
|
||||
AppearanceControlsGUI();
|
||||
EditorGUILayout.PropertyField(m_UVRect, m_UVRectContent);
|
||||
|
||||
EditorGUILayout.PropertyField(m_SetNativeSize);
|
||||
EditorGUILayout.PropertyField(m_KeepAspectRatio);
|
||||
|
||||
SetShowNativeSize(false);
|
||||
NativeSizeButtonGUI();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void SetShowNativeSize(bool instant)
|
||||
{
|
||||
base.SetShowNativeSize(m_Camera.objectReferenceValue != null, instant);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allow the texture to be previewed.
|
||||
/// </summary>
|
||||
|
||||
public override bool HasPreviewGUI()
|
||||
{
|
||||
AVProLiveCameraUGUIComponent rawImage = target as AVProLiveCameraUGUIComponent;
|
||||
return rawImage != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw the Image preview.
|
||||
/// </summary>
|
||||
|
||||
public override void OnPreviewGUI(Rect drawArea, GUIStyle background)
|
||||
{
|
||||
AVProLiveCameraUGUIComponent rawImage = target as AVProLiveCameraUGUIComponent;
|
||||
Texture tex = rawImage.mainTexture;
|
||||
|
||||
if (tex == null)
|
||||
return;
|
||||
|
||||
// Create the texture rectangle that is centered inside rect.
|
||||
Rect outerRect = drawArea;
|
||||
EditorGUI.DrawTextureTransparent(outerRect, tex, ScaleMode.ScaleToFit);//, outer.width / outer.height);
|
||||
//SpriteDrawUtility.DrawSprite(tex, rect, outer, rawImage.uvRect, rawImage.canvasRenderer.GetColor());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Info String drawn at the bottom of the Preview
|
||||
/// </summary>
|
||||
|
||||
public override string GetInfoString()
|
||||
{
|
||||
AVProLiveCameraUGUIComponent rawImage = target as AVProLiveCameraUGUIComponent;
|
||||
|
||||
string text = string.Empty;
|
||||
if (rawImage.HasValidTexture())
|
||||
{
|
||||
text += string.Format("Video Size: {0}x{1}\n",
|
||||
Mathf.RoundToInt(Mathf.Abs(rawImage.mainTexture.width)),
|
||||
Mathf.RoundToInt(Mathf.Abs(rawImage.mainTexture.height)));
|
||||
}
|
||||
|
||||
// Image size Text
|
||||
text += string.Format("Display Size: {0}x{1}",
|
||||
Mathf.RoundToInt(Mathf.Abs(rawImage.rectTransform.rect.width)),
|
||||
Mathf.RoundToInt(Mathf.Abs(rawImage.rectTransform.rect.height)));
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8922fa7e9f324e4a8bd1a7fbd85af94
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
5
Assets/AVProLiveCamera/Resources.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35b53ce01ac6cab4daf5283235822b81
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
||||
BIN
Assets/AVProLiveCamera/Resources/AVProLiveCameraIcon.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69ab7b920ec13a9499cf847d04474e5c
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 256
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: 1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 2
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
2
Assets/AVProLiveCamera/Scripts.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 20def7cb1be9cd443a46cdcfaed8f71f
|
||||
2
Assets/AVProLiveCamera/Scripts/Components.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 6a2c6a51ad553fb49a603e9de724bc1a
|
||||
526
Assets/AVProLiveCamera/Scripts/Components/AVProLiveCamera.cs
Normal file
@ -0,0 +1,526 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/Live Camera")]
|
||||
public class AVProLiveCamera : MonoBehaviour
|
||||
{
|
||||
// Selected
|
||||
protected AVProLiveCameraDevice _device = null;
|
||||
protected AVProLiveCameraDeviceMode _mode = null;
|
||||
protected int _videoInput = -1;
|
||||
|
||||
[Header("Device Selection")]
|
||||
|
||||
// Device selection
|
||||
public SelectDeviceBy _deviceSelection = SelectDeviceBy.Default;
|
||||
public List<string> _desiredDeviceNames = new List<string>(4);
|
||||
public int _desiredDeviceIndex = 0;
|
||||
|
||||
// Mode selection
|
||||
public SelectModeBy _modeSelection = SelectModeBy.Default;
|
||||
public bool _desiredAnyResolution = true;
|
||||
public List<Vector2> _desiredResolutions = new List<Vector2>(2);
|
||||
public int _desiredModeIndex = -1;
|
||||
public bool _maintainAspectRatio = false;
|
||||
public float _desiredFrameRate = 0f;
|
||||
public bool _desiredFormatAny = true;
|
||||
public bool _desiredTransparencyFormat = false;
|
||||
public AVProLiveCameraPlugin.VideoFrameFormat _desiredFormat = AVProLiveCameraPlugin.VideoFrameFormat.YUV_422_HDYC;
|
||||
|
||||
// Video Input selection
|
||||
public SelectDeviceBy _videoInputSelection = SelectDeviceBy.Default;
|
||||
public List<AVProLiveCameraPlugin.VideoInput> _desiredVideoInputs = new List<AVProLiveCameraPlugin.VideoInput>(4);
|
||||
public int _desiredVideoInputIndex = 0;
|
||||
|
||||
[Header("Device Start")]
|
||||
[SerializeField] bool _preferPreviewPin = false;
|
||||
[SerializeField] AVProLiveCameraDevice.ClockMode _clockMode = AVProLiveCameraDevice.ClockMode.None;
|
||||
public bool _deinterlace = false;
|
||||
public bool _playOnStart = true;
|
||||
|
||||
[Header("Display")]
|
||||
public bool _allowTransparency = true;
|
||||
public bool _flipX;
|
||||
public bool _flipY;
|
||||
[SerializeField] YCbCrRange _yCbCrRange = YCbCrRange.Limited;
|
||||
|
||||
[Header("Update")]
|
||||
public bool _updateHotSwap = false;
|
||||
public bool _updateFrameRates = false;
|
||||
public bool _updateSettings = false;
|
||||
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
private System.IntPtr _renderFunc;
|
||||
#endif
|
||||
|
||||
public AVProLiveCameraDevice Device
|
||||
{
|
||||
get { return _device; }
|
||||
}
|
||||
|
||||
public AVProLiveCameraDevice.ClockMode Clock
|
||||
{
|
||||
get { return _clockMode; }
|
||||
set { if (_device != null) { _device.Clock = value; } _clockMode = value; }
|
||||
}
|
||||
|
||||
public YCbCrRange YCbCrRange
|
||||
{
|
||||
get { return _yCbCrRange; }
|
||||
set { if (Device != null) { _device.YCbCrRange = value; } _yCbCrRange = value; }
|
||||
}
|
||||
|
||||
public bool PreferPreviewPin
|
||||
{
|
||||
get { return _preferPreviewPin; }
|
||||
set { _preferPreviewPin = value; }
|
||||
}
|
||||
|
||||
public Texture OutputTexture
|
||||
{
|
||||
get { if (_device != null) return _device.OutputTexture; return null; }
|
||||
}
|
||||
|
||||
public enum SelectDeviceBy
|
||||
{
|
||||
Default,
|
||||
Name,
|
||||
Index,
|
||||
}
|
||||
|
||||
public enum SelectModeBy
|
||||
{
|
||||
Default,
|
||||
Resolution,
|
||||
Index,
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_videoInput = -1;
|
||||
_mode = null;
|
||||
_device = null;
|
||||
_flipX = _flipY = false;
|
||||
_allowTransparency = false;
|
||||
_yCbCrRange = YCbCrRange.Limited;
|
||||
|
||||
_deviceSelection = SelectDeviceBy.Default;
|
||||
_modeSelection = SelectModeBy.Default;
|
||||
_videoInputSelection = SelectDeviceBy.Default;
|
||||
_desiredDeviceNames = new List<string>(4);
|
||||
_desiredResolutions = new List<Vector2>(2);
|
||||
_desiredVideoInputs = new List<AVProLiveCameraPlugin.VideoInput>(4);
|
||||
_desiredDeviceNames.Add("Logitech BRIO");
|
||||
_desiredDeviceNames.Add("Integrated Webcam");
|
||||
_desiredDeviceNames.Add("OBS-Camera");
|
||||
_desiredDeviceNames.Add("XSplit VCam");
|
||||
_desiredDeviceNames.Add("Logitech HD Pro Webcam C922");
|
||||
_desiredDeviceNames.Add("Logitech HD Pro Webcam C920");
|
||||
_desiredDeviceNames.Add("HD Pro Webcam C922");
|
||||
_desiredDeviceNames.Add("HD Pro Webcam C920");
|
||||
_desiredDeviceNames.Add("Decklink Video Capture");
|
||||
_desiredDeviceNames.Add("Logitech Webcam Pro 9000");
|
||||
_desiredResolutions.Add(new Vector2(1920, 1080));
|
||||
_desiredResolutions.Add(new Vector2(1280, 720));
|
||||
_desiredResolutions.Add(new Vector2(640, 360));
|
||||
_desiredResolutions.Add(new Vector2(640, 480));
|
||||
_desiredVideoInputs.Add(AVProLiveCameraPlugin.VideoInput.Video_Serial_Digital);
|
||||
_desiredVideoInputs.Add(AVProLiveCameraPlugin.VideoInput.Video_SVideo);
|
||||
_desiredVideoInputIndex = 0;
|
||||
_maintainAspectRatio = false;
|
||||
_desiredTransparencyFormat = false;
|
||||
_desiredAnyResolution = true;
|
||||
_desiredFrameRate = 0f;
|
||||
_desiredFormatAny = true;
|
||||
_desiredFormat = AVProLiveCameraPlugin.VideoFrameFormat.YUV_422_HDYC;
|
||||
_desiredModeIndex = -1;
|
||||
_desiredDeviceIndex = 0;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (null == FindObjectOfType(typeof(AVProLiveCameraManager)))
|
||||
{
|
||||
throw new System.Exception("You need to add AVProLiveCameraManager component to your scene or change the script execution ordering of AVProLiveCameraManager.");
|
||||
}
|
||||
|
||||
SelectDeviceAndMode();
|
||||
|
||||
if (_playOnStart)
|
||||
{
|
||||
Begin();
|
||||
}
|
||||
}
|
||||
|
||||
public void Begin()
|
||||
{
|
||||
SelectDeviceAndMode();
|
||||
|
||||
if (_device != null)
|
||||
{
|
||||
if (_renderRoutine != null)
|
||||
{
|
||||
StopCoroutine(_renderRoutine);
|
||||
_renderRoutine = null;
|
||||
}
|
||||
|
||||
_device.Deinterlace = _deinterlace;
|
||||
_device.AllowTransparency = _allowTransparency;
|
||||
_device.YCbCrRange = _yCbCrRange;
|
||||
_device.FlipX = _flipX;
|
||||
_device.FlipY = _flipY;
|
||||
_device.Clock = _clockMode;
|
||||
_device.PreferPreviewPin = _preferPreviewPin;
|
||||
if (!_device.Start(_mode, _videoInput))
|
||||
{
|
||||
Debug.LogWarning("[AVPro Live Camera] Device failed to start.");
|
||||
_device.Close();
|
||||
_device = null;
|
||||
_mode = null;
|
||||
_videoInput = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_renderRoutine == null && this.gameObject.activeInHierarchy)
|
||||
{
|
||||
_renderRoutine = StartCoroutine(RenderRoutine());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_device != null)
|
||||
{
|
||||
if (_flipX != _device.FlipX)
|
||||
_device.FlipX = _flipX;
|
||||
if (_flipY != _device.FlipY)
|
||||
_device.FlipY = _flipY;
|
||||
if (_allowTransparency != _device.AllowTransparency)
|
||||
_device.AllowTransparency = _allowTransparency;
|
||||
if (_yCbCrRange != _device.YCbCrRange)
|
||||
_device.YCbCrRange = _yCbCrRange;
|
||||
|
||||
_device.UpdateHotSwap = _updateHotSwap;
|
||||
_device.UpdateFrameRates = _updateFrameRates;
|
||||
_device.UpdateSettings = _updateSettings;
|
||||
|
||||
_device.Update(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int _lastFrameCount;
|
||||
private bool Render()
|
||||
{
|
||||
bool result = false;
|
||||
if (_device != null)
|
||||
{
|
||||
// Prevent this function being executed again this frame if the camera frame has been updated this frame already
|
||||
if (_lastFrameCount != Time.frameCount)
|
||||
{
|
||||
if (_device != null)
|
||||
{
|
||||
if (_device.Render())
|
||||
{
|
||||
_lastFrameCount = Time.frameCount;
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastFrameUpdated = AVProLiveCameraPlugin.GetLastFrameUploaded(_device.DeviceIndex);
|
||||
}
|
||||
|
||||
{
|
||||
int eventId = AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateOneTexture | _device.DeviceIndex;
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
GL.IssuePluginEvent(_renderFunc, eventId);
|
||||
#else
|
||||
GL.IssuePluginEvent(eventId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private YieldInstruction _wait = new WaitForEndOfFrame();
|
||||
private Coroutine _renderRoutine;
|
||||
private int _lastFrameUpdated;
|
||||
|
||||
private System.Collections.IEnumerator RenderRoutine()
|
||||
{
|
||||
while (Application.isPlaying)
|
||||
{
|
||||
yield return null;
|
||||
|
||||
if (this.enabled)
|
||||
{
|
||||
bool hasUpdatedThisFrame = Render();
|
||||
|
||||
// NOTE: in editor, if the game view isn't visible then WaitForEndOfFrame will never complete
|
||||
yield return _wait;
|
||||
|
||||
if (!hasUpdatedThisFrame)
|
||||
{
|
||||
// Try again to get the frame
|
||||
if (!Render())
|
||||
{
|
||||
//Debug.Log("frame dropped :(");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If nothing has updated, send another event
|
||||
int lastFrameUpdated = AVProLiveCameraPlugin.GetLastFrameUploaded(_device.DeviceIndex);
|
||||
if (_lastFrameUpdated == lastFrameUpdated)
|
||||
{
|
||||
int eventId = AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateOneTexture | _device.DeviceIndex;
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
GL.IssuePluginEvent(_renderFunc, eventId);
|
||||
#else
|
||||
GL.IssuePluginEvent(eventId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_renderRoutine = null;
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
if (_renderRoutine != null)
|
||||
{
|
||||
StopCoroutine(_renderRoutine);
|
||||
_renderRoutine = null;
|
||||
}
|
||||
|
||||
if (_device != null)
|
||||
_device.Close();
|
||||
_device = null;
|
||||
}
|
||||
|
||||
public void SelectDeviceAndMode()
|
||||
{
|
||||
_device = null;
|
||||
_mode = null;
|
||||
_videoInput = -1;
|
||||
|
||||
_device = SelectDevice();
|
||||
if (_device != null)
|
||||
{
|
||||
_mode = SelectMode();
|
||||
_videoInput = SelectVideoInputIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[AVProLiveCamera] Could not find the device.");
|
||||
}
|
||||
}
|
||||
|
||||
private AVProLiveCameraDeviceMode SelectMode()
|
||||
{
|
||||
AVProLiveCameraDeviceMode result = null;
|
||||
|
||||
switch (_modeSelection)
|
||||
{
|
||||
default:
|
||||
case SelectModeBy.Default:
|
||||
result = null;
|
||||
break;
|
||||
case SelectModeBy.Resolution:
|
||||
if (_desiredResolutions.Count > 0)
|
||||
{
|
||||
result = GetClosestMode(_device, _desiredAnyResolution, _desiredResolutions, _maintainAspectRatio, _desiredFrameRate, _desiredFormatAny, _desiredTransparencyFormat, _desiredFormat);
|
||||
if (result == null)
|
||||
{
|
||||
Debug.LogWarning("[AVProLiveCamera] Could not find desired mode, using default mode.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SelectModeBy.Index:
|
||||
if (_desiredModeIndex >= 0)
|
||||
{
|
||||
result = _device.GetMode(_desiredModeIndex);
|
||||
if (result == null)
|
||||
{
|
||||
Debug.LogWarning("[AVProLiveCamera] Could not find desired mode, using default mode.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
if (_desiredFrameRate <= 0)
|
||||
{
|
||||
result.SelectHighestFrameRate();
|
||||
}
|
||||
else
|
||||
{
|
||||
result.SelectClosestFrameRate(_desiredFrameRate);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private AVProLiveCameraDevice SelectDevice()
|
||||
{
|
||||
AVProLiveCameraDevice result = null;
|
||||
|
||||
switch (_deviceSelection)
|
||||
{
|
||||
default:
|
||||
case SelectDeviceBy.Default:
|
||||
result = AVProLiveCameraManager.Instance.GetDevice(0);
|
||||
break;
|
||||
case SelectDeviceBy.Name:
|
||||
if (_desiredDeviceNames.Count > 0)
|
||||
{
|
||||
result = GetFirstDevice(_desiredDeviceNames);
|
||||
}
|
||||
break;
|
||||
case SelectDeviceBy.Index:
|
||||
if (_desiredDeviceIndex >= 0)
|
||||
{
|
||||
result = AVProLiveCameraManager.Instance.GetDevice(_desiredDeviceIndex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int SelectVideoInputIndex()
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
switch (_videoInputSelection)
|
||||
{
|
||||
default:
|
||||
case SelectDeviceBy.Default:
|
||||
result = -1;
|
||||
break;
|
||||
case SelectDeviceBy.Name:
|
||||
if (_desiredVideoInputs.Count > 0 && _device.NumVideoInputs > 0)
|
||||
{
|
||||
foreach (AVProLiveCameraPlugin.VideoInput videoInput in _desiredVideoInputs)
|
||||
{
|
||||
for (int i = 0; i < _device.NumVideoInputs; i++)
|
||||
{
|
||||
if (videoInput.ToString().Replace("_", " ") == _device.GetVideoInputName(i))
|
||||
{
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (result >= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SelectDeviceBy.Index:
|
||||
if (_desiredVideoInputIndex >= 0)
|
||||
{
|
||||
result = _desiredVideoInputIndex;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
if (_renderFunc == System.IntPtr.Zero)
|
||||
{
|
||||
_renderFunc = AVProLiveCameraPlugin.GetRenderEventFunc();
|
||||
}
|
||||
#endif
|
||||
if (_device != null)
|
||||
{
|
||||
_device.IsActive = true;
|
||||
if (_renderRoutine == null && _device.IsRunning)
|
||||
{
|
||||
_renderRoutine = StartCoroutine(RenderRoutine());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (_device != null)
|
||||
{
|
||||
_device.IsActive = false;
|
||||
if (_renderRoutine != null)
|
||||
{
|
||||
StopCoroutine(_renderRoutine);
|
||||
_renderRoutine = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static AVProLiveCameraDeviceMode GetClosestMode(AVProLiveCameraDevice device, bool anyResolution, List<Vector2> resolutions, bool maintainApectRatio, float frameRate, bool anyPixelFormat, bool transparentPixelFormat, AVProLiveCameraPlugin.VideoFrameFormat pixelFormat)
|
||||
{
|
||||
AVProLiveCameraDeviceMode result = null;
|
||||
if (anyResolution)
|
||||
{
|
||||
result = device.GetClosestMode(-1, -1, maintainApectRatio, frameRate, anyPixelFormat, transparentPixelFormat, pixelFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < resolutions.Count; i++)
|
||||
{
|
||||
result = device.GetClosestMode(Mathf.FloorToInt(resolutions[i].x), Mathf.FloorToInt(resolutions[i].y), maintainApectRatio, frameRate, anyPixelFormat, transparentPixelFormat, pixelFormat);
|
||||
if (result != null)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static AVProLiveCameraDevice GetFirstDevice(List<string> names)
|
||||
{
|
||||
AVProLiveCameraDevice result = null;
|
||||
for (int i = 0; i < names.Count; i++)
|
||||
{
|
||||
result = AVProLiveCameraManager.Instance.GetDevice(names[i]);
|
||||
if (result != null)
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR && !UNITY_WEBPLAYER
|
||||
[ContextMenu("Save PNG")]
|
||||
private void SavePNG()
|
||||
{
|
||||
if (OutputTexture != null && _device != null)
|
||||
{
|
||||
Texture2D tex = new Texture2D(OutputTexture.width, OutputTexture.height, TextureFormat.ARGB32, false);
|
||||
RenderTexture.active = (RenderTexture)OutputTexture;
|
||||
tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0, false);
|
||||
tex.Apply(false, false);
|
||||
|
||||
byte[] pngBytes = tex.EncodeToPNG();
|
||||
System.IO.File.WriteAllBytes("AVProLiveCamera-image" + Random.Range(0, 65536).ToString("X") + ".png", pngBytes);
|
||||
|
||||
RenderTexture.active = null;
|
||||
Texture2D.Destroy(tex);
|
||||
tex = null;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1015dbb0b69fdd446b617191771ffcce
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 200
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,94 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2014-2018 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
#if NGUI
|
||||
[AddComponentMenu("AVPro Live Camera/Apply to NGUI UITexture")]
|
||||
public class AVProLiveCameraApplyUITextureNGUI : MonoBehaviour
|
||||
{
|
||||
public UITexture _uiTexture;
|
||||
public AVProLiveCamera _liveCamera;
|
||||
public Texture2D _defaultTexture;
|
||||
private AVProLiveCamera _currentCamera;
|
||||
private static Texture2D _blackTexture;
|
||||
[SerializeField] bool _makePixelPerfect = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (_blackTexture == null)
|
||||
CreateTexture();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (_defaultTexture == null)
|
||||
{
|
||||
_defaultTexture = _blackTexture;
|
||||
}
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_liveCamera != null)
|
||||
{
|
||||
if (_liveCamera.OutputTexture != null)
|
||||
{
|
||||
_currentCamera = _liveCamera;
|
||||
|
||||
if (_makePixelPerfect)
|
||||
{
|
||||
_currentCamera.OutputTexture.filterMode = FilterMode.Point;
|
||||
_uiTexture.mainTexture = _currentCamera.OutputTexture;
|
||||
_uiTexture.MakePixelPerfect();
|
||||
}
|
||||
else
|
||||
{
|
||||
_uiTexture.mainTexture = _currentCamera.OutputTexture;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentCamera = null;
|
||||
_uiTexture.mainTexture = _defaultTexture;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDisable()
|
||||
{
|
||||
//_uiTexture.mainTexture = null;
|
||||
//_currentCamera = null;
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
_defaultTexture = null;
|
||||
|
||||
if (_blackTexture != null)
|
||||
{
|
||||
Texture2D.Destroy(_blackTexture);
|
||||
_blackTexture = null;
|
||||
}
|
||||
|
||||
_uiTexture.mainTexture = null;
|
||||
}
|
||||
|
||||
private static void CreateTexture()
|
||||
{
|
||||
_blackTexture = new Texture2D(1, 1, TextureFormat.ARGB32, false, false);
|
||||
_blackTexture.name = "AVProLiveCamera-BlackTexture";
|
||||
_blackTexture.filterMode = FilterMode.Point;
|
||||
_blackTexture.wrapMode = TextureWrapMode.Clamp;
|
||||
_blackTexture.SetPixel(0, 0, Color.black);
|
||||
_blackTexture.Apply(false, true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8faeeff5f7583e40823deb8860119cd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,237 @@
|
||||
using UnityEngine;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/IMGUI Display")]
|
||||
public class AVProLiveCameraGUIDisplay : MonoBehaviour
|
||||
{
|
||||
public AVProLiveCamera _liveCamera;
|
||||
|
||||
public ScaleMode _scaleMode = ScaleMode.ScaleToFit;
|
||||
public Color _color = Color.white;
|
||||
public int _depth = 0;
|
||||
|
||||
public bool _fullScreen = true;
|
||||
public float _x = 0.0f;
|
||||
public float _y = 0.0f;
|
||||
public float _width = 1.0f;
|
||||
public float _height = 1.0f;
|
||||
|
||||
public bool _flipX;
|
||||
public bool _flipY;
|
||||
|
||||
private static int _propApplyGamma;
|
||||
private static int _propFlip;
|
||||
private static Shader _shaderGammaConversion;
|
||||
private static Shader _shaderGammaConversionTransparent;
|
||||
private Material _material;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (_propApplyGamma == 0)
|
||||
{
|
||||
_propApplyGamma = Shader.PropertyToID("_ApplyGamma");
|
||||
_propFlip = Shader.PropertyToID("_Flip");
|
||||
}
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Disabling this lets you skip the GUI layout phase.
|
||||
this.useGUILayout = false;
|
||||
|
||||
if (_shaderGammaConversion == null)
|
||||
{
|
||||
_shaderGammaConversion = Shader.Find("Hidden/AVProLiveCamera/IMGUI");
|
||||
}
|
||||
if (_shaderGammaConversionTransparent == null)
|
||||
{
|
||||
_shaderGammaConversionTransparent = Shader.Find("Hidden/AVProLiveCamera/IMGUI Transparent");
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
// Destroy existing material
|
||||
if (_material != null)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
Material.DestroyImmediate(_material);
|
||||
#else
|
||||
Material.Destroy(_material);
|
||||
#endif
|
||||
_material = null;
|
||||
}
|
||||
}
|
||||
|
||||
private Shader GetRequiredShader()
|
||||
{
|
||||
Shader result = null;
|
||||
|
||||
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
||||
{
|
||||
if (_liveCamera != null && _liveCamera.Device != null && _liveCamera.Device.SupportsTransparency)
|
||||
{
|
||||
result = _shaderGammaConversionTransparent;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = _shaderGammaConversion;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
// Get required shader
|
||||
Shader currentShader = null;
|
||||
if (_material != null)
|
||||
{
|
||||
currentShader = _material.shader;
|
||||
}
|
||||
Shader nextShader = GetRequiredShader();
|
||||
|
||||
// If the shader requirement has changed
|
||||
if (currentShader != nextShader)
|
||||
{
|
||||
// Destroy existing material
|
||||
if (_material != null)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
Material.DestroyImmediate(_material);
|
||||
#else
|
||||
Material.Destroy(_material);
|
||||
#endif
|
||||
_material = null;
|
||||
}
|
||||
|
||||
// Create new material
|
||||
if (nextShader != null)
|
||||
{
|
||||
_material = new Material(nextShader);
|
||||
if (_material.HasProperty(_propApplyGamma))
|
||||
{
|
||||
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
||||
{
|
||||
_material.EnableKeyword("APPLY_GAMMA");
|
||||
}
|
||||
else
|
||||
{
|
||||
_material.DisableKeyword("APPLY_GAMMA");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (_liveCamera == null)
|
||||
return;
|
||||
|
||||
_x = Mathf.Clamp01(_x);
|
||||
_y = Mathf.Clamp01(_y);
|
||||
_width = Mathf.Clamp01(_width);
|
||||
_height = Mathf.Clamp01(_height);
|
||||
|
||||
if (_liveCamera.OutputTexture != null)
|
||||
{
|
||||
GUI.depth = _depth;
|
||||
GUI.color = _color;
|
||||
|
||||
Rect rect;
|
||||
if (_fullScreen)
|
||||
rect = new Rect(0.0f, 0.0f, Screen.width, Screen.height);
|
||||
else
|
||||
rect = new Rect(_x * (Screen.width - 1), _y * (Screen.height - 1), _width * Screen.width, _height * Screen.height);
|
||||
|
||||
if (_material != null)
|
||||
{
|
||||
Vector2 flip = Vector2.one;
|
||||
if (_flipX)
|
||||
{
|
||||
flip.x = -1f;
|
||||
}
|
||||
if (_flipY)
|
||||
{
|
||||
flip.y = -1f;
|
||||
}
|
||||
_material.SetVector(_propFlip, flip);
|
||||
DrawTexture(rect, _liveCamera.OutputTexture, _scaleMode, _material);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_flipX || _flipY)
|
||||
{
|
||||
Vector2 pivot = new Vector2(rect.x + (rect.width / 2), rect.y + (rect.height / 2));
|
||||
Vector2 scale = Vector2.one;
|
||||
if (_flipX)
|
||||
scale.x = -1.0f;
|
||||
if (_flipY)
|
||||
scale.y = -1.0f;
|
||||
GUIUtility.ScaleAroundPivot(scale, pivot);
|
||||
}
|
||||
|
||||
GUI.DrawTexture(rect, _liveCamera.OutputTexture, _scaleMode, _liveCamera.Device.SupportsTransparency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawTexture(Rect screenRect, Texture texture, ScaleMode scaleMode, Material material)
|
||||
{
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
{
|
||||
float textureWidth = texture.width;
|
||||
float textureHeight = texture.height;
|
||||
|
||||
float aspectRatio = (float)textureWidth / (float)textureHeight;
|
||||
Rect sourceRect = new Rect(0f, 0f, 1f, 1f);
|
||||
switch (scaleMode)
|
||||
{
|
||||
case ScaleMode.ScaleAndCrop:
|
||||
{
|
||||
float screenRatio = screenRect.width / screenRect.height;
|
||||
if (screenRatio > aspectRatio)
|
||||
{
|
||||
float adjust = aspectRatio / screenRatio;
|
||||
sourceRect = new Rect(0f, (1f - adjust) * 0.5f, 1f, adjust);
|
||||
}
|
||||
else
|
||||
{
|
||||
float adjust = screenRatio / aspectRatio;
|
||||
sourceRect = new Rect(0.5f - adjust * 0.5f, 0f, adjust, 1f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ScaleMode.ScaleToFit:
|
||||
{
|
||||
float screenRatio = screenRect.width / screenRect.height;
|
||||
if (screenRatio > aspectRatio)
|
||||
{
|
||||
float adjust = aspectRatio / screenRatio;
|
||||
screenRect = new Rect(screenRect.xMin + screenRect.width * (1f - adjust) * 0.5f, screenRect.yMin, adjust * screenRect.width, screenRect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
float adjust = screenRatio / aspectRatio;
|
||||
screenRect = new Rect(screenRect.xMin, screenRect.yMin + screenRect.height * (1f - adjust) * 0.5f, screenRect.width, adjust * screenRect.height);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ScaleMode.StretchToFill:
|
||||
break;
|
||||
}
|
||||
Graphics.DrawTexture(screenRect, texture, sourceRect, 0, 0, 0, 0, GUI.color, material);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a335bb4a52eaa74d869f7e12790b858
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,117 @@
|
||||
#define TEXTURETEST
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2014-2018 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/Grabber")]
|
||||
public class AVProLiveCameraGrabber : MonoBehaviour
|
||||
{
|
||||
public AVProLiveCamera _camera;
|
||||
private AVProLiveCameraDevice _device;
|
||||
|
||||
private Color32[] _frameData;
|
||||
private int _frameWidth;
|
||||
private int _frameHeight;
|
||||
private GCHandle _frameHandle;
|
||||
private System.IntPtr _framePointer;
|
||||
private uint _lastFrame;
|
||||
|
||||
#if TEXTURETEST
|
||||
private Texture2D _testTexture;
|
||||
#endif
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_camera != null)
|
||||
_device = _camera.Device;
|
||||
|
||||
if (_device != null && _device.IsActive && !_device.IsPaused)
|
||||
{
|
||||
if (_device.CurrentWidth > _frameWidth ||
|
||||
_device.CurrentHeight > _frameHeight)
|
||||
{
|
||||
CreateBuffer(_device.CurrentWidth, _device.CurrentHeight);
|
||||
}
|
||||
uint lastFrame = AVProLiveCameraPlugin.GetLastFrame(_device.DeviceIndex);
|
||||
if (lastFrame != _lastFrame)
|
||||
{
|
||||
_lastFrame = lastFrame;
|
||||
bool result = AVProLiveCameraPlugin.GetFrameAsColor32(_device.DeviceIndex, _framePointer, _frameWidth, _frameHeight);
|
||||
if (result)
|
||||
{
|
||||
#if TEXTURETEST
|
||||
_testTexture.SetPixels32(_frameData);
|
||||
_testTexture.Apply(false, false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateBuffer(int width, int height)
|
||||
{
|
||||
// Free buffer if it's too small
|
||||
if (_frameHandle.IsAllocated && _frameData != null)
|
||||
{
|
||||
if (_frameData.Length < _frameWidth * _frameHeight)
|
||||
{
|
||||
FreeBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
if (_frameData == null)
|
||||
{
|
||||
_frameWidth = width;
|
||||
_frameHeight = height;
|
||||
_frameData = new Color32[_frameWidth * _frameHeight];
|
||||
_frameHandle = GCHandle.Alloc(_frameData, GCHandleType.Pinned);
|
||||
_framePointer = _frameHandle.AddrOfPinnedObject();
|
||||
|
||||
#if TEXTURETEST
|
||||
_testTexture = new Texture2D(_frameWidth, _frameHeight, TextureFormat.ARGB32, false, false);
|
||||
_testTexture.Apply(false, false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private void FreeBuffer()
|
||||
{
|
||||
if (_frameHandle.IsAllocated)
|
||||
{
|
||||
_framePointer = System.IntPtr.Zero;
|
||||
_frameHandle.Free();
|
||||
_frameData = null;
|
||||
}
|
||||
|
||||
#if TEXTURETEST
|
||||
if (_testTexture)
|
||||
{
|
||||
Texture2D.DestroyImmediate(_testTexture);
|
||||
_testTexture = null;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
FreeBuffer();
|
||||
}
|
||||
|
||||
#if TEXTURETEST
|
||||
void OnGUI()
|
||||
{
|
||||
if (_testTexture)
|
||||
{
|
||||
GUI.depth = 1;
|
||||
GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), _testTexture, ScaleMode.ScaleToFit, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8fe2a09a366a1ec4cbe1afa8968d5075
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,328 @@
|
||||
using UnityEngine;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/Manager (required)")]
|
||||
public class AVProLiveCameraManager : MonoBehaviour
|
||||
{
|
||||
private static AVProLiveCameraManager _instance;
|
||||
|
||||
public bool _supportHotSwapping = false;
|
||||
|
||||
// If this is false then only modes that are natively supported are returned (eg RGB32)
|
||||
// If this is true then all modes are returned and colour format conversion is attempted
|
||||
public bool _supportInternalFormatConversion = true;
|
||||
|
||||
// Format conversion
|
||||
public Shader _shaderBGRA32;
|
||||
public Shader _shaderMONO8;
|
||||
public Shader _shaderYUY2;
|
||||
public Shader _shaderUYVY;
|
||||
public Shader _shaderYVYU;
|
||||
public Shader _shaderHDYC;
|
||||
public Shader _shaderI420;
|
||||
public Shader _shaderYV12;
|
||||
public Shader _shaderDeinterlace;
|
||||
|
||||
private bool _isInitialised;
|
||||
private List<AVProLiveCameraDevice> _devices;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
public static AVProLiveCameraManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = (AVProLiveCameraManager)GameObject.FindObjectOfType(typeof(AVProLiveCameraManager));
|
||||
if (_instance == null)
|
||||
{
|
||||
Debug.LogError("[AVProLiveCamera] AVProLiveCameraManager component required");
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_instance._isInitialised)
|
||||
_instance.Init();
|
||||
}
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public int NumDevices
|
||||
{
|
||||
get { if (_devices != null) return _devices.Count; return 0; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (!_isInitialised)
|
||||
{
|
||||
_instance = this;
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
Deinit();
|
||||
}
|
||||
|
||||
protected bool Init()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (AVProLiveCameraPlugin.Init(_supportInternalFormatConversion))
|
||||
{
|
||||
Debug.Log("[AVProLiveCamera] version " + AVProLiveCameraPlugin.GetPluginVersionString() + " initialised. " + SystemInfo.graphicsDeviceName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[AVProLiveCamera] failed to initialise.");
|
||||
this.enabled = false;
|
||||
Deinit();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (System.DllNotFoundException e)
|
||||
{
|
||||
Debug.Log("[AVProLiveCamera] Unity couldn't find the DLL, did you move the 'Plugins' folder to the root of your project?");
|
||||
throw e;
|
||||
}
|
||||
|
||||
GetConversionMethod();
|
||||
EnumDevices();
|
||||
|
||||
_isInitialised = true;
|
||||
|
||||
return _isInitialised;
|
||||
}
|
||||
|
||||
|
||||
private void GetConversionMethod()
|
||||
{
|
||||
bool swapRedBlue = false;
|
||||
if (SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 11"))
|
||||
{
|
||||
swapRedBlue = true;
|
||||
}
|
||||
|
||||
if (swapRedBlue)
|
||||
{
|
||||
Shader.DisableKeyword("SWAP_RED_BLUE_OFF");
|
||||
Shader.EnableKeyword("SWAP_RED_BLUE_ON");
|
||||
}
|
||||
else
|
||||
{
|
||||
Shader.DisableKeyword("SWAP_RED_BLUE_ON");
|
||||
Shader.EnableKeyword("SWAP_RED_BLUE_OFF");
|
||||
}
|
||||
|
||||
Shader.DisableKeyword("AVPRO_GAMMACORRECTION");
|
||||
Shader.EnableKeyword("AVPRO_GAMMACORRECTION_OFF");
|
||||
if (QualitySettings.activeColorSpace == ColorSpace.Linear)
|
||||
{
|
||||
Shader.DisableKeyword("AVPRO_GAMMACORRECTION_OFF");
|
||||
Shader.EnableKeyword("AVPRO_GAMMACORRECTION");
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_supportHotSwapping)
|
||||
{
|
||||
if (AVProLiveCameraPlugin.UpdateDevicesConnected())
|
||||
{
|
||||
// Add any new devices
|
||||
AddNewDevices();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
private void OnRenderObject()
|
||||
{
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
GL.IssuePluginEvent(_renderFunc, AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateAllTextures);
|
||||
#else
|
||||
GL.IssuePluginEvent(AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateAllTextures);
|
||||
#endif
|
||||
}*/
|
||||
|
||||
private void AddNewDevices()
|
||||
{
|
||||
bool isDeviceAdded = false;
|
||||
|
||||
int numDevices = AVProLiveCameraPlugin.GetNumDevices();
|
||||
for (int i = 0; i < numDevices; i++)
|
||||
{
|
||||
string deviceGUID;
|
||||
if (!AVProLiveCameraPlugin.GetDeviceGUID(i, out deviceGUID))
|
||||
continue;
|
||||
|
||||
AVProLiveCameraDevice device = FindDeviceWithGUID(deviceGUID);
|
||||
if (device == null)
|
||||
{
|
||||
string deviceName;
|
||||
if (!AVProLiveCameraPlugin.GetDeviceName(i, out deviceName))
|
||||
continue;
|
||||
|
||||
int numModes = AVProLiveCameraPlugin.GetNumModes(i);
|
||||
if (numModes > 0)
|
||||
{
|
||||
device = new AVProLiveCameraDevice(deviceName.ToString(), deviceGUID.ToString(), i);
|
||||
_devices.Add(device);
|
||||
isDeviceAdded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isDeviceAdded)
|
||||
{
|
||||
this.SendMessage("NewDeviceAdded", null, SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
private AVProLiveCameraDevice FindDeviceWithGUID(string guid)
|
||||
{
|
||||
AVProLiveCameraDevice result = null;
|
||||
|
||||
foreach (AVProLiveCameraDevice device in _devices)
|
||||
{
|
||||
if (device.GUID == guid)
|
||||
{
|
||||
result = device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void EnumDevices()
|
||||
{
|
||||
ClearDevices();
|
||||
_devices = new List<AVProLiveCameraDevice>(8);
|
||||
int numDevices = AVProLiveCameraPlugin.GetNumDevices();
|
||||
for (int i = 0; i < numDevices; i++)
|
||||
{
|
||||
string deviceName;
|
||||
if (!AVProLiveCameraPlugin.GetDeviceName(i, out deviceName))
|
||||
continue;
|
||||
|
||||
string deviceGUID;
|
||||
if (!AVProLiveCameraPlugin.GetDeviceGUID(i, out deviceGUID))
|
||||
continue;
|
||||
|
||||
int numModes = AVProLiveCameraPlugin.GetNumModes(i);
|
||||
if (numModes > 0)
|
||||
{
|
||||
AVProLiveCameraDevice device = new AVProLiveCameraDevice(deviceName.ToString(), deviceGUID.ToString(), i);
|
||||
_devices.Add(device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearDevices()
|
||||
{
|
||||
if (_devices != null)
|
||||
{
|
||||
for (int i = 0; i < _devices.Count; i++)
|
||||
{
|
||||
_devices[i].Close();
|
||||
_devices[i].Dispose();
|
||||
}
|
||||
_devices.Clear();
|
||||
_devices = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Deinit()
|
||||
{
|
||||
ClearDevices();
|
||||
_instance = null;
|
||||
_isInitialised = false;
|
||||
|
||||
AVProLiveCameraPlugin.Deinit();
|
||||
}
|
||||
|
||||
public Shader GetDeinterlaceShader()
|
||||
{
|
||||
return _shaderDeinterlace;
|
||||
}
|
||||
|
||||
public Shader GetPixelConversionShader(AVProLiveCameraPlugin.VideoFrameFormat format)
|
||||
{
|
||||
Shader result = null;
|
||||
switch (format)
|
||||
{
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.YUV_422_YUY2:
|
||||
result = _shaderYUY2;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.YUV_422_UYVY:
|
||||
result = _shaderUYVY;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.YUV_422_YVYU:
|
||||
result = _shaderYVYU;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.YUV_422_HDYC:
|
||||
result = _shaderHDYC;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.RAW_BGRA32:
|
||||
result = _shaderBGRA32;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.RAW_MONO8:
|
||||
result = _shaderMONO8;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.YUV_420_PLANAR_I420:
|
||||
result = _shaderI420;
|
||||
break;
|
||||
case AVProLiveCameraPlugin.VideoFrameFormat.YUV_420_PLANAR_YV12:
|
||||
result = _shaderYV12;
|
||||
break;
|
||||
default:
|
||||
Debug.LogError("[AVProLiveCamera] Unknown video format '" + format);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public AVProLiveCameraDevice GetDevice(int index)
|
||||
{
|
||||
AVProLiveCameraDevice result = null;
|
||||
|
||||
if (index >= 0 && index < _devices.Count)
|
||||
result = _devices[index];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public AVProLiveCameraDevice GetDevice(string name)
|
||||
{
|
||||
AVProLiveCameraDevice result = null;
|
||||
int numDevices = NumDevices;
|
||||
for (int i = 0; i < numDevices; i++)
|
||||
{
|
||||
AVProLiveCameraDevice device = GetDevice(i);
|
||||
if (device.Name == name)
|
||||
{
|
||||
result = device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edba0400f2985f145bfd6428f24d2110
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences:
|
||||
- _shaderBGRA32: {fileID: 4800000, guid: 55de6cd535b200d4c9e41052d04ec1e5, type: 3}
|
||||
- _shaderMONO8: {fileID: 4800000, guid: 48acad89159eb1e448777379baab7384, type: 3}
|
||||
- _shaderYUY2: {fileID: 4800000, guid: d1ab837474c2da44594e57fab5f4d831, type: 3}
|
||||
- _shaderUYVY: {fileID: 4800000, guid: cae66dddac87aba4d8af6f0f8829133b, type: 3}
|
||||
- _shaderYVYU: {fileID: 4800000, guid: add9070511111234fb8d9e7048c60b5c, type: 3}
|
||||
- _shaderHDYC: {fileID: 4800000, guid: d15eca7ae06474249b354472a6bf9265, type: 3}
|
||||
- _shaderI420: {fileID: 4800000, guid: 3e319fd1d6f9b4a47b871fb185c665e7, type: 3}
|
||||
- _shaderYV12: {fileID: 4800000, guid: 04afacd8ed181b341910528e6b31102a, type: 3}
|
||||
- _shaderDeinterlace: {fileID: 4800000, guid: 33f55a5d4bd45ae40abfc13543f7bada,
|
||||
type: 3}
|
||||
executionOrder: -100
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,102 @@
|
||||
using UnityEngine;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/Material Apply")]
|
||||
public class AVProLiveCameraMaterialApply : MonoBehaviour
|
||||
{
|
||||
[SerializeField] AVProLiveCamera _liveCamera = null;
|
||||
[SerializeField] Material _material = null;
|
||||
[SerializeField] string _texturePropertyName = "_MainTex";
|
||||
|
||||
private int _propTexture = -1;
|
||||
private Texture _lastTexture;
|
||||
|
||||
public AVProLiveCamera LiveCamera
|
||||
{
|
||||
get { return _liveCamera; }
|
||||
set
|
||||
{
|
||||
if (_liveCamera != value)
|
||||
{
|
||||
_liveCamera = value;
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Material Material
|
||||
{
|
||||
get { return _material; }
|
||||
set
|
||||
{
|
||||
if (_material != value)
|
||||
{
|
||||
ApplyMapping(null);
|
||||
_material = value;
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string TexturePropertyName
|
||||
{
|
||||
get { return _texturePropertyName; }
|
||||
set
|
||||
{
|
||||
if (_texturePropertyName != value)
|
||||
{
|
||||
ApplyMapping(null);
|
||||
_texturePropertyName = value;
|
||||
_propTexture = Shader.PropertyToID(_texturePropertyName);
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_propTexture = Shader.PropertyToID(_texturePropertyName);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_liveCamera != null && _liveCamera.OutputTexture != null)
|
||||
{
|
||||
ApplyMapping(_liveCamera.OutputTexture);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyMapping(null);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyMapping(Texture texture)
|
||||
{
|
||||
if (_lastTexture != texture)
|
||||
{
|
||||
if (_material != null)
|
||||
{
|
||||
if (_propTexture != -1)
|
||||
{
|
||||
if (!_material.HasProperty(_propTexture))
|
||||
{
|
||||
Debug.LogError(string.Format("[AVProLiveCamera] Material {0} doesn't have texture property {1}", _material.name, _texturePropertyName), this);
|
||||
}
|
||||
_material.SetTexture(_propTexture, texture);
|
||||
_lastTexture = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
ApplyMapping(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3f963f7811140b46977bceaf97cc51f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,102 @@
|
||||
using UnityEngine;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/Mesh Apply")]
|
||||
public class AVProLiveCameraMeshApply : MonoBehaviour
|
||||
{
|
||||
[SerializeField] AVProLiveCamera _liveCamera = null;
|
||||
[SerializeField] MeshRenderer _mesh = null;
|
||||
[SerializeField] string _texturePropertyName = "_MainTex";
|
||||
|
||||
private int _propTexture = -1;
|
||||
private Texture _lastTexture;
|
||||
|
||||
public AVProLiveCamera LiveCamera
|
||||
{
|
||||
get { return _liveCamera; }
|
||||
set
|
||||
{
|
||||
if (_liveCamera != value)
|
||||
{
|
||||
_liveCamera = value;
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MeshRenderer Mesh
|
||||
{
|
||||
get { return _mesh; }
|
||||
set
|
||||
{
|
||||
if (_mesh != value)
|
||||
{
|
||||
ApplyMapping(null);
|
||||
_mesh = value;
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string TexturePropertyName
|
||||
{
|
||||
get { return _texturePropertyName; }
|
||||
set
|
||||
{
|
||||
if (_texturePropertyName != value)
|
||||
{
|
||||
ApplyMapping(null);
|
||||
_texturePropertyName = value;
|
||||
_propTexture = Shader.PropertyToID(_texturePropertyName);
|
||||
Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_propTexture = Shader.PropertyToID(_texturePropertyName);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_liveCamera != null && _liveCamera.OutputTexture != null)
|
||||
{
|
||||
ApplyMapping(_liveCamera.OutputTexture);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyMapping(null);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyMapping(Texture texture)
|
||||
{
|
||||
if (_lastTexture != texture)
|
||||
{
|
||||
if (_mesh != null)
|
||||
{
|
||||
if (_propTexture != -1)
|
||||
{
|
||||
Material[] materials = _mesh.materials;
|
||||
for (int i = 0; i < materials.Length; i++)
|
||||
{
|
||||
materials[i].SetTexture(_propTexture, texture);
|
||||
}
|
||||
_lastTexture = texture;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
ApplyMapping(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0127c5b720f8b0e41ba028a98f32e5a3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
@ -0,0 +1,308 @@
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_5)
|
||||
#define UNITY_FEATURE_UGUI
|
||||
#endif
|
||||
|
||||
#if UNITY_FEATURE_UGUI
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2014-2018 RenderHeads Ltd. All rights reserverd.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
[AddComponentMenu("AVPro Live Camera/uGUI Component")]
|
||||
public class AVProLiveCameraUGUIComponent : UnityEngine.UI.MaskableGraphic
|
||||
{
|
||||
[SerializeField]
|
||||
public AVProLiveCamera m_liveCamera;
|
||||
|
||||
[SerializeField]
|
||||
public Rect m_UVRect = new Rect(0f, 0f, 1f, 1f);
|
||||
|
||||
[SerializeField]
|
||||
public bool _setNativeSize = false;
|
||||
|
||||
[SerializeField]
|
||||
public bool _keepAspectRatio = true;
|
||||
|
||||
[SerializeField]
|
||||
public Texture _defaultTexture;
|
||||
|
||||
private int _lastWidth;
|
||||
private int _lastHeight;
|
||||
private Texture _lastTexture;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the texture used to draw this Graphic.
|
||||
/// </summary>
|
||||
public override Texture mainTexture
|
||||
{
|
||||
get
|
||||
{
|
||||
Texture result = Texture2D.whiteTexture;
|
||||
if (HasValidTexture())
|
||||
{
|
||||
result = m_liveCamera.OutputTexture;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_defaultTexture != null)
|
||||
{
|
||||
result = _defaultTexture;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasValidTexture()
|
||||
{
|
||||
return (m_liveCamera != null && m_liveCamera.OutputTexture != null);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (mainTexture == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_setNativeSize)
|
||||
{
|
||||
SetNativeSize();
|
||||
}
|
||||
if (HasValidTexture())
|
||||
{
|
||||
if (mainTexture.width != _lastWidth ||
|
||||
mainTexture.height != _lastHeight)
|
||||
{
|
||||
_lastWidth = mainTexture.width;
|
||||
_lastHeight = mainTexture.height;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
if (mainTexture != _lastTexture)
|
||||
{
|
||||
SetMaterialDirty();
|
||||
_lastTexture = mainTexture;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Texture to be used.
|
||||
/// </summary>
|
||||
public AVProLiveCamera source
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_liveCamera;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (m_liveCamera == value)
|
||||
return;
|
||||
|
||||
m_liveCamera = value;
|
||||
//SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UV rectangle used by the texture.
|
||||
/// </summary>
|
||||
public Rect uvRect
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_UVRect;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (m_UVRect == value)
|
||||
return;
|
||||
m_UVRect = value;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adjust the scale of the Graphic to make it pixel-perfect.
|
||||
/// </summary>
|
||||
|
||||
[ContextMenu("Set Native Size")]
|
||||
public override void SetNativeSize()
|
||||
{
|
||||
Texture tex = mainTexture;
|
||||
if (tex != null)
|
||||
{
|
||||
int w = Mathf.RoundToInt(tex.width * uvRect.width);
|
||||
int h = Mathf.RoundToInt(tex.height * uvRect.height);
|
||||
rectTransform.anchorMax = rectTransform.anchorMin;
|
||||
rectTransform.sizeDelta = new Vector2(w, h);
|
||||
}
|
||||
}
|
||||
|
||||
// OnFillVBO deprecated by 5.2
|
||||
// OnPopulateMesh(Mesh mesh) deprecated by 5.2 patch 1
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
/* protected override void OnPopulateMesh(Mesh mesh)
|
||||
{
|
||||
List<UIVertex> verts = new List<UIVertex>();
|
||||
_OnFillVBO( verts );
|
||||
|
||||
var quad = new UIVertex[4];
|
||||
for (int i = 0; i < vbo.Count; i += 4)
|
||||
{
|
||||
vbo.CopyTo(i, quad, 0, 4);
|
||||
vh.AddUIVertexQuad(quad);
|
||||
}
|
||||
vh.FillMesh( toFill );
|
||||
}*/
|
||||
protected override void OnPopulateMesh(VertexHelper vh)
|
||||
{
|
||||
vh.Clear();
|
||||
|
||||
List<UIVertex> aVerts = new List<UIVertex>();
|
||||
_OnFillVBO(aVerts);
|
||||
|
||||
List<int> aIndicies = new List<int>(new int[] { 0, 1, 2, 2, 3, 0 });
|
||||
vh.AddUIVertexStream(aVerts, aIndicies);
|
||||
}
|
||||
#else
|
||||
protected override void OnFillVBO(List<UIVertex> vbo)
|
||||
{
|
||||
_OnFillVBO( vbo );
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Update all renderer data.
|
||||
/// </summary>
|
||||
protected void _OnFillVBO(List<UIVertex> vbo)
|
||||
{
|
||||
/*Texture tex = mainTexture;
|
||||
|
||||
int texWidth = 4;
|
||||
int texHeight = 4;
|
||||
|
||||
if (HasValidTexture())
|
||||
{
|
||||
|
||||
}
|
||||
if (tex != null)
|
||||
{
|
||||
texWidth = tex.width;
|
||||
texHeight = tex.height;
|
||||
}*/
|
||||
|
||||
{
|
||||
/*Vector4 v = Vector4.zero;
|
||||
|
||||
int w = Mathf.RoundToInt(tex.width * uvRect.width);
|
||||
int h = Mathf.RoundToInt(tex.height * uvRect.height);
|
||||
|
||||
float paddedW = ((w & 1) == 0) ? w : w + 1;
|
||||
float paddedH = ((h & 1) == 0) ? h : h + 1;
|
||||
|
||||
v.x = 0f;
|
||||
v.y = 0f;
|
||||
v.z = w / paddedW;
|
||||
v.w = h / paddedH;
|
||||
|
||||
v.x -= rectTransform.pivot.x;
|
||||
v.y -= rectTransform.pivot.y;
|
||||
v.z -= rectTransform.pivot.x;
|
||||
v.w -= rectTransform.pivot.y;
|
||||
|
||||
v.x *= rectTransform.rect.width;
|
||||
v.y *= rectTransform.rect.height;
|
||||
v.z *= rectTransform.rect.width;
|
||||
v.w *= rectTransform.rect.height;*/
|
||||
|
||||
Vector4 v = GetDrawingDimensions(_keepAspectRatio);
|
||||
|
||||
vbo.Clear();
|
||||
|
||||
var vert = UIVertex.simpleVert;
|
||||
|
||||
vert.position = new Vector2(v.x, v.y);
|
||||
vert.uv0 = new Vector2(m_UVRect.xMin, m_UVRect.yMin);
|
||||
vert.color = color;
|
||||
vbo.Add(vert);
|
||||
|
||||
vert.position = new Vector2(v.x, v.w);
|
||||
vert.uv0 = new Vector2(m_UVRect.xMin, m_UVRect.yMax);
|
||||
vert.color = color;
|
||||
vbo.Add(vert);
|
||||
|
||||
vert.position = new Vector2(v.z, v.w);
|
||||
vert.uv0 = new Vector2(m_UVRect.xMax, m_UVRect.yMax);
|
||||
vert.color = color;
|
||||
vbo.Add(vert);
|
||||
|
||||
vert.position = new Vector2(v.z, v.y);
|
||||
vert.uv0 = new Vector2(m_UVRect.xMax, m_UVRect.yMin);
|
||||
vert.color = color;
|
||||
vbo.Add(vert);
|
||||
}
|
||||
}
|
||||
|
||||
//Added this method from Image.cs to do the keep aspect ratio
|
||||
private Vector4 GetDrawingDimensions(bool shouldPreserveAspect)
|
||||
{
|
||||
Vector4 returnSize = Vector4.zero;
|
||||
|
||||
if (mainTexture)
|
||||
{
|
||||
var padding = Vector4.zero;
|
||||
var textureSize = new Vector2(mainTexture.width, mainTexture.height);
|
||||
|
||||
Rect r = GetPixelAdjustedRect();
|
||||
|
||||
int spriteW = Mathf.RoundToInt(textureSize.x);
|
||||
int spriteH = Mathf.RoundToInt(textureSize.y);
|
||||
|
||||
var size = new Vector4(padding.x / spriteW,
|
||||
padding.y / spriteH,
|
||||
(spriteW - padding.z) / spriteW,
|
||||
(spriteH - padding.w) / spriteH);
|
||||
|
||||
if (shouldPreserveAspect && textureSize.sqrMagnitude > 0.0f)
|
||||
{
|
||||
var spriteRatio = textureSize.x / textureSize.y;
|
||||
var rectRatio = r.width / r.height;
|
||||
|
||||
if (spriteRatio > rectRatio)
|
||||
{
|
||||
var oldHeight = r.height;
|
||||
r.height = r.width * (1.0f / spriteRatio);
|
||||
r.y += (oldHeight - r.height) * rectTransform.pivot.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldWidth = r.width;
|
||||
r.width = r.height * spriteRatio;
|
||||
r.x += (oldWidth - r.width) * rectTransform.pivot.x;
|
||||
}
|
||||
}
|
||||
|
||||
returnSize = new Vector4(r.x + r.width * size.x,
|
||||
r.y + r.height * size.y,
|
||||
r.x + r.width * size.z,
|
||||
r.y + r.height * size.w);
|
||||
|
||||
}
|
||||
|
||||
return returnSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0da62b8b54c37da4a8826e97a78df85f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 69ab7b920ec13a9499cf847d04474e5c, type: 3}
|
||||
userData:
|
||||
2
Assets/AVProLiveCamera/Scripts/Interface.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: e187405658fcc4640af18423f71d2868
|
||||
@ -0,0 +1,347 @@
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
public enum YCbCrRange
|
||||
{
|
||||
Limited,
|
||||
Full,
|
||||
};
|
||||
|
||||
public class AVProLiveCameraPlugin
|
||||
{
|
||||
public enum VideoFrameFormat
|
||||
{
|
||||
RAW_BGRA32,
|
||||
|
||||
YUV_422_YUY2,
|
||||
YUV_422_UYVY,
|
||||
YUV_422_YVYU,
|
||||
YUV_422_HDYC,
|
||||
|
||||
YUV_420_PLANAR_YV12,
|
||||
YUV_420_PLANAR_I420,
|
||||
|
||||
RAW_RGB24,
|
||||
RAW_MONO8,
|
||||
|
||||
RGB_10BPP,
|
||||
YUV_10BPP_V210,
|
||||
|
||||
MPEG,
|
||||
}
|
||||
|
||||
public enum VideoInput
|
||||
{
|
||||
None,
|
||||
Video_Tuner,
|
||||
Video_Composite,
|
||||
Video_SVideo,
|
||||
Video_RGB,
|
||||
Video_YRYBY,
|
||||
Video_Serial_Digital,
|
||||
Video_Parallel_Digital,
|
||||
Video_SCSI,
|
||||
Video_AUX,
|
||||
Video_1394,
|
||||
Video_USB,
|
||||
Video_Decoder,
|
||||
Video_Encoder,
|
||||
Video_SCART,
|
||||
Video_Black,
|
||||
}
|
||||
|
||||
// Used by GL.IssuePluginEvent
|
||||
public const int PluginID = 0xFA20000;
|
||||
public enum PluginEvent
|
||||
{
|
||||
UpdateAllTextures = 0x0001000,
|
||||
UpdateOneTexture = 0x0002000,
|
||||
}
|
||||
|
||||
#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern System.IntPtr GetRenderEventFunc();
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// System Initialisation
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool Init(bool supportInternalConversion);
|
||||
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void Deinit();
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
private static extern System.IntPtr GetPluginVersion();
|
||||
|
||||
public static string GetPluginVersionString()
|
||||
{
|
||||
return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(GetPluginVersion());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Device Enumeration & Configuration
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetNumDevices();
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool HasDeviceConfigWindow(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool ShowDeviceConfigWindow(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera", CharSet = CharSet.Unicode)]
|
||||
private static extern bool GetDeviceName(int index, StringBuilder nameBuffer, int nameBufferLength);
|
||||
|
||||
public static bool GetDeviceName(int index, out string name)
|
||||
{
|
||||
StringBuilder nameStr = new StringBuilder(512);
|
||||
if (GetDeviceName(index, nameStr, nameStr.Capacity))
|
||||
{
|
||||
name = nameStr.ToString();
|
||||
return true;
|
||||
}
|
||||
name = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("AVProLiveCamera", CharSet = CharSet.Unicode)]
|
||||
private static extern bool GetDeviceGUID(int index, StringBuilder nameBuffer, int nameBufferLength);
|
||||
|
||||
public static bool GetDeviceGUID(int index, out string name)
|
||||
{
|
||||
StringBuilder nameStr = new StringBuilder(512);
|
||||
if (GetDeviceGUID(index, nameStr, nameStr.Capacity))
|
||||
{
|
||||
name = nameStr.ToString();
|
||||
return true;
|
||||
}
|
||||
name = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool IsDeviceConnected(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool UpdateDevicesConnected();
|
||||
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetNumModes(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
private static extern bool GetModeInfo(int deviceIndex, int modeIndex, out int width, out int height, out int frameRateCount, out int frameRateIndex, StringBuilder format);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
private static extern bool GetModeFrameRates(int deviceIndex, int modeIndex, int frameRateCount, [MarshalAs(UnmanagedType.LPArray)] float[] frameRates);
|
||||
|
||||
public static bool GetModeInfo(int deviceIndex, int modeIndex, out int width, out int height, out float[] frameRates, out int frameRateIndex, out string format)
|
||||
{
|
||||
StringBuilder formatStr = new StringBuilder(512);
|
||||
|
||||
int frameRateCount = 0;
|
||||
if (GetModeInfo(deviceIndex, modeIndex, out width, out height, out frameRateCount, out frameRateIndex, formatStr))
|
||||
{
|
||||
format = formatStr.ToString();
|
||||
if (frameRateCount > 0 && frameRateCount < 1024)
|
||||
{
|
||||
frameRates = new float[frameRateCount];
|
||||
if (GetModeFrameRates(deviceIndex, modeIndex, frameRateCount, frameRates))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
UnityEngine.Debug.LogWarning("[AVProLiveCamera] Failed to retrieve frame rates");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UnityEngine.Debug.LogWarning("[AVProLiveCamera] FrameRates out of range");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UnityEngine.Debug.LogWarning("[AVProLiveCamera] Failed to retrieve mode info");
|
||||
}
|
||||
frameRates = null;
|
||||
format = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetNumVideoInputs(int deviceIndex);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
private static extern bool GetVideoInputName(int deviceIndex, int inputIndex, StringBuilder name);
|
||||
|
||||
public static bool GetVideoInputName(int deviceIndex, int inputIndex, out string name)
|
||||
{
|
||||
StringBuilder nameStr = new StringBuilder(512);
|
||||
if (GetVideoInputName(deviceIndex, inputIndex, nameStr))
|
||||
{
|
||||
name = nameStr.ToString();
|
||||
return true;
|
||||
}
|
||||
name = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void SetVideoInputByIndex(int deviceIndex, int inputIndex);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Device Settings
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetNumDeviceVideoSettings(int deviceIndex);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
private static extern bool GetDeviceVideoSettingInfo(int deviceIndex, int settingIndex, out int settingType, out int dataType, StringBuilder name, out bool canAutomatic);
|
||||
|
||||
public static bool GetDeviceVideoSettingInfo(int deviceIndex, int settingIndex, out int settingType, out int dataType, out string name, out bool canAutomatic)
|
||||
{
|
||||
StringBuilder nameStr = new StringBuilder(512);
|
||||
if (GetDeviceVideoSettingInfo(deviceIndex, settingIndex, out settingType, out dataType, nameStr, out canAutomatic))
|
||||
{
|
||||
name = nameStr.ToString();
|
||||
return true;
|
||||
}
|
||||
name = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool GetDeviceVideoSettingBoolean(int deviceIndex, int settingIndex, out bool defaultValue, out bool currentValue, out bool isAutomatic);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool GetDeviceVideoSettingFloat(int deviceIndex, int settingIndex, out float defaultValue, out float currentValue, out float minValue, out float maxValue, out bool isAutomatic);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool UpdateDeviceVideoSettingValue(int deviceIndex, int settingIndex, out float currentValue, out bool isAutomatic);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void ApplyDeviceVideoSettingValue(int deviceIndex, int settingIndex, float currentValue, bool isAutomatic);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void SetDeviceClockMode(int deviceIndex, bool useDefaultClock);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Open & Close Devices
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool StartDevice(int index, int modeIndex, int frameRateIndex, int videoInputIndex, bool preferPreviewPin);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void StopDevice(int index);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Play & Pause
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool Play(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void Pause(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void Stop(int index);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Current State of Device
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetWidth(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetHeight(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern float GetFrameRate(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern long GetFrameDurationHNS(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetFormat(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
private static extern bool GetDeviceFormat(int index, StringBuilder format);
|
||||
|
||||
public static string GetDeviceFormat(int deviceIndex)
|
||||
{
|
||||
string result = "Unknown";
|
||||
StringBuilder nameStr = new StringBuilder(512);
|
||||
if (GetDeviceFormat(deviceIndex, nameStr))
|
||||
{
|
||||
result = nameStr.ToString();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool IsFrameTopDown(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern uint GetLastFrame(int index);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Frame Updating
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool SetActive(int index, bool active);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool IsNextFrameReadyForGrab(int index);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern int GetLastFrameUploaded(int handle);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool UpdateTextureGL(int index, int textureID);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool GetFramePixels(int index, System.IntPtr buffer, int bufferIndex, int bufferWidth, int bufferHeight);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void SetTexturePointer(int index, int bufferIndex, System.IntPtr texturePtr);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern bool GetFrameAsColor32(int index, System.IntPtr bufferPtr, int bufferWidth, int bufferHeight);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Live Stats
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern float GetCaptureFrameRate(int deviceIndex);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern uint GetCaptureFramesDropped(int deviceIndex);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Internal Frame Buffering
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern void SetFrameBufferSize(int deviceIndex, int read, int write);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern long GetLastFrameBufferedTime(int deviceIndex);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern System.IntPtr GetLastFrameBuffered(int deviceIndex);
|
||||
|
||||
[DllImport("AVProLiveCamera")]
|
||||
public static extern System.IntPtr GetFrameFromBufferAtTime(int deviceIndex, long time);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 85c1348d501b0fe4d91f4b0ed7d6d9d4
|
||||
2
Assets/AVProLiveCamera/Scripts/Wrapper.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 451a0b7e73c47ad468d1ae117b94c9aa
|
||||
1027
Assets/AVProLiveCamera/Scripts/Wrapper/AVProLiveCameraDevice.cs
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 7f73ae973323450439d2f0989433ef9b
|
||||
@ -0,0 +1,137 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace RenderHeads.Media.AVProLiveCamera
|
||||
{
|
||||
public class AVProLiveCameraDeviceMode
|
||||
{
|
||||
private AVProLiveCameraDevice _device;
|
||||
private int _internalIndex;
|
||||
private int _width, _height;
|
||||
private int _frameRateIndex;
|
||||
private float[] _frameRates;
|
||||
private string _format;
|
||||
|
||||
public int Width
|
||||
{
|
||||
get { return _width; }
|
||||
}
|
||||
|
||||
public int Height
|
||||
{
|
||||
get { return _height; }
|
||||
}
|
||||
|
||||
public float[] FrameRates
|
||||
{
|
||||
get { return _frameRates; }
|
||||
}
|
||||
|
||||
public int FrameRateIndex
|
||||
{
|
||||
get { return _frameRateIndex; }
|
||||
set { if (value >= 0 && value < _frameRates.Length) _frameRateIndex = value; }
|
||||
}
|
||||
|
||||
public float FPS
|
||||
{
|
||||
get { return _frameRates[_frameRateIndex]; }
|
||||
}
|
||||
|
||||
public string Format
|
||||
{
|
||||
get { return _format; }
|
||||
}
|
||||
|
||||
public int InternalIndex
|
||||
{
|
||||
get { return _internalIndex; }
|
||||
}
|
||||
|
||||
public AVProLiveCameraDevice Device
|
||||
{
|
||||
get { return _device; }
|
||||
}
|
||||
|
||||
public void SelectHighestFrameRate()
|
||||
{
|
||||
_frameRateIndex = 0;
|
||||
for (int i = 0; i < _frameRates.Length; i++)
|
||||
{
|
||||
if (_frameRates[i] > FPS)
|
||||
{
|
||||
_frameRateIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal bool HasFrameRate(float frameRate)
|
||||
{
|
||||
bool result = false;
|
||||
for (int i = 0; i < _frameRates.Length; i++)
|
||||
{
|
||||
if (_frameRates[i] == frameRate)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal float HighestFrameRate()
|
||||
{
|
||||
float highestFps = 0f;
|
||||
for (int i = 0; i < _frameRates.Length; i++)
|
||||
{
|
||||
if (_frameRates[i] > highestFps)
|
||||
{
|
||||
highestFps = _frameRates[i];
|
||||
}
|
||||
}
|
||||
return highestFps;
|
||||
}
|
||||
|
||||
internal float GetClosestFrameRate(float frameRate)
|
||||
{
|
||||
float result = float.MinValue;
|
||||
float lowestDelta = 10000f;
|
||||
for (int i = 0; i < _frameRates.Length; i++)
|
||||
{
|
||||
float d = UnityEngine.Mathf.Abs(_frameRates[i] - frameRate);
|
||||
if (d < lowestDelta)
|
||||
{
|
||||
result = _frameRates[i];
|
||||
lowestDelta = d;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SelectClosestFrameRate(float frameRate)
|
||||
{
|
||||
float lowestDelta = 10000f;
|
||||
for (int i = 0; i < _frameRates.Length; i++)
|
||||
{
|
||||
float d = UnityEngine.Mathf.Abs(_frameRates[i] - frameRate);
|
||||
if (d < lowestDelta)
|
||||
{
|
||||
_frameRateIndex = i;
|
||||
lowestDelta = d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AVProLiveCameraDeviceMode(AVProLiveCameraDevice device, int internalIndex, int width, int height, float[] frameRates, int defaultFrameRateIndex, string format)
|
||||
{
|
||||
_device = device;
|
||||
_internalIndex = internalIndex;
|
||||
_width = width;
|
||||
_height = height;
|
||||
_frameRates = frameRates;
|
||||
_frameRateIndex = defaultFrameRateIndex;
|
||||
_format = format;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 8cb524bebfe77d54fb1ce26df88e2335
|
||||