Compare commits
191 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
467fa86f59 | ||
|
|
608509aa22 | ||
|
|
9aa488e100 | ||
|
|
4c225c21c9 | ||
|
|
b8b4238b5f | ||
|
|
4d2766ce3f | ||
|
|
f4096ec9fb | ||
|
|
0f43788650 | ||
|
|
1c1381a7ba | ||
|
|
08903cd27a | ||
|
|
d840983829 | ||
|
|
8a6cee9c2d | ||
|
|
f7798f752f | ||
|
|
70cfad90a9 | ||
|
|
c926127e49 | ||
|
|
03469ce429 | ||
|
|
f63e573f04 | ||
|
|
682553a5a2 | ||
|
|
b5fd483d6a | ||
|
|
0d2c0e02f0 | ||
|
|
6f876f65ed | ||
|
|
8434d803bb | ||
|
|
1c332ebca7 | ||
|
|
340e2d5194 | ||
|
|
e397f5eb84 | ||
|
|
c20c09e275 | ||
|
|
a0ca46630e | ||
|
|
5b5995d7d0 | ||
|
|
808a71ed6d | ||
|
|
da072aa9f3 | ||
|
|
7237d283ef | ||
|
|
4a28b5f341 | ||
|
|
10091be4b3 | ||
|
|
c41fe42aa3 | ||
|
|
c0e1967e2e | ||
|
|
f5a8a83c7e | ||
|
|
c251de3a30 | ||
|
|
b0877a49ed | ||
|
|
68d9e30816 | ||
|
|
b8ae1d6c4a | ||
|
|
15624dc0f4 | ||
|
|
06d4edbcb0 | ||
|
|
9ee2d35175 | ||
|
|
0634993bb0 | ||
|
|
6bd892bc4b | ||
|
|
2a631a0a89 | ||
|
|
0833b965e9 | ||
|
|
12726d85dc | ||
|
|
29920b6b94 | ||
|
|
4de8f0ba51 | ||
|
|
476be8243a | ||
|
|
c681e43d65 | ||
|
|
ed24ca2fb2 | ||
|
|
791fa42478 | ||
|
|
11dbb7be57 | ||
|
|
9ed24dd3b1 | ||
|
|
cfbd218374 | ||
|
|
bf7174f406 | ||
|
|
4a761a06f3 | ||
|
|
1effd65aeb | ||
|
|
46cc789be5 | ||
|
|
1053b30d7e | ||
|
|
d58855ff8a | ||
|
|
741e2c0bc1 | ||
|
|
f6ce875463 | ||
|
|
e6407d1c3b | ||
|
|
620a0f3150 | ||
|
|
d519dba120 | ||
|
|
295b41f57b | ||
|
|
6a8bd86d2b | ||
|
|
22bc306732 | ||
|
|
3ed37d1436 | ||
|
|
03419f2918 | ||
|
|
2ee8ba35b7 | ||
|
|
2a536ce018 | ||
|
|
54531a90f3 | ||
|
|
ae8323fe29 | ||
|
|
d23fe2fc3d | ||
|
|
81bc23d0bc | ||
|
|
583af4ff46 | ||
|
|
7e3df8ec2e | ||
|
|
32adf6c2d0 | ||
|
|
a24472bd92 | ||
|
|
cfee22832a | ||
|
|
9c467a0e6f | ||
|
|
87557ed5ff | ||
|
|
67c90073d9 | ||
|
|
ce9c148282 | ||
|
|
8201a22523 | ||
|
|
5cfbd70e0b | ||
|
|
f2b6a99af3 | ||
|
|
c48bf7fecf | ||
|
|
6673734b9c | ||
|
|
3364c19adf | ||
|
|
f7eba2434f | ||
|
|
ddbfad6e95 | ||
|
|
49aef432e7 | ||
|
|
fc81892917 | ||
|
|
306a656c4e | ||
|
|
faf65b4200 | ||
|
|
ab25af516e | ||
|
|
45b0ab2cd8 | ||
|
|
68227e9af6 | ||
|
|
be9871ba92 | ||
|
|
110d5d7bda | ||
|
|
533a4c9f28 | ||
|
|
88e8342d7a | ||
|
|
72376b9e91 | ||
|
|
a10d5aa5c1 | ||
|
|
306185a1e9 | ||
|
|
60889d53f4 | ||
|
|
f207e65952 | ||
|
|
aea8d112c6 | ||
|
|
9f6971dd45 | ||
|
|
1be698af63 | ||
|
|
064db9f137 | ||
|
|
166d172db2 | ||
|
|
95f8099392 | ||
|
|
9c62157c0c | ||
|
|
be79e52135 | ||
|
|
e9c8b4e571 | ||
|
|
77c95ab1bb | ||
|
|
7b3990107d | ||
|
|
5c21b65afe | ||
|
|
e83f43d7fd | ||
|
|
58e14d76d8 | ||
|
|
f8d8e64e46 | ||
|
|
0a39e37659 | ||
|
|
931ff6b2db | ||
|
|
75819f0a7d | ||
|
|
d6ce41f9b6 | ||
|
|
9f8a026c24 | ||
|
|
dc702c6e1d | ||
|
|
5a3af11d08 | ||
|
|
0646621f73 | ||
|
|
c9d6d3ad6a | ||
|
|
78ee75a875 | ||
|
|
c83ce50468 | ||
|
|
3567182a4d | ||
|
|
e466aa65db | ||
|
|
a0edc1a439 | ||
|
|
1eb821b34d | ||
|
|
212d8ccb9b | ||
|
|
fac8fe1ea7 | ||
|
|
f90178f1db | ||
|
|
74e25f2bd7 | ||
|
|
70c126be6c | ||
|
|
f74221bf75 | ||
|
|
3a705732d1 | ||
|
|
804bfb96bd | ||
|
|
63d8f6936d | ||
|
|
e4e4917bcb | ||
|
|
0e205ecef7 | ||
|
|
cda8024b17 | ||
|
|
05085f7d24 | ||
|
|
52eafbe919 | ||
|
|
be1e0c25bb | ||
|
|
372e44d8c1 | ||
|
|
d79eb91333 | ||
|
|
f654df7f5b | ||
|
|
620762dba7 | ||
|
|
43ba445623 | ||
|
|
c7c12de730 | ||
|
|
1086595d6b | ||
|
|
f69fb6a7bb | ||
|
|
b661b4a93f | ||
|
|
8d9ef71829 | ||
|
|
fb7bcbfa5b | ||
|
|
9ed8bb8d5b | ||
|
|
fab67bbc61 | ||
|
|
5fa9f03a0e | ||
|
|
941bb2da91 | ||
|
|
d423e0d1db | ||
|
|
33a55d95bd | ||
|
|
8e2d8d3218 | ||
|
|
6ac1a5ee60 | ||
|
|
15a98cd774 | ||
|
|
06bb971a42 | ||
|
|
217e63d40c | ||
|
|
9e42fb0abf | ||
|
|
9de5064fbe | ||
|
|
2b108bd4b1 | ||
|
|
f9f8b14f46 | ||
|
|
7774290e71 | ||
|
|
a3a7754fb0 | ||
|
|
0accebb657 | ||
|
|
0a38eda14f | ||
|
|
720f74e6f6 | ||
|
|
80fa39f4eb | ||
|
|
22b21ae3f4 | ||
|
|
43153266a0 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -5,6 +5,8 @@
|
||||
/[Bb]uild/
|
||||
/[Ww]iki/
|
||||
/[Mm]isc/
|
||||
/UnityPackageManager
|
||||
/Packages
|
||||
|
||||
# Autogenerated VS/MD solution and project files
|
||||
*.csproj
|
||||
@@ -27,3 +29,5 @@ sysinfo.txt
|
||||
.DS_Store
|
||||
/Assets/AssetStoreTools*
|
||||
/Assets/Extensions*
|
||||
/uDesktopDuplication.log
|
||||
.vs
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48b92326b146fa848beec6f35365b1f4
|
||||
guid: 022a80d652ef0304e84e9d6ac689e21f
|
||||
folderAsset: yes
|
||||
timeCreated: 1477555207
|
||||
timeCreated: 1478353382
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
|
Before Width: | Height: | Size: 967 B After Width: | Height: | Size: 967 B |
119
Assets/uDesktopDuplication/Editor/TextureEditor.cs
Normal file
119
Assets/uDesktopDuplication/Editor/TextureEditor.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Linq;
|
||||
|
||||
namespace uDesktopDuplication
|
||||
{
|
||||
|
||||
[CustomEditor(typeof(Texture))]
|
||||
public class TextureEditor : Editor
|
||||
{
|
||||
Texture texture
|
||||
{
|
||||
get { return target as Texture; }
|
||||
}
|
||||
|
||||
Monitor monitor
|
||||
{
|
||||
get { return texture.monitor; }
|
||||
}
|
||||
|
||||
bool isAvailable
|
||||
{
|
||||
get { return monitor == null || !Application.isPlaying; }
|
||||
}
|
||||
|
||||
bool basicsFolded_ = true;
|
||||
bool invertFolded_ = true;
|
||||
bool clipFolded_ = true;
|
||||
bool matFolded_ = true;
|
||||
|
||||
SerializedProperty invertX_;
|
||||
SerializedProperty invertY_;
|
||||
SerializedProperty useClip_;
|
||||
SerializedProperty clipPos_;
|
||||
SerializedProperty clipScale_;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
invertX_ = serializedObject.FindProperty("invertX_");
|
||||
invertY_ = serializedObject.FindProperty("invertY_");
|
||||
useClip_ = serializedObject.FindProperty("useClip_");
|
||||
clipPos_ = serializedObject.FindProperty("clipPos");
|
||||
clipScale_ = serializedObject.FindProperty("clipScale");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
DrawMonitor();
|
||||
DrawInvert();
|
||||
DrawClip();
|
||||
DrawMaterial();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void Fold(string name, ref bool folded, System.Action func)
|
||||
{
|
||||
folded = Utils.Foldout(name, folded);
|
||||
if (folded) {
|
||||
++EditorGUI.indentLevel;
|
||||
func();
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawMonitor()
|
||||
{
|
||||
Fold("Monitor", ref basicsFolded_, () => {
|
||||
if (isAvailable) {
|
||||
EditorGUILayout.HelpBox("Monitor information is available only in runtime.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
var id = EditorGUILayout.Popup("Monitor", monitor.id, Manager.monitors.Select(x => x.name).ToArray());
|
||||
if (id != monitor.id) { texture.monitorId = id; }
|
||||
EditorGUILayout.IntField("ID", monitor.id);
|
||||
EditorGUILayout.Toggle("Is Primary", monitor.isPrimary);
|
||||
EditorGUILayout.EnumPopup("Rotation", monitor.rotation);
|
||||
EditorGUILayout.Vector2Field("Resolution", new Vector2(monitor.width, monitor.height));
|
||||
EditorGUILayout.Vector2Field("DPI", new Vector2(monitor.dpiX, monitor.dpiY));
|
||||
});
|
||||
}
|
||||
|
||||
void DrawInvert()
|
||||
{
|
||||
Fold("Invert", ref invertFolded_, () => {
|
||||
texture.invertX = EditorGUILayout.Toggle("Invert X", invertX_.boolValue);
|
||||
texture.invertY = EditorGUILayout.Toggle("Invert Y", invertY_.boolValue);
|
||||
});
|
||||
}
|
||||
|
||||
void DrawClip()
|
||||
{
|
||||
Fold("Clip", ref clipFolded_, () => {
|
||||
texture.useClip = EditorGUILayout.Toggle("Use Clip", useClip_.boolValue);
|
||||
EditorGUILayout.PropertyField(clipPos_);
|
||||
EditorGUILayout.PropertyField(clipScale_);
|
||||
});
|
||||
}
|
||||
|
||||
void DrawMaterial()
|
||||
{
|
||||
Fold("Material", ref matFolded_, () => {
|
||||
if (!Application.isPlaying) {
|
||||
EditorGUILayout.HelpBox("These parameters are applied to the shared material when not playing.", MessageType.Info);
|
||||
}
|
||||
texture.meshForwardDirection = (Texture.MeshForwardDirection)EditorGUILayout.EnumPopup("Mesh Forward Direction", texture.meshForwardDirection);
|
||||
texture.bend = EditorGUILayout.Toggle("Use Bend", texture.bend);
|
||||
texture.width = EditorGUILayout.FloatField("Bend Width", texture.width);
|
||||
texture.radius = EditorGUILayout.Slider("Bend Radius", texture.radius, texture.worldWidth / (2 * Mathf.PI), 100f);
|
||||
texture.thickness = EditorGUILayout.Slider("Thickness", texture.thickness, 0f, 30f);
|
||||
texture.culling = (Texture.Culling)EditorGUILayout.EnumPopup("Culling", texture.culling);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
12
Assets/uDesktopDuplication/Editor/TextureEditor.cs.meta
Normal file
12
Assets/uDesktopDuplication/Editor/TextureEditor.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1202a4540abf0ad4781c025339772c4a
|
||||
timeCreated: 1480758898
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/uDesktopDuplication/Editor/Utils.cs
Normal file
46
Assets/uDesktopDuplication/Editor/Utils.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace uDesktopDuplication
|
||||
{
|
||||
|
||||
public static class Utils
|
||||
{
|
||||
public static bool Foldout(string title, bool display)
|
||||
{
|
||||
var style = new GUIStyle("ShurikenModuleTitle");
|
||||
style.font = new GUIStyle(EditorStyles.label).font;
|
||||
style.border = new RectOffset(15, 7, 4, 4);
|
||||
style.fixedHeight = 22;
|
||||
style.contentOffset = new Vector2(20f, -2f);
|
||||
|
||||
var rect = GUILayoutUtility.GetRect(16f, 22f, style);
|
||||
GUI.Box(rect, title, style);
|
||||
|
||||
var e = Event.current;
|
||||
|
||||
var toggleRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f);
|
||||
if (e.type == EventType.Repaint) {
|
||||
EditorStyles.foldout.Draw(toggleRect, false, false, display, false);
|
||||
}
|
||||
|
||||
if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition)) {
|
||||
display = !display;
|
||||
e.Use();
|
||||
}
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
public static void ReadOnlyTextField(string label, string text)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.LabelField(label, GUILayout.Width(EditorGUIUtility.labelWidth - 4));
|
||||
EditorGUILayout.SelectableLabel(text, EditorStyles.textField, GUILayout.Height(EditorGUIUtility.singleLineHeight));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
12
Assets/uDesktopDuplication/Editor/Utils.cs.meta
Normal file
12
Assets/uDesktopDuplication/Editor/Utils.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 278117152a6252546a219a17ef6f21f4
|
||||
timeCreated: 1480759393
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,99 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1000012642892690}
|
||||
m_IsPrefabParent: 1
|
||||
--- !u!1 &1000012642892690
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 4000011474108562}
|
||||
- component: {fileID: 33000012841683532}
|
||||
- component: {fileID: 23000011974915108}
|
||||
- component: {fileID: 114000012274256594}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor Board
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4000011474108562
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012642892690}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1.08, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &23000011974915108
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012642892690}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: c181d333a7bee7a44b94c0f4e02c4bd4, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &33000012841683532
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012642892690}
|
||||
m_Mesh: {fileID: 4300002, guid: d6b30b913257fee4d8246bf7a2620fcd, type: 3}
|
||||
--- !u!114 &114000012274256594
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012642892690}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
@@ -0,0 +1,116 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1000012030065192}
|
||||
m_IsPrefabParent: 1
|
||||
--- !u!1 &1000012030065192
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 4000012948588652}
|
||||
- component: {fileID: 33000012667387780}
|
||||
- component: {fileID: 23000013406986662}
|
||||
- component: {fileID: 114000010662012988}
|
||||
- component: {fileID: 114000012475682042}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor Plane for Displacement Mapping
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4000012948588652
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012030065192}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1, z: 1.08}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!23 &23000013406986662
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012030065192}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 596fd740aeeee0d4cb4f962d4072954e, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &33000012667387780
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012030065192}
|
||||
m_Mesh: {fileID: 4300000, guid: f30f6cfd6aa37554ca886424cada7cbb, type: 3}
|
||||
--- !u!114 &114000010662012988
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012030065192}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
--- !u!114 &114000012475682042
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000012030065192}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 859a2446b86e55c43932212872c82748, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 0
|
||||
displacementFactor: 0.1
|
||||
tessellationMinDist: 0.5
|
||||
tessellationMaxDist: 10
|
||||
tessellationFactor: 25
|
||||
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 033e0db89e0ca1d46a399c953629f67d
|
||||
timeCreated: 1477555367
|
||||
guid: 57d4a6e606848364c9880f2adec16d90
|
||||
timeCreated: 1480074774
|
||||
licenseType: Pro
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,99 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &100100000
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 1
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1000010241636970}
|
||||
m_IsPrefabParent: 1
|
||||
--- !u!1 &1000010241636970
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 4000010860913228}
|
||||
- component: {fileID: 33000013746893738}
|
||||
- component: {fileID: 23000010406152182}
|
||||
- component: {fileID: 114000011004997192}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor Unity Plane
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4000010860913228
|
||||
Transform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000010241636970}
|
||||
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1, z: 1.08}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||
--- !u!23 &23000010406152182
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000010241636970}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: c181d333a7bee7a44b94c0f4e02c4bd4, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &33000013746893738
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000010241636970}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!114 &114000011004997192
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1000010241636970}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42d6b6dbae38a384e882c2c907915139
|
||||
timeCreated: 1478889784
|
||||
licenseType: Pro
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
440
Assets/uDesktopDuplication/Examples/Scenes/Displacement.unity
Normal file
440
Assets/uDesktopDuplication/Examples/Scenes/Displacement.unity
Normal file
@@ -0,0 +1,440 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 0
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 1024
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &79264388
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 79264393}
|
||||
- component: {fileID: 79264392}
|
||||
- component: {fileID: 79264391}
|
||||
- component: {fileID: 79264390}
|
||||
- component: {fileID: 79264389}
|
||||
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 &79264389
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &79264390
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &79264391
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &79264392
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
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_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
m_StereoMirrorMode: 0
|
||||
--- !u!4 &79264393
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -3}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &913398332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 1000012030065192, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 1607746357}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 913398337}
|
||||
- component: {fileID: 913398336}
|
||||
- component: {fileID: 913398335}
|
||||
- component: {fileID: 913398334}
|
||||
- component: {fileID: 913398333}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor Plane for Displacement Mapping
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &913398333
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 114000012475682042, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 1607746357}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 859a2446b86e55c43932212872c82748, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
target: 0
|
||||
displacementFactor: 0.1
|
||||
tessellationMinDist: 0.5
|
||||
tessellationMaxDist: 10
|
||||
tessellationFactor: 25
|
||||
--- !u!114 &913398334
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 114000010662012988, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 1607746357}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
--- !u!23 &913398335
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 23000013406986662, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 1607746357}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 596fd740aeeee0d4cb4f962d4072954e, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &913398336
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 33000012667387780, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 1607746357}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Mesh: {fileID: 4300000, guid: f30f6cfd6aa37554ca886424cada7cbb, type: 3}
|
||||
--- !u!4 &913398337
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 1607746357}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1, z: 1.08}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &1607746357
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000012948588652, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 23000013406986662, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
propertyPath: m_Materials.Array.data[0]
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 596fd740aeeee0d4cb4f962d4072954e, type: 2}
|
||||
- target: {fileID: 114000010662012988, guid: 57d4a6e606848364c9880f2adec16d90,
|
||||
type: 2}
|
||||
propertyPath: m_Enabled
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: 57d4a6e606848364c9880f2adec16d90, type: 2}
|
||||
m_RootGameObject: {fileID: 913398332}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1 &1738296145
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1738296147}
|
||||
- component: {fileID: 1738296146}
|
||||
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 &1738296146
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738296145}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_FalloffTable:
|
||||
m_Table[0]: 0
|
||||
m_Table[1]: 0
|
||||
m_Table[2]: 0
|
||||
m_Table[3]: 0
|
||||
m_Table[4]: 0
|
||||
m_Table[5]: 0
|
||||
m_Table[6]: 0
|
||||
m_Table[7]: 0
|
||||
m_Table[8]: 0
|
||||
m_Table[9]: 0
|
||||
m_Table[10]: 0
|
||||
m_Table[11]: 0
|
||||
m_Table[12]: 0
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1738296147
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738296145}
|
||||
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e1efec2c71c5b94e8522880dd9636c8
|
||||
timeCreated: 1480074355
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
512
Assets/uDesktopDuplication/Examples/Scenes/GetPixels.unity
Normal file
512
Assets/uDesktopDuplication/Examples/Scenes/GetPixels.unity
Normal file
@@ -0,0 +1,512 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &129126780
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 129126782}
|
||||
- component: {fileID: 129126781}
|
||||
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 &129126781
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 129126780}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_FalloffTable:
|
||||
m_Table[0]: 0
|
||||
m_Table[1]: 0
|
||||
m_Table[2]: 0
|
||||
m_Table[3]: 0
|
||||
m_Table[4]: 0
|
||||
m_Table[5]: 0
|
||||
m_Table[6]: 0
|
||||
m_Table[7]: 0
|
||||
m_Table[8]: 0
|
||||
m_Table[9]: 0
|
||||
m_Table[10]: 0
|
||||
m_Table[11]: 0
|
||||
m_Table[12]: 0
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &129126782
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 129126780}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &913398332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 940835900}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 913398335}
|
||||
- component: {fileID: 913398334}
|
||||
- component: {fileID: 913398333}
|
||||
- component: {fileID: 1426812830}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor Board
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &913398333
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 23000011974915108, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 940835900}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: c181d333a7bee7a44b94c0f4e02c4bd4, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &913398334
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 33000012841683532, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 940835900}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Mesh: {fileID: 4300002, guid: d6b30b913257fee4d8246bf7a2620fcd, type: 3}
|
||||
--- !u!4 &913398335
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 940835900}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1.08, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &940835900
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 100100000, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
m_RootGameObject: {fileID: 913398332}
|
||||
m_IsPrefabParent: 0
|
||||
--- !u!1 &1324913475
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1324913479}
|
||||
- component: {fileID: 1324913478}
|
||||
- component: {fileID: 1324913477}
|
||||
- component: {fileID: 1324913476}
|
||||
- component: {fileID: 1324913480}
|
||||
m_Layer: 0
|
||||
m_Name: GetPixels() Plane
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!23 &1324913476
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1324913475}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!64 &1324913477
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1324913475}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_Convex: 0
|
||||
m_InflateMesh: 0
|
||||
m_SkinWidth: 0.01
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!33 &1324913478
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1324913475}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &1324913479
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1324913475}
|
||||
m_LocalRotation: {x: 0, y: -0.7071068, z: 0.7071068, w: 0}
|
||||
m_LocalPosition: {x: 11, y: 4, z: 10}
|
||||
m_LocalScale: {x: 0.25, y: 1, z: 0.25}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 180}
|
||||
--- !u!114 &1324913480
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1324913475}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fd3f838ff57152e44a1810274a9df49b, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
uddTexture: {fileID: 1426812830}
|
||||
x: 100
|
||||
y: 100
|
||||
texture: {fileID: 0}
|
||||
--- !u!114 &1426812830
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 114000012274256594, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 940835900}
|
||||
m_GameObject: {fileID: 913398332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
--- !u!1 &1446288312
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1446288317}
|
||||
- component: {fileID: 1446288316}
|
||||
- component: {fileID: 1446288315}
|
||||
- component: {fileID: 1446288314}
|
||||
- component: {fileID: 1446288313}
|
||||
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 &1446288313
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1446288312}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &1446288314
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1446288312}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &1446288315
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1446288312}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1446288316
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1446288312}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
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_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
m_StereoMirrorMode: 0
|
||||
--- !u!4 &1446288317
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1446288312}
|
||||
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
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38a5db360d5147c46ae925104162b881
|
||||
timeCreated: 1480420198
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
403
Assets/uDesktopDuplication/Examples/Scenes/Meta Data.unity
Normal file
403
Assets/uDesktopDuplication/Examples/Scenes/Meta Data.unity
Normal file
@@ -0,0 +1,403 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &240701085
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 240701092}
|
||||
- component: {fileID: 240701091}
|
||||
- component: {fileID: 240701090}
|
||||
- component: {fileID: 240701089}
|
||||
- component: {fileID: 240701087}
|
||||
- component: {fileID: 240701086}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &240701086
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 240701085}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 52d402bdca823cc42925c9d65993ee59, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
calcAveragePos: 1
|
||||
moveRectFilter: 0.05
|
||||
mouseFilter: 0.05
|
||||
dirtyRectFilter: 0.025
|
||||
noEventFilter: 0.05
|
||||
velocityFilter: 0.1
|
||||
drawAveragePos: 1
|
||||
drawCursorPos: 0
|
||||
drawMoveRects: 1
|
||||
drawDirtyRects: 1
|
||||
--- !u!114 &240701087
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 240701085}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 602d3a9bed585d14eaf21e0528d24d54, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &240701089
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 114000012274256594, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 240701085}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
--- !u!23 &240701090
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 23000011974915108, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 240701085}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: c181d333a7bee7a44b94c0f4e02c4bd4, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &240701091
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 33000012841683532, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 240701085}
|
||||
m_Mesh: {fileID: 4300002, guid: d6b30b913257fee4d8246bf7a2620fcd, type: 3}
|
||||
--- !u!4 &240701092
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 240701085}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1.08, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &772447740
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 772447742}
|
||||
- component: {fileID: 772447741}
|
||||
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 &772447741
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 772447740}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_FalloffTable:
|
||||
m_Table[0]: 0
|
||||
m_Table[1]: 0
|
||||
m_Table[2]: 0
|
||||
m_Table[3]: 0
|
||||
m_Table[4]: 0
|
||||
m_Table[5]: 0
|
||||
m_Table[6]: 0
|
||||
m_Table[7]: 0
|
||||
m_Table[8]: 0
|
||||
m_Table[9]: 0
|
||||
m_Table[10]: 0
|
||||
m_Table[11]: 0
|
||||
m_Table[12]: 0
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &772447742
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 772447740}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &1789105689
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1789105694}
|
||||
- component: {fileID: 1789105693}
|
||||
- component: {fileID: 1789105692}
|
||||
- component: {fileID: 1789105691}
|
||||
- component: {fileID: 1789105690}
|
||||
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 &1789105690
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1789105689}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &1789105691
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1789105689}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &1789105692
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1789105689}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1789105693
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1789105689}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
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_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
m_StereoMirrorMode: 0
|
||||
--- !u!4 &1789105694
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1789105689}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -3}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aac40d1b58f3f8940be815779d89b5a4
|
||||
timeCreated: 1479544409
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,366 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 0
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 1024
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &79264388
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 79264393}
|
||||
- component: {fileID: 79264392}
|
||||
- component: {fileID: 79264391}
|
||||
- component: {fileID: 79264390}
|
||||
- component: {fileID: 79264389}
|
||||
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 &79264389
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &79264390
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &79264391
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &79264392
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
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_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
m_StereoMirrorMode: 0
|
||||
--- !u!4 &79264393
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -6}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &400296148
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 400296150}
|
||||
- component: {fileID: 400296149}
|
||||
- component: {fileID: 400296151}
|
||||
- component: {fileID: 400296152}
|
||||
m_Layer: 0
|
||||
m_Name: Multiple Monitor Creator
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &400296149
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fb22986017201f74aa864dcbf0cab751, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
monitorPrefab: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
scaleMode: 1
|
||||
scale: 0.3
|
||||
meshForwardDirection: 1
|
||||
removeIfUnsupported: 1
|
||||
removeWaitDuration: 15
|
||||
removeChildrenWhenClear: 1
|
||||
--- !u!4 &400296150
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 3}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &400296151
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a31b05fdfa301f14e88365e64622b43a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
updateEveryFrame: 1
|
||||
margin: 0.1
|
||||
thickness: 1
|
||||
debugDraw: 1
|
||||
radius: 5
|
||||
offsetAngle: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &400296152
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dbdfccef47068644b81b671bb4e6e166, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
gazePointFilter: 0.03
|
||||
moveRectFilter: 0.05
|
||||
mouseFilter: 0.05
|
||||
dirtyRectFilter: 0.01
|
||||
noEventFilter: 0.01
|
||||
velocityFilter: 0.1
|
||||
drawGazePoint: 1
|
||||
drawAveragePos: 1
|
||||
drawMoveRects: 1
|
||||
drawDirtyRects: 1
|
||||
--- !u!1 &1738296145
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1738296147}
|
||||
- component: {fileID: 1738296146}
|
||||
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 &1738296146
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738296145}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_FalloffTable:
|
||||
m_Table[0]: 0
|
||||
m_Table[1]: 0
|
||||
m_Table[2]: 0
|
||||
m_Table[3]: 0
|
||||
m_Table[4]: 0
|
||||
m_Table[5]: 0
|
||||
m_Table[6]: 0
|
||||
m_Table[7]: 0
|
||||
m_Table[8]: 0
|
||||
m_Table[9]: 0
|
||||
m_Table[10]: 0
|
||||
m_Table[11]: 0
|
||||
m_Table[12]: 0
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1738296147
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738296145}
|
||||
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4bae91f55031b98488c9e668031f7387
|
||||
timeCreated: 1478610618
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
466
Assets/uDesktopDuplication/Examples/Scenes/Raycast.unity
Normal file
466
Assets/uDesktopDuplication/Examples/Scenes/Raycast.unity
Normal file
@@ -0,0 +1,466 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 0
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 1024
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &79264388
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 79264393}
|
||||
- component: {fileID: 79264392}
|
||||
- component: {fileID: 79264391}
|
||||
- component: {fileID: 79264390}
|
||||
- component: {fileID: 79264389}
|
||||
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 &79264389
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &79264390
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &79264391
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &79264392
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
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_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
m_StereoMirrorMode: 0
|
||||
--- !u!4 &79264393
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 79264388}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -6}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &400296148
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 400296150}
|
||||
- component: {fileID: 400296149}
|
||||
- component: {fileID: 400296151}
|
||||
- component: {fileID: 400296152}
|
||||
m_Layer: 0
|
||||
m_Name: Multiple Monitor Creator
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &400296149
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fb22986017201f74aa864dcbf0cab751, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
monitorPrefab: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
scaleMode: 1
|
||||
scale: 0.3
|
||||
meshForwardDirection: 1
|
||||
removeIfUnsupported: 1
|
||||
removeWaitDuration: 15
|
||||
removeChildrenWhenClear: 1
|
||||
--- !u!4 &400296150
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 3}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &400296151
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a31b05fdfa301f14e88365e64622b43a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
updateEveryFrame: 1
|
||||
margin: 0.1
|
||||
thickness: 1
|
||||
debugDraw: 1
|
||||
radius: 5
|
||||
offsetAngle: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &400296152
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 400296148}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dbdfccef47068644b81b671bb4e6e166, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
gazePointFilter: 0.03
|
||||
moveRectFilter: 0.05
|
||||
mouseFilter: 0.05
|
||||
dirtyRectFilter: 0.01
|
||||
noEventFilter: 0.01
|
||||
velocityFilter: 0.1
|
||||
drawGazePoint: 1
|
||||
drawAveragePos: 1
|
||||
drawMoveRects: 1
|
||||
drawDirtyRects: 1
|
||||
--- !u!1 &1070915829
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1070915830}
|
||||
m_Layer: 0
|
||||
m_Name: To
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1070915830
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1070915829}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: -2.41, y: 0, z: 3.36}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1470035823}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1470035821
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1470035823}
|
||||
- component: {fileID: 1470035822}
|
||||
m_Layer: 0
|
||||
m_Name: Ray Tester
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1470035822
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1470035821}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 810a4ad59c7d8d34e9b6014e8191fffe, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
from: {fileID: 1976533531}
|
||||
to: {fileID: 1070915830}
|
||||
--- !u!4 &1470035823
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1470035821}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.27}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1976533531}
|
||||
- {fileID: 1070915830}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1738296145
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1738296147}
|
||||
- component: {fileID: 1738296146}
|
||||
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 &1738296146
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738296145}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_FalloffTable:
|
||||
m_Table[0]: 0
|
||||
m_Table[1]: 0
|
||||
m_Table[2]: 0
|
||||
m_Table[3]: 0
|
||||
m_Table[4]: 0
|
||||
m_Table[5]: 0
|
||||
m_Table[6]: 0
|
||||
m_Table[7]: 0
|
||||
m_Table[8]: 0
|
||||
m_Table[9]: 0
|
||||
m_Table[10]: 0
|
||||
m_Table[11]: 0
|
||||
m_Table[12]: 0
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1738296147
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1738296145}
|
||||
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1976533530
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 1976533531}
|
||||
m_Layer: 0
|
||||
m_Name: From
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1976533531
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1976533530}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 1.89, y: 0, z: -4.58}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1470035823}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f68bd0626da87264cb4daca57d3c1594
|
||||
timeCreated: 1481736541
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
156
Assets/uDesktopDuplication/Examples/Scenes/Switch Scenes.unity
Normal file
156
Assets/uDesktopDuplication/Examples/Scenes/Switch Scenes.unity
Normal file
@@ -0,0 +1,156 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 8
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 9
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_TextureWidth: 1024
|
||||
m_TextureHeight: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFiltering: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousColorSigma: 1
|
||||
m_PVRFilteringAtrousNormalSigma: 1
|
||||
m_PVRFilteringAtrousPositionSigma: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &439248177
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 439248178}
|
||||
- component: {fileID: 439248179}
|
||||
m_Layer: 0
|
||||
m_Name: Scene Manager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &439248178
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 439248177}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.2346474, y: 1.2998462, z: 2.603952}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &439248179
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 439248177}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 426ff762e9c02b0499e1453018ecdc94, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
scenes:
|
||||
- Primary Monitor
|
||||
- Multiple Monitors Roundly
|
||||
- Shaders
|
||||
- Zoom
|
||||
sceneNo: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ce9467b01f36d647ace156faef9cb9f
|
||||
timeCreated: 1478927635
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
551
Assets/uDesktopDuplication/Examples/Scenes/Zoom.unity
Normal file
551
Assets/uDesktopDuplication/Examples/Scenes/Zoom.unity
Normal file
@@ -0,0 +1,551 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_TemporalCoherenceThreshold: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 1
|
||||
m_BakeBackend: 0
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 0
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1001 &10684088
|
||||
Prefab:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 7.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -2.91
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 9.52
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_RootOrder
|
||||
value: 4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_Name
|
||||
value: Loupe
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 114000012274256594, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
propertyPath: useZoom
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: de6f36e446e5e8a48bf61fe198985bb4, type: 2}
|
||||
m_IsPrefabAsset: 0
|
||||
--- !u!1 &106183784 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 10684088}
|
||||
--- !u!114 &106183785
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 106183784}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: efd9499cdb931b945947a2cd47909676, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
zoom: 10
|
||||
aspect: 1
|
||||
--- !u!1 &691659230
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 691659233}
|
||||
- component: {fileID: 691659232}
|
||||
- component: {fileID: 691659231}
|
||||
m_Layer: 0
|
||||
m_Name: Usage Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!102 &691659231
|
||||
TextMesh:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 691659230}
|
||||
m_Text: 'Tab: Next Screen Shift + Tab: Previous Screen'
|
||||
m_OffsetZ: 0
|
||||
m_CharacterSize: 0.1
|
||||
m_LineSpacing: 1
|
||||
m_Anchor: 4
|
||||
m_Alignment: 1
|
||||
m_TabSize: 4
|
||||
m_FontSize: 48
|
||||
m_FontStyle: 0
|
||||
m_RichText: 1
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_Color:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
--- !u!23 &691659232
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 691659230}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_Materials:
|
||||
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!4 &691659233
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 691659230}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 6, z: 10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &813882971
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 1000012642892690, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 813882978}
|
||||
- component: {fileID: 813882977}
|
||||
- component: {fileID: 813882975}
|
||||
- component: {fileID: 813882974}
|
||||
- component: {fileID: 813882972}
|
||||
m_Layer: 0
|
||||
m_Name: Monitor
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &813882972
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 813882971}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 602d3a9bed585d14eaf21e0528d24d54, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &813882974
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 114000012274256594, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 813882971}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bb54a34570e4747429b1c5b66c69d356, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
invertX_: 0
|
||||
invertY_: 0
|
||||
useClip_: 0
|
||||
clipPos: {x: 0, y: 0}
|
||||
clipScale: {x: 0.2, y: 0.2}
|
||||
--- !u!23 &813882975
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 23000011974915108, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 813882971}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RenderingLayerMask: 4294967295
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: c181d333a7bee7a44b94c0f4e02c4bd4, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_PreserveUVs: 1
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 0
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
--- !u!33 &813882977
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 33000012841683532, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 813882971}
|
||||
m_Mesh: {fileID: 4300002, guid: d6b30b913257fee4d8246bf7a2620fcd, type: 3}
|
||||
--- !u!4 &813882978
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 4000011474108562, guid: de6f36e446e5e8a48bf61fe198985bb4,
|
||||
type: 2}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 813882971}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 10}
|
||||
m_LocalScale: {x: 1.92, y: 1.08, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1874811380
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1874811385}
|
||||
- component: {fileID: 1874811384}
|
||||
- component: {fileID: 1874811383}
|
||||
- component: {fileID: 1874811382}
|
||||
- component: {fileID: 1874811381}
|
||||
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 &1874811381
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1874811380}
|
||||
m_Enabled: 1
|
||||
--- !u!124 &1874811382
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1874811380}
|
||||
m_Enabled: 1
|
||||
--- !u!92 &1874811383
|
||||
Behaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1874811380}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1874811384
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1874811380}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
|
||||
m_projectionMatrixMode: 1
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
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_TargetEye: 3
|
||||
m_HDR: 0
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &1874811385
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1874811380}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -3}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1895115489
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1895115491}
|
||||
- component: {fileID: 1895115490}
|
||||
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 &1895115490
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1895115489}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 8
|
||||
m_Type: 1
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &1895115491
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1895115489}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3d41026babadc241b9d0852b0831584
|
||||
timeCreated: 1478436298
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,58 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
[RequireComponent(typeof(uDesktopDuplication.Texture))]
|
||||
public class DisplacementMapping : MonoBehaviour
|
||||
{
|
||||
public enum TargetMonitor
|
||||
{
|
||||
Self,
|
||||
Next,
|
||||
Prev,
|
||||
}
|
||||
public TargetMonitor target = TargetMonitor.Self;
|
||||
|
||||
uDesktopDuplication.Texture uddTexture_;
|
||||
|
||||
int dispTexId_;
|
||||
int dispFactorId_;
|
||||
int tessMinDistId_;
|
||||
int tessMaxDistId_;
|
||||
int tessFactorId_;
|
||||
|
||||
[Range(0.0f, 10f)] public float displacementFactor = 0.1f;
|
||||
[Range(0.1f, 10f)] public float tessellationMinDist = 0.5f;
|
||||
[Range(1.0f, 50f)] public float tessellationMaxDist = 25f;
|
||||
[Range(1.0f, 50f)] public float tessellationFactor = 25f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
uddTexture_ = GetComponent<uDesktopDuplication.Texture>();
|
||||
Assert.IsNotNull(uddTexture_);
|
||||
|
||||
dispTexId_ = Shader.PropertyToID("_DispTex");
|
||||
dispFactorId_ = Shader.PropertyToID("_DispFactor");
|
||||
tessMinDistId_ = Shader.PropertyToID("_TessMinDist");
|
||||
tessMaxDistId_ = Shader.PropertyToID("_TessMaxDist");
|
||||
tessFactorId_ = Shader.PropertyToID("_TessFactor");
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
var id = uddTexture_.monitor.id;
|
||||
switch (target) {
|
||||
case TargetMonitor.Self: break;
|
||||
case TargetMonitor.Next: ++id; break;
|
||||
case TargetMonitor.Prev: --id; break;
|
||||
}
|
||||
id = Mathf.Clamp(id, 0, uDesktopDuplication.Manager.monitorCount - 1);
|
||||
var monitor = uDesktopDuplication.Manager.GetMonitor(id);
|
||||
monitor.shouldBeUpdated = true;
|
||||
|
||||
uddTexture_.material.SetTexture(dispTexId_, monitor.texture);
|
||||
uddTexture_.material.SetFloat(dispFactorId_, displacementFactor);
|
||||
uddTexture_.material.SetFloat(tessMinDistId_, tessellationMinDist);
|
||||
uddTexture_.material.SetFloat(tessMaxDistId_, tessellationMaxDist);
|
||||
uddTexture_.material.SetFloat(tessFactorId_, tessellationFactor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 859a2446b86e55c43932212872c82748
|
||||
timeCreated: 1480146517
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
168
Assets/uDesktopDuplication/Examples/Scripts/GazePointAnalyzer.cs
Normal file
168
Assets/uDesktopDuplication/Examples/Scripts/GazePointAnalyzer.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
using UnityEngine;
|
||||
using MeshForwardDirection = uDesktopDuplication.Texture.MeshForwardDirection;
|
||||
|
||||
[RequireComponent(typeof(uDesktopDuplication.Texture))]
|
||||
public class GazePointAnalyzer : MonoBehaviour
|
||||
{
|
||||
uDesktopDuplication.Texture uddTexture_;
|
||||
|
||||
[Tooltip("This needs a small calculation cost.")]
|
||||
public bool calcAveragePos = true;
|
||||
|
||||
private Vector2 averageCoord_ = Vector2.zero;
|
||||
private Vector2 averageCoordVelocity_ = Vector2.zero;
|
||||
public Vector3 averagePos
|
||||
{
|
||||
get { return GetWorldPositionFromCoord((int)averageCoord_.x, (int)averageCoord_.y); }
|
||||
}
|
||||
|
||||
public Vector3 cursorPos
|
||||
{
|
||||
get { return GetWorldPositionFromCoord(uddTexture_.monitor.cursorX, uddTexture_.monitor.cursorY); }
|
||||
}
|
||||
private Vector2 preCursorCoord_ = Vector2.zero;
|
||||
|
||||
[Header("Filters")]
|
||||
[Range(0f, 1f)] public float moveRectFilter = 0.05f;
|
||||
[Range(0f, 1f)] public float mouseFilter = 0.05f;
|
||||
[Range(0f, 1f)] public float dirtyRectFilter = 0.01f;
|
||||
[Range(0f, 1f)] public float noEventFilter = 0.01f;
|
||||
[Range(0f, 1f)] public float velocityFilter = 0.1f;
|
||||
|
||||
[Header("Debug")]
|
||||
public bool drawAveragePos;
|
||||
public bool drawCursorPos;
|
||||
public bool drawMoveRects;
|
||||
public bool drawDirtyRects;
|
||||
|
||||
void Start()
|
||||
{
|
||||
uddTexture_ = GetComponent<uDesktopDuplication.Texture>();
|
||||
averageCoord_ = new Vector2(uddTexture_.monitor.width / 2, uddTexture_.monitor.height / 2);
|
||||
}
|
||||
|
||||
public Vector3 GetWorldPositionFromCoord(int u, int v)
|
||||
{
|
||||
return uddTexture_.GetWorldPositionFromCoord(u, v);
|
||||
}
|
||||
|
||||
void CalcAveragePos()
|
||||
{
|
||||
if (!calcAveragePos) return;
|
||||
|
||||
var coord = Vector2.zero;
|
||||
var monitor = uddTexture_.monitor;
|
||||
var cursorCoord = new Vector2(monitor.cursorX, monitor.cursorY);
|
||||
var filter = 0f;
|
||||
|
||||
// move rect
|
||||
if (monitor.moveRectCount > 0) {
|
||||
foreach (var rects in monitor.moveRects) {
|
||||
var rect = rects.destination;
|
||||
var center = new Vector2(
|
||||
(rect.right + rect.left) / 2,
|
||||
(rect.bottom + rect.top) / 2);
|
||||
coord += center;
|
||||
}
|
||||
coord /= monitor.moveRectCount;
|
||||
filter = moveRectFilter;
|
||||
}
|
||||
// mouse
|
||||
else if (
|
||||
monitor.isCursorVisible &&
|
||||
cursorCoord != preCursorCoord_ &&
|
||||
(cursorCoord - preCursorCoord_).magnitude > 5 &&
|
||||
monitor.cursorX >= 0 &&
|
||||
monitor.cursorY >= 0)
|
||||
{
|
||||
coord = cursorCoord;
|
||||
filter = mouseFilter;
|
||||
}
|
||||
// dirty rect
|
||||
else if (monitor.dirtyRectCount > 0) {
|
||||
var totalWeights = 0f;
|
||||
foreach (var rect in monitor.dirtyRects) {
|
||||
var center = new Vector2(
|
||||
(rect.right + rect.left) / 2,
|
||||
(rect.bottom + rect.top) / 2);
|
||||
var weight = 1f / Mathf.Sqrt((rect.right - rect.left) * (rect.bottom - rect.top));
|
||||
coord += center * weight;
|
||||
totalWeights += weight;
|
||||
}
|
||||
coord /= totalWeights;
|
||||
filter = dirtyRectFilter;
|
||||
}
|
||||
// no event
|
||||
else {
|
||||
coord = new Vector2(monitor.width / 2, monitor.height / 2);
|
||||
filter = noEventFilter;
|
||||
}
|
||||
|
||||
var cf = (filter / ((1f / 60) / Time.deltaTime));
|
||||
var vf = (velocityFilter / ((1f / 60) / Time.deltaTime));
|
||||
var targetCoord = averageCoord_ + (coord - averageCoord_) * cf;
|
||||
var targetVelocity = targetCoord - averageCoord_;
|
||||
|
||||
if (float.IsNaN(targetCoord.x) || float.IsNaN(targetCoord.y)) return;
|
||||
if (float.IsNaN(targetVelocity.x) || float.IsNaN(targetVelocity.y)) return;
|
||||
|
||||
averageCoordVelocity_ += (targetVelocity - averageCoordVelocity_) * vf;
|
||||
averageCoord_ += averageCoordVelocity_;
|
||||
averageCoord_.x = Mathf.Clamp(averageCoord_.x, 0, monitor.width);
|
||||
averageCoord_.y = Mathf.Clamp(averageCoord_.y, 0, monitor.height);
|
||||
|
||||
preCursorCoord_ = cursorCoord;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
CalcAveragePos();
|
||||
DebugDraw();
|
||||
}
|
||||
|
||||
void DebugDraw()
|
||||
{
|
||||
if (drawAveragePos) DrawAveragePos();
|
||||
if (drawCursorPos) DrawCursorPos();
|
||||
if (drawDirtyRects) DrawDirtyRects();
|
||||
if (drawMoveRects) DrawMoveRects();
|
||||
}
|
||||
|
||||
void DrawRect(uDesktopDuplication.RECT rect, Color color)
|
||||
{
|
||||
var p0 = GetWorldPositionFromCoord(rect.left, rect.top);
|
||||
var p1 = GetWorldPositionFromCoord(rect.right, rect.top);
|
||||
var p2 = GetWorldPositionFromCoord(rect.right, rect.bottom);
|
||||
var p3 = GetWorldPositionFromCoord(rect.left, rect.bottom);
|
||||
|
||||
Debug.DrawLine(p0, p1, color);
|
||||
Debug.DrawLine(p1, p2, color);
|
||||
Debug.DrawLine(p2, p3, color);
|
||||
Debug.DrawLine(p3, p0, color);
|
||||
}
|
||||
|
||||
void DrawAveragePos()
|
||||
{
|
||||
Debug.DrawLine(transform.position, averagePos, Color.yellow);
|
||||
}
|
||||
|
||||
void DrawCursorPos()
|
||||
{
|
||||
Debug.DrawLine(transform.position, cursorPos, Color.grey);
|
||||
}
|
||||
|
||||
void DrawMoveRects()
|
||||
{
|
||||
foreach (var rect in uddTexture_.monitor.moveRects) {
|
||||
DrawRect(rect.source, Color.blue);
|
||||
DrawRect(rect.destination, Color.green);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawDirtyRects()
|
||||
{
|
||||
foreach (var rect in uddTexture_.monitor.dirtyRects) {
|
||||
DrawRect(rect, Color.red);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52d402bdca823cc42925c9d65993ee59
|
||||
timeCreated: 1479546123
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GetPixelsExample : MonoBehaviour
|
||||
{
|
||||
[SerializeField] uDesktopDuplication.Texture uddTexture;
|
||||
|
||||
[SerializeField] int x = 100;
|
||||
[SerializeField] int y = 100;
|
||||
const int width = 64;
|
||||
const int height = 32;
|
||||
|
||||
public Texture2D texture;
|
||||
Color32[] colors = new Color32[width * height];
|
||||
|
||||
void Start()
|
||||
{
|
||||
texture = new Texture2D(width, height, TextureFormat.ARGB32, false);
|
||||
GetComponent<Renderer>().material.mainTexture = texture;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
// must be called (performance will be slightly down).
|
||||
uDesktopDuplication.Manager.primary.useGetPixels = true;
|
||||
|
||||
var monitor = uddTexture.monitor;
|
||||
if (!monitor.hasBeenUpdated) return;
|
||||
|
||||
if (monitor.GetPixels(colors, x, y, width, height)) {
|
||||
texture.SetPixels32(colors);
|
||||
texture.Apply();
|
||||
}
|
||||
|
||||
Debug.Log(monitor.GetPixel(monitor.cursorX, monitor.cursorY));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd3f838ff57152e44a1810274a9df49b
|
||||
timeCreated: 1480420430
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
Assets/uDesktopDuplication/Examples/Scripts/Loupe.cs
Normal file
50
Assets/uDesktopDuplication/Examples/Scripts/Loupe.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(uDesktopDuplication.Texture))]
|
||||
public class Loupe : MonoBehaviour
|
||||
{
|
||||
private uDesktopDuplication.Texture uddTexture_;
|
||||
public float zoom = 3f;
|
||||
public float aspect = 1f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
uddTexture_ = GetComponent<uDesktopDuplication.Texture>();
|
||||
uddTexture_.useClip = true;
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
CheckVariables();
|
||||
|
||||
if (uDesktopDuplication.Manager.cursorMonitorId < 0) return;
|
||||
uddTexture_.monitorId = uDesktopDuplication.Manager.cursorMonitorId;
|
||||
|
||||
// To get other monitor textures, set dirty flag.
|
||||
foreach (var target in uDesktopDuplication.Manager.monitors) {
|
||||
target.CreateTextureIfNeeded();
|
||||
target.shouldBeUpdated = true;
|
||||
}
|
||||
|
||||
var monitor = uddTexture_.monitor;
|
||||
var x = monitor.isCursorVisible ?
|
||||
(float)monitor.cursorX / monitor.width :
|
||||
(float)monitor.systemCursorX / monitor.width;
|
||||
var y = monitor.isCursorVisible ?
|
||||
(float)monitor.cursorY / monitor.height :
|
||||
(float)monitor.systemCursorY / monitor.height;
|
||||
var w = 1f / zoom;
|
||||
var h = w / aspect * monitor.aspect;
|
||||
x = Mathf.Clamp(x - w / 2, 0f, 1f - w);
|
||||
y = Mathf.Clamp(y - h / 2, 0f, 1f - h);
|
||||
uddTexture_.clipPos = new Vector2(x, y);
|
||||
uddTexture_.clipScale = new Vector2(w, h);
|
||||
}
|
||||
|
||||
void CheckVariables()
|
||||
{
|
||||
if (zoom < 1f) zoom = 1f;
|
||||
if (aspect < 0.01f) aspect = 0.01f;
|
||||
}
|
||||
}
|
||||
|
||||
12
Assets/uDesktopDuplication/Examples/Scripts/Loupe.cs.meta
Normal file
12
Assets/uDesktopDuplication/Examples/Scripts/Loupe.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: efd9499cdb931b945947a2cd47909676
|
||||
timeCreated: 1478438457
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,69 @@
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(MultipleMonitorCreator))]
|
||||
public class MultipleMonitorAnalyzer : MonoBehaviour
|
||||
{
|
||||
MultipleMonitorCreator creator_;
|
||||
Vector3 gazePoint_ = Vector3.zero;
|
||||
public Vector3 gazePoint
|
||||
{
|
||||
get { return gazePoint_; }
|
||||
private set
|
||||
{
|
||||
gazePoint_ += (value - gazePoint) * (gazePointFilter / (1f / 60 / Time.deltaTime));
|
||||
}
|
||||
}
|
||||
|
||||
[Header("Filters")]
|
||||
[Range(0f, 1f)] public float gazePointFilter = 0.1f;
|
||||
[Range(0f, 1f)] public float moveRectFilter = 0.05f;
|
||||
[Range(0f, 1f)] public float mouseFilter = 0.05f;
|
||||
[Range(0f, 1f)] public float dirtyRectFilter = 0.01f;
|
||||
[Range(0f, 1f)] public float noEventFilter = 0.01f;
|
||||
[Range(0f, 1f)] public float velocityFilter = 0.1f;
|
||||
|
||||
[Header("Debug")]
|
||||
[SerializeField] bool drawGazePoint;
|
||||
[SerializeField] bool drawAveragePos;
|
||||
[SerializeField] bool drawMoveRects;
|
||||
[SerializeField] bool drawDirtyRects;
|
||||
|
||||
void Start()
|
||||
{
|
||||
creator_ = GetComponent<MultipleMonitorCreator>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
var cursorMonitorId = uDesktopDuplication.Manager.cursorMonitorId;
|
||||
for (int i = 0; i < creator_.monitors.Count; ++i) {
|
||||
var info = creator_.monitors[i];
|
||||
var analyzer =
|
||||
info.gameObject.GetComponent<GazePointAnalyzer>() ??
|
||||
info.gameObject.AddComponent<GazePointAnalyzer>();
|
||||
UpdateAnalyzer(analyzer);
|
||||
if (info.uddTexture.monitorId == cursorMonitorId) {
|
||||
gazePoint = analyzer.averagePos;
|
||||
}
|
||||
}
|
||||
|
||||
if (drawGazePoint) DrawGazePoint();
|
||||
}
|
||||
|
||||
void DrawGazePoint()
|
||||
{
|
||||
Debug.DrawLine(transform.position, gazePoint, Color.magenta);
|
||||
}
|
||||
|
||||
void UpdateAnalyzer(GazePointAnalyzer analyzer)
|
||||
{
|
||||
analyzer.moveRectFilter = moveRectFilter;
|
||||
analyzer.mouseFilter = mouseFilter;
|
||||
analyzer.dirtyRectFilter = dirtyRectFilter;
|
||||
analyzer.noEventFilter = noEventFilter;
|
||||
analyzer.velocityFilter = velocityFilter;
|
||||
analyzer.drawAveragePos = drawAveragePos;
|
||||
analyzer.drawMoveRects = drawMoveRects;
|
||||
analyzer.drawDirtyRects = drawDirtyRects;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbdfccef47068644b81b671bb4e6e166
|
||||
timeCreated: 1479620455
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,57 +1,203 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
using System.Collections.Generic;
|
||||
using MeshForwardDirection = uDesktopDuplication.Texture.MeshForwardDirection;
|
||||
using DuplicatorState = uDesktopDuplication.DuplicatorState;
|
||||
|
||||
public class MultipleMonitorCreator : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameObject monitorPrefab;
|
||||
[SerializeField] float width = 0.3f;
|
||||
[SerializeField] float margin = 1f;
|
||||
[Tooltip("Create monitors using this prefab.")]
|
||||
public GameObject monitorPrefab;
|
||||
|
||||
public enum ScaleMode
|
||||
{
|
||||
Real,
|
||||
Fixed,
|
||||
Pixel,
|
||||
}
|
||||
|
||||
[Tooltip("Real: DPI-based real scale \nFixed: Same width \nPixel: bigger if screen resolution is high.")]
|
||||
public ScaleMode scaleMode = ScaleMode.Fixed;
|
||||
|
||||
[Tooltip("Use this scale as width if scaleMode is Fixed.")]
|
||||
public float scale = 0.5f;
|
||||
|
||||
[Tooltip("Please specify the surface direction of the mesh (e.g. Plane => Y.)")]
|
||||
public MeshForwardDirection meshForwardDirection = MeshForwardDirection.Z;
|
||||
|
||||
[Tooltip("Remove unsupported monitors automatically after removeWaitDuration.")]
|
||||
public bool removeIfUnsupported = true;
|
||||
|
||||
[Tooltip("Remove unsupported monitors automatically after removeWaitDuration.")]
|
||||
public float removeWaitDuration = 5f;
|
||||
|
||||
[Tooltip("Remove all childrens (for debug).")]
|
||||
public bool removeChildrenWhenClear = true;
|
||||
|
||||
bool hasMonitorUnsupportStateChecked_ = false;
|
||||
float removeWaitTimer_ = 0f;
|
||||
|
||||
public class MonitorInfo
|
||||
{
|
||||
public GameObject gameObject { get; set; }
|
||||
public Quaternion originalRotation { get; set; }
|
||||
public Vector3 originalLocalScale { get; set; }
|
||||
public uDesktopDuplication.Texture uddTexture { get; set; }
|
||||
public Mesh mesh { get; set; }
|
||||
}
|
||||
|
||||
private List<MonitorInfo> monitors_ = new List<MonitorInfo>();
|
||||
public List<MonitorInfo> monitors { get { return monitors_; } }
|
||||
|
||||
public class SavedMonitorInfo
|
||||
{
|
||||
public float widthScale = 1f;
|
||||
public float heightScale = 1f;
|
||||
}
|
||||
|
||||
private List<SavedMonitorInfo> savedInfoList_ = new List<SavedMonitorInfo>();
|
||||
public List<SavedMonitorInfo> savedInfoList { get { return savedInfoList_; } }
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Sort monitors in coordinate order
|
||||
var monitors = uDesktopDuplication.Manager.monitors;
|
||||
monitors.Sort((a, b) => a.left - b.left);
|
||||
uDesktopDuplication.Manager.CreateInstance();
|
||||
Create();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (removeIfUnsupported) {
|
||||
RemoveUnsupportedDisplayAfterRemoveTimer();
|
||||
}
|
||||
|
||||
if (uDesktopDuplication.Manager.monitorCount != monitors.Count) {
|
||||
Recreate();
|
||||
}
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
uDesktopDuplication.Manager.onReinitialized += Recreate;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
uDesktopDuplication.Manager.onReinitialized -= Recreate;
|
||||
}
|
||||
|
||||
void RemoveUnsupportedDisplayAfterRemoveTimer()
|
||||
{
|
||||
if (!hasMonitorUnsupportStateChecked_) {
|
||||
removeWaitTimer_ += Time.deltaTime;
|
||||
if (removeWaitTimer_ > removeWaitDuration) {
|
||||
hasMonitorUnsupportStateChecked_ = true;
|
||||
foreach (var info in monitors) {
|
||||
if (info.uddTexture.monitor.state == DuplicatorState.Unsupported) {
|
||||
Destroy(info.gameObject);
|
||||
}
|
||||
}
|
||||
monitors.RemoveAll(info => info.uddTexture.monitor.state == DuplicatorState.Unsupported);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ResetRemoveTimer()
|
||||
{
|
||||
hasMonitorUnsupportStateChecked_ = false;
|
||||
removeWaitTimer_ = 0f;
|
||||
}
|
||||
|
||||
void Create()
|
||||
{
|
||||
ResetRemoveTimer();
|
||||
|
||||
// Create monitors
|
||||
var n = monitors.Count;
|
||||
var totalWidth = 0f;
|
||||
for (int i = 0 ; i < n; ++i) {
|
||||
var n = uDesktopDuplication.Manager.monitors.Count;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
// Create monitor obeject
|
||||
var go = Instantiate(monitorPrefab);
|
||||
go.name = "Monitor " + i;
|
||||
go.name = uDesktopDuplication.Manager.monitors[i].name;
|
||||
|
||||
// Saved infomation
|
||||
if (savedInfoList.Count == i) {
|
||||
savedInfoList.Add(new SavedMonitorInfo());
|
||||
Assert.AreEqual(i, savedInfoList.Count - 1);
|
||||
}
|
||||
var savedInfo = savedInfoList[i];
|
||||
|
||||
// Expand AABB
|
||||
var mesh = go.GetComponent<MeshFilter>().mesh; // clone
|
||||
var aabbScale = mesh.bounds.size;
|
||||
aabbScale.y = Mathf.Max(aabbScale.y, aabbScale.x);
|
||||
aabbScale.z = Mathf.Max(aabbScale.z, aabbScale.x);
|
||||
mesh.bounds = new Bounds(mesh.bounds.center, aabbScale);
|
||||
|
||||
// Assign monitor
|
||||
var texture = go.GetComponent<uDesktopDuplication.Texture>();
|
||||
texture.monitorId = i;
|
||||
var monitor = texture.monitor;
|
||||
|
||||
// Set width / height
|
||||
var isHorizontal = texture.monitor.isHorizontal;
|
||||
var w = isHorizontal ? width : (width * texture.monitor.aspect);
|
||||
var h = isHorizontal ? width / texture.monitor.aspect : width;
|
||||
go.transform.localScale = new Vector3(w, go.transform.localScale.y, h);
|
||||
float width = 1f, height = 1f;
|
||||
switch (scaleMode) {
|
||||
case ScaleMode.Real:
|
||||
width = monitor.widthMeter;
|
||||
height = monitor.heightMeter;
|
||||
break;
|
||||
case ScaleMode.Fixed:
|
||||
width = scale * (monitor.isHorizontal ? monitor.aspect : 1f);
|
||||
height = scale * (monitor.isHorizontal ? 1f : 1f / monitor.aspect);
|
||||
break;
|
||||
case ScaleMode.Pixel:
|
||||
width = scale * (monitor.isHorizontal ? 1f : monitor.aspect) * ((float)monitor.width / 1920);
|
||||
height = scale * (monitor.isHorizontal ? 1f / monitor.aspect : 1f) * ((float)monitor.width / 1920);
|
||||
break;
|
||||
}
|
||||
|
||||
width *= savedInfo.widthScale;
|
||||
height *= savedInfo.heightScale;
|
||||
|
||||
if (meshForwardDirection == MeshForwardDirection.Y) {
|
||||
go.transform.localScale = new Vector3(width, go.transform.localScale.y, height);
|
||||
} else {
|
||||
go.transform.localScale = new Vector3(width, height, go.transform.localScale.z);
|
||||
}
|
||||
|
||||
// Set parent as this object
|
||||
go.transform.SetParent(transform);
|
||||
|
||||
// Calc actual size considering mesh size
|
||||
var scaleX = go.GetComponent<MeshFilter>().sharedMesh.bounds.extents.x * 2f;
|
||||
totalWidth += w * scaleX;
|
||||
// Save
|
||||
var info = new MonitorInfo();
|
||||
info.gameObject = go;
|
||||
info.originalRotation = go.transform.rotation;
|
||||
info.originalLocalScale = go.transform.localScale;
|
||||
info.uddTexture = texture;
|
||||
info.mesh = mesh;
|
||||
monitors.Add(info);
|
||||
}
|
||||
|
||||
// Set positions with margin
|
||||
totalWidth += margin * (n - 1);
|
||||
var x = -totalWidth / 2;
|
||||
for (int i = 0 ; i < n; ++i) {
|
||||
//
|
||||
var go = transform.FindChild("Monitor " + i);
|
||||
var texture = go.GetComponent<uDesktopDuplication.Texture>();
|
||||
var halfScaleX = go.GetComponent<MeshFilter>().sharedMesh.bounds.extents.x;
|
||||
var w = texture.monitor.isHorizontal ? width : (width * texture.monitor.aspect);
|
||||
var halfWidth = w * halfScaleX;
|
||||
x += halfWidth;
|
||||
go.transform.localPosition = new Vector3(x, 0f, 0f);
|
||||
x += halfWidth + margin;
|
||||
// Sort monitors in coordinate order
|
||||
monitors.Sort((a, b) => a.uddTexture.monitor.left - b.uddTexture.monitor.left);
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
foreach (var info in monitors) {
|
||||
Destroy(info.gameObject);
|
||||
}
|
||||
if (removeChildrenWhenClear) {
|
||||
for (int i = 0; i < transform.childCount; ++i) {
|
||||
Destroy(transform.GetChild(i).gameObject);
|
||||
}
|
||||
}
|
||||
monitors.Clear();
|
||||
}
|
||||
|
||||
[ContextMenu("Recreate")]
|
||||
public void Recreate()
|
||||
{
|
||||
Clear();
|
||||
Create();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(MultipleMonitorCreator))]
|
||||
public class MultipleMonitorLayouter : MonoBehaviour
|
||||
{
|
||||
protected MultipleMonitorCreator creator_;
|
||||
public bool updateEveryFrame = true;
|
||||
public float margin = 0.1f;
|
||||
[Range(0f, 10f)] public float thickness = 1f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
creator_ = GetComponent<MultipleMonitorCreator>();
|
||||
Layout();
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
{
|
||||
margin = Mathf.Max(margin, 0f);
|
||||
|
||||
if (updateEveryFrame) {
|
||||
Layout();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Layout()
|
||||
{
|
||||
var monitors = creator_.monitors;
|
||||
var n = monitors.Count;
|
||||
|
||||
var totalWidth = 0f;
|
||||
foreach (var info in monitors) {
|
||||
var width = info.gameObject.transform.localScale.x * (info.mesh.bounds.extents.x * 2f);
|
||||
totalWidth += width;
|
||||
}
|
||||
totalWidth += margin * (n - 1);
|
||||
|
||||
var x = -totalWidth / 2;
|
||||
|
||||
foreach (var info in monitors) {
|
||||
var width = info.gameObject.transform.localScale.x;
|
||||
x += (width * info.mesh.bounds.extents.x);
|
||||
info.gameObject.transform.localPosition = new Vector3(x, 0f, 0f);
|
||||
info.gameObject.transform.localRotation = info.originalRotation;
|
||||
x += (width * info.mesh.bounds.extents.x) + margin;
|
||||
}
|
||||
|
||||
foreach (var info in monitors) {
|
||||
info.uddTexture.thickness = thickness;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0db1dcac2dedc724194c423ee75b3bf4
|
||||
timeCreated: 1478608632
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,102 @@
|
||||
using UnityEngine;
|
||||
using MeshForwardDirection = uDesktopDuplication.Texture.MeshForwardDirection;
|
||||
|
||||
public class MultipleMonitorRoundLayouter : MultipleMonitorLayouter
|
||||
{
|
||||
[SerializeField] bool debugDraw = true;
|
||||
|
||||
public float radius = 10f;
|
||||
public Vector3 offsetAngle = Vector3.zero;
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
foreach (var info in creator_.monitors) {
|
||||
info.uddTexture.bend = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Layout()
|
||||
{
|
||||
var monitors = creator_.monitors;
|
||||
var n = monitors.Count;
|
||||
|
||||
// Keep the local scale z of monitors as 1 to bend them correctly.
|
||||
// And save width / height to use same values after reinitialization.
|
||||
for (int i = 0; i < n; ++i) {
|
||||
var info = monitors[i];
|
||||
var savedInfo = creator_.savedInfoList[i];
|
||||
var scale = info.gameObject.transform.localScale;
|
||||
if (creator_.meshForwardDirection == MeshForwardDirection.Y) {
|
||||
scale.y = 1f;
|
||||
savedInfo.widthScale = scale.x / info.originalLocalScale.x;
|
||||
savedInfo.heightScale = scale.z / info.originalLocalScale.z;
|
||||
} else {
|
||||
scale.z = 1f;
|
||||
savedInfo.widthScale = scale.x / info.originalLocalScale.x;
|
||||
savedInfo.heightScale = scale.y / info.originalLocalScale.y;
|
||||
}
|
||||
info.gameObject.transform.localScale = scale;
|
||||
}
|
||||
|
||||
// keep thicness plus value.
|
||||
thickness = Mathf.Max(thickness, 0f);
|
||||
|
||||
// calculate total width
|
||||
var totalWidth = 0f;
|
||||
foreach (var info in monitors) {
|
||||
var width = info.gameObject.transform.localScale.x * (info.mesh.bounds.extents.x * 2f);
|
||||
totalWidth += width;
|
||||
}
|
||||
totalWidth += margin * (n - 1);
|
||||
|
||||
// expand radius if total width is larger than the circumference.
|
||||
radius = Mathf.Max(radius, (totalWidth + margin) / (2 * Mathf.PI));
|
||||
|
||||
// total angle of monitors
|
||||
var totalAngle = totalWidth / radius;
|
||||
|
||||
// layout
|
||||
float angle = -totalAngle / 2;
|
||||
var offsetRot = Quaternion.Euler(offsetAngle);
|
||||
foreach (var info in monitors) {
|
||||
var uddTex = info.uddTexture;
|
||||
var width = info.gameObject.transform.localScale.x * (info.mesh.bounds.extents.x * 2f);
|
||||
|
||||
angle += (width / radius) * 0.5f;
|
||||
var pos = radius * new Vector3(Mathf.Sin(angle), 0f, Mathf.Cos(angle) - 1f);
|
||||
pos += radius * Vector3.forward;
|
||||
pos = offsetRot * pos;
|
||||
pos -= radius * Vector3.forward;
|
||||
uddTex.transform.localPosition = pos;
|
||||
uddTex.transform.localRotation = offsetRot * Quaternion.AngleAxis(angle * Mathf.Rad2Deg, Vector3.up) * info.originalRotation;
|
||||
angle += (width * 0.5f + margin) / radius;
|
||||
|
||||
uddTex.bend = true;
|
||||
uddTex.meshForwardDirection = creator_.meshForwardDirection;
|
||||
uddTex.radius = radius;
|
||||
uddTex.thickness = thickness;
|
||||
uddTex.width = uddTex.transform.localScale.x;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (debugDraw) DebugDraw();
|
||||
}
|
||||
|
||||
void DebugDraw()
|
||||
{
|
||||
// draw the circumference in the scene view.
|
||||
var scale = transform.localScale.x;
|
||||
var center = transform.position - Vector3.forward * radius * scale;
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
var a0 = 2 * Mathf.PI * i / 100;
|
||||
var a1 = 2 * Mathf.PI * (i + 1) / 100;
|
||||
var p0 = center + radius * scale * new Vector3(Mathf.Cos(a0), 0f, Mathf.Sin(a0));
|
||||
var p1 = center + radius * scale * new Vector3(Mathf.Cos(a1), 0f, Mathf.Sin(a1));
|
||||
Debug.DrawLine(p0, p1, Color.red);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a31b05fdfa301f14e88365e64622b43a
|
||||
timeCreated: 1478524060
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
23
Assets/uDesktopDuplication/Examples/Scripts/RaycastTest.cs
Normal file
23
Assets/uDesktopDuplication/Examples/Scripts/RaycastTest.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class RaycastTest : MonoBehaviour
|
||||
{
|
||||
public Transform from;
|
||||
public Transform to;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!from || !to) return;
|
||||
|
||||
Debug.DrawLine(from.position, to.position, Color.red);
|
||||
|
||||
foreach (var uddTexture in GameObject.FindObjectsOfType<uDesktopDuplication.Texture>()) {
|
||||
var result = uddTexture.RayCast(from.position, to.position - from.position);
|
||||
if (result.hit) {
|
||||
Debug.DrawLine(result.position, result.position + result.normal, Color.yellow);
|
||||
Debug.Log("COORD: " + result.coords + ", DESKTOP: " + result.desktopCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 810a4ad59c7d8d34e9b6014e8191fffe
|
||||
timeCreated: 1481722966
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,10 +6,12 @@ public class ToggleMonitors : MonoBehaviour
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Tab)) {
|
||||
var texture = GetComponent<uDesktopDuplication.Texture>();
|
||||
var id = texture.monitorId;
|
||||
var n = uDesktopDuplication.Manager.monitorCount;
|
||||
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) {
|
||||
texture.monitorId--;
|
||||
texture.monitorId = (id - 1 < 0) ? 0 : (id - 1);
|
||||
} else {
|
||||
texture.monitorId++;
|
||||
texture.monitorId = (id + 1 >= n) ? (n - 1) : (id + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class UddSceneManager : MonoBehaviour
|
||||
{
|
||||
public static UddSceneManager instance { get; set; }
|
||||
[SerializeField] string[] scenes;
|
||||
[SerializeField] int sceneNo = 0;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (!instance) {
|
||||
instance = this;
|
||||
} else {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
Load();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.RightArrow)) {
|
||||
Next();
|
||||
} else if (Input.GetKeyDown(KeyCode.LeftArrow)) {
|
||||
Prev();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.R) && (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))) {
|
||||
uDesktopDuplication.Manager.instance.Reinitialize();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Escape)) {
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
void Next()
|
||||
{
|
||||
sceneNo = (sceneNo + 1) % scenes.Length;
|
||||
Load();
|
||||
}
|
||||
|
||||
void Prev()
|
||||
{
|
||||
sceneNo = (sceneNo + scenes.Length - 1) % scenes.Length;
|
||||
Load();
|
||||
}
|
||||
|
||||
void Load()
|
||||
{
|
||||
SceneManager.LoadScene(scenes[Mathf.Clamp(sceneNo, 0, scenes.Length - 1)]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 426ff762e9c02b0499e1453018ecdc94
|
||||
timeCreated: 1478927673
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,49 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: uDD_Screen_Unlit_Displacement
|
||||
m_Shader: {fileID: 4800000, guid: 05df46eb51b13c84eabbdf4c53cc8db7, type: 3}
|
||||
m_ShaderKeywords: BEND_ON _CULL_OFF _FORWARD_Z
|
||||
m_LightmapFlags: 5
|
||||
m_EnableInstancingVariants: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _CursorTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DispTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _Bend: 1
|
||||
- _Cull: 0
|
||||
- _DispFactor: 0.1
|
||||
- _Displacement: 0.3
|
||||
- _Forward: 1
|
||||
- _InsideTessFactor: 1
|
||||
- _Radius: 15.4
|
||||
- _TessDistFactor: 3
|
||||
- _TessDistPower: 1.545
|
||||
- _TessEdgeLen: 1
|
||||
- _TessFactor: 25
|
||||
- _TessMaxDist: 10
|
||||
- _TessMinDist: 0.5
|
||||
- _Thickness: 1
|
||||
- _Width: 1.92
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 596fd740aeeee0d4cb4f962d4072954e
|
||||
timeCreated: 1480074277
|
||||
licenseType: Pro
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
9
Assets/uDesktopDuplication/Models.meta
Normal file
9
Assets/uDesktopDuplication/Models.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75494e992a22ea44d9b614d7fd3dc235
|
||||
folderAsset: yes
|
||||
timeCreated: 1478887431
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/uDesktopDuplication/Models/Resources.meta
Normal file
9
Assets/uDesktopDuplication/Models/Resources.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b281589e6b8e27b4fbf0509d620b7871
|
||||
folderAsset: yes
|
||||
timeCreated: 1478354860
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e36cd526b654d024e875d5110a1b0442
|
||||
folderAsset: yes
|
||||
timeCreated: 1478354877
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e2bcc27e10c0d141a0c11cd88cdcf98
|
||||
folderAsset: yes
|
||||
timeCreated: 1478353263
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
@@ -0,0 +1,59 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9855ecfc2b823c94d8a1354715d343a1
|
||||
timeCreated: 1478353264
|
||||
licenseType: Pro
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 7
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
allowsAlphaSplitting: 0
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/uDesktopDuplication/Models/uDD_Board.fbx
Normal file
BIN
Assets/uDesktopDuplication/Models/uDD_Board.fbx
Normal file
Binary file not shown.
78
Assets/uDesktopDuplication/Models/uDD_Board.fbx.meta
Normal file
78
Assets/uDesktopDuplication/Models/uDD_Board.fbx.meta
Normal file
@@ -0,0 +1,78 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6b30b913257fee4d8246bf7a2620fcd
|
||||
timeCreated: 1478887431
|
||||
licenseType: Pro
|
||||
ModelImporter:
|
||||
serializedVersion: 19
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: pCube1
|
||||
4300002: uDD_Board
|
||||
9500000: //RootNode
|
||||
materials:
|
||||
importMaterials: 0
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
clipAnimations: []
|
||||
isReadable: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 0.1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
importBlendShapes: 0
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 0
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 2
|
||||
importAnimation: 0
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 0
|
||||
humanoidOversampling: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/uDesktopDuplication/Models/uDD_Plane.fbx
Normal file
BIN
Assets/uDesktopDuplication/Models/uDD_Plane.fbx
Normal file
Binary file not shown.
87
Assets/uDesktopDuplication/Models/uDD_Plane.fbx.meta
Normal file
87
Assets/uDesktopDuplication/Models/uDD_Plane.fbx.meta
Normal file
@@ -0,0 +1,87 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f30f6cfd6aa37554ca886424cada7cbb
|
||||
timeCreated: 1480072865
|
||||
licenseType: Pro
|
||||
ModelImporter:
|
||||
serializedVersion: 19
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
100002: uDD_Plane_MeshPart0
|
||||
100004: uDD_Plane_MeshPart1
|
||||
400000: //RootNode
|
||||
400002: uDD_Plane_MeshPart0
|
||||
400004: uDD_Plane_MeshPart1
|
||||
2300000: //RootNode
|
||||
2300002: uDD_Plane_MeshPart0
|
||||
2300004: uDD_Plane_MeshPart1
|
||||
3300000: //RootNode
|
||||
3300002: uDD_Plane_MeshPart0
|
||||
3300004: uDD_Plane_MeshPart1
|
||||
4300000: uDD_Plane
|
||||
4300002: uDD_Plane_MeshPart0
|
||||
4300004: uDD_Plane_MeshPart1
|
||||
9500000: //RootNode
|
||||
materials:
|
||||
importMaterials: 0
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
clipAnimations: []
|
||||
isReadable: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 0.1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
importBlendShapes: 0
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 2
|
||||
importAnimation: 0
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 0
|
||||
humanoidOversampling: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02fc121822cf2ea4e82e16c4a28bf711
|
||||
timeCreated: 1477546714
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
platformData:
|
||||
Any:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/uDesktopDuplication/Plugins/x86.meta
Normal file
9
Assets/uDesktopDuplication/Plugins/x86.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3ded3542f0e6b74ea0ff9ea58aea2f2
|
||||
folderAsset: yes
|
||||
timeCreated: 1480693928
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/uDesktopDuplication/Plugins/x86/uDesktopDuplication.dll
Normal file
BIN
Assets/uDesktopDuplication/Plugins/x86/uDesktopDuplication.dll
Normal file
Binary file not shown.
@@ -0,0 +1,150 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3ab0ac3a3d6bb643af0a464a93be957
|
||||
timeCreated: 1503496900
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 0
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 0
|
||||
Exclude Linux64: 0
|
||||
Exclude LinuxUniversal: 0
|
||||
Exclude OSXIntel: 0
|
||||
Exclude OSXIntel64: 0
|
||||
Exclude OSXUniversal: 0
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 1
|
||||
data:
|
||||
first:
|
||||
'': data
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 0
|
||||
Exclude Linux64: 0
|
||||
Exclude LinuxUniversal: 0
|
||||
Exclude OSXIntel: 0
|
||||
Exclude OSXIntel64: 0
|
||||
Exclude OSXUniversal: 0
|
||||
Exclude WebGL: 0
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 1
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Facebook: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/uDesktopDuplication/Plugins/x86_64.meta
Normal file
9
Assets/uDesktopDuplication/Plugins/x86_64.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99257566ccd0582439a44abad90e65d4
|
||||
folderAsset: yes
|
||||
timeCreated: 1478626361
|
||||
licenseType: Pro
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,150 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cb91c9ae744dc5429005b20e11f4f37
|
||||
timeCreated: 1503505907
|
||||
licenseType: Pro
|
||||
PluginImporter:
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
platformData:
|
||||
data:
|
||||
first:
|
||||
'': Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 0
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 0
|
||||
Exclude Linux64: 0
|
||||
Exclude LinuxUniversal: 0
|
||||
Exclude OSXIntel: 0
|
||||
Exclude OSXIntel64: 0
|
||||
Exclude OSXUniversal: 0
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 0
|
||||
data:
|
||||
first:
|
||||
'': data
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Android: Android
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: ARMv7
|
||||
data:
|
||||
first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
Exclude Editor: 0
|
||||
Exclude Linux: 0
|
||||
Exclude Linux64: 0
|
||||
Exclude LinuxUniversal: 0
|
||||
Exclude OSXIntel: 0
|
||||
Exclude OSXIntel64: 0
|
||||
Exclude OSXUniversal: 0
|
||||
Exclude WebGL: 0
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 0
|
||||
data:
|
||||
first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
data:
|
||||
first:
|
||||
Facebook: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
data:
|
||||
first:
|
||||
Facebook: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Facebook: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
data:
|
||||
first:
|
||||
Standalone: LinuxUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXIntel64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
data:
|
||||
first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
data:
|
||||
first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,71 +0,0 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace uDesktopDuplication
|
||||
{
|
||||
|
||||
[AddComponentMenu("uDesktopDuplication/Cursor"),
|
||||
RequireComponent(typeof(Texture))]
|
||||
public class Cursor : MonoBehaviour
|
||||
{
|
||||
Vector3 worldPosition { get; set; }
|
||||
|
||||
private Texture uddTexture_;
|
||||
private Monitor monitor { get { return uddTexture_.monitor; } }
|
||||
|
||||
private Texture2D currentTexture_;
|
||||
private Dictionary<Vector2, Texture2D> textures_ = new Dictionary<Vector2, Texture2D>();
|
||||
[SerializeField] Vector2 modelScale = Vector2.one;
|
||||
|
||||
void Start()
|
||||
{
|
||||
uddTexture_ = GetComponent<Texture>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (monitor.isCursorVisible) {
|
||||
UpdatePosition();
|
||||
UpdateTexture();
|
||||
UpdateMaterial();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdatePosition()
|
||||
{
|
||||
var x = (1f * monitor.pointerX / monitor.width - 0.5f) * modelScale.x;
|
||||
var y = (1f * monitor.pointerY / monitor.height - 0.5f) * modelScale.y;
|
||||
var iy = uddTexture_.invertY ? -1 : +1;
|
||||
var localPos = transform.right * x + iy * transform.up * y;
|
||||
worldPosition = transform.TransformPoint(localPos);
|
||||
}
|
||||
|
||||
void UpdateTexture()
|
||||
{
|
||||
var w = monitor.pointerShapeWidth;
|
||||
var h = monitor.pointerShapeHeight;
|
||||
if (w == 0 || h == 0) return;
|
||||
|
||||
var scale = new Vector2(w, h);
|
||||
if (!textures_.ContainsKey(scale)) {
|
||||
var texture = new Texture2D(w, h, TextureFormat.BGRA32, false);
|
||||
texture.wrapMode = TextureWrapMode.Clamp;
|
||||
textures_.Add(scale, texture);
|
||||
}
|
||||
|
||||
var pointerTexture = textures_[scale];
|
||||
monitor.UpdateCursorTexture(pointerTexture.GetNativeTexturePtr());
|
||||
uddTexture_.material.SetTexture("_CursorTex", pointerTexture);
|
||||
}
|
||||
|
||||
void UpdateMaterial()
|
||||
{
|
||||
var x = (float)monitor.pointerX / monitor.width;
|
||||
var y = (float)monitor.pointerY / monitor.height;
|
||||
var w = (float)monitor.pointerShapeWidth / monitor.width;
|
||||
var h = (float)monitor.pointerShapeHeight / monitor.height;
|
||||
uddTexture_.material.SetVector("_CursorPositionScale", new Vector4(x, y, w, h));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#pragma warning disable 114, 465
|
||||
|
||||
namespace uDesktopDuplication
|
||||
{
|
||||
|
||||
@@ -9,10 +12,12 @@ public enum Message
|
||||
{
|
||||
None = -1,
|
||||
Reinitialized = 0,
|
||||
TextureSizeChanged = 1,
|
||||
}
|
||||
|
||||
public enum CursorShapeType
|
||||
{
|
||||
Unspecified = 0,
|
||||
MonoChrome = 1,
|
||||
Color = 2,
|
||||
MaskedColor = 4,
|
||||
@@ -27,29 +32,93 @@ public enum MonitorRotation
|
||||
Rotate270 = 4
|
||||
}
|
||||
|
||||
public enum DuplicatorState
|
||||
{
|
||||
NotSet = -1,
|
||||
Ready = 0,
|
||||
Running = 1,
|
||||
InvalidArg = 2,
|
||||
AccessDenied = 3,
|
||||
Unsupported = 4,
|
||||
CurrentlyNotAvailable = 5,
|
||||
SessionDisconnected = 6,
|
||||
AccessLost = 7,
|
||||
TextureSizeInconsistent = 8,
|
||||
Unknown = 999,
|
||||
}
|
||||
|
||||
public enum DebugMode
|
||||
{
|
||||
None = 0,
|
||||
File = 1,
|
||||
UnityLog = 2, /* currently has bug when app exits. */
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT
|
||||
{
|
||||
[MarshalAs(UnmanagedType.I4)]
|
||||
public int left;
|
||||
[MarshalAs(UnmanagedType.I4)]
|
||||
public int top;
|
||||
[MarshalAs(UnmanagedType.I4)]
|
||||
public int right;
|
||||
[MarshalAs(UnmanagedType.I4)]
|
||||
public int bottom;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct DXGI_OUTDUPL_MOVE_RECT
|
||||
{
|
||||
public RECT source;
|
||||
public RECT destination;
|
||||
}
|
||||
|
||||
public static class Lib
|
||||
{
|
||||
public delegate void MessageHandler(Message message);
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void DebugLogDelegate(string str);
|
||||
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void InitializeUDD();
|
||||
public static extern bool IsInitialized();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void FinalizeUDD();
|
||||
public static extern void Initialize();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void Finalize();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void Reinitialize();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void Update();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern Message PopMessage();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void EnableDebug();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void DisableDebug();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void SetDebugMode(DebugMode mode);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void SetLogFunc(DebugLogDelegate func);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void SetErrorFunc(DebugLogDelegate func);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetMonitorCount();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern bool HasMonitorCountChanged();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetCursorMonitorId();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetTotalWidth();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetTotalHeight();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void SetTimeout(int timeout);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern IntPtr GetRenderEventFunc();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetId(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern DuplicatorState GetState(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void GetName(int id, StringBuilder buf, int len);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetLeft(int id);
|
||||
@@ -64,27 +133,47 @@ public static class Lib
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetHeight(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetDpiX(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetDpiY(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern MonitorRotation GetRotation(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern bool IsPrimary(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern bool IsCursorVisible(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetCursorX(int id);
|
||||
public static extern int GetCursorX();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetCursorY(int id);
|
||||
public static extern int GetCursorY();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetCursorShapeWidth(int id);
|
||||
public static extern int GetCursorShapeWidth();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetCursorShapeHeight(int id);
|
||||
public static extern int GetCursorShapeHeight();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetCursorShapePitch(int id);
|
||||
public static extern int GetCursorShapePitch();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern CursorShapeType GetCursorShapeType(int id);
|
||||
public static extern CursorShapeType GetCursorShapeType();
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void UpdateCursorTexture(int id, System.IntPtr ptr);
|
||||
public static extern void GetCursorTexture(int id, System.IntPtr ptr);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int SetTexturePtr(int id, IntPtr ptr);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetMoveRectCount(int id);
|
||||
[DllImport("uDesktopDuplication", EntryPoint = "GetMoveRects")]
|
||||
private static extern IntPtr GetMoveRects_Internal(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern int GetDirtyRectCount(int id);
|
||||
[DllImport("uDesktopDuplication", EntryPoint = "GetDirtyRects")]
|
||||
private static extern IntPtr GetDirtyRects_Internal(int id);
|
||||
[DllImport("uDesktopDuplication", EntryPoint = "GetPixels")]
|
||||
private static extern bool GetPixels_Internal(int id, System.IntPtr ptr, int x, int y, int width, int height);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern bool HasBeenUpdated(int id);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern bool UseGetPixels(int id, bool use);
|
||||
[DllImport("uDesktopDuplication")]
|
||||
public static extern void SetFrameRate(uint frameRate);
|
||||
|
||||
public static string GetName(int id)
|
||||
{
|
||||
@@ -92,6 +181,60 @@ public static class Lib
|
||||
GetName(id, buf, buf.Capacity);
|
||||
return buf.ToString();
|
||||
}
|
||||
|
||||
public static DXGI_OUTDUPL_MOVE_RECT[] GetMoveRects(int id)
|
||||
{
|
||||
var count = GetMoveRectCount(id);
|
||||
var rects = new DXGI_OUTDUPL_MOVE_RECT[count];
|
||||
var ptr = GetMoveRects_Internal(id);
|
||||
var size = Marshal.SizeOf(typeof(DXGI_OUTDUPL_MOVE_RECT));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
var data = new IntPtr(ptr.ToInt64() + size * i);
|
||||
rects[i] = (DXGI_OUTDUPL_MOVE_RECT)Marshal.PtrToStructure(data, typeof(DXGI_OUTDUPL_MOVE_RECT));
|
||||
}
|
||||
return rects;
|
||||
}
|
||||
|
||||
public static RECT[] GetDirtyRects(int id)
|
||||
{
|
||||
var count = GetDirtyRectCount(id);
|
||||
var rects = new RECT[count];
|
||||
var ptr = GetDirtyRects_Internal(id);
|
||||
var size = Marshal.SizeOf(typeof(RECT));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
var data = new IntPtr(ptr.ToInt64() + size * i);
|
||||
rects[i] = (RECT)Marshal.PtrToStructure(data, typeof(RECT));
|
||||
}
|
||||
return rects;
|
||||
}
|
||||
|
||||
public static Color32[] GetPixels(int id, int x, int y, int width, int height)
|
||||
{
|
||||
var color = new Color32[width * height];
|
||||
GetPixels(id, color, x, y, width, height);
|
||||
return color;
|
||||
}
|
||||
|
||||
public static bool GetPixels(int id, Color32[] colors, int x, int y, int width, int height)
|
||||
{
|
||||
if (colors.Length < width * height) {
|
||||
Debug.LogErrorFormat("colors is small.", id, x, y, width, height);
|
||||
return false;
|
||||
}
|
||||
var handle = GCHandle.Alloc(colors, GCHandleType.Pinned);
|
||||
var ptr = handle.AddrOfPinnedObject();
|
||||
if (!GetPixels_Internal(id, ptr, x, y, width, height)) {
|
||||
Debug.LogErrorFormat("GetPixels({0}, {1}, {2}, {3}, {4}) failed.", id, x, y, width, height);
|
||||
return false;
|
||||
}
|
||||
handle.Free();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Color32 GetPixel(int id, int x, int y)
|
||||
{
|
||||
return GetPixels(id, x, y, 1, 1)[0];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,12 +10,22 @@ public class Manager : MonoBehaviour
|
||||
private static Manager instance_;
|
||||
public static Manager instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance_) return instance_;
|
||||
var go = new GameObject("uDesktopDuplicationManager");
|
||||
return go.AddComponent<Manager>();
|
||||
get { return CreateInstance(); }
|
||||
}
|
||||
|
||||
public static Manager CreateInstance()
|
||||
{
|
||||
if (instance_ != null) return instance_;
|
||||
|
||||
var manager = FindObjectOfType<Manager>();
|
||||
if (manager) {
|
||||
instance_ = manager;
|
||||
return manager;
|
||||
}
|
||||
|
||||
var go = new GameObject("uDesktopDuplicationManager");
|
||||
instance_ = go.AddComponent<Manager>();
|
||||
return instance_;
|
||||
}
|
||||
|
||||
private List<Monitor> monitors_ = new List<Monitor>();
|
||||
@@ -29,6 +39,11 @@ public class Manager : MonoBehaviour
|
||||
get { return Lib.GetMonitorCount(); }
|
||||
}
|
||||
|
||||
static public int cursorMonitorId
|
||||
{
|
||||
get { return Lib.GetCursorMonitorId(); }
|
||||
}
|
||||
|
||||
static public Monitor primary
|
||||
{
|
||||
get
|
||||
@@ -37,31 +52,81 @@ public class Manager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField, Tooltip("Set Desktop Duplication API timeout (milliseconds).")]
|
||||
int timeout = 0;
|
||||
[Tooltip("Debug mode is not applied while running.")]
|
||||
[SerializeField] DebugMode debugMode = DebugMode.File;
|
||||
|
||||
[SerializeField] float retryReinitializationDuration = 1f;
|
||||
|
||||
private Coroutine renderCoroutine_ = null;
|
||||
private bool shouldReinitialize_ = false;
|
||||
private float reinitializationTimer_ = 0f;
|
||||
private bool isFirstFrame_ = true;
|
||||
|
||||
public static event Lib.DebugLogDelegate onDebugLog = OnDebugLog;
|
||||
public static event Lib.DebugLogDelegate onDebugErr = OnDebugErr;
|
||||
|
||||
[AOT.MonoPInvokeCallback(typeof(Lib.DebugLogDelegate))]
|
||||
private static void OnDebugLog(string msg) { Debug.Log(msg); }
|
||||
[AOT.MonoPInvokeCallback(typeof(Lib.DebugLogDelegate))]
|
||||
private static void OnDebugErr(string msg) { Debug.LogError(msg); }
|
||||
|
||||
public delegate void ReinitializeHandler();
|
||||
public static event ReinitializeHandler onReinitialized;
|
||||
|
||||
public static Monitor GetMonitor(int id)
|
||||
{
|
||||
if (id < 0 || id >= Manager.monitors.Count) {
|
||||
Debug.LogErrorFormat("[uDD::Error] there is no monitor whose id is {0}.", id);
|
||||
return Manager.primary;
|
||||
}
|
||||
return monitors[Mathf.Clamp(id, 0, Manager.monitorCount - 1)];
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
Lib.InitializeUDD();
|
||||
// for simple singleton
|
||||
|
||||
if (instance_ == this) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance_ != null && instance_ != this) {
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance_ != null) return;
|
||||
instance_ = this;
|
||||
|
||||
Lib.SetDebugMode(debugMode);
|
||||
Lib.SetLogFunc(onDebugLog);
|
||||
Lib.SetErrorFunc(onDebugErr);
|
||||
|
||||
Lib.Initialize();
|
||||
|
||||
CreateMonitors();
|
||||
|
||||
Lib.SetTimeout(timeout);
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
Shader.DisableKeyword("USE_GAMMA_TO_LINEAR_SPACE");
|
||||
#else
|
||||
Shader.EnableKeyword("USE_GAMMA_TO_LINEAR_SPACE");
|
||||
#endif
|
||||
}
|
||||
|
||||
void OnApplicationQuit()
|
||||
{
|
||||
Lib.FinalizeUDD();
|
||||
Lib.Finalize();
|
||||
DestroyMonitors();
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
renderCoroutine_ = StartCoroutine(OnRender());
|
||||
if (!isFirstFrame_) {
|
||||
Reinitialize();
|
||||
}
|
||||
|
||||
Lib.SetDebugMode(debugMode);
|
||||
Lib.SetLogFunc(onDebugLog);
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
@@ -70,18 +135,78 @@ public class Manager : MonoBehaviour
|
||||
StopCoroutine(renderCoroutine_);
|
||||
renderCoroutine_ = null;
|
||||
}
|
||||
|
||||
Lib.SetLogFunc(null);
|
||||
Lib.SetErrorFunc(null);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
Lib.Update();
|
||||
ReinitializeIfNeeded();
|
||||
UpdateMessage();
|
||||
isFirstFrame_ = false;
|
||||
}
|
||||
|
||||
[ContextMenu("Reinitialize")]
|
||||
public void Reinitialize()
|
||||
{
|
||||
Debug.Log("[uDD] Reinitialize");
|
||||
Lib.Reinitialize();
|
||||
CreateMonitors();
|
||||
if (onReinitialized != null) {
|
||||
onReinitialized();
|
||||
}
|
||||
}
|
||||
|
||||
void ReinitializeIfNeeded()
|
||||
{
|
||||
bool reinitializeNeeded = false;
|
||||
|
||||
for (int i = 0; i < monitors.Count; ++i) {
|
||||
var monitor = monitors[i];
|
||||
var state = monitor.state;
|
||||
if (
|
||||
state == DuplicatorState.NotSet ||
|
||||
state == DuplicatorState.AccessLost ||
|
||||
state == DuplicatorState.AccessDenied ||
|
||||
state == DuplicatorState.SessionDisconnected ||
|
||||
state == DuplicatorState.Unknown
|
||||
) {
|
||||
reinitializeNeeded = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Lib.HasMonitorCountChanged()) {
|
||||
reinitializeNeeded = true;
|
||||
}
|
||||
|
||||
if (!shouldReinitialize_ && reinitializeNeeded) {
|
||||
shouldReinitialize_ = true;
|
||||
reinitializationTimer_ = 0f;
|
||||
}
|
||||
|
||||
if (shouldReinitialize_) {
|
||||
if (reinitializationTimer_ > retryReinitializationDuration) {
|
||||
Reinitialize();
|
||||
shouldReinitialize_ = false;
|
||||
}
|
||||
reinitializationTimer_ += Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateMessage()
|
||||
{
|
||||
var message = Lib.PopMessage();
|
||||
while (message != Message.None) {
|
||||
Debug.Log("[uDD] " + message);
|
||||
switch (message) {
|
||||
case Message.Reinitialized:
|
||||
Debug.Log("Reinitialize");
|
||||
Reinitialize();
|
||||
ReinitializeMonitors();
|
||||
break;
|
||||
case Message.TextureSizeChanged:
|
||||
RecreateTextures();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -106,18 +231,35 @@ public class Manager : MonoBehaviour
|
||||
|
||||
void CreateMonitors()
|
||||
{
|
||||
DestroyMonitors();
|
||||
for (int i = 0; i < monitorCount; ++i) {
|
||||
monitors.Add(new Monitor(i));
|
||||
}
|
||||
}
|
||||
|
||||
void Reinitialize()
|
||||
void DestroyMonitors()
|
||||
{
|
||||
for (int i = 0; i < monitors.Count; ++i) {
|
||||
monitors[i].DestroyTexture();
|
||||
}
|
||||
monitors.Clear();
|
||||
}
|
||||
|
||||
void ReinitializeMonitors()
|
||||
{
|
||||
for (int i = 0; i < monitorCount; ++i) {
|
||||
if (i == monitors.Count) {
|
||||
monitors.Add(new Monitor(i));
|
||||
} else {
|
||||
monitors[i].Reinitialize();
|
||||
}
|
||||
monitors[i].Reinitialize();
|
||||
}
|
||||
}
|
||||
|
||||
void RecreateTextures()
|
||||
{
|
||||
for (int i = 0; i < monitorCount; ++i) {
|
||||
monitors[i].CreateTextureIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,40 @@ public class Monitor
|
||||
public Monitor(int id)
|
||||
{
|
||||
this.id = id;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case DuplicatorState.Ready:
|
||||
break;
|
||||
case DuplicatorState.Running:
|
||||
break;
|
||||
case DuplicatorState.InvalidArg:
|
||||
Debug.LogErrorFormat("[uDD] {0}:{1} => Invalid.", id, name);
|
||||
break;
|
||||
case DuplicatorState.AccessDenied:
|
||||
Debug.LogWarningFormat("[uDD] {0}:{1} => Access Denied.", id, name);
|
||||
break;
|
||||
case DuplicatorState.Unsupported:
|
||||
Debug.LogWarningFormat("[uDD] {0}:{1} => Unsupported.", id, name);
|
||||
break;
|
||||
case DuplicatorState.SessionDisconnected:
|
||||
Debug.LogWarningFormat("[uDD] {0}:{1} => Disconnected.", id, name);
|
||||
break;
|
||||
case DuplicatorState.NotSet:
|
||||
Debug.LogErrorFormat("[uDD] {0}:{1} => Something wrong.", id, name);
|
||||
break;
|
||||
default:
|
||||
Debug.LogErrorFormat("[uDD] {0}:{1} => Unknown error.", id, name);
|
||||
break;
|
||||
}
|
||||
|
||||
if (dpiX == 0 || dpiY == 0) {
|
||||
Debug.LogWarningFormat("[uDD] {0}:{1} => Could not get DPI", id, name);
|
||||
}
|
||||
}
|
||||
|
||||
~Monitor()
|
||||
{
|
||||
}
|
||||
|
||||
public int id
|
||||
@@ -21,6 +55,21 @@ public class Monitor
|
||||
get { return id < Manager.monitorCount; }
|
||||
}
|
||||
|
||||
public DuplicatorState state
|
||||
{
|
||||
get { return Lib.GetState(id); }
|
||||
}
|
||||
|
||||
public bool available
|
||||
{
|
||||
get
|
||||
{
|
||||
return
|
||||
state == DuplicatorState.Ready ||
|
||||
state == DuplicatorState.Running;
|
||||
}
|
||||
}
|
||||
|
||||
public string name
|
||||
{
|
||||
get { return Lib.GetName(id); }
|
||||
@@ -61,6 +110,36 @@ public class Monitor
|
||||
get { return Lib.GetHeight(id); }
|
||||
}
|
||||
|
||||
public int dpiX
|
||||
{
|
||||
get
|
||||
{
|
||||
var dpi = Lib.GetDpiX(id);
|
||||
if (dpi == 0) dpi = 100; // when monitors are duplicated
|
||||
return dpi;
|
||||
}
|
||||
}
|
||||
|
||||
public int dpiY
|
||||
{
|
||||
get
|
||||
{
|
||||
var dpi = Lib.GetDpiY(id);
|
||||
if (dpi == 0) dpi = 100; // when monitors are duplicated
|
||||
return dpi;
|
||||
}
|
||||
}
|
||||
|
||||
public float widthMeter
|
||||
{
|
||||
get { return width / dpiX * 0.0254f; }
|
||||
}
|
||||
|
||||
public float heightMeter
|
||||
{
|
||||
get { return height / dpiY * 0.0254f; }
|
||||
}
|
||||
|
||||
public MonitorRotation rotation
|
||||
{
|
||||
get { return Lib.GetRotation(id); }
|
||||
@@ -73,12 +152,22 @@ public class Monitor
|
||||
|
||||
public bool isHorizontal
|
||||
{
|
||||
get { return width > height; }
|
||||
get
|
||||
{
|
||||
return
|
||||
(rotation == MonitorRotation.Identity) ||
|
||||
(rotation == MonitorRotation.Rotate180);
|
||||
}
|
||||
}
|
||||
|
||||
public bool isVertical
|
||||
{
|
||||
get { return height > width; }
|
||||
get
|
||||
{
|
||||
return
|
||||
(rotation == MonitorRotation.Rotate90) ||
|
||||
(rotation == MonitorRotation.Rotate270);
|
||||
}
|
||||
}
|
||||
|
||||
public bool isCursorVisible
|
||||
@@ -86,29 +175,86 @@ public class Monitor
|
||||
get { return Lib.IsCursorVisible(id); }
|
||||
}
|
||||
|
||||
public int pointerX
|
||||
public int cursorX
|
||||
{
|
||||
get { return Lib.GetCursorX(id); }
|
||||
get { return Lib.GetCursorMonitorId() == id ? Lib.GetCursorX() : -1; }
|
||||
}
|
||||
|
||||
public int pointerY
|
||||
public int cursorY
|
||||
{
|
||||
get { return Lib.GetCursorY(id); }
|
||||
get { return Lib.GetCursorMonitorId() == id ? Lib.GetCursorY() : -1; }
|
||||
}
|
||||
|
||||
public int pointerShapeWidth
|
||||
public int systemCursorX
|
||||
{
|
||||
get { return Lib.GetCursorShapeWidth(id); }
|
||||
get
|
||||
{
|
||||
var p = Utility.GetCursorPos();
|
||||
return p.x - left;
|
||||
}
|
||||
}
|
||||
|
||||
public int pointerShapeHeight
|
||||
public int systemCursorY
|
||||
{
|
||||
get { return Lib.GetCursorShapeHeight(id); }
|
||||
get
|
||||
{
|
||||
var p = Utility.GetCursorPos();
|
||||
return p.y - top;
|
||||
}
|
||||
}
|
||||
|
||||
public CursorShapeType pointerShapeType
|
||||
public int cursorShapeWidth
|
||||
{
|
||||
get { return Lib.GetCursorShapeType(id); }
|
||||
get { return Lib.GetCursorShapeWidth(); }
|
||||
}
|
||||
|
||||
public int cursorShapeHeight
|
||||
{
|
||||
get { return Lib.GetCursorShapeHeight(); }
|
||||
}
|
||||
|
||||
public CursorShapeType cursorShapeType
|
||||
{
|
||||
get { return Lib.GetCursorShapeType(); }
|
||||
}
|
||||
|
||||
public int moveRectCount
|
||||
{
|
||||
get { return Lib.GetMoveRectCount(id); }
|
||||
}
|
||||
|
||||
public DXGI_OUTDUPL_MOVE_RECT[] moveRects
|
||||
{
|
||||
get { return Lib.GetMoveRects(id); }
|
||||
}
|
||||
|
||||
public int dirtyRectCount
|
||||
{
|
||||
get { return Lib.GetDirtyRectCount(id); }
|
||||
}
|
||||
|
||||
public RECT[] dirtyRects
|
||||
{
|
||||
get { return Lib.GetDirtyRects(id); }
|
||||
}
|
||||
|
||||
public bool hasBeenUpdated
|
||||
{
|
||||
get { return Lib.HasBeenUpdated(id); }
|
||||
}
|
||||
|
||||
bool useGetPixels_ = false;
|
||||
public bool useGetPixels
|
||||
{
|
||||
get
|
||||
{
|
||||
return useGetPixels_;
|
||||
}
|
||||
set
|
||||
{
|
||||
useGetPixels_ = value;
|
||||
Lib.UseGetPixels(id, value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool shouldBeUpdated
|
||||
@@ -117,52 +263,111 @@ public class Monitor
|
||||
set;
|
||||
}
|
||||
|
||||
private static Texture2D errorTexture_;
|
||||
private static readonly string errorTexturePath = "uDesktopDuplication/Textures/NotAvailable";
|
||||
private Texture2D errorTexture
|
||||
{
|
||||
get
|
||||
{
|
||||
return errorTexture_ ??
|
||||
(errorTexture_ = Resources.Load<Texture2D>(errorTexturePath));
|
||||
}
|
||||
}
|
||||
|
||||
private Texture2D texture_;
|
||||
private System.IntPtr texturePtr_;
|
||||
public Texture2D texture
|
||||
{
|
||||
get
|
||||
{
|
||||
if (texture_ == null) {
|
||||
CreateTexture();
|
||||
}
|
||||
if (!available) return errorTexture;
|
||||
if (texture_ == null) CreateTextureIfNeeded();
|
||||
return texture_;
|
||||
}
|
||||
}
|
||||
|
||||
public void Render()
|
||||
{
|
||||
Lib.SetTexturePtr(id, texture_.GetNativeTexturePtr());
|
||||
GL.IssuePluginEvent(Lib.GetRenderEventFunc(), id);
|
||||
if (texture_ && available && texturePtr_ != System.IntPtr.Zero) {
|
||||
Lib.SetTexturePtr(id, texturePtr_);
|
||||
GL.IssuePluginEvent(Lib.GetRenderEventFunc(), id);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateCursorTexture(System.IntPtr ptr)
|
||||
public void GetCursorTexture(System.IntPtr ptr)
|
||||
{
|
||||
Lib.UpdateCursorTexture(id, ptr);
|
||||
Lib.GetCursorTexture(id, ptr);
|
||||
}
|
||||
|
||||
void CreateTexture()
|
||||
public void CreateTextureIfNeeded()
|
||||
{
|
||||
if (!available) return;
|
||||
|
||||
var w = isHorizontal ? width : height;
|
||||
var h = isHorizontal ? height : width;
|
||||
bool shouldCreate = true;
|
||||
|
||||
if (texture_) {
|
||||
if (texture_.width != w || texture_.height != h) {
|
||||
if (texture_) Object.DestroyImmediate(texture_);
|
||||
shouldCreate = true;
|
||||
} else {
|
||||
shouldCreate = false;
|
||||
}
|
||||
if (texture_ && texture_.width == w && texture_.height == h) {
|
||||
shouldCreate = false;
|
||||
}
|
||||
|
||||
if (w <= 0 || h <= 0) {
|
||||
shouldCreate = false;
|
||||
}
|
||||
|
||||
if (shouldCreate) {
|
||||
texture_ = new Texture2D(w, h, TextureFormat.BGRA32, false);
|
||||
CreateTexture();
|
||||
}
|
||||
}
|
||||
|
||||
void CreateTexture()
|
||||
{
|
||||
DestroyTexture();
|
||||
var w = isHorizontal ? width : height;
|
||||
var h = isHorizontal ? height : width;
|
||||
texture_ = new Texture2D(w, h, TextureFormat.BGRA32, false);
|
||||
texturePtr_ = texture_.GetNativeTexturePtr();
|
||||
}
|
||||
|
||||
public void DestroyTexture()
|
||||
{
|
||||
if (texture_) {
|
||||
Object.Destroy(texture_);
|
||||
texture_ = null;
|
||||
texturePtr_ = System.IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
public void Reinitialize()
|
||||
{
|
||||
CreateTexture();
|
||||
CreateTextureIfNeeded();
|
||||
}
|
||||
|
||||
public Color32[] GetPixels(int x, int y, int width, int height)
|
||||
{
|
||||
if (!useGetPixels_) {
|
||||
Debug.LogErrorFormat("Please set Monitor[{0}].useGetPixels as true.", id);
|
||||
return null;
|
||||
}
|
||||
return Lib.GetPixels(id, x, y, width, height);
|
||||
}
|
||||
|
||||
public bool GetPixels(Color32[] colors, int x, int y, int width, int height)
|
||||
{
|
||||
if (!useGetPixels_) {
|
||||
Debug.LogErrorFormat("Please set Monitor[{0}].useGetPixels as true.", id);
|
||||
return false;
|
||||
}
|
||||
return Lib.GetPixels(id, colors, x, y, width, height);
|
||||
}
|
||||
|
||||
public Color32 GetPixel(int x, int y)
|
||||
{
|
||||
if (!useGetPixels_) {
|
||||
Debug.LogErrorFormat("Please set Monitor[{0}].useGetPixels as true.", id);
|
||||
return Color.black;
|
||||
}
|
||||
return Lib.GetPixel(id, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,39 +6,245 @@ namespace uDesktopDuplication
|
||||
[AddComponentMenu("uDesktopDuplication/Texture")]
|
||||
public class Texture : MonoBehaviour
|
||||
{
|
||||
private Monitor monitor_;
|
||||
Monitor monitor_;
|
||||
public Monitor monitor
|
||||
{
|
||||
get { return monitor_; }
|
||||
set
|
||||
{
|
||||
monitor_ = value;
|
||||
material = GetComponent<Renderer>().material;
|
||||
material.mainTexture = monitor_.texture;
|
||||
if (monitor_ != null) {
|
||||
material.mainTexture = monitor_.texture;
|
||||
width = transform.localScale.x;
|
||||
rotation = monitor.rotation;
|
||||
invertX = invertX_;
|
||||
invertY = invertY_;
|
||||
useClip = useClip_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int lastMonitorId_ = 0;
|
||||
public int monitorId
|
||||
{
|
||||
get { return monitor.id; }
|
||||
set { monitor = Manager.monitors[Mathf.Clamp(value, 0, Manager.monitorCount - 1)]; }
|
||||
set { monitor = Manager.GetMonitor(value); }
|
||||
}
|
||||
|
||||
public bool invertX = false;
|
||||
public bool invertY = false;
|
||||
[SerializeField] bool invertX_ = false;
|
||||
public bool invertX
|
||||
{
|
||||
get
|
||||
{
|
||||
return invertX_;
|
||||
}
|
||||
set
|
||||
{
|
||||
invertX_ = value;
|
||||
if (invertX_) {
|
||||
material.EnableKeyword("INVERT_X");
|
||||
} else {
|
||||
material.DisableKeyword("INVERT_X");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField] bool invertY_ = false;
|
||||
public bool invertY
|
||||
{
|
||||
get
|
||||
{
|
||||
return invertY_;
|
||||
}
|
||||
set
|
||||
{
|
||||
invertY_ = value;
|
||||
if (invertY_) {
|
||||
material.EnableKeyword("INVERT_Y");
|
||||
} else {
|
||||
material.DisableKeyword("INVERT_Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorRotation rotation
|
||||
{
|
||||
get
|
||||
{
|
||||
return monitor.rotation;
|
||||
}
|
||||
private set
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case MonitorRotation.Identity:
|
||||
material.DisableKeyword("ROTATE90");
|
||||
material.DisableKeyword("ROTATE180");
|
||||
material.DisableKeyword("ROTATE270");
|
||||
break;
|
||||
case MonitorRotation.Rotate90:
|
||||
material.EnableKeyword("ROTATE90");
|
||||
material.DisableKeyword("ROTATE180");
|
||||
material.DisableKeyword("ROTATE270");
|
||||
break;
|
||||
case MonitorRotation.Rotate180:
|
||||
material.DisableKeyword("ROTATE90");
|
||||
material.EnableKeyword("ROTATE180");
|
||||
material.DisableKeyword("ROTATE270");
|
||||
break;
|
||||
case MonitorRotation.Rotate270:
|
||||
material.DisableKeyword("ROTATE90");
|
||||
material.DisableKeyword("ROTATE180");
|
||||
material.EnableKeyword("ROTATE270");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField] bool useClip_ = false;
|
||||
public Vector2 clipPos = Vector2.zero;
|
||||
public Vector2 clipScale = new Vector2(0.2f, 0.2f);
|
||||
public bool useClip
|
||||
{
|
||||
get
|
||||
{
|
||||
return useClip_;
|
||||
}
|
||||
set
|
||||
{
|
||||
useClip_ = value;
|
||||
if (useClip_) {
|
||||
material.EnableKeyword("USE_CLIP");
|
||||
} else {
|
||||
material.DisableKeyword("USE_CLIP");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool bend
|
||||
{
|
||||
get
|
||||
{
|
||||
return material.GetInt("_Bend") != 0;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value) {
|
||||
material.EnableKeyword("BEND_ON");
|
||||
material.SetInt("_Bend", 1);
|
||||
} else {
|
||||
material.DisableKeyword("BEND_ON");
|
||||
material.SetInt("_Bend", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum MeshForwardDirection
|
||||
{
|
||||
Y = 0,
|
||||
Z = 1,
|
||||
}
|
||||
public MeshForwardDirection meshForwardDirection
|
||||
{
|
||||
get
|
||||
{
|
||||
return (MeshForwardDirection)material.GetInt("_Forward");
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (value) {
|
||||
case MeshForwardDirection.Y:
|
||||
material.SetInt("_Forward", 0);
|
||||
material.EnableKeyword("_FORWARD_Y");
|
||||
material.DisableKeyword("_FORWARD_Z");
|
||||
break;
|
||||
case MeshForwardDirection.Z:
|
||||
material.SetInt("_Forward", 1);
|
||||
material.DisableKeyword("_FORWARD_Y");
|
||||
material.EnableKeyword("_FORWARD_Z");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum Culling
|
||||
{
|
||||
Off = 0,
|
||||
Front = 1,
|
||||
Back = 2,
|
||||
}
|
||||
public Culling culling
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Culling)material.GetInt("_Cull");
|
||||
}
|
||||
set
|
||||
{
|
||||
material.SetInt("_Cull", (int)value);
|
||||
}
|
||||
}
|
||||
|
||||
public float radius
|
||||
{
|
||||
get { return material.GetFloat("_Radius"); }
|
||||
set { material.SetFloat("_Radius", value); }
|
||||
}
|
||||
|
||||
public float width
|
||||
{
|
||||
get { return material.GetFloat("_Width"); }
|
||||
set { material.SetFloat("_Width", value); }
|
||||
}
|
||||
|
||||
public float thickness
|
||||
{
|
||||
get { return material.GetFloat("_Thickness"); }
|
||||
set { material.SetFloat("_Thickness", value); }
|
||||
}
|
||||
|
||||
Material material_;
|
||||
public Material material
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
get
|
||||
{
|
||||
if (Application.isPlaying) {
|
||||
return material_ ?? (material_ = GetComponent<Renderer>().material); // clone
|
||||
} else {
|
||||
return GetComponent<Renderer>().sharedMaterial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Mesh mesh
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetComponent<MeshFilter>().sharedMesh;
|
||||
}
|
||||
}
|
||||
public float worldWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return transform.localScale.x * (mesh.bounds.extents.x * 2f);
|
||||
}
|
||||
}
|
||||
public float worldHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return transform.localScale.y * (mesh.bounds.extents.y * 2f);
|
||||
}
|
||||
}
|
||||
|
||||
int clipPositionScaleKey_;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (!GetComponent<Cursor>())
|
||||
{
|
||||
gameObject.AddComponent<Cursor>();
|
||||
}
|
||||
clipPositionScaleKey_ = Shader.PropertyToID("_ClipPositionScale");
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
@@ -46,53 +252,205 @@ public class Texture : MonoBehaviour
|
||||
if (monitor == null) {
|
||||
monitor = Manager.primary;
|
||||
}
|
||||
Manager.onReinitialized += Reinitialize;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
Manager.onReinitialized -= Reinitialize;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
monitor.shouldBeUpdated = true;
|
||||
KeepMonitor();
|
||||
RequireUpdate();
|
||||
UpdateMaterial();
|
||||
}
|
||||
|
||||
void KeepMonitor()
|
||||
{
|
||||
if (monitor == null) {
|
||||
Reinitialize();
|
||||
} else {
|
||||
lastMonitorId_ = monitorId;
|
||||
}
|
||||
}
|
||||
|
||||
void RequireUpdate()
|
||||
{
|
||||
if (monitor != null) {
|
||||
monitor.shouldBeUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Reinitialize()
|
||||
{
|
||||
// Monitor instance is released here when initialized.
|
||||
monitor = Manager.GetMonitor(lastMonitorId_);
|
||||
}
|
||||
|
||||
void UpdateMaterial()
|
||||
{
|
||||
if (invertX) {
|
||||
material.EnableKeyword("INVERT_X");
|
||||
} else {
|
||||
material.DisableKeyword("INVERT_X");
|
||||
width = transform.localScale.x;
|
||||
|
||||
if (monitor != null) {
|
||||
rotation = monitor.rotation;
|
||||
}
|
||||
|
||||
if (invertY) {
|
||||
material.EnableKeyword("INVERT_Y");
|
||||
} else {
|
||||
material.DisableKeyword("INVERT_Y");
|
||||
material.SetVector(clipPositionScaleKey_, new Vector4(clipPos.x, clipPos.y, clipScale.x, clipScale.y));
|
||||
}
|
||||
|
||||
public Vector3 GetWorldPositionFromCoord(Vector2 coord)
|
||||
{
|
||||
return GetWorldPositionFromCoord((int)coord.x, (int)coord.y);
|
||||
}
|
||||
|
||||
public Vector3 GetWorldPositionFromCoord(int u, int v)
|
||||
{
|
||||
// Local position (scale included).
|
||||
var x = (float)(u - monitor.width / 2) / monitor.width;
|
||||
var y = -(float)(v - monitor.height / 2) / monitor.height;
|
||||
var localPos = new Vector3(worldWidth * x, worldHeight * y, 0f);
|
||||
|
||||
// Bending
|
||||
if (bend) {
|
||||
var angle = localPos.x / radius;
|
||||
if (meshForwardDirection == MeshForwardDirection.Y) {
|
||||
localPos.y -= radius * (1f - Mathf.Cos(angle));
|
||||
} else {
|
||||
localPos.z -= radius * (1f - Mathf.Cos(angle));
|
||||
}
|
||||
localPos.x = radius * Mathf.Sin(angle);
|
||||
}
|
||||
|
||||
switch (monitor.rotation)
|
||||
{
|
||||
case MonitorRotation.Identity:
|
||||
material.DisableKeyword("ROTATE90");
|
||||
material.DisableKeyword("ROTATE180");
|
||||
material.DisableKeyword("ROTATE270");
|
||||
break;
|
||||
case MonitorRotation.Rotate90:
|
||||
material.EnableKeyword("ROTATE90");
|
||||
material.DisableKeyword("ROTATE180");
|
||||
material.DisableKeyword("ROTATE270");
|
||||
break;
|
||||
case MonitorRotation.Rotate180:
|
||||
material.DisableKeyword("ROTATE90");
|
||||
material.EnableKeyword("ROTATE180");
|
||||
material.DisableKeyword("ROTATE270");
|
||||
break;
|
||||
case MonitorRotation.Rotate270:
|
||||
material.DisableKeyword("ROTATE90");
|
||||
material.DisableKeyword("ROTATE180");
|
||||
material.EnableKeyword("ROTATE270");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
// To world position
|
||||
return transform.position + (transform.rotation * localPos);
|
||||
}
|
||||
|
||||
public struct RayCastResult
|
||||
{
|
||||
public bool hit;
|
||||
public Texture texture;
|
||||
public Vector3 position;
|
||||
public Vector3 normal;
|
||||
public Vector2 coords;
|
||||
public Vector2 desktopCoord;
|
||||
}
|
||||
|
||||
static readonly RayCastResult raycastFailedResult = new RayCastResult {
|
||||
hit = false,
|
||||
texture = null,
|
||||
position = Vector3.zero,
|
||||
normal = Vector3.forward,
|
||||
coords = Vector2.zero,
|
||||
desktopCoord = Vector2.zero,
|
||||
};
|
||||
|
||||
// This function can be used only for vertical (= MeshForwardDirection.Z) plane.
|
||||
public RayCastResult RayCast(Vector3 from, Vector3 dir)
|
||||
{
|
||||
var r = radius;
|
||||
var center = transform.position - transform.forward * r;
|
||||
|
||||
// Localize the start point of the ray and the direction.
|
||||
var trs = Matrix4x4.TRS(center, transform.rotation, Vector3.one);
|
||||
var invTrs = trs.inverse;
|
||||
Vector3 localFrom = invTrs.MultiplyPoint3x4(from);
|
||||
Vector3 localDir = invTrs.MultiplyVector(dir).normalized;
|
||||
|
||||
// Calculate the intersection points of circle and line on the X-Z plane.
|
||||
var a = localDir.z / localDir.x;
|
||||
var b = localFrom.z - a * localFrom.x;
|
||||
|
||||
var aa = a * a;
|
||||
var bb = b * b;
|
||||
var ab = a * b;
|
||||
var rr = r * r;
|
||||
|
||||
var s = aa * rr - bb + rr;
|
||||
if (s < 0f) {
|
||||
return raycastFailedResult;
|
||||
}
|
||||
s = Mathf.Sqrt(s);
|
||||
|
||||
var t = aa + 1;
|
||||
|
||||
var lx0 = (-s - ab) / t;
|
||||
var lz0 = (b - a * s) / t;
|
||||
var to0 = new Vector3(lx0, 0f, lz0);
|
||||
|
||||
var lx1 = (s - ab) / t;
|
||||
var lz1 = (a * s + b) / t;
|
||||
var to1 = new Vector3(lx1, 0f, lz1);
|
||||
|
||||
var to = (Vector3.Dot(localDir, to0) > 0f) ? to0 : to1;
|
||||
|
||||
// Check if the point is inner angle of mesh width.
|
||||
var toAngle = Mathf.Atan2(to.x, to.z);
|
||||
var halfWidthAngle = (worldWidth / radius) * 0.5f;
|
||||
if (Mathf.Abs(toAngle) > halfWidthAngle) {
|
||||
return raycastFailedResult;
|
||||
}
|
||||
|
||||
// Calculate the intersection points on XZ-Y plane.
|
||||
var v = to - localFrom;
|
||||
var l = Mathf.Sqrt(Mathf.Pow(v.x, 2f) + Mathf.Pow(v.z, 2f));
|
||||
var ly = localFrom.y + l * localDir.y / Mathf.Sqrt(Mathf.Pow(localDir.x, 2f) + Mathf.Pow(localDir.z, 2f));
|
||||
|
||||
// Check if the point is inner mesh height.
|
||||
var halfHeight = worldHeight * 0.5f;
|
||||
if (Mathf.Abs(ly) > halfHeight) {
|
||||
return raycastFailedResult;
|
||||
}
|
||||
|
||||
// Check hit position is in the range of the ray.
|
||||
to.y = ly;
|
||||
var hitPos = trs.MultiplyPoint(to);
|
||||
|
||||
if ((hitPos - from).magnitude > dir.magnitude) {
|
||||
return raycastFailedResult;
|
||||
}
|
||||
|
||||
// Calculate coordinates.
|
||||
var coordX = toAngle / halfWidthAngle * 0.5f;
|
||||
var coordY = ly / halfHeight * 0.5f;
|
||||
|
||||
// Zoom
|
||||
if (useClip) {
|
||||
coordX = clipPos.x + (0.5f + coordX) * clipScale.x;
|
||||
coordX -= Mathf.Floor(coordX);
|
||||
coordX -= 0.5f;
|
||||
|
||||
coordY = (1f - clipPos.y) + (coordY - 0.5f) * clipScale.y;
|
||||
coordY -= Mathf.Floor(coordY);
|
||||
coordY -= 0.5f;
|
||||
}
|
||||
|
||||
// Desktop position
|
||||
int desktopX = monitor.left + (int)((coordX + 0.5f) * monitor.width);
|
||||
int desktopY = monitor.top + (int)((0.5f - coordY) * monitor.height);
|
||||
|
||||
// Calculate normal.
|
||||
var normal = new Vector3(-to.x, 0f, -to.z);
|
||||
|
||||
// Result
|
||||
return new RayCastResult {
|
||||
hit = true,
|
||||
texture = this,
|
||||
position = trs.MultiplyPoint(to),
|
||||
normal = trs.MultiplyVector(normal).normalized,
|
||||
coords = new Vector2(coordX, coordY),
|
||||
desktopCoord = new Vector2(desktopX, desktopY)
|
||||
};
|
||||
}
|
||||
|
||||
public static RayCastResult RayCastAll(Vector3 from, Vector3 dir)
|
||||
{
|
||||
foreach (var uddTexture in GameObject.FindObjectsOfType<uDesktopDuplication.Texture>()) {
|
||||
var result = uddTexture.RayCast(from, dir);
|
||||
if (result.hit) return result;
|
||||
}
|
||||
return raycastFailedResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
42
Assets/uDesktopDuplication/Scripts/Utility.cs
Normal file
42
Assets/uDesktopDuplication/Scripts/Utility.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace uDesktopDuplication
|
||||
{
|
||||
|
||||
public struct MousePoint
|
||||
{
|
||||
public int x;
|
||||
public int y;
|
||||
}
|
||||
|
||||
public static class Utility
|
||||
{
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool GetCursorPos(out MousePoint point);
|
||||
|
||||
public static MousePoint GetCursorPos()
|
||||
{
|
||||
MousePoint p;
|
||||
if (!GetCursorPos(out p)) {
|
||||
p.x = -1;
|
||||
p.y = -1;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
public static void WaitThenDo(System.Action func, float sec)
|
||||
{
|
||||
Manager.instance.StartCoroutine(_WaitThenDo(func, sec));
|
||||
}
|
||||
|
||||
public static IEnumerator _WaitThenDo(System.Action func, float sec)
|
||||
{
|
||||
yield return new WaitForSeconds(sec);
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2d9e4ca459ecb44da8815bafe9655c5
|
||||
timeCreated: 1477635630
|
||||
guid: 6c7e8da181b03ce4fb343ffa33cbb929
|
||||
timeCreated: 1479043365
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
@@ -2,6 +2,7 @@
|
||||
#define UDD_COMMON_CGINC
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "./uDD_Params.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
@@ -17,68 +18,116 @@ struct v2f
|
||||
|
||||
struct Input
|
||||
{
|
||||
float2 uv_MainTex;
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
|
||||
float2 uddInvertUV(float2 uv)
|
||||
inline float2 uddInvertUV(float2 uv)
|
||||
{
|
||||
#ifdef INVERT_X
|
||||
uv.x = 1.0 - uv.x;
|
||||
uv.x = 1.0 - uv.x;
|
||||
#endif
|
||||
#ifdef INVERT_Y
|
||||
uv.y = 1.0 - uv.y;
|
||||
uv.y = 1.0 - uv.y;
|
||||
#endif
|
||||
return uv;
|
||||
return uv;
|
||||
}
|
||||
|
||||
float2 uddRotateUV(float2 uv)
|
||||
inline float2 uddRotateUV(float2 uv)
|
||||
{
|
||||
#ifdef ROTATE90
|
||||
float2 tmp = uv;
|
||||
uv.x = tmp.y;
|
||||
uv.y = 1.0 - tmp.x;
|
||||
#elif ROTATE180
|
||||
uv.x = 1.0 - uv.x;
|
||||
uv.y = 1.0 - uv.y;
|
||||
uv.x = 1.0 - uv.x;
|
||||
uv.y = 1.0 - uv.y;
|
||||
#elif ROTATE270
|
||||
float2 tmp = uv;
|
||||
uv.x = 1.0 - tmp.y;
|
||||
uv.y = tmp.x;
|
||||
#endif
|
||||
return uv;
|
||||
return uv;
|
||||
}
|
||||
|
||||
inline float2 uddClipUV(float2 uv)
|
||||
{
|
||||
uv.x = _ClipX + uv.x * _ClipWidth;
|
||||
uv.y = _ClipY + uv.y * _ClipHeight;
|
||||
return uv;
|
||||
}
|
||||
|
||||
inline void uddConvertToLinearIfNeeded(inout fixed3 rgb)
|
||||
{
|
||||
#ifdef USE_GAMMA_TO_LINEAR_SPACE
|
||||
if (!IsGammaSpace()) {
|
||||
rgb = GammaToLinearSpace(rgb);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
inline fixed4 uddGetScreenTexture(sampler2D tex, float2 uv)
|
||||
inline fixed4 uddGetTexture(sampler2D tex, float2 uv)
|
||||
{
|
||||
fixed4 c = tex2D(tex, uv);
|
||||
uv = uddInvertUV(uv);
|
||||
#ifdef USE_CLIP
|
||||
uv = uddClipUV(uv);
|
||||
#endif
|
||||
fixed4 c = tex2D(tex, uddRotateUV(uv));
|
||||
uddConvertToLinearIfNeeded(c.rgb);
|
||||
return c;
|
||||
}
|
||||
|
||||
inline fixed4 uddGetCursorTexture(sampler2D tex, float2 uv, fixed4 cursorPosScale)
|
||||
inline fixed4 uddGetScreenTexture(float2 uv)
|
||||
{
|
||||
uv.x = (uv.x - cursorPosScale.x) / cursorPosScale.z;
|
||||
uv.y = (uv.y - cursorPosScale.y) / cursorPosScale.w;
|
||||
fixed4 c = tex2D(tex, uv);
|
||||
fixed a = c.a * step(0, uv.x) * step(0, uv.y) * step(uv.x, 1) * step(uv.y, 1);
|
||||
c *= step(0.01, a);
|
||||
return c;
|
||||
return uddGetTexture(_MainTex, uv);
|
||||
}
|
||||
|
||||
inline fixed4 uddGetScreenTextureWithCursor(sampler2D screenTex, sampler2D cursorTex, float2 uv, fixed4 cursorPosScale)
|
||||
inline void uddBendVertex(inout float3 v, half radius, half width, half thickness)
|
||||
{
|
||||
uv = uddInvertUV(uv);
|
||||
fixed4 screen = uddGetScreenTexture(screenTex, uddRotateUV(uv));
|
||||
fixed4 cursor = uddGetCursorTexture(cursorTex, uv, cursorPosScale);
|
||||
fixed4 color = lerp(screen, cursor, cursor.a);
|
||||
uddConvertToLinearIfNeeded(color.rgb);
|
||||
return color;
|
||||
#ifdef BEND_ON
|
||||
half angle = width * v.x / radius;
|
||||
#ifdef _FORWARD_Z
|
||||
v.z *= thickness;
|
||||
radius += v.z;
|
||||
v.z -= radius * (1 - cos(angle));
|
||||
#elif _FORWARD_Y
|
||||
v.y *= thickness;
|
||||
radius += v.y;
|
||||
v.y += radius * (1 - cos(angle));
|
||||
#endif
|
||||
v.x = radius * sin(angle) / width;
|
||||
#else
|
||||
#ifdef _FORWARD_Z
|
||||
v.z *= thickness;
|
||||
#elif _FORWARD_Y
|
||||
v.y *= thickness;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
inline float3 uddRotateY(float3 n, float angle)
|
||||
{
|
||||
float c = cos(angle);
|
||||
float s = sin(angle);
|
||||
return float3(c * n.x - s * n.z, n.y, s * n.x + c * n.z);
|
||||
}
|
||||
|
||||
inline float3 uddRotateX(float3 n, float angle)
|
||||
{
|
||||
float c = cos(angle);
|
||||
float s = sin(angle);
|
||||
return float3(n.x, c * n.y + s * n.z, -s * n.y + c * n.z);
|
||||
}
|
||||
|
||||
inline void uddBendNormal(float4 x, inout float3 n, half radius, half width)
|
||||
{
|
||||
#ifdef BEND_ON
|
||||
half angle = width * x / radius;
|
||||
#ifdef _FORWARD_Z
|
||||
n = uddRotateY(n, -angle);
|
||||
#elif _FORWARD_Y
|
||||
n = uddRotateX(n, -angle);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,18 @@
|
||||
sampler2D _MainTex;
|
||||
fixed4 _Color;
|
||||
sampler2D _CursorTex;
|
||||
|
||||
half4 _CursorPositionScale;
|
||||
#define _CursorX _CursorPositionScale.x
|
||||
#define _CursorY _CursorPositionScale.y
|
||||
#define _CursorWidth _CursorPositionScale.z
|
||||
#define _CursorHeight _CursorPositionScale.w
|
||||
|
||||
half4 _ClipPositionScale;
|
||||
#define _ClipX _ClipPositionScale.x
|
||||
#define _ClipY _ClipPositionScale.y
|
||||
#define _ClipWidth _ClipPositionScale.z
|
||||
#define _ClipHeight _ClipPositionScale.w
|
||||
|
||||
#ifndef SURFACE_SHADER
|
||||
float4 _MainTex_ST;
|
||||
|
||||
@@ -7,6 +7,11 @@ Properties
|
||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
||||
_Glossiness ("Smoothness", Range(0, 1)) = 0.5
|
||||
_Metallic ("Metallic", Range(0, 1)) = 0.0
|
||||
[KeywordEnum(Y, Z)] _Forward("Mesh Forward Direction", Int) = 0
|
||||
[Toggle(BEND_ON)] _Bend("Use Bend", Int) = 0
|
||||
[PowerSlider(10.0)] _Radius("Bend Radius", Range(1, 100)) = 30
|
||||
[PowerSlider(10.0)] _Thickness("Thickness", Range(0.01, 10)) = 1
|
||||
_Width("Width", Range(0.0, 10.0)) = 1.0
|
||||
[KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2
|
||||
}
|
||||
|
||||
@@ -19,22 +24,33 @@ SubShader
|
||||
CGPROGRAM
|
||||
|
||||
#pragma target 3.0
|
||||
#pragma surface surf Standard fullforwardshadows
|
||||
#pragma surface surf Standard fullforwardshadows vertex:vert
|
||||
#pragma multi_compile ___ INVERT_X
|
||||
#pragma multi_compile ___ INVERT_Y
|
||||
#pragma multi_compile ___ VERTICAL
|
||||
#pragma multi_compile ___ ROTATE90 ROTATE180 ROTATE270
|
||||
#pragma multi_compile ___ USE_CLIP
|
||||
#pragma multi_compile ___ BEND_ON
|
||||
#pragma multi_compile _FORWARD_Y _FORWARD_Z
|
||||
#pragma multi_compile ___ USE_GAMMA_TO_LINEAR_SPACE
|
||||
|
||||
#define SURFACE_SHADER
|
||||
#define SURFACE_SHADER
|
||||
#include "./uDD_Common.cginc"
|
||||
#include "./uDD_Params.cginc"
|
||||
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
half _Radius;
|
||||
half _Width;
|
||||
half _Thickness;
|
||||
|
||||
void vert(inout appdata_full v)
|
||||
{
|
||||
uddBendNormal(v.vertex.x, v.normal, _Radius, _Width);
|
||||
uddBendVertex(v.vertex.xyz, _Radius, _Width, _Thickness);
|
||||
}
|
||||
|
||||
void surf(Input IN, inout SurfaceOutputStandard o)
|
||||
{
|
||||
fixed4 c = uddGetScreenTextureWithCursor(_MainTex, _CursorTex, IN.uv_MainTex, _CursorPositionScale) * _Color;
|
||||
fixed4 c = uddGetScreenTexture(IN.uv_MainTex) * _Color;
|
||||
o.Albedo = c.rgb;
|
||||
o.Metallic = _Metallic;
|
||||
o.Smoothness = _Glossiness;
|
||||
|
||||
@@ -5,8 +5,11 @@ Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1, 1, 1, 1)
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[Toggle(USE_BEND)] _UseBend("UseBend", Float) = 0
|
||||
[PowerSlider(10.0)]_Radius ("Radius", Range(3, 100)) = 10
|
||||
[KeywordEnum(Y, Z)] _Forward("Mesh Forward Direction", Int) = 0
|
||||
[Toggle(BEND_ON)] _Bend("Use Bend", Int) = 0
|
||||
[PowerSlider(10.0)] _Radius("Bend Radius", Range(1, 100)) = 30
|
||||
[PowerSlider(10.0)] _Thickness("Thickness", Range(0.01, 10)) = 1
|
||||
_Width("Width", Range(0.0, 10.0)) = 1.0
|
||||
[KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2
|
||||
}
|
||||
|
||||
@@ -20,18 +23,15 @@ Cull [_Cull]
|
||||
CGINCLUDE
|
||||
|
||||
#include "./uDD_Common.cginc"
|
||||
#include "./uDD_Params.cginc"
|
||||
|
||||
fixed _Radius;
|
||||
half _Radius;
|
||||
half _Width;
|
||||
half _Thickness;
|
||||
|
||||
v2f vert(appdata v)
|
||||
{
|
||||
v2f o;
|
||||
#ifdef USE_BEND
|
||||
half a = v.vertex.x / _Radius;
|
||||
v.vertex.x = _Radius * sin(a);
|
||||
v.vertex.y += _Radius * (1 - cos(a));
|
||||
#endif
|
||||
uddBendVertex(v.vertex.xyz, _Radius, _Width, _Thickness);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
@@ -39,7 +39,7 @@ v2f vert(appdata v)
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target
|
||||
{
|
||||
return uddGetScreenTextureWithCursor(_MainTex, _CursorTex, i.uv, _CursorPositionScale);
|
||||
return uddGetScreenTexture(i.uv);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
@@ -51,9 +51,11 @@ Pass
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile ___ INVERT_X
|
||||
#pragma multi_compile ___ INVERT_Y
|
||||
#pragma multi_compile ___ VERTICAL
|
||||
#pragma shader_feature ___ USE_BEND
|
||||
#pragma multi_compile ___ ROTATE90 ROTATE180 ROTATE270
|
||||
#pragma multi_compile ___ USE_CLIP
|
||||
#pragma multi_compile ___ BEND_ON
|
||||
#pragma multi_compile _FORWARD_Y _FORWARD_Z
|
||||
#pragma multi_compile ___ USE_GAMMA_TO_LINEAR_SPACE
|
||||
ENDCG
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ Properties
|
||||
_Color ("Color", Color) = (1, 1, 1, 1)
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_Mask ("Mask", Range(0, 1)) = 0.1
|
||||
[KeywordEnum(Y, Z)] _Forward("Mesh Forward Direction", Int) = 0
|
||||
[Toggle(BEND_ON)] _Bend("Use Bend", Int) = 0
|
||||
[PowerSlider(10.0)] _Radius("Bend Radius", Range(1, 100)) = 30
|
||||
[PowerSlider(10.0)] _Thickness("Thickness", Range(0.01, 10)) = 1
|
||||
_Width("Width", Range(0.0, 10.0)) = 1.0
|
||||
[KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2
|
||||
}
|
||||
|
||||
@@ -21,13 +26,16 @@ Blend SrcAlpha OneMinusSrcAlpha
|
||||
CGINCLUDE
|
||||
|
||||
#include "./uDD_Common.cginc"
|
||||
#include "./uDD_Params.cginc"
|
||||
|
||||
fixed _Mask;
|
||||
half _Radius;
|
||||
half _Width;
|
||||
half _Thickness;
|
||||
|
||||
v2f vert(appdata v)
|
||||
{
|
||||
v2f o;
|
||||
uddBendVertex(v.vertex.xyz, _Radius, _Width, _Thickness);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
@@ -35,23 +43,26 @@ v2f vert(appdata v)
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target
|
||||
{
|
||||
fixed4 tex = uddGetScreenTextureWithCursor(_MainTex, _CursorTex, i.uv, _CursorPositionScale);
|
||||
fixed alpha = pow((tex.r + tex.g + tex.b) / 3.0, _Mask);
|
||||
return fixed4(tex.rgb * _Color.rgb, alpha * _Color.a);
|
||||
fixed4 tex = uddGetScreenTexture(i.uv);
|
||||
fixed alpha = pow((tex.r + tex.g + tex.b) / 3.0, _Mask);
|
||||
return fixed4(tex.rgb * _Color.rgb, alpha * _Color.a);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile ___ INVERT_X
|
||||
#pragma multi_compile ___ INVERT_Y
|
||||
#pragma multi_compile ___ VERTICAL
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile ___ INVERT_X
|
||||
#pragma multi_compile ___ INVERT_Y
|
||||
#pragma multi_compile ___ ROTATE90 ROTATE180 ROTATE270
|
||||
ENDCG
|
||||
#pragma multi_compile ___ USE_CLIP
|
||||
#pragma multi_compile ___ BEND_ON
|
||||
#pragma multi_compile _FORWARD_Y _FORWARD_Z
|
||||
#pragma multi_compile ___ USE_GAMMA_TO_LINEAR_SPACE
|
||||
ENDCG
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
179
Assets/uDesktopDuplication/Shaders/uDD_Unlit_Displacement.shader
Normal file
179
Assets/uDesktopDuplication/Shaders/uDD_Unlit_Displacement.shader
Normal file
@@ -0,0 +1,179 @@
|
||||
Shader "uDesktopDuplication/Unlit_Displacement"
|
||||
{
|
||||
|
||||
Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1, 1, 1, 1)
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[KeywordEnum(Y, Z)] _Forward("Mesh Forward Direction", Int) = 0
|
||||
[Toggle(BEND_ON)] _Bend("Use Bend", Int) = 0
|
||||
[PowerSlider(10.0)] _Radius("Bend Radius", Range(1, 100)) = 30
|
||||
_Width ("Width", Range(0.0, 10.0)) = 1.92
|
||||
[PowerSlider(10.0)] _Thickness("Thickness", Range(0.01, 10)) = 1
|
||||
[KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2
|
||||
_DispTex ("Displacement Map", 2D) = "black" {}
|
||||
_DispFactor("Displacement Factor", Range(0, 5.0)) = 1
|
||||
_TessMinDist("Tessellation Min Distance", Range(0.1, 100.0)) = 1.0
|
||||
_TessMaxDist("Tessellation Max Distance", Range(0.1, 100.0)) = 5.0
|
||||
_TessFactor("Tessellation Factor", Range(0.1, 50.0)) = 10.0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
|
||||
Tags { "RenderType"="Opaque" }
|
||||
|
||||
Cull [_Cull]
|
||||
|
||||
CGINCLUDE
|
||||
|
||||
#include "./uDD_Common.cginc"
|
||||
#include "Tessellation.cginc"
|
||||
|
||||
half _Radius;
|
||||
half _Width;
|
||||
half _Thickness;
|
||||
Texture2D _DispTex;
|
||||
SamplerState sampler_DispTex;
|
||||
half _DispFactor;
|
||||
half _TessMinDist;
|
||||
half _TessMaxDist;
|
||||
half _TessFactor;
|
||||
|
||||
struct VsInput
|
||||
{
|
||||
float3 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct HsInput
|
||||
{
|
||||
float4 f4Position : POS;
|
||||
float3 f3Normal : NORMAL;
|
||||
float2 f2TexCoord : TEXCOORD;
|
||||
};
|
||||
|
||||
struct HsControlPointOutput
|
||||
{
|
||||
float3 f3Position : POS;
|
||||
float3 f3Normal : NORMAL;
|
||||
float2 f2TexCoord : TEXCOORD;
|
||||
};
|
||||
|
||||
struct HsConstantOutput
|
||||
{
|
||||
float fTessFactor[3] : SV_TessFactor;
|
||||
float fInsideTessFactor : SV_InsideTessFactor;
|
||||
};
|
||||
|
||||
struct DsOutput
|
||||
{
|
||||
float4 f4Position : SV_Position;
|
||||
float2 f2TexCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
HsInput vert(VsInput i)
|
||||
{
|
||||
HsInput o;
|
||||
o.f4Position = float4(i.vertex, 1.0);
|
||||
o.f3Normal = i.normal;
|
||||
o.f2TexCoord = i.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
[domain("tri")]
|
||||
[partitioning("integer")]
|
||||
[outputtopology("triangle_cw")]
|
||||
[patchconstantfunc("hullConst")]
|
||||
[outputcontrolpoints(3)]
|
||||
HsControlPointOutput hull(InputPatch<HsInput, 3> i, uint id : SV_OutputControlPointID)
|
||||
{
|
||||
HsControlPointOutput o = (HsControlPointOutput)0;
|
||||
o.f3Position = i[id].f4Position.xyz;
|
||||
o.f3Normal = i[id].f3Normal;
|
||||
o.f2TexCoord = i[id].f2TexCoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
HsConstantOutput hullConst(InputPatch<HsInput, 3> i)
|
||||
{
|
||||
HsConstantOutput o = (HsConstantOutput)0;
|
||||
|
||||
float4 p0 = i[0].f4Position;
|
||||
float4 p1 = i[1].f4Position;
|
||||
float4 p2 = i[2].f4Position;
|
||||
float4 tessFactor = UnityDistanceBasedTess(p0, p1, p2, _TessMinDist, _TessMaxDist, _TessFactor);
|
||||
|
||||
o.fTessFactor[0] = tessFactor.x;
|
||||
o.fTessFactor[1] = tessFactor.y;
|
||||
o.fTessFactor[2] = tessFactor.z;
|
||||
o.fInsideTessFactor = tessFactor.w;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
[domain("tri")]
|
||||
DsOutput domain(
|
||||
HsConstantOutput hsConst,
|
||||
const OutputPatch<HsControlPointOutput, 3> i,
|
||||
float3 bary : SV_DomainLocation)
|
||||
{
|
||||
DsOutput o = (DsOutput)0;
|
||||
|
||||
float3 f3Position =
|
||||
bary.x * i[0].f3Position +
|
||||
bary.y * i[1].f3Position +
|
||||
bary.z * i[2].f3Position;
|
||||
|
||||
float3 f3Normal = normalize(
|
||||
bary.x * i[0].f3Normal +
|
||||
bary.y * i[1].f3Normal +
|
||||
bary.z * i[2].f3Normal);
|
||||
|
||||
o.f2TexCoord =
|
||||
bary.x * i[0].f2TexCoord +
|
||||
bary.y * i[1].f2TexCoord +
|
||||
bary.z * i[2].f2TexCoord;
|
||||
|
||||
uddBendNormal(f3Position.x, f3Normal, _Radius, _Width);
|
||||
uddBendVertex(f3Position, _Radius, _Width, _Thickness);
|
||||
|
||||
float disp = length(_DispTex.SampleLevel(sampler_DispTex, o.f2TexCoord, 0)) * _DispFactor;
|
||||
f3Position.xyz += f3Normal * disp;
|
||||
|
||||
o.f4Position = UnityObjectToClipPos(float4(f3Position.xyz, 1.0));
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
fixed4 frag(DsOutput i) : SV_Target
|
||||
{
|
||||
return uddGetScreenTexture(i.f2TexCoord);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma hull hull
|
||||
#pragma domain domain
|
||||
#pragma multi_compile ___ INVERT_X
|
||||
#pragma multi_compile ___ INVERT_Y
|
||||
#pragma multi_compile ___ ROTATE90 ROTATE180 ROTATE270
|
||||
#pragma multi_compile ___ USE_CLIP
|
||||
#pragma multi_compile ___ BEND_ON
|
||||
#pragma multi_compile _FORWARD_Y _FORWARD_Z
|
||||
#pragma multi_compile ___ USE_GAMMA_TO_LINEAR_SPACE
|
||||
ENDCG
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Fallback "Unlit/Texture"
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05df46eb51b13c84eabbdf4c53cc8db7
|
||||
timeCreated: 1480072905
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -5,6 +5,11 @@ Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1, 1, 1, 1)
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[KeywordEnum(Y, Z)] _Forward("Mesh Forward Direction", Int) = 0
|
||||
[Toggle(BEND_ON)] _Bend("Use Bend", Int) = 0
|
||||
[PowerSlider(10.0)] _Radius("Bend Radius", Range(1, 100)) = 30
|
||||
[PowerSlider(10.0)] _Thickness("Thickness", Range(0.01, 10)) = 1
|
||||
_Width("Width", Range(0.0, 10.0)) = 1.0
|
||||
[KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2
|
||||
}
|
||||
|
||||
@@ -20,11 +25,15 @@ Blend SrcAlpha OneMinusSrcAlpha
|
||||
CGINCLUDE
|
||||
|
||||
#include "./uDD_Common.cginc"
|
||||
#include "./uDD_Params.cginc"
|
||||
|
||||
half _Radius;
|
||||
half _Width;
|
||||
half _Thickness;
|
||||
|
||||
v2f vert(appdata v)
|
||||
{
|
||||
v2f o;
|
||||
uddBendVertex(v.vertex.xyz, _Radius, _Width, _Thickness);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
@@ -32,7 +41,7 @@ v2f vert(appdata v)
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target
|
||||
{
|
||||
return fixed4(uddGetScreenTextureWithCursor(_MainTex, _CursorTex, i.uv, _CursorPositionScale).rgb, 1.0) * _Color;
|
||||
return fixed4(uddGetScreenTexture(i.uv).rgb, 1.0) * _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
@@ -44,8 +53,11 @@ Pass
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile ___ INVERT_X
|
||||
#pragma multi_compile ___ INVERT_Y
|
||||
#pragma multi_compile ___ VERTICAL
|
||||
#pragma multi_compile ___ ROTATE90 ROTATE180 ROTATE270
|
||||
#pragma multi_compile ___ USE_CLIP
|
||||
#pragma multi_compile ___ BEND_ON
|
||||
#pragma multi_compile _FORWARD_Y _FORWARD_Z
|
||||
#pragma multi_compile ___ USE_GAMMA_TO_LINEAR_SPACE
|
||||
ENDCG
|
||||
}
|
||||
|
||||
|
||||
5
Plugins/uDesktopDuplication/uDesktopDuplication.def
Normal file
5
Plugins/uDesktopDuplication/uDesktopDuplication.def
Normal file
@@ -0,0 +1,5 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
UnityPluginLoad
|
||||
UnityPluginUnload
|
||||
34
Plugins/uDesktopDuplication/uDesktopDuplication.sln
Normal file
34
Plugins/uDesktopDuplication/uDesktopDuplication.sln
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uDesktopDuplication", "uDesktopDuplication\uDesktopDuplication.vcxproj", "{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Debug|x64.Build.0 = Debug|x64
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Debug|x86.Build.0 = Debug|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Release|Win32.Build.0 = Release|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Release|x64.ActiveCfg = Release|x64
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Release|x64.Build.0 = Release|x64
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Release|x86.ActiveCfg = Release|Win32
|
||||
{BC5DE2F9-BDCC-4449-A017-E5642E04BB56}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
104
Plugins/uDesktopDuplication/uDesktopDuplication/Common.cpp
Normal file
104
Plugins/uDesktopDuplication/uDesktopDuplication/Common.cpp
Normal file
@@ -0,0 +1,104 @@
|
||||
#pragma once
|
||||
|
||||
#include <queue>
|
||||
#include <d3d11.h>
|
||||
|
||||
#include "IUnityInterface.h"
|
||||
#include "IUnityGraphicsD3D11.h"
|
||||
#include "Common.h"
|
||||
#include "Debug.h"
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
|
||||
|
||||
|
||||
extern IUnityInterfaces* g_unity;
|
||||
extern std::unique_ptr<MonitorManager> g_manager;
|
||||
extern std::queue<Message> g_messages;
|
||||
|
||||
|
||||
void OutputWindowsInformation()
|
||||
{
|
||||
const auto hModule = ::LoadLibrary(TEXT("ntdll.dll"));
|
||||
if (!hModule) return;
|
||||
|
||||
ScopedReleaser freeModule([&] { ::FreeLibrary(hModule); });
|
||||
|
||||
if (const auto address = ::GetProcAddress(hModule, "RtlGetVersion"))
|
||||
{
|
||||
using RtlGetVersionType = NTSTATUS(WINAPI *)(OSVERSIONINFOEXW*);
|
||||
const auto RtlGetVersion = reinterpret_cast<RtlGetVersionType>(address);
|
||||
|
||||
OSVERSIONINFOEXW os = { sizeof(os) };
|
||||
if (!FAILED(RtlGetVersion(&os)))
|
||||
{
|
||||
Debug::Log("OS Version : ", os.dwMajorVersion, ".", os.dwMinorVersion);
|
||||
Debug::Log("Build Number : ", os.dwBuildNumber);
|
||||
Debug::Log("Service Pack : ", os.szCSDVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IUnityInterfaces* GetUnity()
|
||||
{
|
||||
return g_unity;
|
||||
}
|
||||
|
||||
|
||||
ComPtr<ID3D11Device> GetDevice()
|
||||
{
|
||||
return GetUnity()->Get<IUnityGraphicsD3D11>()->GetDevice();
|
||||
}
|
||||
|
||||
|
||||
const std::unique_ptr<MonitorManager>& GetMonitorManager()
|
||||
{
|
||||
return g_manager;
|
||||
}
|
||||
|
||||
|
||||
LUID GetUnityAdapterLuid()
|
||||
{
|
||||
UDD_FUNCTION_SCOPE_TIMER
|
||||
|
||||
const auto device = GetDevice();
|
||||
|
||||
Microsoft::WRL::ComPtr<IDXGIDevice1> dxgiDevice;
|
||||
if (FAILED(device->QueryInterface(IID_PPV_ARGS(&dxgiDevice)))){
|
||||
Debug::Error("QueryInterface from IUnityGraphicsD3D11 to IDXGIDevice1 failed.");
|
||||
return LUID();
|
||||
}
|
||||
|
||||
Microsoft::WRL::ComPtr<IDXGIAdapter> dxgiAdapter;
|
||||
if (FAILED(dxgiDevice->GetAdapter(&dxgiAdapter))) {
|
||||
Debug::Error("QueryInterface from IDXGIDevice1 to IDXGIAdapter failed.");
|
||||
return LUID();
|
||||
}
|
||||
|
||||
DXGI_ADAPTER_DESC adapterDesc;
|
||||
dxgiAdapter->GetDesc(&adapterDesc);
|
||||
|
||||
return adapterDesc.AdapterLuid;
|
||||
}
|
||||
|
||||
|
||||
void SendMessageToUnity(Message message)
|
||||
{
|
||||
g_messages.push(message);
|
||||
}
|
||||
|
||||
|
||||
ScopedTimer::ScopedTimer(TimerFuncType&& func)
|
||||
: func_(func)
|
||||
, start_(std::chrono::high_resolution_clock::now())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ScopedTimer::~ScopedTimer()
|
||||
{
|
||||
const auto end = std::chrono::high_resolution_clock::now();
|
||||
const auto time = std::chrono::duration_cast<microseconds>(end - start_);
|
||||
func_(time);
|
||||
}
|
||||
@@ -1,15 +1,180 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include "IUnityInterface.h"
|
||||
#include <chrono>
|
||||
#include <wrl/client.h>
|
||||
|
||||
class MonitorManager;
|
||||
|
||||
|
||||
// Output windows version
|
||||
void OutputWindowsInformation();
|
||||
|
||||
// Unity interface getter
|
||||
struct IUnityInterfaces;
|
||||
IUnityInterfaces* GetUnity();
|
||||
ID3D11Device* GetDevice();
|
||||
|
||||
// ID3D11Device (in Unity) getter
|
||||
struct ID3D11Device;
|
||||
Microsoft::WRL::ComPtr<ID3D11Device> GetDevice();
|
||||
|
||||
// Manager getter
|
||||
class MonitorManager;
|
||||
const std::unique_ptr<MonitorManager>& GetMonitorManager();
|
||||
|
||||
// Get adapter LUID to check the adapter of the monitor is same as Unity one.
|
||||
LUID GetUnityAdapterLuid();
|
||||
|
||||
|
||||
|
||||
// Releaser
|
||||
class ScopedReleaser
|
||||
{
|
||||
public:
|
||||
using ReleaseFuncType = std::function<void()>;
|
||||
ScopedReleaser(ReleaseFuncType&& func) : func_(func) {}
|
||||
~ScopedReleaser() { func_(); }
|
||||
|
||||
private:
|
||||
const ReleaseFuncType func_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Timer
|
||||
class ScopedTimer
|
||||
{
|
||||
public:
|
||||
using microseconds = std::chrono::microseconds;
|
||||
using TimerFuncType = std::function<void(microseconds)>;
|
||||
ScopedTimer(TimerFuncType&& func);
|
||||
~ScopedTimer();
|
||||
|
||||
private:
|
||||
const TimerFuncType func_;
|
||||
const std::chrono::time_point<std::chrono::steady_clock> start_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Message is pooled and fetch from Unity.
|
||||
enum class Message
|
||||
{
|
||||
None = -1,
|
||||
Reinitialized = 0,
|
||||
None = -1,
|
||||
Reinitialized = 0,
|
||||
TextureSizeChanged = 1,
|
||||
};
|
||||
void SendMessageToUnity(Message message);
|
||||
|
||||
void SendMessageToUnity(Message message);
|
||||
|
||||
|
||||
|
||||
// Buffer
|
||||
template <class T>
|
||||
class Buffer
|
||||
{
|
||||
public:
|
||||
Buffer()
|
||||
{
|
||||
}
|
||||
|
||||
Buffer(const Buffer& other)
|
||||
{
|
||||
value_.reset();
|
||||
size_ = 0;
|
||||
ExpandIfNeeded(other.size_);
|
||||
memcpy_s(value_.get(), size_, other.value_.get(), other.size_);
|
||||
}
|
||||
|
||||
Buffer<T>& operator=(const Buffer& other)
|
||||
{
|
||||
if (&other == this) return *this;
|
||||
|
||||
value_.reset();
|
||||
size_ = 0;
|
||||
ExpandIfNeeded(other.size_);
|
||||
memcpy_s(value_.get(), size_, other.value_.get(), other.size_);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
~Buffer()
|
||||
{
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
return !value_;
|
||||
}
|
||||
|
||||
void ExpandIfNeeded(UINT size)
|
||||
{
|
||||
if (size > size_)
|
||||
{
|
||||
size_ = size;
|
||||
value_ = std::make_unique<T[]>(size);
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
value_.reset();
|
||||
size_ = 0;
|
||||
}
|
||||
|
||||
UINT Size() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
T* Get() const
|
||||
{
|
||||
return value_.get();
|
||||
}
|
||||
|
||||
T* Get(UINT offset) const
|
||||
{
|
||||
return (value_.get() + offset);
|
||||
}
|
||||
|
||||
template <class U>
|
||||
U* As() const
|
||||
{
|
||||
return reinterpret_cast<U*>(Get());
|
||||
}
|
||||
|
||||
template <class U>
|
||||
U* As(UINT offset) const
|
||||
{
|
||||
return reinterpret_cast<U*>(Get(offset));
|
||||
}
|
||||
|
||||
operator bool() const
|
||||
{
|
||||
return value_ != nullptr;
|
||||
}
|
||||
|
||||
const T operator [](UINT index) const
|
||||
{
|
||||
if (index >= size_)
|
||||
{
|
||||
Debug::Error("Array index out of range: ", index, size_);
|
||||
return T(0);
|
||||
}
|
||||
return value_[index];
|
||||
}
|
||||
|
||||
T& operator [](UINT index)
|
||||
{
|
||||
if (index >= size_)
|
||||
{
|
||||
Debug::Error("Array index out of range: ", index, size_);
|
||||
return value_[0];
|
||||
}
|
||||
return value_[index];
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<T[]> value_;
|
||||
UINT size_ = 0;
|
||||
};
|
||||
@@ -1,217 +1,425 @@
|
||||
#include <d3d11.h>
|
||||
#include "Common.h"
|
||||
#include "MonitorManager.h"
|
||||
#include "Monitor.h"
|
||||
|
||||
#include "Cursor.h"
|
||||
#include "Debug.h"
|
||||
#include "Monitor.h"
|
||||
#include "Duplicator.h"
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
|
||||
|
||||
Cursor::Cursor(Monitor* monitor)
|
||||
: monitor_(monitor)
|
||||
|
||||
Cursor::Cursor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Cursor::~Cursor()
|
||||
{
|
||||
if (apiBuffer_ != nullptr)
|
||||
{
|
||||
delete[] apiBuffer_;
|
||||
apiBuffer_ = nullptr;
|
||||
}
|
||||
if (bgra32Buffer_ != nullptr)
|
||||
{
|
||||
delete[] bgra32Buffer_;
|
||||
bgra32Buffer_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Cursor::Update(const DXGI_OUTDUPL_FRAME_INFO& frameInfo)
|
||||
void Cursor::UpdateBuffer(Duplicator* duplicator, const DXGI_OUTDUPL_FRAME_INFO& frameInfo)
|
||||
{
|
||||
isVisible_ = frameInfo.PointerPosition.Visible != 0;
|
||||
x_ = frameInfo.PointerPosition.Position.x;
|
||||
y_ = frameInfo.PointerPosition.Position.y;
|
||||
UDD_FUNCTION_SCOPE_TIMER
|
||||
|
||||
// TODO: see more information to check where the cursor is.
|
||||
if (isVisible_)
|
||||
if (frameInfo.LastMouseUpdateTime.QuadPart == 0)
|
||||
{
|
||||
GetMonitorManager()->SetCursorMonitorId(monitor_->GetId());
|
||||
}
|
||||
|
||||
if (GetMonitorManager()->GetCursorMonitorId() != monitor_->GetId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Increase the buffer size if needed
|
||||
if (frameInfo.PointerShapeBufferSize > apiBufferSize_)
|
||||
{
|
||||
if (apiBuffer_) delete[] apiBuffer_;
|
||||
apiBuffer_ = new BYTE[frameInfo.PointerShapeBufferSize];
|
||||
apiBufferSize_ = frameInfo.PointerShapeBufferSize;
|
||||
}
|
||||
if (apiBuffer_ == nullptr) return;
|
||||
isVisible_ = frameInfo.PointerPosition.Visible != 0;
|
||||
x_ = frameInfo.PointerPosition.Position.x;
|
||||
y_ = frameInfo.PointerPosition.Position.y;
|
||||
timestamp_ = frameInfo.LastMouseUpdateTime;
|
||||
|
||||
// Get information about the mouse pointer if needed
|
||||
if (frameInfo.PointerShapeBufferSize != 0)
|
||||
if (frameInfo.PointerShapeBufferSize == 0)
|
||||
{
|
||||
UINT bufferSize;
|
||||
monitor_->GetDeskDupl()->GetFramePointerShape(
|
||||
frameInfo.PointerShapeBufferSize,
|
||||
reinterpret_cast<void*>(apiBuffer_),
|
||||
&bufferSize,
|
||||
&shapeInfo_);
|
||||
return;
|
||||
}
|
||||
|
||||
// cursor type
|
||||
const auto cursorType = shapeInfo_.Type;
|
||||
const bool isMono = cursorType == DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME;
|
||||
const bool isColorMask = cursorType == DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR;
|
||||
|
||||
// Size
|
||||
const auto w = shapeInfo_.Width;
|
||||
const auto h = shapeInfo_.Height / (isMono ? 2 : 1);
|
||||
const auto p = shapeInfo_.Pitch;
|
||||
|
||||
// Convert the buffer given by API into BGRA32
|
||||
const auto bgraBufferSize = w * h * 4;
|
||||
if (bgraBufferSize > bgra32BufferSize_)
|
||||
buffer_.ExpandIfNeeded(frameInfo.PointerShapeBufferSize);
|
||||
if (!buffer_)
|
||||
{
|
||||
if (bgra32Buffer_) delete[] bgra32Buffer_;
|
||||
bgra32Buffer_ = new BYTE[bgraBufferSize];
|
||||
bgra32BufferSize_ = bgraBufferSize;
|
||||
}
|
||||
if (bgra32Buffer_ == nullptr) return;
|
||||
|
||||
// If masked, copy the desktop image and merge it with masked image.
|
||||
if (isMono || isColorMask)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
desc.Width = w;
|
||||
desc.Height = h;
|
||||
desc.MipLevels = 1;
|
||||
desc.ArraySize = 1;
|
||||
desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_STAGING;
|
||||
desc.BindFlags = 0;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
|
||||
desc.MiscFlags = 0;
|
||||
|
||||
ID3D11Texture2D* texture = nullptr;
|
||||
hr = GetDevice()->CreateTexture2D(&desc, nullptr, &texture);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
D3D11_BOX box;
|
||||
box.front = 0;
|
||||
box.back = 1;
|
||||
box.left = x_;
|
||||
box.top = y_;
|
||||
box.right = x_ + w;
|
||||
box.bottom = y_ + h;
|
||||
|
||||
ID3D11DeviceContext* context;
|
||||
GetDevice()->GetImmediateContext(&context);
|
||||
context->CopySubresourceRegion(texture, 0, 0, 0, 0, monitor_->GetUnityTexture(), 0, &box);
|
||||
context->Release();
|
||||
|
||||
IDXGISurface* surface = nullptr;
|
||||
hr = texture->QueryInterface(__uuidof(IDXGISurface), (void**)&surface);
|
||||
texture->Release();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DXGI_MAPPED_RECT mappedSurface;
|
||||
hr = surface->Map(&mappedSurface, DXGI_MAP_READ);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
surface->Release();
|
||||
return;
|
||||
}
|
||||
|
||||
// Finally, get the texture behind the mouse cursor.
|
||||
const auto desktop32 = reinterpret_cast<UINT*>(mappedSurface.pBits);
|
||||
const UINT desktopPitch = mappedSurface.Pitch / sizeof(UINT);
|
||||
|
||||
// Access RGBA values at the same time
|
||||
auto output32 = reinterpret_cast<UINT*>(bgra32Buffer_);
|
||||
|
||||
if (isMono)
|
||||
{
|
||||
for (UINT row = 0; row < h; ++row)
|
||||
{
|
||||
BYTE mask = 0x80;
|
||||
for (UINT col = 0; col < w; ++col)
|
||||
{
|
||||
const int i = row * w + col;
|
||||
const BYTE andMask = apiBuffer_[col / 8 + row * p] & mask;
|
||||
const BYTE xorMask = apiBuffer_[col / 8 + (row + h) * p] & mask;
|
||||
const UINT andMask32 = andMask ? 0xFFFFFFFF : 0xFF000000;
|
||||
const UINT xorMask32 = xorMask ? 0x00FFFFFF : 0x00000000;
|
||||
output32[i] = (desktop32[row * desktopPitch + col] & andMask32) ^ xorMask32;
|
||||
mask = (mask == 0x01) ? 0x80 : (mask >> 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR
|
||||
{
|
||||
const auto buffer32 = reinterpret_cast<UINT*>(apiBuffer_);
|
||||
|
||||
for (UINT row = 0; row < h; ++row)
|
||||
{
|
||||
for (UINT col = 0; col < w; ++col)
|
||||
{
|
||||
const int i = row * w + col;
|
||||
const int j = row * p / sizeof(UINT) + col;
|
||||
|
||||
UINT mask = 0xFF000000 & buffer32[j];
|
||||
if (mask)
|
||||
{
|
||||
output32[i] = (desktop32[row * desktopPitch + col] ^ buffer32[j]) | 0xFF000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
output32[i] = buffer32[j] | 0xFF000000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hr = surface->Unmap();
|
||||
surface->Release();
|
||||
if (FAILED(hr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else // DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR
|
||||
{
|
||||
auto output32 = reinterpret_cast<UINT*>(bgra32Buffer_);
|
||||
const auto buffer32 = reinterpret_cast<UINT*>(apiBuffer_);
|
||||
for (UINT i = 0; i < w * h; ++i)
|
||||
{
|
||||
output32[i] = buffer32[i];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
// Get mouse pointer information
|
||||
UINT bufferSize;
|
||||
DXGI_OUTDUPL_POINTER_SHAPE_INFO shapeInfo;
|
||||
const auto hr = duplicator->GetDuplication()->GetFramePointerShape(
|
||||
buffer_.Size(),
|
||||
buffer_.Get(),
|
||||
&bufferSize,
|
||||
&shapeInfo);
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
Debug::Error("Cursor::UpdateBuffer() => GetFramePointerShape() failed.");
|
||||
buffer_.Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
shapeInfo_ = shapeInfo;
|
||||
}
|
||||
|
||||
|
||||
void Cursor::UpdateTexture(ID3D11Texture2D* texture)
|
||||
void Cursor::UpdateTexture(
|
||||
Duplicator* duplicator,
|
||||
const ComPtr<ID3D11Texture2D>& desktopTexture)
|
||||
{
|
||||
if (bgra32Buffer_ == nullptr) return;
|
||||
ID3D11DeviceContext* context;
|
||||
UDD_FUNCTION_SCOPE_TIMER
|
||||
|
||||
auto monitor = duplicator->GetMonitor();
|
||||
|
||||
// Check desktop texure
|
||||
if (desktopTexture == nullptr)
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => Desktop texture is null.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Cursor information
|
||||
const auto cursorImageWidth = GetWidth();
|
||||
const auto cursorImageHeight = GetHeight();
|
||||
const auto cursorImagePitch = GetPitch();
|
||||
|
||||
// Monitor orientation
|
||||
const auto monitorRot = static_cast<DXGI_MODE_ROTATION>(monitor->GetRotation());
|
||||
const auto isMonitorPortrait =
|
||||
monitorRot == DXGI_MODE_ROTATION_ROTATE90 ||
|
||||
monitorRot == DXGI_MODE_ROTATION_ROTATE270;
|
||||
|
||||
// Captured size (desktop cooridinates).
|
||||
auto capturedImageWidth = !isMonitorPortrait ? cursorImageWidth : cursorImageHeight;
|
||||
auto capturedImageHeight = !isMonitorPortrait ? cursorImageHeight : cursorImageWidth;
|
||||
|
||||
// Convert the buffer given by API into BGRA32
|
||||
const UINT bgraBufferSize = cursorImageWidth * cursorImageHeight * 4;
|
||||
bgraBuffer_.ExpandIfNeeded(bgraBufferSize);
|
||||
|
||||
// Check buffers
|
||||
if (!bgraBuffer_ || !buffer_)
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => no buffer.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Desktop size
|
||||
const int monitorWidth = monitor->GetWidth();
|
||||
const int monitorHeight = monitor->GetHeight();
|
||||
const int desktopImageWidth = !isMonitorPortrait ? monitorWidth : monitorHeight;
|
||||
const int desktopImageHeight = !isMonitorPortrait ? monitorHeight : monitorWidth;
|
||||
|
||||
// x_, y_ are cooridinates in rotated monitor.
|
||||
// desktopX, desktopY are coordinates in captured desktop image (always landscape).
|
||||
int desktopX, desktopY;
|
||||
switch (monitorRot)
|
||||
{
|
||||
case DXGI_MODE_ROTATION_ROTATE90:
|
||||
{
|
||||
desktopX = y_;
|
||||
desktopY = (desktopImageHeight - 1) - x_ - cursorImageWidth;
|
||||
break;
|
||||
}
|
||||
case DXGI_MODE_ROTATION_ROTATE180:
|
||||
{
|
||||
desktopX = (desktopImageWidth - 1) - x_ - cursorImageWidth;
|
||||
desktopY = (desktopImageHeight - 1) - y_ - cursorImageHeight;
|
||||
break;
|
||||
}
|
||||
case DXGI_MODE_ROTATION_ROTATE270:
|
||||
{
|
||||
desktopX = (desktopImageWidth - 1) - y_ - cursorImageHeight;
|
||||
desktopY = x_;
|
||||
break;
|
||||
}
|
||||
case DXGI_MODE_ROTATION_IDENTITY:
|
||||
case DXGI_MODE_ROTATION_UNSPECIFIED:
|
||||
default:
|
||||
{
|
||||
desktopX = x_;
|
||||
desktopY = y_;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate information to capture desktop image under cursor.
|
||||
int cursorOffsetX = 0;
|
||||
int cursorOffsetY = 0;
|
||||
int capturedImageLeft = desktopX;
|
||||
int capturedImageTop = desktopY;
|
||||
int capturedImageRight = desktopX + capturedImageWidth;
|
||||
int capturedImageBottom = desktopY + capturedImageHeight;
|
||||
|
||||
if (capturedImageLeft < 0)
|
||||
{
|
||||
capturedImageWidth -= -desktopX;
|
||||
cursorOffsetX = -desktopX;
|
||||
capturedImageLeft = 0;
|
||||
}
|
||||
|
||||
if (capturedImageRight >= desktopImageWidth)
|
||||
{
|
||||
capturedImageWidth -= capturedImageRight - desktopImageWidth;
|
||||
capturedImageRight = desktopImageWidth - 1;
|
||||
}
|
||||
|
||||
if (capturedImageTop < 0)
|
||||
{
|
||||
capturedImageHeight -= -desktopY;
|
||||
cursorOffsetY = -desktopY;
|
||||
capturedImageTop = 0;
|
||||
}
|
||||
|
||||
if (capturedImageBottom >= desktopImageHeight)
|
||||
{
|
||||
capturedImageHeight -= capturedImageBottom - desktopImageHeight;
|
||||
capturedImageBottom = desktopImageHeight - 1;
|
||||
}
|
||||
|
||||
// Check if box is inner desktop area
|
||||
if (capturedImageLeft < 0 ||
|
||||
capturedImageTop < 0 ||
|
||||
capturedImageRight >= desktopImageWidth ||
|
||||
capturedImageBottom >= desktopImageHeight)
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => box is out of area.");
|
||||
Debug::Error(
|
||||
" ",
|
||||
"(", capturedImageLeft, ", ", capturedImageTop, ")",
|
||||
" ~ (", capturedImageRight, ", ", capturedImageBottom, ") > ",
|
||||
"(", desktopImageWidth, ", ", desktopImageHeight, ")");
|
||||
return;
|
||||
}
|
||||
|
||||
if (capturedImageWidth == 0 || capturedImageHeight == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
capturedImageArea_ = D3D11_BOX
|
||||
{
|
||||
static_cast<UINT>(capturedImageLeft),
|
||||
static_cast<UINT>(capturedImageTop),
|
||||
0,
|
||||
static_cast<UINT>(capturedImageRight),
|
||||
static_cast<UINT>(capturedImageBottom),
|
||||
1
|
||||
};
|
||||
|
||||
// Create texture for capturing desktop image
|
||||
ComPtr<ID3D11Texture2D> texture;
|
||||
{
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
desc.Width = capturedImageWidth;
|
||||
desc.Height = capturedImageHeight;
|
||||
desc.MipLevels = 1;
|
||||
desc.ArraySize = 1;
|
||||
desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_STAGING;
|
||||
desc.BindFlags = 0;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
|
||||
desc.MiscFlags = 0;
|
||||
|
||||
if (FAILED(duplicator->GetDevice()->CreateTexture2D(&desc, nullptr, &texture)))
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => GetDevice()->CreateTexture2D() failed.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy desktop image to the texture
|
||||
{
|
||||
ComPtr<ID3D11DeviceContext> context;
|
||||
duplicator->GetDevice()->GetImmediateContext(&context);
|
||||
context->CopySubresourceRegion(texture.Get(), 0, 0, 0, 0, desktopTexture.Get(), 0, &capturedImageArea_);
|
||||
}
|
||||
|
||||
// Get mapped surface to access pixels in CPU
|
||||
ComPtr<IDXGISurface> surface;
|
||||
if (FAILED(texture.As(&surface)))
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => texture.As() failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
DXGI_MAPPED_RECT mappedSurface;
|
||||
if (FAILED(surface->Map(&mappedSurface, DXGI_MAP_READ)))
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => surface->Map() failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Finally, get the desktop texture under the mouse cursor.
|
||||
const auto desktop32 = reinterpret_cast<UINT*>(mappedSurface.pBits);
|
||||
const UINT desktopPitch = mappedSurface.Pitch / sizeof(UINT);
|
||||
|
||||
// Rotate cursor image to match the monitor orientation
|
||||
Buffer<BYTE> rotatedBuffer_;
|
||||
rotatedBuffer_.ExpandIfNeeded(buffer_.Size());
|
||||
|
||||
for (int y = 0; y < capturedImageHeight; ++y)
|
||||
{
|
||||
for (int x = 0; x < capturedImageWidth; ++x)
|
||||
{
|
||||
// Cursor coordinates
|
||||
int cursorX, cursorY;
|
||||
|
||||
switch (monitorRot)
|
||||
{
|
||||
case DXGI_MODE_ROTATION_ROTATE90:
|
||||
{
|
||||
cursorX = (cursorImageWidth - 1) - (y + cursorOffsetY);
|
||||
cursorY = (x + cursorOffsetX);
|
||||
break;
|
||||
}
|
||||
case DXGI_MODE_ROTATION_ROTATE180:
|
||||
{
|
||||
cursorX = (cursorImageWidth - 1) - (x + cursorOffsetX);
|
||||
cursorY = (cursorImageHeight - 1) - (y + cursorOffsetY);
|
||||
break;
|
||||
}
|
||||
case DXGI_MODE_ROTATION_ROTATE270:
|
||||
{
|
||||
cursorX = (y + cursorOffsetY);
|
||||
cursorY = (cursorImageHeight - 1) - (x + cursorOffsetX);
|
||||
break;
|
||||
}
|
||||
case DXGI_MODE_ROTATION_IDENTITY:
|
||||
case DXGI_MODE_ROTATION_UNSPECIFIED:
|
||||
default:
|
||||
{
|
||||
cursorX = (x + cursorOffsetX);
|
||||
cursorY = (y + cursorOffsetY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const auto outputIndex = y * capturedImageWidth + x;
|
||||
const auto desktopIndex = y * desktopPitch + x;
|
||||
const auto cursorIndex = cursorY * cursorImageWidth + cursorX;
|
||||
const auto buffer32 = buffer_.As<UINT>();
|
||||
auto output32 = bgraBuffer_.As<UINT>();
|
||||
|
||||
switch (GetType())
|
||||
{
|
||||
case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME:
|
||||
{
|
||||
BYTE mask = 0b10000000 >> (cursorX % 8);
|
||||
const BYTE andMask = buffer_[cursorX / 8 + cursorY * cursorImagePitch] & mask;
|
||||
const BYTE xorMask = buffer_[cursorX / 8 + (cursorY + cursorImageHeight) * cursorImagePitch] & mask;
|
||||
const UINT andMask32 = andMask ? 0xFFFFFFFF : 0x00000000;
|
||||
const UINT xorMask32 = xorMask ? 0xFFFFFFFF : 0x00000000;
|
||||
output32[outputIndex] = (desktop32[desktopIndex] & andMask32) ^ xorMask32;
|
||||
break;
|
||||
}
|
||||
case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR:
|
||||
{
|
||||
UINT mask = 0xFF000000 & buffer32[cursorIndex];
|
||||
if (mask)
|
||||
{
|
||||
output32[outputIndex] = (desktop32[desktopIndex] ^ buffer32[cursorIndex]) | 0xFF000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
output32[outputIndex] = buffer32[cursorIndex] | 0xFF000000;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR:
|
||||
{
|
||||
const auto desktop = reinterpret_cast<BYTE*>(&desktop32[desktopIndex]);
|
||||
const auto desktopB = desktop[0];
|
||||
const auto desktopG = desktop[1];
|
||||
const auto desktopR = desktop[2];
|
||||
const auto desktopA = desktop[3];
|
||||
|
||||
const auto cursor = buffer_.Get(cursorIndex * 4);
|
||||
const auto cursorB = cursor[0];
|
||||
const auto cursorG = cursor[1];
|
||||
const auto cursorR = cursor[2];
|
||||
const auto cursorA = cursor[3];
|
||||
|
||||
const auto a0 = cursorA / 255.f;
|
||||
const auto a1 = 1.f - a0;
|
||||
|
||||
auto output = reinterpret_cast<BYTE*>(&output32[outputIndex]);
|
||||
output[0] = static_cast<BYTE>(cursorB * a0 + desktopB * a1);
|
||||
output[1] = static_cast<BYTE>(cursorG * a0 + desktopG * a1);
|
||||
output[2] = static_cast<BYTE>(cursorR * a0 + desktopR * a1);
|
||||
output[3] = desktopA;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => Unknown cursor type");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(surface->Unmap()))
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => surface->Unmap() failed.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Cursor::Draw(const Microsoft::WRL::ComPtr<ID3D11Texture2D>& texture)
|
||||
{
|
||||
UDD_FUNCTION_SCOPE_TIMER
|
||||
|
||||
if (texture == nullptr)
|
||||
{
|
||||
Debug::Error("Cursor::UpdateTexture() => Desktop texture is null.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto capturedImageWidth = capturedImageArea_.right - capturedImageArea_.left;
|
||||
ComPtr<ID3D11DeviceContext> context;
|
||||
GetDevice()->GetImmediateContext(&context);
|
||||
context->UpdateSubresource(texture, 0, nullptr, bgra32Buffer_, shapeInfo_.Width * 4, 0);
|
||||
context->Release();
|
||||
context->UpdateSubresource(texture.Get(), 0, &capturedImageArea_, bgraBuffer_.Get(), capturedImageWidth * 4, 0);
|
||||
}
|
||||
|
||||
|
||||
void Cursor::GetTexture(ID3D11Texture2D* texture)
|
||||
{
|
||||
UDD_FUNCTION_SCOPE_TIMER
|
||||
|
||||
if (!bgraBuffer_)
|
||||
{
|
||||
Debug::Error("Cursor::GetTexture() => bgra32Buffer is null.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (texture == nullptr)
|
||||
{
|
||||
Debug::Error("Cursor::GetTexture() => The given texture is null.");
|
||||
return;
|
||||
}
|
||||
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
texture->GetDesc(&desc);
|
||||
if ((int)desc.Width < GetWidth() || (int)desc.Height < GetHeight())
|
||||
{
|
||||
char buf[256];
|
||||
sprintf_s(buf, 256,
|
||||
"Cursor::GetTexture() => The given texture has smaller width / height.\n"
|
||||
"Given => (%d, %d) Buffer => (%d, %d)",
|
||||
desc.Width, desc.Height, GetWidth(), GetHeight());
|
||||
Debug::Error(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
ComPtr<ID3D11DeviceContext> context;
|
||||
GetDevice()->GetImmediateContext(&context);
|
||||
context->UpdateSubresource(texture, 0, nullptr, bgraBuffer_.Get(), GetWidth() * 4, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -256,4 +464,4 @@ int Cursor::GetPitch() const
|
||||
int Cursor::GetType() const
|
||||
{
|
||||
return shapeInfo_.Type;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user