diff --git a/Unity-19050-03_RoyalGallery_iPad/.gitignore b/Unity-19050-03_RoyalGallery_iPad/.gitignore
new file mode 100644
index 0000000..0cd637a
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/.gitignore
@@ -0,0 +1,43 @@
+/.vscode/
+/Logs/
+/Packages/com.ultracombos.template
+
+# Created by https://www.gitignore.io/api/unity
+
+### Unity ###
+/[Ll]ibrary/
+/[Tt]emp/
+/[Oo]bj/
+/[Bb]uild/
+/[Bb]uilds/
+/Assets/AssetStoreTools*
+
+# Visual Studio 2015 cache directory
+/.vs/
+
+# Autogenerated VS/MD/Consulo solution and project files
+ExportedObj/
+.consulo/
+*.csproj
+*.unityproj
+*.sln
+*.suo
+*.tmp
+*.user
+*.userprefs
+*.pidb
+*.booproj
+*.svd
+*.pdb
+
+# Unity3D generated meta files
+*.pidb.meta
+
+# Unity3D Generated File On Crash Reports
+sysinfo.txt
+
+# Builds
+*.apk
+*.unitypackage
+
+# End of https://www.gitignore.io/api/unity
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/.gitkeep b/Unity-19050-03_RoyalGallery_iPad/.gitkeep
deleted file mode 100644
index 0e8c54b..0000000
--- a/Unity-19050-03_RoyalGallery_iPad/.gitkeep
+++ /dev/null
@@ -1 +0,0 @@
-#gitkeep file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo.meta
new file mode 100644
index 0000000..85ae641
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 031025b1a4246d34fa19abd547244d14
+folderAsset: yes
+timeCreated: 1541620985
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials.meta
new file mode 100644
index 0000000..738e066
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: bb52e262d07b2d44d867f77a1be49439
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/cube360.mat b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/cube360.mat
new file mode 100644
index 0000000..c01387c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/cube360.mat
@@ -0,0 +1,52 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 3
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: cube360
+ m_Shader: {fileID: 4800000, guid: 1ca6555d94ddb204c87e9fe549085b3c, type: 3}
+ m_ShaderKeywords:
+ - STEREO_NONE
+ m_CustomRenderQueue: -1
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs:
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ data:
+ first:
+ name: _ChromaTex
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats:
+ data:
+ first:
+ name: Stereo
+ second: 0
+ data:
+ first:
+ name: _StereoDebug
+ second: 0
+ data:
+ first:
+ name: _ApplyGamma
+ second: 0
+ data:
+ first:
+ name: _UseYpCbCr
+ second: 0
+ m_Colors:
+ data:
+ first:
+ name: _Color
+ second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/cube360.mat.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/cube360.mat.meta
new file mode 100644
index 0000000..0e4f9aa
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/cube360.mat.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 528f5620ff3f26b428baf78fbf6ed558
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/sphere360.mat b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/sphere360.mat
new file mode 100644
index 0000000..7addb5f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/sphere360.mat
@@ -0,0 +1,28 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 3
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_Name: sphere360
+ m_Shader: {fileID: 4800000, guid: 46b84ca7ab6291e4fb6c57ac48d01e8f, type: 3}
+ m_ShaderKeywords: []
+ m_CustomRenderQueue: -1
+ m_SavedProperties:
+ serializedVersion: 2
+ m_TexEnvs:
+ data:
+ first:
+ name: _MainTex
+ second:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats: {}
+ m_Colors:
+ data:
+ first:
+ name: _Color
+ second: {r: 1, g: 1, b: 1, a: 1}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/sphere360.mat.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/sphere360.mat.meta
new file mode 100644
index 0000000..191504b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Materials/sphere360.mat.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 17b8b08ed638ac04a9e726c6ec0cea35
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs.meta
new file mode 100644
index 0000000..5667a28
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 107a33f32a4dd694ab9ed5c0c7a035c6
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360CubeVideo.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360CubeVideo.prefab
new file mode 100644
index 0000000..f059b93
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360CubeVideo.prefab
@@ -0,0 +1,195 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &149002
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 449002}
+ m_Layer: 0
+ m_Name: 360CubeVideo
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &149004
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 449004}
+ - 114: {fileID: 11449004}
+ m_Layer: 0
+ m_Name: AVPro Video Media Player
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &149006
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 449006}
+ - 23: {fileID: 2388718}
+ - 33: {fileID: 3388718}
+ - 114: {fileID: 11488718}
+ m_Layer: 0
+ m_Name: Cube
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &449002
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149002}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 449006}
+ - {fileID: 449004}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+--- !u!4 &449004
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149004}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 449002}
+ m_RootOrder: 1
+--- !u!4 &449006
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149006}
+ m_LocalRotation: {x: 0, y: 1, z: 0, w: -4.37113883e-08}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 10, y: 10, z: 10}
+ m_Children: []
+ m_Father: {fileID: 449002}
+ m_RootOrder: 0
+--- !u!23 &2388718
+Renderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149006}
+ m_Enabled: 1
+ m_CastShadows: 0
+ m_ReceiveShadows: 0
+ m_LightmapIndex: 255
+ m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
+ m_Materials:
+ - {fileID: 2100000, guid: 528f5620ff3f26b428baf78fbf6ed558, type: 2}
+ m_SubsetIndices:
+ m_StaticBatchRoot: {fileID: 0}
+ m_UseLightProbes: 0
+ m_LightProbeAnchor: {fileID: 0}
+ m_ScaleInLightmap: 1
+ m_SortingLayerID: 0
+ m_SortingOrder: 0
+--- !u!33 &3388718
+MeshFilter:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149006}
+ m_Mesh: {fileID: 0}
+--- !u!114 &11449004
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149004}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 638c870cac4da414fba921606d504407, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_VideoLocation: 2
+ m_VideoPath:
+ m_AutoOpen: 1
+ m_AutoStart: 1
+ m_Loop: 1
+ m_Volume: 1
+ m_Muted: 0
+ m_PlaybackRate: 1
+ m_DebugGui: 0
+ m_Persistent: 0
+ m_StereoPacking: 0
+ m_DisplayDebugStereoColorTint: 0
+ m_FilterMode: 1
+ m_WrapMode: 1
+ m_AnisoLevel: 0
+ m_events:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: RenderHeads.Media.AVProVideo.MediaPlayerEvent, Assembly-CSharp, Version=0.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ _optionsWindows:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ forceDirectShowApi: 0
+ forceAudioOutputDeviceName:
+ _optionsMacOSX:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsIOS:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsTVOS:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsAndroid:
+ overridePath: 0
+ pathLocation: 2
+ path:
+--- !u!114 &11488718
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 149006}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 683e7713922f8044c81bf497a0b5887e, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _material: {fileID: 2100000, guid: 528f5620ff3f26b428baf78fbf6ed558, type: 2}
+ _mediaPlayer: {fileID: 11449004}
+ expansion_coeff: 1.00999999
+--- !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: 149002}
+ m_IsPrefabParent: 1
+ m_IsExploded: 1
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360CubeVideo.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360CubeVideo.prefab.meta
new file mode 100644
index 0000000..6438847
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360CubeVideo.prefab.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 5cc7e20810735fc46ab7b17491990099
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360SphereVideo.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360SphereVideo.prefab
new file mode 100644
index 0000000..ba11036
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360SphereVideo.prefab
@@ -0,0 +1,224 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &127526
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 427526}
+ - 33: {fileID: 3327526}
+ - 23: {fileID: 2327526}
+ - 114: {fileID: 11404242}
+ - 114: {fileID: 11476996}
+ m_Layer: 0
+ m_Name: Sphere
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &198420
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 498420}
+ m_Layer: 0
+ m_Name: 360SphereVideo
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &198424
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 498424}
+ - 114: {fileID: 11498420}
+ m_Layer: 0
+ m_Name: AVPro Video Media Player
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &427526
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 127526}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 5, y: 5, z: 5}
+ m_Children: []
+ m_Father: {fileID: 498420}
+ m_RootOrder: 0
+--- !u!4 &498420
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 198420}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 427526}
+ - {fileID: 498424}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+--- !u!4 &498424
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 198424}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 498420}
+ m_RootOrder: 1
+--- !u!23 &2327526
+Renderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 127526}
+ m_Enabled: 1
+ m_CastShadows: 0
+ m_ReceiveShadows: 0
+ m_LightmapIndex: 255
+ m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
+ m_Materials:
+ - {fileID: 2100000, guid: 17b8b08ed638ac04a9e726c6ec0cea35, type: 2}
+ m_SubsetIndices:
+ m_StaticBatchRoot: {fileID: 0}
+ m_UseLightProbes: 0
+ m_LightProbeAnchor: {fileID: 0}
+ m_ScaleInLightmap: 1
+ m_SortingLayerID: 0
+ m_SortingOrder: 0
+--- !u!33 &3327526
+MeshFilter:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 127526}
+ m_Mesh: {fileID: 4300000, guid: c8b055314efcb4b4dbd29f97a847fc4c, type: 2}
+--- !u!114 &11404242
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 127526}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 4ed685e8c5f1f584aa28b32dcf9bdab1, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _camera: {fileID: 0}
+ _renderer: {fileID: 2327526}
+--- !u!114 &11476996
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 127526}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: f6d1977a52888584496b1acc7e998011, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _offset: {x: 0, y: 0}
+ _scale: {x: 1, y: 1}
+ _mesh: {fileID: 2327526}
+ _media: {fileID: 11498420}
+ _defaultTexture: {fileID: 0}
+--- !u!114 &11498420
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 198424}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 638c870cac4da414fba921606d504407, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_VideoLocation: 2
+ m_VideoPath:
+ m_AutoOpen: 1
+ m_AutoStart: 1
+ m_Loop: 1
+ m_Volume: 1
+ m_Muted: 0
+ m_PlaybackRate: 1
+ m_DebugGui: 0
+ m_Persistent: 0
+ m_StereoPacking: 0
+ m_AlphaPacking: 0
+ m_DisplayDebugStereoColorTint: 0
+ m_FilterMode: 1
+ m_WrapMode: 1
+ m_AnisoLevel: 0
+ m_events:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: RenderHeads.Media.AVProVideo.MediaPlayerEvent, Assembly-CSharp, Version=0.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ _optionsWindows:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ forceDirectShowApi: 0
+ forceAudioOutputDeviceName:
+ _optionsMacOSX:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsIOS:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsTVOS:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsAndroid:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsWindowsPhone:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsWindowsUWP:
+ overridePath: 0
+ pathLocation: 2
+ path:
+ _optionsWebGL:
+ overridePath: 0
+ pathLocation: 2
+ path:
+--- !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: 198420}
+ m_IsPrefabParent: 1
+ m_IsExploded: 1
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360SphereVideo.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360SphereVideo.prefab.meta
new file mode 100644
index 0000000..c7efa4b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/360SphereVideo.prefab.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 5a12218ea7e5b7a4e8b89d25e07d237d
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/AudioOutput.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/AudioOutput.prefab
new file mode 100644
index 0000000..6713ebd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/AudioOutput.prefab
@@ -0,0 +1,113 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &162392
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 462392}
+ - 114: {fileID: 11462392}
+ - 82: {fileID: 8262392}
+ m_Layer: 0
+ m_Name: AudioOutput
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &462392
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 162392}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+--- !u!82 &8262392
+AudioSource:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 162392}
+ m_Enabled: 1
+ serializedVersion: 3
+ m_audioClip: {fileID: 0}
+ m_PlayOnAwake: 0
+ m_Volume: 1
+ m_Pitch: 1
+ Loop: 0
+ Mute: 0
+ Priority: 128
+ DopplerLevel: 1
+ MinDistance: 1
+ MaxDistance: 500
+ Pan2D: 0
+ rolloffMode: 0
+ BypassEffects: 0
+ BypassListenerEffects: 0
+ BypassReverbZones: 0
+ rolloffCustomCurve:
+ serializedVersion: 2
+ m_Curve:
+ - time: 0
+ value: 1
+ inSlope: 0
+ outSlope: 0
+ tangentMode: 0
+ - time: 1
+ value: 0
+ inSlope: 0
+ outSlope: 0
+ tangentMode: 0
+ m_PreInfinity: 2
+ m_PostInfinity: 2
+ panLevelCustomCurve:
+ serializedVersion: 2
+ m_Curve:
+ - time: 0
+ value: 1
+ inSlope: 0
+ outSlope: 0
+ tangentMode: 0
+ m_PreInfinity: 2
+ m_PostInfinity: 2
+ spreadCustomCurve:
+ serializedVersion: 2
+ m_Curve:
+ - time: 0
+ value: 0
+ inSlope: 0
+ outSlope: 0
+ tangentMode: 0
+ m_PreInfinity: 2
+ m_PostInfinity: 2
+--- !u!114 &11462392
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 162392}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 3b05a64a5de3f8546bf586f42e37b979, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _mediaPlayer: {fileID: 0}
+--- !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: 162392}
+ m_IsPrefabParent: 1
+ m_IsExploded: 1
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/AudioOutput.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/AudioOutput.prefab.meta
new file mode 100644
index 0000000..fc4cd20
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/AudioOutput.prefab.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 23fac3371501b864a8a2468ac0bef6f3
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/BackgroundVideo.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/BackgroundVideo.prefab
new file mode 100644
index 0000000..bf09437
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/BackgroundVideo.prefab
@@ -0,0 +1,174 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &166464
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 466464}
+ m_Layer: 0
+ m_Name: BackgroundVideo
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &166466
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 466466}
+ - 33: {fileID: 3366464}
+ - 23: {fileID: 2366464}
+ - 114: {fileID: 11466464}
+ m_Layer: 0
+ m_Name: Background
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!1 &166468
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 466468}
+ - 114: {fileID: 11466466}
+ m_Layer: 0
+ m_Name: AVPro Video Media Player
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &466464
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166464}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 466468}
+ - {fileID: 466466}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+--- !u!4 &466466
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166466}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 466464}
+ m_RootOrder: 1
+--- !u!4 &466468
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166468}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 466464}
+ m_RootOrder: 0
+--- !u!23 &2366464
+Renderer:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166466}
+ m_Enabled: 1
+ m_CastShadows: 0
+ m_ReceiveShadows: 0
+ m_LightmapIndex: 255
+ m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
+ m_Materials:
+ - {fileID: 2100000, guid: 7ccf4b555441d554484bbe799cb1c834, type: 2}
+ m_SubsetIndices:
+ m_StaticBatchRoot: {fileID: 0}
+ m_UseLightProbes: 0
+ m_LightProbeAnchor: {fileID: 0}
+ m_ScaleInLightmap: 1
+ m_SortingLayerID: 0
+ m_SortingOrder: 0
+--- !u!33 &3366464
+MeshFilter:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166466}
+ m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!114 &11466464
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166466}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: f6d1977a52888584496b1acc7e998011, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _mesh: {fileID: 2366464}
+ _media: {fileID: 11466466}
+ _defaultTexture: {fileID: 0}
+--- !u!114 &11466466
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 166468}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 638c870cac4da414fba921606d504407, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_VideoLocation: 2
+ m_VideoPath:
+ m_AutoOpen: 1
+ m_AutoStart: 1
+ m_Loop: 1
+ m_Volume: 1
+ m_Muted: 0
+ m_DebugGui: 0
+ m_events:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: RenderHeads.Media.AVProVideo.MediaPlayerEvent, Assembly-CSharp, Version=0.0.0.0,
+ Culture=neutral, PublicKeyToken=null
+ m_platformVideoPathOverride: 0000000000
+ m_platformVideoPath:
+ -
+ -
+ -
+ -
+ -
+ m_platformVideoLocation: 0000000000000000000000000000000000000000
+--- !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: 166464}
+ m_IsPrefabParent: 1
+ m_IsExploded: 1
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/BackgroundVideo.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/BackgroundVideo.prefab.meta
new file mode 100644
index 0000000..58c10fc
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/BackgroundVideo.prefab.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 5dbef7d4930a98e4186b12a1b5f2cda6
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/FullscreenVideo.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/FullscreenVideo.prefab
new file mode 100644
index 0000000..2ab1d88
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/FullscreenVideo.prefab
@@ -0,0 +1,82 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &192192
+GameObject:
+ m_ObjectHideFlags: 0
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ serializedVersion: 4
+ m_Component:
+ - 4: {fileID: 492192}
+ - 114: {fileID: 11492190}
+ - 114: {fileID: 11492192}
+ m_Layer: 0
+ m_Name: FullscreenVideo
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &492192
+Transform:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 192192}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+--- !u!114 &11492190
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 192192}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 638c870cac4da414fba921606d504407, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_VideoPath:
+ m_AutoOpen: 1
+ m_AutoStart: 1
+ m_Loop: 0
+ m_Volume: 1
+ m_Muted: 0
+ m_DebugGui: 0
+--- !u!114 &11492192
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_PrefabParentObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 100100000}
+ m_GameObject: {fileID: 192192}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 75f3b319d2d69934d8bf545ab45c918d, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _mediaPlayer: {fileID: 11492190}
+ _scaleMode: 2
+ _color: {r: 1, g: 1, b: 1, a: 1}
+ _alphaBlend: 0
+ _fullScreen: 1
+ _depth: 0
+ _x: 0
+ _y: 0
+ _width: 1
+ _height: 1
+--- !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: 192192}
+ m_IsPrefabParent: 1
+ m_IsExploded: 1
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/FullscreenVideo.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/FullscreenVideo.prefab.meta
new file mode 100644
index 0000000..aae0480
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Prefabs/FullscreenVideo.prefab.meta
@@ -0,0 +1,4 @@
+fileFormatVersion: 2
+guid: 84fd971487e311c45a6573a72503271c
+NativeFormatImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources.meta
new file mode 100644
index 0000000..6cd7a44
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 870241155d4fedc4a86fa89eb85ae5c3
+folderAsset: yes
+timeCreated: 1449047212
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro.png b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro.png
new file mode 100644
index 0000000..8bf79e3
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro.png differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro.png.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro.png.meta
new file mode 100644
index 0000000..cc07bc1
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro.png.meta
@@ -0,0 +1,47 @@
+fileFormatVersion: 2
+guid: 8bef6179fcd26aa4c89b766c6b95490a
+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: .25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: 2
+ aniso: -1
+ mipBias: -1
+ wrapMode: 1
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: .5, y: .5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: 5
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ spritePackingTag:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro1.png b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro1.png
new file mode 100644
index 0000000..7fc7742
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro1.png differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro1.png.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro1.png.meta
new file mode 100644
index 0000000..0c3eb53
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVPro1.png.meta
@@ -0,0 +1,47 @@
+fileFormatVersion: 2
+guid: 855eae39e9698944daf581d77f6cef3c
+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: .25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ seamlessCubemap: 0
+ textureFormat: -1
+ maxTextureSize: 2048
+ textureSettings:
+ filterMode: 2
+ aniso: -1
+ mipBias: -1
+ wrapMode: 1
+ nPOTScale: 0
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: .5, y: .5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: 5
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ spritePackingTag:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVProVideoIcon.png b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVProVideoIcon.png
new file mode 100644
index 0000000..035c518
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVProVideoIcon.png differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVProVideoIcon.png.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVProVideoIcon.png.meta
new file mode 100644
index 0000000..5531ec6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/AVProVideoIcon.png.meta
@@ -0,0 +1,47 @@
+fileFormatVersion: 2
+guid: bb83b41b53a59874692b83eab5873998
+TextureImporter:
+ fileIDToRecycleName: {}
+ serializedVersion: 2
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ linearTexture: 1
+ correctGamma: 1
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: .25
+ normalMapFilter: 0
+ isReadable: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 0
+ seamlessCubemap: 0
+ textureFormat: -3
+ maxTextureSize: 1024
+ textureSettings:
+ filterMode: -1
+ aniso: 1
+ mipBias: -1
+ wrapMode: 0
+ nPOTScale: 1
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: .5, y: .5}
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spritePixelsToUnits: 100
+ alphaIsTransparency: 0
+ textureType: 5
+ buildTargetSettings: []
+ spriteSheet:
+ sprites: []
+ spritePackingTag:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders.meta
new file mode 100644
index 0000000..621e5af
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: e04bc3dc12a5117428fce7e0f1245bd9
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreen.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreen.shader
new file mode 100644
index 0000000..78600b4
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreen.shader
@@ -0,0 +1,95 @@
+Shader "AVProVideo/Background/Full Screen"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "black" {}
+ _ChromaTex ("Chroma", 2D) = "gray" {}
+ _Color("Main Color", Color) = (1,1,1,1)
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "Queue" = "Background" "RenderType"="Opaque" }
+ LOD 100
+ Cull Off
+ ZWrite Off
+ ZTest Always
+ Lighting Off
+
+ Pass
+ {
+ CGPROGRAM
+// Upgrade NOTE: excluded shader from OpenGL ES 2.0 because it uses non-square matrices
+#pragma exclude_renderers gles
+ #pragma vertex vert
+ #pragma fragment frag
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ float2 uv : TEXCOORD0;
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+ uniform fixed4 _Color;
+
+ v2f vert(appdata_img v)
+ {
+ v2f o;
+
+ float2 scale = ScaleZoomToFit(_ScreenParams.x, _ScreenParams.y, _MainTex_TexelSize.z, _MainTex_TexelSize.w);
+ float2 pos = ((v.vertex.xy) * scale * 2.0);
+
+ // we're rendering with upside-down flipped projection,
+ // so flip the vertical UV coordinate too
+ if (_ProjectionParams.x < 0.0)
+ {
+ pos.y = (1.0 - pos.y) - 1.0;
+ }
+
+ o.vertex = float4(pos.xy, UNITY_NEAR_CLIP_VALUE, 1.0);
+
+ o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
+
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv).r, tex2D(_ChromaTex, i.uv).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv).r, tex2D(_ChromaTex, i.uv).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ // Sample the texture
+ fixed4 col = tex2D(_MainTex, i.uv);
+#endif
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+ col *= _Color;
+ return fixed4(col.rgb, 1.0);
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreen.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreen.shader.meta
new file mode 100644
index 0000000..4fb03b0
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreen.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 71eb101954888314ba2a8b9fe74e1cae
+timeCreated: 1447418752
+licenseType: Store
+ShaderImporter:
+ defaultTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreenTransparent.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreenTransparent.shader
new file mode 100644
index 0000000..8ed368b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreenTransparent.shader
@@ -0,0 +1,123 @@
+Shader "AVProVideo/Background/Full Screen Transparent"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "black" {}
+ _ChromaTex("Chroma", 2D) = "gray" {}
+ _Color("Main Color", Color) = (1,1,1,1)
+ [KeywordEnum(None, Top_Bottom, Left_Right)] AlphaPack("Alpha Pack", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "Queue"="Background+1" "RenderType" = "Transparent" }
+ LOD 100
+ Cull Off
+ ZWrite Off
+ ZTest Always
+ Lighting Off
+ Blend SrcAlpha OneMinusSrcAlpha
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #pragma multi_compile ALPHAPACK_NONE ALPHAPACK_TOP_BOTTOM ALPHAPACK_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ float4 uv : TEXCOORD0;
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+ uniform fixed4 _Color;
+
+ v2f vert (appdata_img v)
+ {
+ v2f o;
+
+ float2 scale = ScaleZoomToFit(_ScreenParams.x, _ScreenParams.y, _MainTex_TexelSize.z, _MainTex_TexelSize.w);
+ float2 pos = ((v.vertex.xy) * scale * 2.0);
+
+ // we're rendering with upside-down flipped projection,
+ // so flip the vertical UV coordinate too
+ if (_ProjectionParams.x < 0.0)
+ {
+ pos.y = (1.0 - pos.y) - 1.0;
+ }
+
+ o.vertex = float4(pos.xy, UNITY_NEAR_CLIP_VALUE, 1.0);
+
+ o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex);
+
+ // Horrible hack to undo the scale transform to fit into our UV packing layout logic...
+ if (_MainTex_ST.y < 0.0)
+ {
+ o.uv.y = 1.0 - o.uv.y;
+ }
+
+ o.uv = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, o.uv.xy, _MainTex_ST.y < 0.0);
+
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv.xy).r, tex2D(_ChromaTex, i.uv.xy).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv.xy).r, tex2D(_ChromaTex, i.uv.xy).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ // Sample RGB
+ fixed4 col = tex2D(_MainTex, i.uv.xy);
+#endif
+
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if ALPHAPACK_TOP_BOTTOM | ALPHAPACK_LEFT_RIGHT
+ // Sample the alpha
+
+#if USE_YPCBCR
+ col.a = tex2D(_MainTex, i.uv.zw).r;
+#else
+ fixed4 alpha = tex2D(_MainTex, i.uv.zw);
+#if APPLY_GAMMA
+ alpha.rgb = GammaToLinear(alpha.rgb);
+#endif
+ col.a = (alpha.r + alpha.g + alpha.b) / 3.0;
+#endif
+#endif
+
+ col *= _Color;
+
+ return col;
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreenTransparent.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreenTransparent.shader.meta
new file mode 100644
index 0000000..2a9b35c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Background-FullScreenTransparent.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 38b28fc6a6d12d144bf6d6de820d83ce
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-BlendFrames.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-BlendFrames.shader
new file mode 100644
index 0000000..2af378c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-BlendFrames.shader
@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// Copyright 2014-2017 RenderHeads Ltd. All rights reserved.
+//-----------------------------------------------------------------------------
+
+Shader "AVProVideo/BlendFrames"
+{
+ Properties
+ {
+ _MainTex("Before Texture", 2D) = "white" {}
+ _AfterTex("After Texture", 2D) = "white" {}
+ _t("t", Float) = 0.5
+ }
+
+ SubShader
+ {
+ Pass
+ {
+ ZTest Always Cull Off ZWrite Off
+ Fog{ Mode off }
+
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma exclude_renderers flash xbox360 ps3 gles
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ uniform sampler2D _MainTex;
+ uniform sampler2D _AfterTex;
+ uniform float _t;
+
+ struct v2f
+ {
+ float4 pos : POSITION;
+ float4 uv : TEXCOORD0;
+ };
+
+ v2f vert(appdata_img v)
+ {
+ v2f o;
+ o.uv = float4(0.0, 0.0, 0.0, 0.0);
+ o.pos = XFormObjectToClip(v.vertex);
+
+ o.uv.xy = v.texcoord.xy;
+ return o;
+ }
+
+ float4 frag(v2f i) : COLOR
+ {
+ float4 before = tex2D(_MainTex, i.uv.xy);
+ float4 after = tex2D(_AfterTex, i.uv.xy);
+
+ float4 result = ((1.0 -_t) * before) + (_t * after);
+
+ return result;
+ }
+
+ ENDCG
+ }
+ }
+
+ FallBack Off
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-BlendFrames.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-BlendFrames.shader.meta
new file mode 100644
index 0000000..6d4dad6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-BlendFrames.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 8ebaafdbf44b0b9489f20bc27374d187
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Helper-Transition.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Helper-Transition.shader
new file mode 100644
index 0000000..d708ee7
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Helper-Transition.shader
@@ -0,0 +1,179 @@
+Shader "AVProVideo/Helper/Transition"
+{
+ Properties
+ {
+ _MainTex ("Texture To", 2D) = "white" {}
+ _FromTex ("Texture From", 2D) = "white" {}
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" }
+ LOD 100
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile LERP_NONE LERP_FADE LERP_BLACK LERP_WHITE LERP_TRANSP LERP_HORIZ LERP_HORIZ_MIRROR LERP_VERT LERP_VERT_MIRROR LERP_DIAG LERP_DIAG_MIRROR LERP_CIRCLE LERP_SCROLL_VERT LERP_SCROLL_HORIZ LERP_DIAMOND LERP_BLINDS LERP_RECTS_VERT LERP_ARROW LERP_SLIDE_HORIZ LERP_SLIDE_VERT LERP_ZOOM_FADE
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct appdata
+ {
+ float4 vertex : POSITION;
+ float2 uv : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float2 uv : TEXCOORD0;
+ float4 vertex : SV_POSITION;
+ };
+
+ sampler2D _MainTex;
+ sampler2D _FromTex;
+ float4 _MainTex_ST;
+ float4 _FromTex_ST;
+ float _Fade;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+ o.vertex = XFormObjectToClip(v.vertex);
+ o.uv = TRANSFORM_TEX(v.uv, _MainTex);
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+ float2 uv1 = i.uv;
+ float2 uv2 = i.uv;
+
+#if LERP_FADE
+ float t = _Fade;
+#elif LERP_BLACK
+ float t = _Fade;
+ if (t < 0.5)
+ {
+ return lerp(tex2D(_FromTex, uv1), float4(0.0, 0.0, 0.0, 1.0), t * 2.0);
+ }
+ else
+ {
+ return lerp(float4(0.0, 0.0, 0.0, 1.0), tex2D(_MainTex, uv2), 2.0 * (t - 0.5));
+ }
+#elif LERP_WHITE
+ float t = _Fade;
+ if (t < 0.5)
+ {
+ return lerp(tex2D(_FromTex, uv1), float4(1.0, 1.0, 1.0, 1.0), t * 2.0);
+ }
+ else
+ {
+ return lerp(float4(1.0, 1.0, 1.0, 1.0), tex2D(_MainTex, uv2), 2.0 * (t - 0.5));
+ }
+#elif LERP_TRANSP
+ float t = _Fade;
+ if (t < 0.5)
+ {
+ return lerp(tex2D(_FromTex, uv1), float4(0.0, 0.0, 0.0, 0.0), t * 2.0);
+ }
+ else
+ {
+ return lerp(float4(0.0, 0.0, 0.0, 0.0), tex2D(_MainTex, uv2), 2.0 * (t - 0.5));
+ }
+#elif LERP_HORIZ
+ float t = step(i.uv.x, _Fade);
+#elif LERP_HORIZ_MIRROR
+ float t = step(abs(i.uv.x - 0.5), _Fade);
+#elif LERP_VERT
+ float t = step(i.uv.y, _Fade);
+#elif LERP_VERT_MIRROR
+ float t = step(abs(i.uv.y - 0.5), _Fade);
+#elif LERP_DIAG
+ float t = step((i.uv.y+i.uv.x)*0.5, _Fade);
+#elif LERP_DIAG_MIRROR
+ float t = step(abs(i.uv.y - i.uv.x), _Fade);
+#elif LERP_CIRCLE
+ float t = distance(float2(i.uv.x*1.777, i.uv.y), float2(0.5*1.7777, 0.5));
+ t = step(t, _Fade*2.1);
+#elif LERP_SCROLL_VERT
+ float t = _Fade;
+ uv1.y += _Fade;
+ t = step(1 - uv1.y, 0);
+#elif LERP_SCROLL_HORIZ
+ float t = _Fade;
+ uv1.x += _Fade;
+ t = step(1 - uv1.x, 0);
+#elif LERP_DIAMOND
+ float2 origin = float2(0.5 * 1.7777, 0.5);
+
+ float t = abs(uv1.x*1.7777 - origin.x);
+ t += abs(uv1.y - origin.y);
+
+ t = step(t, _Fade*1.4);
+#elif LERP_BLINDS
+
+ float x = frac(uv1.x*4.0);
+ float t = step(x, _Fade);
+
+#elif LERP_ARROW
+ // Arrow
+ float y = abs(i.uv.y - 0.5) * 0.5;
+ float x = lerp(0.5, 1.0, i.uv.x);
+ float t = step(x, y + _Fade);
+#elif LERP_SLIDE_HORIZ
+ // Slide horiz
+ float t = _Fade;
+ uv1.x += _Fade;
+ uv2.x -= 1.0 - _Fade;
+ t = step(1 - uv1.x, 0);
+#elif LERP_SLIDE_VERT
+ // slide vert
+ float t = _Fade;
+ uv1.y += _Fade;
+ uv2.y -= 1.0 - _Fade;
+ t = step(1 - uv1.y, 0);
+#elif LERP_ZOOM_FADE
+ // zoom-fade
+ float scale = lerp(1.0, 0.15, _Fade);
+ float scale2 = lerp(1.0, 0.15, 1.0-_Fade);
+ uv1 -= 0.5;
+ uv2 -= 0.5;
+ uv1 *= scale;
+ uv2 *= scale2;
+ uv1 += 0.5;
+ uv2 += 0.5;
+ float t = smoothstep(0.5, 1.0, _Fade);
+
+#elif LERP_RECTS_VERT
+
+ float x = uv1.x;
+
+ float bf = _Fade / 1.5;
+
+ bf = frac(uv1.y * 8.0);
+ bf = (int)fmod(uv1.y * 8.0, 8.0);
+ bf += 1.0;
+
+ bf *= _Fade / 2.0;
+
+ float t = step(abs(x - 0.5), bf);
+
+#endif
+
+#if LERP_NONE
+ return tex2D(_MainTex, uv1);
+#else
+ float4 cola = tex2D(_FromTex, uv1);
+ float4 colb = tex2D(_MainTex, uv2);
+
+ float4 col = lerp(cola, colb, t);
+ return col;
+#endif
+ }
+ ENDCG
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Helper-Transition.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Helper-Transition.shader.meta
new file mode 100644
index 0000000..2f9b129
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Helper-Transition.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 73f378cafe7b4a745907b70e76bb3259
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-IMGUI-Transparent.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-IMGUI-Transparent.shader
new file mode 100644
index 0000000..9ec18cf
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-IMGUI-Transparent.shader
@@ -0,0 +1,107 @@
+Shader "AVProVideo/IMGUI/Texture Transparent"
+{
+ Properties
+ {
+ _MainTex("Texture", any) = "" {}
+ _ChromaTex("Chroma", any) = "" {}
+ _VertScale("Vertical Scale", Range(-1, 1)) = 1.0
+ [KeywordEnum(None, Top_Bottom, Left_Right)] AlphaPack("Alpha Pack", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags { "ForceSupported" = "True" "RenderType" = "Overlay" }
+
+ Lighting Off
+ Blend SrcAlpha OneMinusSrcAlpha
+ Cull Off
+ ZWrite Off
+ ZTest Always
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile ALPHAPACK_NONE ALPHAPACK_TOP_BOTTOM ALPHAPACK_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct appdata_t
+ {
+ float4 vertex : POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ float4 texcoord : TEXCOORD0;
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+ uniform float _VertScale;
+
+ v2f vert(appdata_t v)
+ {
+ v2f o;
+ o.vertex = XFormObjectToClip(v.vertex);
+ o.color = v.color;
+ o.texcoord = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, TRANSFORM_TEX(v.texcoord, _MainTex), _VertScale < 0.0);
+
+ return o;
+ }
+
+ fixed4 frag(v2f i) : SV_Target
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, i.texcoord.xy).r, tex2D(_ChromaTex, i.texcoord.xy).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, i.texcoord.xy).r, tex2D(_ChromaTex, i.texcoord.xy).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ // Sample RGB
+ fixed4 col = tex2D(_MainTex, i.texcoord.xy);
+#endif
+#if APPLY_GAMMA
+ col.rgb = LinearToGamma(col.rgb);
+#endif
+#if ALPHAPACK_TOP_BOTTOM | ALPHAPACK_LEFT_RIGHT
+ // Sample the alpha
+ #if USE_YPCBCR
+ col.a = tex2D(_MainTex, i.texcoord.zw).r;
+ #else
+ fixed4 alpha = tex2D(_MainTex, i.texcoord.zw);
+ #if APPLY_GAMMA
+ alpha.rgb = LinearToGamma(alpha.rgb);
+ #endif
+ col.a = (alpha.r + alpha.g + alpha.b) / 3.0;
+ #endif
+#endif
+ return col * i.color;
+ }
+ ENDCG
+ }
+ }
+
+ Fallback off
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-IMGUI-Transparent.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-IMGUI-Transparent.shader.meta
new file mode 100644
index 0000000..7d703b6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-IMGUI-Transparent.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: d1085d25f9ef09b4c91188f9f99f37a2
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Diffuse.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Diffuse.shader
new file mode 100644
index 0000000..211a933
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Diffuse.shader
@@ -0,0 +1,91 @@
+Shader "AVProVideo/Lit/Diffuse (texture+color+fog+stereo support)"
+{
+ Properties
+ {
+ _Color("Main Color", Color) = (1,1,1,1)
+ _MainTex("Base (RGB)", 2D) = "white" {}
+ _ChromaTex("Chroma", 2D) = "white" {}
+
+ [KeywordEnum(None, Top_Bottom, Left_Right, Custom_UV)] Stereo("Stereo Mode", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug("Stereo Debug Tinting", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags { "Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Geometry" }
+ LOD 200
+
+ CGPROGRAM
+ #pragma surface surf Lambert vertex:VertexFunction
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "AVProVideo.cginc"
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform fixed4 _Color;
+ uniform float3 _cameraPosition;
+
+ struct Input
+ {
+ float2 uv_MainTex;
+ float4 color;
+ };
+
+ void VertexFunction(inout appdata_full v, out Input o)
+ {
+ UNITY_INITIALIZE_OUTPUT(Input, o);
+
+#if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ float4 scaleOffset = GetStereoScaleOffset(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz), true);
+ o.uv_MainTex = v.texcoord.xy *= scaleOffset.xy;
+ o.uv_MainTex = v.texcoord.xy += scaleOffset.zw;
+#elif STEREO_CUSTOM_UV
+ o.uv_MainTex = v.texcoord.xy;
+ if (!IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz))
+ {
+ o.uv_MainTex = v.texcoord1.xy;
+ }
+#endif
+ o.color = _Color;
+#if STEREO_DEBUG
+ o.color *= GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz));
+#endif
+ }
+
+ void surf(Input IN, inout SurfaceOutput o)
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.uv_MainTex).r, tex2D(_ChromaTex, IN.uv_MainTex).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.uv_MainTex).r, tex2D(_ChromaTex, IN.uv_MainTex).ra);
+ #endif
+ fixed4 c = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0f);
+#else
+ fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
+#endif
+#if APPLY_GAMMA
+ c.rgb = GammaToLinear(c.rgb);
+#endif
+ c *= IN.color;
+ o.Albedo = c.rgb;
+ o.Alpha = c.a;
+ }
+ ENDCG
+ }
+
+ Fallback "Legacy Shaders/Transparent/VertexLit"
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Diffuse.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Diffuse.shader.meta
new file mode 100644
index 0000000..3b3e95e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Diffuse.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 06b0cff0150d7eb41b3d269f7e11daa3
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Transparent-Diffuse.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Transparent-Diffuse.shader
new file mode 100644
index 0000000..115d783
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Transparent-Diffuse.shader
@@ -0,0 +1,92 @@
+Shader "AVProVideo/Lit/Transparent Diffuse (texture+color+fog+packed alpha)"
+{
+ Properties
+ {
+ _Color("Main Color", Color) = (1,1,1,1)
+ _MainTex("Base (RGB)", 2D) = "black" {}
+ _ChromaTex("Chroma", 2D) = "black" {}
+
+ [KeywordEnum(None, Top_Bottom, Left_Right)] AlphaPack("Alpha Pack", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
+ LOD 200
+ ZWrite Off
+ Blend SrcAlpha OneMinusSrcAlpha
+ Cull Off
+
+ CGPROGRAM
+ #pragma surface surf Lambert vertex:VertexFunction alpha
+ #pragma multi_compile ALPHAPACK_NONE ALPHAPACK_TOP_BOTTOM ALPHAPACK_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "AVProVideo.cginc"
+
+ uniform sampler2D _MainTex;
+ //uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform fixed4 _Color;
+ uniform float3 _cameraPosition;
+
+ struct Input
+ {
+ float4 texcoords;
+ };
+
+ void VertexFunction(inout appdata_full v, out Input o)
+ {
+ UNITY_INITIALIZE_OUTPUT(Input, o);
+
+ o.texcoords = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, v.texcoord.xy, true);// _MainTex_ST.y < 0.0);
+ }
+
+ void surf(Input IN, inout SurfaceOutput o)
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.texcoords.xy).r, tex2D(_ChromaTex, IN.texcoords.xy).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.texcoords.xy).r, tex2D(_ChromaTex, IN.texcoords.xy).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0f);
+#else
+ fixed4 col = tex2D(_MainTex, IN.texcoords.xy);
+#endif
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if ALPHAPACK_TOP_BOTTOM | ALPHAPACK_LEFT_RIGHT
+ // Sample the alpha
+ #if USE_YPCBCR
+ col.a = tex2D(_MainTex, IN.texcoords.zw).r;
+ #else
+ fixed4 alpha = tex2D(_MainTex, IN.texcoords.zw);
+ #if APPLY_GAMMA
+ alpha.rgb = GammaToLinear(alpha.rgb);
+ #endif
+ col.a = (alpha.r + alpha.g + alpha.b) / 3.0;
+ #endif
+#endif
+ col *= _Color;
+ o.Albedo = col.rgb;
+ o.Alpha = col.a;
+ }
+ ENDCG
+ }
+
+ Fallback "Legacy Shaders/Transparent/VertexLit"
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Transparent-Diffuse.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Transparent-Diffuse.shader.meta
new file mode 100644
index 0000000..6feec9c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Lit-Transparent-Diffuse.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 751148eda67f7b34fbd51bfb7951084f
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-AndroidOES.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-AndroidOES.shader
new file mode 100644
index 0000000..e035f71
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-AndroidOES.shader
@@ -0,0 +1,140 @@
+Shader "AVProVideo/UI/AndroidOES"
+{
+ Properties
+ {
+ [PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
+ [PerRendererData] _ChromaTex("Sprite Texture", 2D) = "white" {}
+ _Color("Tint", Color) = (1,1,1,1)
+
+ _StencilComp("Stencil Comparison", Float) = 8
+ _Stencil("Stencil ID", Float) = 0
+ _StencilOp("Stencil Operation", Float) = 0
+ _StencilWriteMask("Stencil Write Mask", Float) = 255
+ _StencilReadMask("Stencil Read Mask", Float) = 255
+
+ _ColorMask("Color Mask", Float) = 15
+
+ [KeywordEnum(None, Top_Bottom, Left_Right)] Stereo("Stereo Mode", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug("Stereo Debug Tinting", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags
+ {
+ "Queue" = "Transparent"
+ "IgnoreProjector" = "True"
+ "RenderType" = "Transparent"
+ "PreviewType" = "Plane"
+ "CanUseSpriteAtlas" = "True"
+ }
+
+ Stencil
+ {
+ Ref[_Stencil]
+ Comp[_StencilComp]
+ Pass[_StencilOp]
+ ReadMask[_StencilReadMask]
+ WriteMask[_StencilWriteMask]
+ }
+
+ Cull Off
+ Lighting Off
+ ZWrite Off
+ ZTest[unity_GUIZTestMode]
+ Fog{ Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask[_ColorMask]
+
+ Pass
+ {
+ GLSLPROGRAM
+ #pragma only_renderers gles gles3
+
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+
+ #extension GL_OES_EGL_image_external : require
+ #extension GL_OES_EGL_image_external_essl3 : enable
+
+ precision mediump float;
+
+
+#ifdef VERTEX
+
+#include "UnityCG.glslinc"
+#define SHADERLAB_GLSL
+#include "AVProVideo.cginc"
+ uniform mat4 _ViewMatrix;
+ uniform vec3 _cameraPosition;
+ varying vec2 texVal;
+
+#if defined(STEREO_DEBUG)
+ varying vec4 tint;
+#endif
+
+ void main()
+ {
+ gl_Position = XFormObjectToClip(gl_Vertex);
+ texVal = gl_MultiTexCoord0.xy;
+ texVal.y = 1.0 - texVal.y;
+
+#if defined(STEREO_TOP_BOTTOM) | defined(STEREO_LEFT_RIGHT)
+ bool isLeftEye = IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz);
+
+ vec4 scaleOffset = GetStereoScaleOffset(isLeftEye, false);
+
+ texVal.xy *= scaleOffset.xy;
+ texVal.xy += scaleOffset.zw;
+#elif defined (STEREO_CUSTOM_UV)
+ if (!IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz))
+ {
+ texVal = gl_MultiTexCoord1.xy;
+ texVal = vec2(1.0, 1.0) - texVal;
+ }
+#endif
+
+#if defined(STEREO_DEBUG)
+ tint = GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz));
+#endif
+
+ }
+#endif
+
+#ifdef FRAGMENT
+ varying vec2 texVal;
+
+#if defined(STEREO_DEBUG)
+ varying vec4 tint;
+#endif
+
+ uniform vec4 _Color;
+ uniform samplerExternalOES _MainTex;
+
+ void main()
+ {
+#if defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
+
+#if __VERSION__ < 300
+ gl_FragColor = texture2D(_MainTex, texVal.xy) * _Color;
+#else
+ gl_FragColor = texture(_MainTex, texVal.xy) * _Color;
+#endif
+
+#else
+ gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
+#endif
+
+#if defined(STEREO_DEBUG)
+ gl_FragColor *= tint;
+#endif
+ }
+
+#endif
+
+ ENDGLSL
+ }
+ }
+
+ Fallback "AVProVideo/UI/Stereo"
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-AndroidOES.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-AndroidOES.shader.meta
new file mode 100644
index 0000000..5c5ff65
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-AndroidOES.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: f9f51999155859b419ff715c8127688a
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Stereo.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Stereo.shader
new file mode 100644
index 0000000..7743311
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Stereo.shader
@@ -0,0 +1,141 @@
+Shader "AVProVideo/UI/Stereo"
+{
+ Properties
+ {
+ [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
+ [PerRendererData] _ChromaTex ("Sprite Texture", 2D) = "white" {}
+ _Color ("Tint", Color) = (1,1,1,1)
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _ColorMask ("Color Mask", Float) = 15
+
+ [KeywordEnum(None, Top_Bottom, Left_Right)] Stereo("Stereo Mode", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug("Stereo Debug Tinting", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags
+ {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ "PreviewType"="Plane"
+ "CanUseSpriteAtlas"="True"
+ }
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull Off
+ Lighting Off
+ ZWrite Off
+ ZTest [unity_GUIZTestMode]
+ Fog { Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct appdata_t
+ {
+ float4 vertex : POSITION;
+ float4 color : COLOR;
+ float2 texcoord : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ half2 texcoord : TEXCOORD0;
+ };
+
+ uniform fixed4 _Color;
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+ uniform float3 _cameraPosition;
+
+ v2f vert(appdata_t IN)
+ {
+ v2f OUT;
+
+ OUT.vertex = XFormObjectToClip(IN.vertex);
+
+#ifdef UNITY_HALF_TEXEL_OFFSET
+ OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
+#endif
+
+ OUT.texcoord.xy = IN.texcoord.xy;
+
+#if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ float4 scaleOffset = GetStereoScaleOffset(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz), _MainTex_ST.y < 0.0);
+ OUT.texcoord.xy *= scaleOffset.xy;
+ OUT.texcoord.xy += scaleOffset.zw;
+#endif
+
+ OUT.color = IN.color * _Color;
+
+#if STEREO_DEBUG
+ OUT.color *= GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz));
+#endif
+ return OUT;
+ }
+
+ fixed4 frag(v2f IN) : SV_Target
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.texcoord).r, tex2D(_ChromaTex, IN.texcoord).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.texcoord).r, tex2D(_ChromaTex, IN.texcoord).ra);
+ #endif
+ half4 color = half4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ half4 color = tex2D(_MainTex, IN.texcoord.xy);
+#endif
+#if APPLY_GAMMA
+ color.rgb = GammaToLinear(color.rgb);
+#endif
+
+ color *= IN.color;
+ return color;
+ }
+
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Stereo.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Stereo.shader.meta
new file mode 100644
index 0000000..41d1975
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Stereo.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 018fe741dec71f14bb43801a31a07303
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Transparent.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Transparent.shader
new file mode 100644
index 0000000..778ba0e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Transparent.shader
@@ -0,0 +1,174 @@
+Shader "AVProVideo/UI/Transparent Packed"
+{
+ Properties
+ {
+ [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
+ [PerRendererData] _ChromaTex ("Sprite Texture", 2D) = "white" {}
+ _Color ("Tint", Color) = (1,1,1,1)
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _ColorMask ("Color Mask", Float) = 15
+
+ _VertScale("Vertical Scale", Range(-1, 1)) = 1.0
+
+ [KeywordEnum(None, Top_Bottom, Left_Right)] AlphaPack("Alpha Pack", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags
+ {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ "PreviewType"="Plane"
+ "CanUseSpriteAtlas"="True"
+ }
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull Off
+ Lighting Off
+ ZWrite Off
+ ZTest [unity_GUIZTestMode]
+ Fog { Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile ALPHAPACK_NONE ALPHAPACK_TOP_BOTTOM ALPHAPACK_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+#if APPLY_GAMMA
+ //#pragma target 3.0
+#endif
+ #include "UnityCG.cginc"
+ // TODO: once we drop support for Unity 4.x then we can include this
+ //#include "UnityUI.cginc"
+ #include "AVProVideo.cginc"
+
+ struct appdata_t
+ {
+ float4 vertex : POSITION;
+ float4 color : COLOR;
+ float2 texcoord : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ half4 texcoord : TEXCOORD0;
+ float4 worldPosition : TEXCOORD1;
+ };
+
+ uniform fixed4 _Color;
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_TexelSize;
+ uniform float _VertScale;
+ uniform float4 _ClipRect;
+
+#if UNITY_VERSION >= 520
+ inline float UnityGet2DClipping (in float2 position, in float4 clipRect)
+ {
+ float2 inside = step(clipRect.xy, position.xy) * step(position.xy, clipRect.zw);
+ return inside.x * inside.y;
+ }
+#endif
+
+ v2f vert(appdata_t IN)
+ {
+ v2f OUT;
+ OUT.worldPosition = IN.vertex;
+
+ OUT.vertex = XFormObjectToClip(IN.vertex);
+
+#ifdef UNITY_HALF_TEXEL_OFFSET
+ OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
+#endif
+
+ OUT.texcoord.xy = IN.texcoord.xy;
+
+ // Horrible hack to undo the scale transform to fit into our UV packing layout logic...
+ if (_VertScale < 0.0)
+ {
+ OUT.texcoord.y = 1.0 - OUT.texcoord.y;
+ }
+
+ OUT.texcoord = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, OUT.texcoord.xy, _VertScale < 0.0);
+
+ OUT.color = IN.color * _Color;
+ return OUT;
+ }
+
+ fixed4 frag(v2f IN) : SV_Target
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.texcoord.xy).r, tex2D(_ChromaTex, IN.texcoord.xy).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, IN.texcoord.xy).r, tex2D(_ChromaTex, IN.texcoord.xy).ra);
+ #endif
+ half4 color = half4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0f);
+#else
+ // Sample RGB
+ half4 color = tex2D(_MainTex, IN.texcoord.xy);
+#endif
+#if APPLY_GAMMA
+ color.rgb = GammaToLinear(color.rgb);
+#endif
+
+#if ALPHAPACK_TOP_BOTTOM | ALPHAPACK_LEFT_RIGHT
+ #if USE_YPCBCR
+ color.a = tex2D(_MainTex, IN.texcoord.zw).r;
+ #else
+ // Sample the alpha
+ half4 alpha = tex2D(_MainTex, IN.texcoord.zw);
+ #if APPLY_GAMMA
+ alpha.rgb = GammaToLinear(alpha.rgb);
+ #endif
+ color.a = (alpha.r + alpha.g + alpha.b) / 3.0;
+ #endif
+#endif
+ color *= IN.color;
+
+#if UNITY_VERSION >= 520
+ color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
+#endif
+ clip(color.a - 0.001);
+
+ return color;
+ }
+
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Transparent.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Transparent.shader.meta
new file mode 100644
index 0000000..74b7080
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-UI-Default-Transparent.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: f32079bbb2560394abb63e40e1d53da7
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-AndroidOES.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-AndroidOES.shader
new file mode 100644
index 0000000..2e16d1f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-AndroidOES.shader
@@ -0,0 +1,74 @@
+Shader "AVProVideo/Unlit/Opaque (texture+color support) - Android OES ONLY"
+{
+ Properties
+ {
+ _MainTex ("Base (RGB)", 2D) = "black" {}
+ _ChromaTex("Chroma", 2D) = "gray" {}
+ _Color("Main Color", Color) = (1,1,1,1)
+
+ [KeywordEnum(None, Top_Bottom, Left_Right)] Stereo("Stereo Mode", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" "IgnoreProjector"="False" "Queue"="Geometry" }
+ LOD 100
+ Lighting Off
+ Cull Off
+
+ Pass
+ {
+ GLSLPROGRAM
+
+ #pragma only_renderers gles gles3
+ #extension GL_OES_EGL_image_external : require
+ #extension GL_OES_EGL_image_external_essl3 : enable
+ precision mediump float;
+
+ #ifdef VERTEX
+
+ #include "UnityCG.glslinc"
+ #define SHADERLAB_GLSL
+ #include "AVProVideo.cginc"
+
+ varying vec2 texVal;
+ uniform vec4 _MainTex_ST;
+
+ /// @fix: explicit TRANSFORM_TEX(); Unity's preprocessor chokes when attempting to use the TRANSFORM_TEX() macro in UnityCG.glslinc
+ /// (as of Unity 4.5.0f6; issue dates back to 2011 or earlier: http://forum.unity3d.com/threads/glsl-transform_tex-and-tiling.93756/)
+ vec2 transformTex(vec4 texCoord, vec4 texST)
+ {
+ return (texCoord.xy * texST.xy + texST.zw);
+ }
+
+ void main()
+ {
+ gl_Position = XFormObjectToClip(gl_Vertex);
+ texVal = transformTex(gl_MultiTexCoord0, _MainTex_ST);
+ //texVal.x = 1.0 - texVal.x;
+ texVal.y = 1.0 - texVal.y;
+ }
+ #endif
+
+ #ifdef FRAGMENT
+
+ varying vec2 texVal;
+
+ uniform samplerExternalOES _MainTex;
+
+ void main()
+ {
+#if defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
+ gl_FragColor = texture2D(_MainTex, texVal.xy);
+#else
+ gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
+#endif
+ }
+ #endif
+
+ ENDGLSL
+ }
+ }
+
+ Fallback "AVProVideo/Unlit/Opaque (texture+color+fog+stereo support)"
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-AndroidOES.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-AndroidOES.shader.meta
new file mode 100644
index 0000000..a9c31d1
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-AndroidOES.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: eb44a525a7e2c6640a8cd90fd7fabce4
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-Transparent.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-Transparent.shader
new file mode 100644
index 0000000..01005e4
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-Transparent.shader
@@ -0,0 +1,129 @@
+Shader "AVProVideo/Unlit/Transparent (texture+color+fog+packed alpha)"
+{
+ Properties
+ {
+ _MainTex ("Base (RGB) Trans (A)", 2D) = "black" {}
+ _Color("Main Color", Color) = (1,1,1,1)
+ _ChromaTex("Chroma", 2D) = "gray" {}
+
+ [KeywordEnum(None, Top_Bottom, Left_Right)] AlphaPack("Alpha Pack", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Transparent" "IgnoreProjector"="True" "Queue"="Transparent" }
+ LOD 100
+ ZWrite Off
+ Blend SrcAlpha OneMinusSrcAlpha
+ Lighting Off
+ Cull Off
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile_fog
+ #pragma multi_compile ALPHAPACK_NONE ALPHAPACK_TOP_BOTTOM ALPHAPACK_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct appdata
+ {
+ float4 vertex : POSITION;
+ float2 uv : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ float4 uv : TEXCOORD0;
+
+#if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+#endif
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+ uniform fixed4 _Color;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+
+ o.vertex = XFormObjectToClip(v.vertex);
+ o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
+
+ // Horrible hack to undo the scale transform to fit into our UV packing layout logic...
+ if (_MainTex_ST.y < 0.0)
+ {
+ o.uv.y = 1.0 - o.uv.y;
+ }
+
+ o.uv = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, o.uv.xy, _MainTex_ST.y < 0.0);
+
+#if UNITY_VERSION >= 500
+ UNITY_TRANSFER_FOG(o, o.vertex);
+#endif
+
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv.xy).r, tex2D(_ChromaTex, i.uv.xy).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv.xy).r, tex2D(_ChromaTex, i.uv.xy).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ // Sample RGB
+ fixed4 col = tex2D(_MainTex, i.uv.xy);
+#endif
+
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if ALPHAPACK_TOP_BOTTOM | ALPHAPACK_LEFT_RIGHT
+ // Sample the alpha
+ #if USE_YPCBCR
+ col.a = tex2D(_MainTex, i.uv.zw).r;
+ #else
+ fixed4 alpha = tex2D(_MainTex, i.uv.zw);
+ #if APPLY_GAMMA
+ alpha.rgb = GammaToLinear(alpha.rgb);
+ #endif
+ col.a = (alpha.r + alpha.g + alpha.b) / 3.0;
+ //col.a = (alpha.r + alpha.g + alpha.g + alpha.b) / 4.0;
+ //clip(col.a - 0.01);
+ #endif
+#endif
+ col *= _Color;
+
+#if UNITY_VERSION >= 500
+ UNITY_APPLY_FOG(i.fogCoord, col);
+#endif
+
+ return col;
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-Transparent.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-Transparent.shader.meta
new file mode 100644
index 0000000..ee08a0b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit-Transparent.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 0ed1fb9218ad96f49acfdb428d5b5aab
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit.shader
new file mode 100644
index 0000000..4bde45e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit.shader
@@ -0,0 +1,128 @@
+Shader "AVProVideo/Unlit/Opaque (texture+color+fog+stereo support)"
+{
+ Properties
+ {
+ _MainTex ("Base (RGB)", 2D) = "black" {}
+ _ChromaTex ("Chroma", 2D) = "gray" {}
+ _Color("Main Color", Color) = (1,1,1,1)
+
+ [KeywordEnum(None, Top_Bottom, Left_Right, Custom_UV)] Stereo("Stereo Mode", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug("Stereo Debug Tinting", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" "IgnoreProjector"="False" "Queue"="Geometry" }
+ LOD 100
+ Lighting Off
+ Cull Off
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile_fog
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+
+ struct appdata
+ {
+ float4 vertex : POSITION;
+ float2 uv : TEXCOORD0;
+#if STEREO_CUSTOM_UV
+ float2 uv2 : TEXCOORD1; // Custom uv set for right eye (left eye is in TEXCOORD0)
+#endif
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION;
+ float2 uv : TEXCOORD0;
+#if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+#endif
+#if STEREO_DEBUG
+ float4 tint : COLOR;
+#endif
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform fixed4 _Color;
+ uniform float3 _cameraPosition;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+
+ o.vertex = XFormObjectToClip(v.vertex);
+ o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
+
+#if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ float4 scaleOffset = GetStereoScaleOffset(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz), _MainTex_ST.y < 0.0);
+ o.uv.xy *= scaleOffset.xy;
+ o.uv.xy += scaleOffset.zw;
+#elif STEREO_CUSTOM_UV
+ if (!IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz))
+ {
+ o.uv.xy = TRANSFORM_TEX(v.uv2, _MainTex);
+ }
+#endif
+
+#if STEREO_DEBUG
+ o.tint = GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz));
+#endif
+
+#if UNITY_VERSION >= 500
+ UNITY_TRANSFER_FOG(o, o.vertex);
+#endif
+
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv).r, tex2D(_ChromaTex, i.uv).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, i.uv).r, tex2D(_ChromaTex, i.uv).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ fixed4 col = tex2D(_MainTex, i.uv.xy);
+#endif
+ col *= _Color;
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if STEREO_DEBUG
+ col *= i.tint;
+#endif
+
+#if UNITY_VERSION >= 500
+ UNITY_APPLY_FOG(i.fogCoord, col);
+#endif
+
+ return fixed4(col.rgb, 1.0);
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit.shader.meta
new file mode 100644
index 0000000..7a60d83
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-Unlit.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 1ca6555d94ddb204c87e9fe549085b3c
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-AndroidOES.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-AndroidOES.shader
new file mode 100644
index 0000000..5b72d07
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-AndroidOES.shader
@@ -0,0 +1,111 @@
+Shader "AVProVideo/VR/InsideSphere Unlit (stereo) - Android OES ONLY"
+{
+ Properties
+ {
+ _MainTex ("Base (RGB)", 2D) = "black" {}
+ _Color("Color", Color) = (0.0, 1.0, 0.0, 1.0)
+ [KeywordEnum(None, Top_Bottom, Left_Right, Custom_UV)] Stereo("Stereo Mode", Float) = 0
+ [KeywordEnum(None, EquiRect180)] Layout("Layout", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug("Stereo Debug Tinting", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ }
+ SubShader
+ {
+ Tags{ "Queue" = "Geometry" }
+ Pass
+ {
+ Cull Front
+ //ZTest Always
+ ZWrite On
+ Lighting Off
+
+ GLSLPROGRAM
+
+ #pragma only_renderers gles gles3
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
+ #pragma multi_compile __ STEREO_DEBUG
+ #pragma multi_compile LAYOUT_NONE LAYOUT_EQUIRECT180
+ //#pragma multi_compile __ GOOGLEVR
+
+ #extension GL_OES_EGL_image_external : require
+ #extension GL_OES_EGL_image_external_essl3 : enable
+ precision mediump float;
+
+ #ifdef VERTEX
+
+#include "UnityCG.glslinc"
+#define SHADERLAB_GLSL
+#include "AVProVideo.cginc"
+
+ varying vec2 texVal;
+ uniform vec3 _cameraPosition;
+ uniform mat4 _ViewMatrix;
+
+#if defined(STEREO_DEBUG)
+ varying vec4 tint;
+#endif
+
+ void main()
+ {
+ gl_Position = XFormObjectToClip(gl_Vertex);
+ texVal = gl_MultiTexCoord0.xy;
+ texVal = vec2(1.0, 1.0) - texVal;
+#if defined(EQUIRECT180)
+ texVal.x = ((texVal.x - 0.5) * 2.0) + 0.5;
+#endif
+#if defined(STEREO_TOP_BOTTOM) | defined(STEREO_LEFT_RIGHT)
+ bool isLeftEye = IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz);
+
+ vec4 scaleOffset = GetStereoScaleOffset(isLeftEye, false);
+
+ texVal.xy *= scaleOffset.xy;
+ texVal.xy += scaleOffset.zw;
+#elif defined (STEREO_CUSTOM_UV)
+ if (!IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz))
+ {
+ texVal = gl_MultiTexCoord1.xy;
+ texVal = vec2(1.0, 1.0) - texVal;
+ }
+#endif
+#if defined(STEREO_DEBUG)
+ tint = GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz));
+#endif
+ }
+ #endif
+
+ #ifdef FRAGMENT
+
+ varying vec2 texVal;
+#if defined(STEREO_DEBUG)
+ varying vec4 tint;
+#endif
+
+ uniform vec4 _Color;
+ uniform samplerExternalOES _MainTex;
+
+ void main()
+ {
+#if defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
+
+#if __VERSION__ < 300
+ gl_FragColor = texture2D(_MainTex, texVal.xy) * _Color;
+#else
+ gl_FragColor = texture(_MainTex, texVal.xy) * _Color;
+#endif
+
+#else
+ gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
+#endif
+
+#if defined(STEREO_DEBUG)
+ gl_FragColor *= tint;
+#endif
+ }
+ #endif
+
+ ENDGLSL
+ }
+ }
+
+ Fallback "AVProVideo/VR/InsideSphere Unlit (stereo+fog)"
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-AndroidOES.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-AndroidOES.shader.meta
new file mode 100644
index 0000000..c556a3f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-AndroidOES.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: a22a9f37cda6a3b48be178ec57376024
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-StereoUV.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-StereoUV.shader
new file mode 100644
index 0000000..fcc3bbe
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-StereoUV.shader
@@ -0,0 +1,114 @@
+Shader "AVProVideo/VR/InsideSphere Unlit (stereo+fog) Stereo UV"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "black" {}
+
+ [Toggle(STEREO_DEBUG)] _StereoDebug ("Stereo Debug Tinting", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" "IgnoreProjector" = "True" "Queue" = "Background" }
+ ZWrite On
+ //ZTest Always
+ Cull Front
+ Lighting Off
+
+ Pass
+ {
+ CGPROGRAM
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+ //#pragma target 3.0
+ #pragma vertex vert
+ #pragma fragment frag
+
+ //#define STEREO_DEBUG 1
+ //#define HIGH_QUALITY 1
+
+ #pragma multi_compile_fog
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+
+ struct appdata
+ {
+ float4 vertex : POSITION; // vertex position
+ float2 uv : TEXCOORD0; // texture coordinate 1
+ float2 uv2 : TEXCOORD1; // texture coordinate 2
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION; // clip space position
+ float2 uv : TEXCOORD0; // texture coordinate
+
+#if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+#endif
+
+#if STEREO_DEBUG
+ float4 tint : COLOR;
+#endif
+ };
+
+ uniform sampler2D _MainTex;
+ uniform float4 _MainTex_ST;
+ uniform float3 _cameraPosition;
+
+ v2f vert(appdata v)
+ {
+ v2f o;
+ o.vertex = XFormObjectToClip(v.vertex);
+
+ if (IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz))
+ {
+ o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
+ o.uv.xy = float2(1.0 - o.uv.x, o.uv.y);
+ }
+ else
+ {
+ o.uv.xy = TRANSFORM_TEX(v.uv2, _MainTex);
+ o.uv.xy = float2(1.0 - o.uv.x, o.uv.y);
+ }
+
+ #if STEREO_DEBUG
+ o.tint = GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz));
+ #endif
+
+#if UNITY_VERSION >= 500
+ UNITY_TRANSFER_FOG(o, o.vertex);
+#endif
+
+ return o;
+ }
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+ float2 uv;
+ uv = i.uv;
+
+ fixed4 col = tex2D(_MainTex, uv);
+
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if STEREO_DEBUG
+ col *= i.tint;
+#endif
+
+#if UNITY_VERSION >= 500
+ UNITY_APPLY_FOG(i.fogCoord, col);
+#endif
+
+ return fixed4(col.rgb, 1.0);
+ }
+ ENDCG
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-StereoUV.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-StereoUV.shader.meta
new file mode 100644
index 0000000..e58d3ec
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-StereoUV.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 08ccc6021f136814494572dcad0c489d
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-Transparent.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-Transparent.shader
new file mode 100644
index 0000000..8e5f030
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-Transparent.shader
@@ -0,0 +1,282 @@
+Shader "AVProVideo/VR/InsideSphere Unlit Transparent(stereo+color+fog+alpha)"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "black" {}
+ _ChromaTex("Chroma", 2D) = "white" {}
+ _Color("Main Color", Color) = (1,1,1,1)
+
+ [KeywordEnum(None, Top_Bottom, Left_Right, Custom_UV)] Stereo ("Stereo Mode", Float) = 0
+ [KeywordEnum(None, Top_Bottom, Left_Right)] AlphaPack("Alpha Pack", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug ("Stereo Debug Tinting", Float) = 0
+ [KeywordEnum(None, EquiRect180)] Layout("Layout", Float) = 0
+ [Toggle(HIGH_QUALITY)] _HighQuality ("High Quality", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ _EdgeFeather("Edge Feather", Range (0, 1)) = 0.02
+ }
+ SubShader
+ {
+ Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
+ ZWrite On
+ //ZTest Always
+ Blend SrcAlpha OneMinusSrcAlpha
+ Cull Front
+ Lighting Off
+
+ Pass
+ {
+ CGPROGRAM
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+#if HIGH_QUALITY || APPLY_GAMMA
+ #pragma target 3.0
+#endif
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #pragma multi_compile_fog
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
+ #pragma multi_compile ALPHAPACK_NONE ALPHAPACK_TOP_BOTTOM ALPHAPACK_LEFT_RIGHT
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile HIGH_QUALITY_OFF HIGH_QUALITY
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+ #pragma multi_compile LAYOUT_NONE LAYOUT_EQUIRECT180
+
+ struct appdata
+ {
+ float4 vertex : POSITION; // vertex position
+#if HIGH_QUALITY
+ float3 normal : NORMAL;
+#else
+ float2 uv : TEXCOORD0; // texture coordinate
+ #if STEREO_CUSTOM_UV
+ float2 uv2 : TEXCOORD1; // Custom uv set for right eye (left eye is in TEXCOORD0)
+ #endif
+#endif
+
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION; // clip space position
+#if HIGH_QUALITY
+ float3 normal : TEXCOORD0;
+
+ #if STEREO_TOP_BOTTOM || STEREO_LEFT_RIGHT
+ float4 scaleOffset : TEXCOORD1; // texture coordinate
+ #if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(2)
+ #endif
+ #else
+ #if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+ #endif
+ #endif
+#else
+ float4 uv : TEXCOORD0; // texture coordinate
+ #if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+ #endif
+#endif
+
+#if STEREO_DEBUG
+ float4 tint : COLOR;
+#endif
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float4 _MainTex_TexelSize;
+ uniform float3 _cameraPosition;
+ uniform fixed4 _Color;
+ uniform float _EdgeFeather;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+ o.vertex = XFormObjectToClip(v.vertex);
+#if !HIGH_QUALITY
+ o.uv.zw = 0.0;
+ o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
+ #if LAYOUT_EQUIRECT180
+ o.uv.x = ((o.uv.x - 0.5) * 2.0) + 0.5;
+ // Set value for clipping if UV area is behind viewer
+ o.uv.z = -1.0;
+ if (v.uv.x > 0.25 && v.uv.x < 0.75)
+ {
+ o.uv.z = 1.0;
+ }
+ #endif
+ o.uv.xy = float2(1.0-o.uv.x, o.uv.y);
+#endif
+
+#if STEREO_TOP_BOTTOM || STEREO_LEFT_RIGHT
+ float4 scaleOffset = GetStereoScaleOffset(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz), _MainTex_ST.y < 0.0);
+
+ #if !HIGH_QUALITY
+ o.uv.xy *= scaleOffset.xy;
+ o.uv.xy += scaleOffset.zw;
+ #else
+ o.scaleOffset = scaleOffset;
+ #endif
+#elif STEREO_CUSTOM_UV && !HIGH_QUALITY
+ if (!IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz))
+ {
+ o.uv.xy = TRANSFORM_TEX(v.uv2, _MainTex);
+ o.uv.xy = float2(1.0 - o.uv.x, o.uv.y);
+ }
+#endif
+
+#if !HIGH_QUALITY
+ #if ALPHAPACK_TOP_BOTTOM || ALPHAPACK_LEFT_RIGHT
+ o.uv = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, o.uv.xy, _MainTex_ST.y > 0.0);
+ #endif
+#endif
+
+#if HIGH_QUALITY
+ o.normal = v.normal;
+#endif
+
+ #if STEREO_DEBUG
+ o.tint = GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz));
+ #endif
+
+#if UNITY_VERSION >= 500
+ UNITY_TRANSFER_FOG(o, o.vertex);
+#endif
+ return o;
+ }
+
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+ float4 uv = 0;
+#if HIGH_QUALITY
+ float3 n = normalize(i.normal);
+ #if LAYOUT_EQUIRECT180
+ clip(-n.z); // Clip pixels on the back of the sphere
+ #endif
+
+ float M_1_PI = 1.0 / 3.1415926535897932384626433832795;
+ float M_1_2PI = 1.0 / 6.283185307179586476925286766559;
+ uv.x = 0.5 - atan2(n.z, n.x) * M_1_2PI;
+ uv.y = 0.5 - asin(-n.y) * M_1_PI;
+ uv.x += 0.75;
+ uv.x = fmod(uv.x, 1.0);
+ //uv.x = uv.x % 1.0;
+ uv.xy = TRANSFORM_TEX(uv, _MainTex);
+ #if LAYOUT_EQUIRECT180
+ uv.x = ((uv.x - 0.5) * 2.0) + 0.5;
+ #endif
+ #if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ uv.xy *= i.scaleOffset.xy;
+ uv.xy += i.scaleOffset.zw;
+ #endif
+ #if ALPHAPACK_TOP_BOTTOM | ALPHAPACK_LEFT_RIGHT
+ uv = OffsetAlphaPackingUV(_MainTex_TexelSize.xy, uv.xy, _MainTex_ST.y < 0.0);
+ #endif
+#else
+ uv = i.uv;
+ #if LAYOUT_EQUIRECT180
+ clip(i.uv.z); // Clip pixels on the back of the sphere
+ #endif
+#endif
+
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, uv).r, tex2D(_ChromaTex, uv).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, uv).r, tex2D(_ChromaTex, uv).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ fixed4 col = tex2D(_MainTex, uv);
+#endif
+
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if ALPHAPACK_TOP_BOTTOM || ALPHAPACK_LEFT_RIGHT
+ // Sample the alpha
+ fixed4 alpha = tex2D(_MainTex, uv.zw);
+#if APPLY_GAMMA
+ alpha.rgb = GammaToLinear(alpha.rgb);
+#endif
+
+ col.a = (alpha.r + alpha.g + alpha.b) / 3.0;
+ //col.a = (alpha.r + alpha.g + alpha.g + alpha.b) / 4.0;
+
+ //clip(col.a - 0.01);
+#endif
+
+#if STEREO_DEBUG
+ col *= i.tint;
+#endif
+
+ col *= _Color;
+
+#if UNITY_VERSION >= 500
+ UNITY_APPLY_FOG(i.fogCoord, col);
+#endif
+
+#if LAYOUT_EQUIRECT180
+ // Apply edge feathering based on UV mapping - this is useful if you're using a hemisphere mesh for 180 degree video and want to have soft edges
+ if (_EdgeFeather > 0.0)
+ {
+ float4 featherDirection = float4(0.0, 0.0, 1.0, 1.0);
+
+#if STEREO_TOP_BOTTOM
+ if (uv.y > 0.5)
+ {
+ featherDirection.y = 0.5;
+ }
+ else
+ {
+ featherDirection.w = 0.5;
+ }
+#endif
+
+#if STEREO_LEFT_RIGHT
+ if (uv.x > 0.5)
+ {
+ featherDirection.x = 0.5;
+ }
+ else
+ {
+ featherDirection.z = 0.5;
+ }
+#endif
+
+
+#if ALPHAPACK_TOP_BOTTOM
+ featherDirection.w *= 0.5;
+#endif
+
+#if ALPHAPACK_LEFT_RIGHT
+ featherDirection.z *= 0.5;
+#endif
+
+ float d = min(uv.x - featherDirection.x, min((uv.y - featherDirection.y), min(featherDirection.z - uv.x, featherDirection.w - uv.y)));
+ float a = smoothstep(0.0, _EdgeFeather, d);
+ col.a *= a;
+ }
+#endif
+
+ return col;
+
+ }
+ ENDCG
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-Transparent.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-Transparent.shader.meta
new file mode 100644
index 0000000..bc61466
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere-Transparent.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 867ec56bd96e5504a95f991314cd5706
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere.shader b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere.shader
new file mode 100644
index 0000000..ff12953
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere.shader
@@ -0,0 +1,201 @@
+Shader "AVProVideo/VR/InsideSphere Unlit (stereo+fog)"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "black" {}
+ _ChromaTex("Chroma", 2D) = "white" {}
+
+ [KeywordEnum(None, Top_Bottom, Left_Right, Custom_UV)] Stereo ("Stereo Mode", Float) = 0
+ [KeywordEnum(None, Left, Right)] ForceEye ("Force Eye Mode", Float) = 0
+ [Toggle(STEREO_DEBUG)] _StereoDebug ("Stereo Debug Tinting", Float) = 0
+ [KeywordEnum(None, EquiRect180)] Layout("Layout", Float) = 0
+ [Toggle(HIGH_QUALITY)] _HighQuality ("High Quality", Float) = 0
+ [Toggle(APPLY_GAMMA)] _ApplyGamma("Apply Gamma", Float) = 0
+ [Toggle(USE_YPCBCR)] _UseYpCbCr("Use YpCbCr", Float) = 0
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" "IgnoreProjector" = "True" "Queue" = "Background" }
+ ZWrite On
+ //ZTest Always
+ Cull Front
+ Lighting Off
+
+ Pass
+ {
+ CGPROGRAM
+ #include "UnityCG.cginc"
+ #include "AVProVideo.cginc"
+#if HIGH_QUALITY || APPLY_GAMMA
+ #pragma target 3.0
+#endif
+ #pragma vertex vert
+ #pragma fragment frag
+
+ //#define STEREO_DEBUG 1
+ //#define HIGH_QUALITY 1
+
+ #pragma multi_compile_fog
+ #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
+
+ // TODO: Change XX_OFF to __ for Unity 5.0 and above
+ // this was just added for Unity 4.x compatibility as __ causes
+ // Android and iOS builds to fail the shader
+ #pragma multi_compile STEREO_DEBUG_OFF STEREO_DEBUG
+ #pragma multi_compile FORCEEYE_NONE FORCEEYE_LEFT FORCEEYE_RIGHT
+ #pragma multi_compile HIGH_QUALITY_OFF HIGH_QUALITY
+ #pragma multi_compile APPLY_GAMMA_OFF APPLY_GAMMA
+ #pragma multi_compile USE_YPCBCR_OFF USE_YPCBCR
+ #pragma multi_compile LAYOUT_NONE LAYOUT_EQUIRECT180
+
+ struct appdata
+ {
+ float4 vertex : POSITION; // vertex position
+#if HIGH_QUALITY
+ float3 normal : NORMAL;
+#else
+ float2 uv : TEXCOORD0; // texture coordinate
+#if STEREO_CUSTOM_UV
+ float2 uv2 : TEXCOORD1; // Custom uv set for right eye (left eye is in TEXCOORD0)
+#endif
+#endif
+
+ };
+
+ struct v2f
+ {
+ float4 vertex : SV_POSITION; // clip space position
+#if HIGH_QUALITY
+ float3 normal : TEXCOORD0;
+
+#if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ float4 scaleOffset : TEXCOORD1; // texture coordinate
+#if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(2)
+#endif
+#else
+#if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+#endif
+#endif
+#else
+ float2 uv : TEXCOORD0; // texture coordinate
+
+#if UNITY_VERSION >= 500
+ UNITY_FOG_COORDS(1)
+#endif
+#endif
+
+#if STEREO_DEBUG
+ float4 tint : COLOR;
+#endif
+ };
+
+ uniform sampler2D _MainTex;
+#if USE_YPCBCR
+ uniform sampler2D _ChromaTex;
+ uniform float4x4 _YpCbCrTransform;
+#endif
+ uniform float4 _MainTex_ST;
+ uniform float3 _cameraPosition;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+
+ o.vertex = XFormObjectToClip(v.vertex);
+
+#if !HIGH_QUALITY
+ o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
+ #if LAYOUT_EQUIRECT180
+ o.uv.x = ((o.uv.x - 0.5) * 2.0) + 0.5;
+ #endif
+ o.uv.xy = float2(1.0-o.uv.x, o.uv.y);
+#endif
+
+#if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ float4 scaleOffset = GetStereoScaleOffset(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz), _MainTex_ST.y < 0.0);
+
+ #if !HIGH_QUALITY
+ o.uv.xy *= scaleOffset.xy;
+ o.uv.xy += scaleOffset.zw;
+ #else
+ o.scaleOffset = scaleOffset;
+ #endif
+#elif STEREO_CUSTOM_UV && !HIGH_QUALITY
+ if (!IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz))
+ {
+ o.uv.xy = TRANSFORM_TEX(v.uv2, _MainTex);
+ o.uv.xy = float2(1.0 - o.uv.x, o.uv.y);
+ }
+#endif
+
+#if HIGH_QUALITY
+ o.normal = v.normal;
+#endif
+
+ #if STEREO_DEBUG
+ o.tint = GetStereoDebugTint(IsStereoEyeLeft(_cameraPosition, UNITY_MATRIX_V[0].xyz));
+ #endif
+
+#if UNITY_VERSION >= 500
+ UNITY_TRANSFER_FOG(o, o.vertex);
+#endif
+
+ return o;
+ }
+
+
+ fixed4 frag (v2f i) : SV_Target
+ {
+ float2 uv;
+
+#if HIGH_QUALITY
+ float3 n = normalize(i.normal);
+
+ float M_1_PI = 1.0 / 3.1415926535897932384626433832795;
+ float M_1_2PI = 1.0 / 6.283185307179586476925286766559;
+ uv.x = 0.5 - atan2(n.z, n.x) * M_1_2PI;
+ uv.y = 0.5 - asin(-n.y) * M_1_PI;
+ uv.x += 0.75;
+ uv.x = fmod(uv.x, 1.0);
+ //uv.x = uv.x % 1.0;
+ uv.xy = TRANSFORM_TEX(uv, _MainTex);
+ #if LAYOUT_EQUIRECT180
+ uv.x = ((uv.x - 0.5) * 2.0) + 0.5;
+ #endif
+ #if STEREO_TOP_BOTTOM | STEREO_LEFT_RIGHT
+ uv.xy *= i.scaleOffset.xy;
+ uv.xy += i.scaleOffset.zw;
+ #endif
+#else
+ uv = i.uv;
+#endif
+#if USE_YPCBCR
+ #if SHADER_API_METAL || SHADER_API_GLES || SHADER_API_GLES3
+ float3 ypcbcr = float3(tex2D(_MainTex, uv).r, tex2D(_ChromaTex, uv).rg);
+ #else
+ float3 ypcbcr = float3(tex2D(_MainTex, uv).r, tex2D(_ChromaTex, uv).ra);
+ #endif
+ fixed4 col = fixed4(ConvertYpCbCrToRGB(ypcbcr, _YpCbCrTransform), 1.0);
+#else
+ fixed4 col = tex2D(_MainTex, uv);
+#endif
+#if APPLY_GAMMA
+ col.rgb = GammaToLinear(col.rgb);
+#endif
+
+#if STEREO_DEBUG
+ col *= i.tint;
+#endif
+
+#if UNITY_VERSION >= 500
+ UNITY_APPLY_FOG(i.fogCoord, col);
+#endif
+
+ return fixed4(col.rgb, 1.0);
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere.shader.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere.shader.meta
new file mode 100644
index 0000000..0753cd1
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo-VR-InsideSphere.shader.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 46b84ca7ab6291e4fb6c57ac48d01e8f
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo.cginc b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo.cginc
new file mode 100644
index 0000000..9a3e2be
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo.cginc
@@ -0,0 +1,306 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2017 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if defined (SHADERLAB_GLSL)
+ #define INLINE
+ #define HALF2 vec2
+ #define HALF3 vec3
+ #define HALF4 vec4
+ #define FLOAT2 vec2
+ #define FLOAT3 vec3
+ #define FLOAT4 vec4
+ #define FLOAT3X3 mat3
+ #define FLOAT4X4 mat4
+#else
+ #define INLINE inline
+ #define HALF2 half2
+ #define HALF3 half3
+ #define HALF4 half4
+ #define FLOAT2 float2
+ #define FLOAT3 float3
+ #define FLOAT4 float4
+ #define FLOAT3X3 float3x3
+ #define FLOAT4X4 float4x4
+#endif
+
+// Specify this so Unity doesn't automatically update our shaders.
+#define UNITY_SHADER_NO_UPGRADE 1
+
+// We use this method so that when Unity automatically updates the shader from the old
+// mul(UNITY_MATRIX_MVP.. to UnityObjectToClipPos that it only changes in one place.
+INLINE FLOAT4 XFormObjectToClip(FLOAT4 vertex)
+{
+#if defined(SHADERLAB_GLSL)
+ return gl_ModelViewProjectionMatrix * vertex;
+#else
+#if (UNITY_VERSION >= 560)
+ return UnityObjectToClipPos(vertex);
+#else
+ return mul(UNITY_MATRIX_MVP, vertex);
+#endif
+#endif
+}
+
+INLINE bool IsStereoEyeLeft(FLOAT3 worldNosePosition, FLOAT3 worldCameraRight)
+{
+#if defined(FORCEEYE_LEFT)
+ return true;
+#elif defined(FORCEEYE_RIGHT)
+ return false;
+#elif defined(UNITY_SINGLE_PASS_STEREO) || defined (UNITY_STEREO_INSTANCING_ENABLED)
+ // Unity 5.4 has this new variable
+ return (unity_StereoEyeIndex == 0);
+#elif defined (UNITY_DECLARE_MULTIVIEW)
+ // OVR_multiview extension
+ return (UNITY_VIEWID == 0);
+#else
+
+//#if (UNITY_VERSION > 540) && defined(GOOGLEVR) && !defined(SHADERLAB_GLSL)
+ // Daydream support uses the skew component of the projection matrix
+ // (But unity_CameraProjection doesn't seem to be declared when using GLSL)
+ // NOTE: we've had to remove this minor optimisationg as it was causing too many isues.
+ // eg. Unity 5.4.1 in GLSL mode complained UNITY_VERSION and unity_CameraProjection aren't defined
+ //return (unity_CameraProjection[0][2] > 0.0);
+//#else
+ // worldNosePosition is the camera positon passed in from Unity via script
+ // We need to determine whether _WorldSpaceCameraPos (Unity shader variable) is to the left or to the right of _cameraPosition
+ float dRight = distance(worldNosePosition + worldCameraRight, _WorldSpaceCameraPos);
+ float dLeft = distance(worldNosePosition - worldCameraRight, _WorldSpaceCameraPos);
+ return (dRight > dLeft);
+//#endif
+
+#endif
+}
+
+#if defined(STEREO_TOP_BOTTOM) || defined(STEREO_LEFT_RIGHT)
+FLOAT4 GetStereoScaleOffset(bool isLeftEye, bool isYFlipped)
+{
+ FLOAT2 scale = FLOAT2(1.0, 1.0);
+ FLOAT2 offset = FLOAT2(0.0, 0.0);
+
+ // Top-Bottom
+#if defined(STEREO_TOP_BOTTOM)
+
+ scale.y = 0.5;
+ offset.y = 0.0;
+
+ if (!isLeftEye)
+ {
+ offset.y = 0.5;
+ }
+
+#if !defined(SHADERLAB_GLSL)
+#if !defined(UNITY_UV_STARTS_AT_TOP) // UNITY_UV_STARTS_AT_TOP is for directx
+ if (!isYFlipped)
+ {
+ // Currently this only runs for Android and Windows using DirectShow
+ offset.y = 0.5 - offset.y;
+ }
+#endif
+#endif
+
+ // Left-Right
+#elif defined(STEREO_LEFT_RIGHT)
+
+ scale.x = 0.5;
+ offset.x = 0.0;
+ if (!isLeftEye)
+ {
+ offset.x = 0.5;
+ }
+
+#endif
+
+ return FLOAT4(scale, offset);
+}
+#endif
+
+#if defined(STEREO_DEBUG)
+INLINE FLOAT4 GetStereoDebugTint(bool isLeftEye)
+{
+ FLOAT4 tint = FLOAT4(1.0, 1.0, 1.0, 1.0);
+
+#if defined(STEREO_TOP_BOTTOM) || defined(STEREO_LEFT_RIGHT) || defined(STEREO_CUSTOM_UV)
+ FLOAT4 leftEyeColor = FLOAT4(0.0, 1.0, 0.0, 1.0); // green
+ FLOAT4 rightEyeColor = FLOAT4(1.0, 0.0, 0.0, 1.0); // red
+
+ if (isLeftEye)
+ {
+ tint = leftEyeColor;
+ }
+ else
+ {
+ tint = rightEyeColor;
+ }
+#endif
+
+#if defined(UNITY_UV_STARTS_AT_TOP)
+ tint.b = 0.5;
+#endif
+/*#if defined(UNITY_SINGLE_PASS_STEREO) || defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_DECLARE_MULTIVIEW)
+ tint.b = 1.0;
+#endif*/
+
+ return tint;
+}
+#endif
+
+FLOAT2 ScaleZoomToFit(float targetWidth, float targetHeight, float sourceWidth, float sourceHeight)
+{
+#if defined(ALPHAPACK_TOP_BOTTOM)
+ sourceHeight *= 0.5;
+#elif defined(ALPHAPACK_LEFT_RIGHT)
+ sourceWidth *= 0.5;
+#endif
+ float targetAspect = targetHeight / targetWidth;
+ float sourceAspect = sourceHeight / sourceWidth;
+ FLOAT2 scale = FLOAT2(1.0, sourceAspect / targetAspect);
+ if (targetAspect < sourceAspect)
+ {
+ scale = FLOAT2(targetAspect / sourceAspect, 1.0);
+ }
+ return scale;
+}
+
+FLOAT4 OffsetAlphaPackingUV(FLOAT2 texelSize, FLOAT2 uv, bool flipVertical)
+{
+ FLOAT4 result = uv.xyxy;
+
+ // We don't want bilinear interpolation to cause bleeding
+ // when reading the pixels at the edge of the packed areas.
+ // So we shift the UV's by a fraction of a pixel so the edges don't get sampled.
+
+#if defined(ALPHAPACK_TOP_BOTTOM)
+ float offset = texelSize.y * 1.5;
+ result.y = lerp(0.0 + offset, 0.5 - offset, uv.y);
+ result.w = result.y + 0.5;
+
+ if (flipVertical)
+ {
+ // Flip vertically (and offset to put back in 0..1 range)
+ result.yw = 1.0 - result.yw;
+ result.yw = result.wy;
+ }
+ else
+ {
+#if !defined(UNITY_UV_STARTS_AT_TOP)
+ // For opengl we flip
+ result.yw = result.wy;
+#endif
+ }
+
+#elif defined(ALPHAPACK_LEFT_RIGHT)
+ float offset = texelSize.x * 1.5;
+ result.x = lerp(0.0 + offset, 0.5 - offset, uv.x);
+ result.z = result.x + 0.5;
+
+ if (flipVertical)
+ {
+ // Flip vertically (and offset to put back in 0..1 range)
+ result.yw = 1.0 - result.yw;
+ }
+
+#else
+
+ if (flipVertical)
+ {
+ // Flip vertically (and offset to put back in 0..1 range)
+ result.yw = 1.0 - result.yw;
+ }
+
+#endif
+
+ return result;
+}
+
+
+// http://entropymine.com/imageworsener/srgbformula/
+INLINE HALF3 GammaToLinear(HALF3 col)
+{
+// Forced cheap version
+#if defined(CHEAP_GAMMATOLINEAR)
+#if defined (SHADERLAB_GLSL)
+ return pow(col, vec3(2.2, 2.2, 2.2));
+#else
+ // Approximate version from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1
+ return col * (col * (col * 0.305306011h + 0.682171111h) + 0.012522878h);
+#endif
+#else
+
+#if SHADER_TARGET < 30
+// Cheaper approximation
+#if defined (SHADERLAB_GLSL)
+ return col * (col * (col * 0.305306011 + 0.682171111) + 0.012522878);
+#else
+ return col * (col * (col * 0.305306011h + 0.682171111h) + 0.012522878h);
+#endif
+#else
+// Accurate version
+ if (col.r <= 0.04045)
+ col.r = col.r / 12.92;
+ else
+ col.r = pow((col.r + 0.055) / 1.055, 2.4);
+
+ if (col.g <= 0.04045)
+ col.g = col.g / 12.92;
+ else
+ col.g = pow((col.g + 0.055) / 1.055, 2.4);
+
+ if (col.b <= 0.04045)
+ col.b = col.b / 12.92;
+ else
+ col.b = pow((col.b + 0.055) / 1.055, 2.4);
+#endif
+#endif
+ return col;
+}
+
+INLINE HALF3 LinearToGamma(HALF3 col)
+{
+// Forced cheap version
+#if defined(CHEAP_GAMMATOLINEAR)
+#if defined (SHADERLAB_GLSL)
+ return pow(col, vec3(1.0 / 2.2, 1.0 / 2.2, 1.0 / 2.2));
+#else
+ // Approximate version from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1
+ return max(1.055h * pow(col, 0.416666667h) - 0.055h, 0.0h);
+#endif
+#else
+
+#if SHADER_TARGET < 30
+// Cheaper approximation
+#if defined (SHADERLAB_GLSL)
+ return max(1.055 * pow(col, vec3(0.416666667, 0.416666667, 0.416666667)) - 0.055, 0.0);
+#else
+ return max(1.055h * pow(col, 0.416666667h) - 0.055h, 0.0h);
+#endif
+#else
+// Accurate version
+ if (col.r <= 0.0031308)
+ col.r = col.r * 12.92;
+ else
+ col.r = 1.055 * pow(col.r, 0.4166667) - 0.055;
+
+ if (col.g <= 0.0031308)
+ col.g = col.g * 12.92;
+ else
+ col.g = 1.055 * pow(col.g, 0.4166667) - 0.055;
+
+ if (col.b <= 0.0031308)
+ col.b = col.b * 12.92;
+ else
+ col.b = 1.055 * pow(col.b, 0.4166667) - 0.055;
+#endif
+#endif
+ return col;
+}
+
+INLINE FLOAT3 ConvertYpCbCrToRGB(FLOAT3 YpCbCr, FLOAT4X4 YpCbCrTransform)
+{
+#if defined(SHADERLAB_GLSL)
+ return (FLOAT3X3)YpCbCrTransform * (YpCbCr + YpCbCrTransform[3].xyz);
+#else
+ return mul((FLOAT3X3)YpCbCrTransform, YpCbCr + YpCbCrTransform[3].xyz);
+#endif
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo.cginc.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo.cginc.meta
new file mode 100644
index 0000000..903ef78
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Resources/Shaders/AVProVideo.cginc.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 5bcf2893fead7a14a8c737d1bb6cdd09
+ShaderImporter:
+ defaultTextures: []
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts.meta
new file mode 100644
index 0000000..164cbc6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 48d8a0fb8367d5e40b369691646ad6e3
+folderAsset: yes
+timeCreated: 1438695622
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components.meta
new file mode 100644
index 0000000..249890f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 40d7664ce355730488a96ff5305f1b5d
+folderAsset: yes
+timeCreated: 1438698284
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMaterial.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMaterial.cs
new file mode 100644
index 0000000..0dcfa9e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMaterial.cs
@@ -0,0 +1,283 @@
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Sets up a material to display the video from a MediaPlayer
+ ///
+ [AddComponentMenu("AVPro Video/Apply To Material", 300)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class ApplyToMaterial : MonoBehaviour
+ {
+ public Vector2 _offset = Vector2.zero;
+ public Vector2 _scale = Vector2.one;
+ public Material _material;
+ public string _texturePropertyName;
+ public MediaPlayer _media;
+ public Texture2D _defaultTexture;
+
+ private Texture _originalTexture;
+ private Vector2 _originalScale = Vector2.one;
+ private Vector2 _originalOffset = Vector2.zero;
+
+ private static int _propStereo;
+ private static int _propAlphaPack;
+ private static int _propApplyGamma;
+ private static int _propLayout;
+
+ private const string PropChromaTexName = "_ChromaTex";
+ private static int _propChromaTex;
+
+ private const string PropYpCbCrTransformName = "_YpCbCrTransform";
+ private static int _propYpCbCrTransform;
+
+ private const string PropUseYpCbCrName = "_UseYpCbCr";
+ private static int _propUseYpCbCr;
+
+ private void Awake()
+ {
+ if (_propStereo == 0)
+ {
+ _propStereo = Shader.PropertyToID("Stereo");
+ }
+ if (_propAlphaPack == 0)
+ {
+ _propAlphaPack = Shader.PropertyToID("AlphaPack");
+ }
+ if (_propApplyGamma == 0)
+ {
+ _propApplyGamma = Shader.PropertyToID("_ApplyGamma");
+ }
+ if (_propLayout == 0)
+ {
+ _propLayout = Shader.PropertyToID("Layout");
+ }
+ if (_propChromaTex == 0)
+ {
+ _propChromaTex = Shader.PropertyToID(PropChromaTexName);
+ }
+ if (_propYpCbCrTransform == 0)
+ {
+ _propYpCbCrTransform = Shader.PropertyToID(PropYpCbCrTransformName);
+ }
+ if (_propUseYpCbCr == 0)
+ {
+ _propUseYpCbCr = Shader.PropertyToID(PropUseYpCbCrName);
+ }
+ }
+
+ // We do a LateUpdate() to allow for any changes in the texture that may have happened in Update()
+ private void LateUpdate()
+ {
+ bool applied = false;
+
+ if (_media != null && _media.TextureProducer != null)
+ {
+ int planeCount = _media.m_Resample ? 1 : _media.TextureProducer.GetTextureCount();
+ for (int plane = 0; plane < planeCount; ++plane)
+ {
+ Texture resamplerTex = _media.FrameResampler == null || _media.FrameResampler.OutputTexture == null ? null : _media.FrameResampler.OutputTexture[plane];
+ Texture texture = _media.m_Resample ? resamplerTex : _media.TextureProducer.GetTexture(plane);
+ if (texture != null)
+ {
+ ApplyMapping(texture, _media.TextureProducer.RequiresVerticalFlip(), plane);
+ applied = true;
+ }
+ }
+ }
+
+ if (!applied)
+ {
+ if (_material != null && _material.HasProperty(_propUseYpCbCr))
+ {
+ _material.DisableKeyword("USE_YPCBCR");
+ }
+ ApplyMapping(_defaultTexture, false);
+ }
+ }
+
+ private void ApplyMapping(Texture texture, bool requiresYFlip, int plane = 0)
+ {
+ if (_material != null)
+ {
+ if (plane == 0)
+ {
+ if (string.IsNullOrEmpty(_texturePropertyName))
+ {
+ _material.mainTexture = texture;
+
+ if (texture != null)
+ {
+ if (requiresYFlip)
+ {
+ _material.mainTextureScale = new Vector2(_scale.x, -_scale.y);
+ _material.mainTextureOffset = Vector2.up + _offset;
+ }
+ else
+ {
+ _material.mainTextureScale = _scale;
+ _material.mainTextureOffset = _offset;
+ }
+ }
+ }
+ else
+ {
+ _material.SetTexture(_texturePropertyName, texture);
+
+ if (texture != null)
+ {
+ if (requiresYFlip)
+ {
+ _material.SetTextureScale(_texturePropertyName, new Vector2(_scale.x, -_scale.y));
+ _material.SetTextureOffset(_texturePropertyName, Vector2.up + _offset);
+ }
+ else
+ {
+ _material.SetTextureScale(_texturePropertyName, _scale);
+ _material.SetTextureOffset(_texturePropertyName, _offset);
+ }
+ }
+ }
+ }
+ else if (plane == 1)
+ {
+ if (_material.HasProperty(_propUseYpCbCr))
+ {
+ _material.EnableKeyword("USE_YPCBCR");
+ }
+ if (_material.HasProperty(_propChromaTex))
+ {
+ _material.SetTexture(_propChromaTex, texture);
+ _material.SetMatrix(_propYpCbCrTransform, _media.TextureProducer.GetYpCbCrTransform());
+ if (texture != null)
+ {
+ #if UNITY_5_6_OR_NEWER
+ if (requiresYFlip)
+ {
+ _material.SetTextureScale(_propChromaTex, new Vector2(_scale.x, -_scale.y));
+ _material.SetTextureOffset(_propChromaTex, Vector2.up + _offset);
+ }
+ else
+ {
+ _material.SetTextureScale(_propChromaTex, _scale);
+ _material.SetTextureOffset(_propChromaTex, _offset);
+ }
+ #else
+ if (requiresYFlip)
+ {
+ _material.SetTextureScale(PropChromaTexName, new Vector2(_scale.x, -_scale.y));
+ _material.SetTextureOffset(PropChromaTexName, Vector2.up + _offset);
+ }
+ else
+ {
+ _material.SetTextureScale(PropChromaTexName, _scale);
+ _material.SetTextureOffset(PropChromaTexName, _offset);
+ }
+ #endif
+ }
+ }
+ }
+
+ if (_media != null)
+ {
+ // Apply changes for layout
+ if (_material.HasProperty(_propLayout))
+ {
+ Helper.SetupLayoutMaterial(_material, _media.VideoLayoutMapping);
+ }
+ // Apply changes for stereo videos
+ if (_material.HasProperty(_propStereo))
+ {
+ Helper.SetupStereoMaterial(_material, _media.m_StereoPacking, _media.m_DisplayDebugStereoColorTint);
+ }
+ // Apply changes for alpha videos
+ if (_material.HasProperty(_propAlphaPack))
+ {
+ Helper.SetupAlphaPackedMaterial(_material, _media.m_AlphaPacking);
+ }
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ // Apply gamma
+ if (_material.HasProperty(_propApplyGamma) && _media.Info != null)
+ {
+ Helper.SetupGammaMaterial(_material, _media.Info.PlayerSupportsLinearColorSpace());
+ }
+#else
+ _propApplyGamma |= 0;
+#endif
+ }
+ }
+ }
+
+ private void Start()
+ {
+ SaveProperties();
+ LateUpdate();
+ }
+
+ private void OnEnable()
+ {
+ SaveProperties();
+ LateUpdate();
+ }
+
+ private void OnDisable()
+ {
+ RestoreProperties();
+ }
+
+ private void SaveProperties()
+ {
+ if (_material != null)
+ {
+ if (string.IsNullOrEmpty(_texturePropertyName))
+ {
+ _originalTexture = _material.mainTexture;
+ _originalScale = _material.mainTextureScale;
+ _originalOffset = _material.mainTextureOffset;
+ }
+ else
+ {
+ _originalTexture = _material.GetTexture(_texturePropertyName);
+ _originalScale = _material.GetTextureScale(_texturePropertyName);
+ _originalOffset = _material.GetTextureOffset(_texturePropertyName);
+ }
+ }
+ }
+
+ private void RestoreProperties()
+ {
+ if (_material != null)
+ {
+ if (string.IsNullOrEmpty(_texturePropertyName))
+ {
+ _material.mainTexture = _originalTexture;
+ _material.mainTextureScale = _originalScale;
+ _material.mainTextureOffset = _originalOffset;
+ }
+ else
+ {
+ _material.SetTexture(_texturePropertyName, _originalTexture);
+ _material.SetTextureScale(_texturePropertyName, _originalScale);
+ _material.SetTextureOffset(_texturePropertyName, _originalOffset);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMaterial.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMaterial.cs.meta
new file mode 100644
index 0000000..de75a96
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMaterial.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d2feedce2e2e63647b8f875ec0894a15
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMesh.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMesh.cs
new file mode 100644
index 0000000..74e0e95
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMesh.cs
@@ -0,0 +1,384 @@
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Sets up a mesh to display the video from a MediaPlayer
+ ///
+ [AddComponentMenu("AVPro Video/Apply To Mesh", 300)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class ApplyToMesh : MonoBehaviour
+ {
+ // TODO: add specific material / material index to target in the mesh if there are multiple materials
+
+ [Header("Media Source")]
+
+ [SerializeField]
+ private MediaPlayer _media = null;
+
+ public MediaPlayer Player
+ {
+ get { return _media; }
+ set { ChangeMediaPlayer(value); }
+ }
+
+ [Tooltip("Default texture to display when the video texture is preparing")]
+ [SerializeField]
+ private Texture2D _defaultTexture = null;
+
+ public Texture2D DefaultTexture
+ {
+ get { return _defaultTexture; }
+ set { if (_defaultTexture != value) { _defaultTexture = value; _isDirty = true; } }
+ }
+
+ [Space(8f)]
+ [Header("Renderer Target")]
+
+ [SerializeField]
+ private Renderer _mesh = null;
+
+ public Renderer MeshRenderer
+ {
+ get { return _mesh; }
+ set { if (_mesh != value) { _mesh = value; _isDirty = true; } }
+ }
+
+ [SerializeField]
+ private string _texturePropertyName = "_MainTex";
+
+ public string TexturePropertyName
+ {
+ get { return _texturePropertyName; }
+ set
+ {
+ if (_texturePropertyName != value)
+ {
+ _texturePropertyName = value;
+#if UNITY_5_6_OR_NEWER
+ _propTexture = Shader.PropertyToID(_texturePropertyName);
+#endif
+ _isDirty = true;
+ }
+ }
+ }
+
+ [SerializeField]
+ private Vector2 _offset = Vector2.zero;
+
+ public Vector2 Offset
+ {
+ get { return _offset; }
+ set { if (_offset != value) { _offset = value; _isDirty = true; } }
+ }
+
+ [SerializeField]
+ private Vector2 _scale = Vector2.one;
+
+ public Vector2 Scale
+ {
+ get { return _scale; }
+ set { if (_scale != value) { _scale = value; _isDirty = true; } }
+ }
+
+ private bool _isDirty = false;
+ private Texture _lastTextureApplied;
+#if UNITY_5_6_OR_NEWER
+ private int _propTexture;
+#endif
+
+ private static int _propStereo;
+ private static int _propAlphaPack;
+ private static int _propApplyGamma;
+ private static int _propLayout;
+
+ private const string PropChromaTexName = "_ChromaTex";
+ private static int _propChromaTex;
+ private const string PropYpCbCrTransformName = "_YpCbCrTransform";
+ private static int _propYpCbCrTransform;
+ private const string PropUseYpCbCrName = "_UseYpCbCr";
+ private static int _propUseYpCbCr;
+
+ private void Awake()
+ {
+ if (_propStereo == 0)
+ {
+ _propStereo = Shader.PropertyToID("Stereo");
+ }
+ if (_propAlphaPack == 0)
+ {
+ _propAlphaPack = Shader.PropertyToID("AlphaPack");
+ }
+ if (_propApplyGamma == 0)
+ {
+ _propApplyGamma = Shader.PropertyToID("_ApplyGamma");
+ }
+ if (_propLayout == 0)
+ {
+ _propLayout = Shader.PropertyToID("Layout");
+ }
+ if (_propChromaTex == 0)
+ {
+ _propChromaTex = Shader.PropertyToID(PropChromaTexName);
+ }
+ if (_propYpCbCrTransform == 0)
+ {
+ _propYpCbCrTransform = Shader.PropertyToID(PropYpCbCrTransformName);
+ }
+ if (_propUseYpCbCr == 0)
+ {
+ _propUseYpCbCr = Shader.PropertyToID(PropUseYpCbCrName);
+ }
+
+ if (_media != null)
+ {
+ _media.Events.AddListener(OnMediaPlayerEvent);
+ }
+ }
+
+ public void ForceUpdate()
+ {
+ _isDirty = true;
+ LateUpdate();
+ }
+
+ // Callback function to handle events
+ private void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.FirstFrameReady:
+ case MediaPlayerEvent.EventType.PropertiesChanged:
+ ForceUpdate();
+ break;
+ }
+ }
+
+ private void ChangeMediaPlayer(MediaPlayer player)
+ {
+ if (_media != player)
+ {
+ if (_media != null)
+ {
+ _media.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ _media = player;
+ if (_media != null)
+ {
+ _media.Events.AddListener(OnMediaPlayerEvent);
+ }
+ _isDirty = true;
+ }
+ }
+
+ // We do a LateUpdate() to allow for any changes in the texture that may have happened in Update()
+ private void LateUpdate()
+ {
+ bool applied = false;
+
+ // Try to apply texture from media
+ if (_media != null && _media.TextureProducer != null)
+ {
+ Texture resamplerTex = _media.FrameResampler == null || _media.FrameResampler.OutputTexture == null ? null : _media.FrameResampler.OutputTexture[0];
+ Texture texture = _media.m_Resample ? resamplerTex : _media.TextureProducer.GetTexture(0);
+ if (texture != null)
+ {
+ // Check for changing texture
+ if (texture != _lastTextureApplied)
+ {
+ _isDirty = true;
+ }
+
+ if (_isDirty)
+ {
+ int planeCount = _media.m_Resample ? 1 : _media.TextureProducer.GetTextureCount();
+ for (int plane = 0; plane < planeCount; plane++)
+ {
+ Texture resamplerTexPlane = _media.FrameResampler == null || _media.FrameResampler.OutputTexture == null ? null : _media.FrameResampler.OutputTexture[plane];
+ texture = _media.m_Resample ? resamplerTexPlane : _media.TextureProducer.GetTexture(plane);
+ if (texture != null)
+ {
+ ApplyMapping(texture, _media.TextureProducer.RequiresVerticalFlip(), plane);
+ }
+ }
+ }
+ applied = true;
+ }
+ }
+
+ // If the media didn't apply a texture, then try to apply the default texture
+ if (!applied)
+ {
+ if (_defaultTexture != _lastTextureApplied)
+ {
+ _isDirty = true;
+ }
+ if (_isDirty)
+ {
+ ApplyMapping(_defaultTexture, false);
+ }
+ }
+ }
+
+ private void ApplyMapping(Texture texture, bool requiresYFlip, int plane = 0)
+ {
+ if (_mesh != null)
+ {
+ _isDirty = false;
+
+ Material[] meshMaterials = _mesh.materials;
+ if (meshMaterials != null)
+ {
+ for (int i = 0; i < meshMaterials.Length; i++)
+ {
+ Material mat = meshMaterials[i];
+ if (mat != null)
+ {
+ if (plane == 0)
+ {
+#if UNITY_5_6_OR_NEWER
+ mat.SetTexture(_propTexture, texture);
+#else
+ mat.SetTexture(_texturePropertyName, texture);
+#endif
+
+ _lastTextureApplied = texture;
+
+ if (texture != null)
+ {
+#if UNITY_5_6_OR_NEWER
+ if (requiresYFlip)
+ {
+ mat.SetTextureScale(_propTexture, new Vector2(_scale.x, -_scale.y));
+ mat.SetTextureOffset(_propTexture, Vector2.up + _offset);
+ }
+ else
+ {
+ mat.SetTextureScale(_propTexture, _scale);
+ mat.SetTextureOffset(_propTexture, _offset);
+ }
+#else
+ if (requiresYFlip)
+ {
+ mat.SetTextureScale(_texturePropertyName, new Vector2(_scale.x, -_scale.y));
+ mat.SetTextureOffset(_texturePropertyName, Vector2.up + _offset);
+ }
+ else
+ {
+ mat.SetTextureScale(_texturePropertyName, _scale);
+ mat.SetTextureOffset(_texturePropertyName, _offset);
+ }
+#endif
+ }
+ }
+ else if (plane == 1)
+ {
+ if (mat.HasProperty(_propUseYpCbCr) && mat.HasProperty(_propChromaTex))
+ {
+ mat.EnableKeyword("USE_YPCBCR");
+ mat.SetTexture(_propChromaTex, texture);
+ mat.SetMatrix(_propYpCbCrTransform, _media.TextureProducer.GetYpCbCrTransform());
+#if UNITY_5_6_OR_NEWER
+ if (requiresYFlip)
+ {
+ mat.SetTextureScale(_propChromaTex, new Vector2(_scale.x, -_scale.y));
+ mat.SetTextureOffset(_propChromaTex, Vector2.up + _offset);
+ }
+ else
+ {
+ mat.SetTextureScale(_propChromaTex, _scale);
+ mat.SetTextureOffset(_propChromaTex, _offset);
+ }
+#else
+ if (requiresYFlip)
+ {
+ mat.SetTextureScale(PropChromaTexName, new Vector2(_scale.x, -_scale.y));
+ mat.SetTextureOffset(PropChromaTexName, Vector2.up + _offset);
+ }
+ else
+ {
+ mat.SetTextureScale(PropChromaTexName, _scale);
+ mat.SetTextureOffset(PropChromaTexName, _offset);
+ }
+#endif
+ }
+ }
+
+ if (_media != null)
+ {
+ // Apply changes for layout
+ if (mat.HasProperty(_propLayout))
+ {
+ Helper.SetupLayoutMaterial(mat, _media.VideoLayoutMapping);
+ }
+ // Apply changes for stereo videos
+ if (mat.HasProperty(_propStereo))
+ {
+ Helper.SetupStereoMaterial(mat, _media.m_StereoPacking, _media.m_DisplayDebugStereoColorTint);
+ }
+ // Apply changes for alpha videos
+ if (mat.HasProperty(_propAlphaPack))
+ {
+ Helper.SetupAlphaPackedMaterial(mat, _media.m_AlphaPacking);
+ }
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ // Apply gamma
+ if (mat.HasProperty(_propApplyGamma) && _media.Info != null)
+ {
+ Helper.SetupGammaMaterial(mat, _media.Info.PlayerSupportsLinearColorSpace());
+ }
+#else
+ _propApplyGamma |= 0;
+#endif
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void OnEnable()
+ {
+ if (_mesh == null)
+ {
+ _mesh = this.GetComponent();
+ if (_mesh == null)
+ {
+ Debug.LogWarning("[AVProVideo] No mesh renderer set or found in gameobject");
+ }
+ }
+
+#if UNITY_5_6_OR_NEWER
+ _propTexture = Shader.PropertyToID(_texturePropertyName);
+#endif
+
+ _isDirty = true;
+ if (_mesh != null)
+ {
+ LateUpdate();
+ }
+ }
+
+ private void OnDisable()
+ {
+ ApplyMapping(_defaultTexture, false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMesh.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMesh.cs.meta
new file mode 100644
index 0000000..536c00f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/ApplyToMesh.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f6d1977a52888584496b1acc7e998011
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/AudioOutput.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/AudioOutput.cs
new file mode 100644
index 0000000..7ca1c3f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/AudioOutput.cs
@@ -0,0 +1,121 @@
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// This is an experimental feature and only works in Windows currently
+ /// Audio is grabbed from the MediaPlayer and rendered via Unity
+ /// This allows audio to have 3D spatial control, effects applied and to be spatialised for VR
+ ///
+ [RequireComponent(typeof(AudioSource))]
+ [AddComponentMenu("AVPro Video/Audio Output", 400)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class AudioOutput : MonoBehaviour
+ {
+ public enum AudioOutputMode
+ {
+ Single,
+ Multiple
+ }
+
+ public AudioOutputMode _audioOutputMode = AudioOutputMode.Multiple;
+
+ [SerializeField]
+ private MediaPlayer _mediaPlayer;
+
+ private AudioSource _audioSource;
+
+ [HideInInspector]
+ public int _channelMask = -1;
+
+ void Awake()
+ {
+ _audioSource = this.GetComponent();
+ }
+
+ void Start()
+ {
+ ChangeMediaPlayer(_mediaPlayer);
+#if (!UNITY_5 && !UNITY_5_4_OR_NEWER)
+ Debug.LogWarning("[AVProVideo] AudioOutput component requires Unity 5.x or above", this);
+#endif
+ }
+
+ void OnDestroy()
+ {
+ ChangeMediaPlayer(null);
+ }
+
+ void Update()
+ {
+ if (_mediaPlayer != null && _mediaPlayer.Control != null && _mediaPlayer.Control.IsPlaying())
+ {
+ ApplyAudioSettings(_mediaPlayer, _audioSource);
+ }
+ }
+
+ public void ChangeMediaPlayer(MediaPlayer newPlayer)
+ {
+ // When changing the media player, handle event subscriptions
+ if (_mediaPlayer != null)
+ {
+ _mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ _mediaPlayer = null;
+ }
+
+ _mediaPlayer = newPlayer;
+ if (_mediaPlayer != null)
+ {
+ _mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ }
+
+ // Callback function to handle events
+ private void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Closing:
+ _audioSource.Stop();
+ break;
+ case MediaPlayerEvent.EventType.Started:
+ ApplyAudioSettings(_mediaPlayer, _audioSource);
+ _audioSource.Play();
+ break;
+ }
+ }
+
+ private static void ApplyAudioSettings(MediaPlayer player, AudioSource audioSource)
+ {
+ // Apply volume and mute from the MediaPlayer to the AudioSource
+ if (player != null && player.Control != null)
+ {
+ float volume = player.Control.GetVolume();
+ bool isMuted = player.Control.IsMuted();
+ float rate = player.Control.GetPlaybackRate();
+ audioSource.volume = volume;
+ audioSource.mute = isMuted;
+ audioSource.pitch = rate;
+ }
+ }
+
+#if (UNITY_5 || UNITY_5_4_OR_NEWER)
+#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_WSA_10_0 || UNITY_WINRT_8_1
+ void OnAudioFilterRead(float[] data, int channels)
+ {
+ AudioOutputManager.Instance.RequestAudio(this, _mediaPlayer, data, _channelMask, channels, _audioOutputMode);
+ }
+#endif
+#endif
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/AudioOutput.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/AudioOutput.cs.meta
new file mode 100644
index 0000000..5dbcd4e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/AudioOutput.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3b05a64a5de3f8546bf586f42e37b979
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/CubemapCube.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/CubemapCube.cs
new file mode 100644
index 0000000..9d64727
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/CubemapCube.cs
@@ -0,0 +1,397 @@
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Builds a cube mesh for displaying a 360 degree "Cubemap 3x2 facebook layout" texture in VR
+ ///
+ [RequireComponent(typeof(MeshRenderer))]
+ [RequireComponent(typeof(MeshFilter))]
+ //[ExecuteInEditMode]
+ [AddComponentMenu("AVPro Video/Cubemap Cube (VR)", 400)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class CubemapCube : MonoBehaviour
+ {
+ public enum Layout
+ {
+ FacebookTransform32, // Layout for Facebooks FFMPEG Transform plugin with 3:2 layout
+ Facebook360Capture, // Layout for Facebooks 360-Capture-SDK
+ }
+
+ private Mesh _mesh;
+ protected MeshRenderer _renderer;
+
+ [SerializeField]
+ protected Material _material = null;
+
+ [SerializeField]
+ private MediaPlayer _mediaPlayer = null;
+
+ // This value comes from the facebook transform ffmpeg filter and is used to prevent seams appearing along the edges due to bilinear filtering
+ [SerializeField]
+ private float expansion_coeff = 1.01f;
+
+ [SerializeField]
+ private Layout _layout = Layout.FacebookTransform32;
+
+ private Texture _texture;
+ private bool _verticalFlip;
+ private int _textureWidth;
+ private int _textureHeight;
+ private static int _propApplyGamma;
+
+ private static int _propUseYpCbCr;
+ private const string PropChromaTexName = "_ChromaTex";
+ private static int _propChromaTex;
+ private const string PropYpCbCrTransformName = "_YpCbCrTransform";
+ private static int _propYpCbCrTransform;
+
+ public MediaPlayer Player
+ {
+ set { _mediaPlayer = value; }
+ get { return _mediaPlayer; }
+ }
+
+
+ void Awake()
+ {
+ if (_propApplyGamma == 0)
+ {
+ _propApplyGamma = Shader.PropertyToID("_ApplyGamma");
+ }
+ if (_propUseYpCbCr == 0)
+ _propUseYpCbCr = Shader.PropertyToID("_UseYpCbCr");
+ if (_propChromaTex == 0)
+ _propChromaTex = Shader.PropertyToID(PropChromaTexName);
+ if (_propYpCbCrTransform == 0)
+ _propYpCbCrTransform = Shader.PropertyToID(PropYpCbCrTransformName);
+ }
+
+ void Start()
+ {
+ if (_mesh == null)
+ {
+ _mesh = new Mesh();
+ _mesh.MarkDynamic();
+ MeshFilter filter = this.GetComponent();
+ if (filter != null)
+ {
+ filter.mesh = _mesh;
+ }
+ _renderer = this.GetComponent();
+ if (_renderer != null)
+ {
+ _renderer.material = _material;
+ }
+ BuildMesh();
+ }
+ }
+
+ void OnDestroy()
+ {
+ if (_mesh != null)
+ {
+ MeshFilter filter = this.GetComponent();
+ if (filter != null)
+ {
+ filter.mesh = null;
+ }
+
+#if UNITY_EDITOR
+ Mesh.DestroyImmediate(_mesh);
+#else
+ Mesh.Destroy(_mesh);
+#endif
+ _mesh = null;
+ }
+
+ if (_renderer != null)
+ {
+ _renderer.material = null;
+ _renderer = null;
+ }
+ }
+
+ // We do a LateUpdate() to allow for any changes in the texture that may have happened in Update()
+ void LateUpdate()
+ {
+ if (Application.isPlaying)
+ {
+ Texture texture = null;
+ bool requiresVerticalFlip = false;
+ if (_mediaPlayer != null && _mediaPlayer.Control != null)
+ {
+ if (_mediaPlayer.TextureProducer != null)
+ {
+ Texture resamplerTex = _mediaPlayer.FrameResampler == null || _mediaPlayer.FrameResampler.OutputTexture == null ? null : _mediaPlayer.FrameResampler.OutputTexture[0];
+ texture = _mediaPlayer.m_Resample ? resamplerTex : _mediaPlayer.TextureProducer.GetTexture();
+ requiresVerticalFlip = _mediaPlayer.TextureProducer.RequiresVerticalFlip();
+
+ // Detect changes that we need to apply to the material/mesh
+ if (_texture != texture ||
+ _verticalFlip != requiresVerticalFlip ||
+ (texture != null && (_textureWidth != texture.width || _textureHeight != texture.height))
+ )
+ {
+ _texture = texture;
+ if (texture != null)
+ {
+ UpdateMeshUV(texture.width, texture.height, requiresVerticalFlip);
+ }
+ }
+
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ // Apply gamma
+ if (_renderer.material.HasProperty(_propApplyGamma) && _mediaPlayer.Info != null)
+ {
+ Helper.SetupGammaMaterial(_renderer.material, _mediaPlayer.Info.PlayerSupportsLinearColorSpace());
+ }
+#endif
+ if (_renderer.material.HasProperty(_propUseYpCbCr) && _mediaPlayer.TextureProducer.GetTextureCount() == 2)
+ {
+ _renderer.material.EnableKeyword("USE_YPCBCR");
+ Texture resamplerTexYCRCB = _mediaPlayer.FrameResampler == null || _mediaPlayer.FrameResampler.OutputTexture == null ? null : _mediaPlayer.FrameResampler.OutputTexture[1];
+ _renderer.material.SetTexture(_propChromaTex, _mediaPlayer.m_Resample ? resamplerTexYCRCB : _mediaPlayer.TextureProducer.GetTexture(1));
+ _renderer.material.SetMatrix(_propYpCbCrTransform, _mediaPlayer.TextureProducer.GetYpCbCrTransform());
+ }
+ }
+
+ _renderer.material.mainTexture = _texture;
+ }
+ else
+ {
+ _renderer.material.mainTexture = null;
+ }
+ }
+ }
+
+ private void BuildMesh()
+ {
+ Vector3 offset = new Vector3(-0.5f, -0.5f, -0.5f);
+ Vector3[] v = new Vector3[]
+ {
+ // Left
+ new Vector3(0f,-1f,0f) - offset,
+ new Vector3(0f,0f,0f) - offset,
+ new Vector3(0f,0f,-1f) - offset,
+ new Vector3(0f,-1f,-1f) - offset,
+ // Front
+ new Vector3(0f,0f,0f) - offset,
+ new Vector3(-1f,0f,0f) - offset,
+ new Vector3(-1f,0f,-1f) - offset,
+ new Vector3(0f,0f,-1f) - offset,
+ // Right
+ new Vector3(-1f,0f,0f) - offset,
+ new Vector3(-1f,-1f,0f) - offset,
+ new Vector3(-1f,-1f,-1f) - offset,
+ new Vector3(-1f,0f,-1f) - offset,
+ // Back
+ new Vector3(-1f,-1f,0f) - offset,
+ new Vector3(0f,-1f,0f) - offset,
+ new Vector3(0f,-1f,-1f) - offset,
+ new Vector3(-1f,-1f,-1f) - offset,
+ // Bottom
+ new Vector3(0f,-1f,-1f) - offset,
+ new Vector3(0f,0f,-1f) - offset,
+ new Vector3(-1f,0f,-1f) - offset,
+ new Vector3(-1f,-1f,-1f) - offset,
+ // Top
+ new Vector3(-1f,-1f,0f) - offset,
+ new Vector3(-1f,0f,0f) - offset,
+ new Vector3(0f,0f,0f) - offset,
+ new Vector3(0f,-1f,0f) - offset,
+ };
+
+ Matrix4x4 rot = Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(-90f, Vector3.right), Vector3.one);
+ for (int i = 0; i < v.Length; i++)
+ {
+ v[i] = rot.MultiplyPoint(v[i]);
+ }
+
+ _mesh.vertices = v;
+
+ _mesh.triangles = new int[]
+ {
+ 0,1,2,
+ 0,2,3,
+ 4,5,6,
+ 4,6,7,
+ 8,9,10,
+ 8,10,11,
+ 12,13,14,
+ 12,14,15,
+ 16,17,18,
+ 16,18,19,
+ 20,21,22,
+ 20,22,23,
+ };
+
+ _mesh.normals = new Vector3[]
+ {
+ // Left
+ new Vector3(-1f,0f,0f),
+ new Vector3(-1f,0f,0f),
+ new Vector3(-1f,0f,0f),
+ new Vector3(-1f,0f,0f),
+ // Front
+ new Vector3(0f,-1f,0f),
+ new Vector3(0f,-1f,0f),
+ new Vector3(0f,-1f,0f),
+ new Vector3(0f,-1f,0f),
+ // Right
+ new Vector3(1f,0f,0f),
+ new Vector3(1f,0f,0f),
+ new Vector3(1f,0f,0f),
+ new Vector3(1f,0f,0f),
+ // Back
+ new Vector3(0f,1f,0f),
+ new Vector3(0f,1f,0f),
+ new Vector3(0f,1f,0f),
+ new Vector3(0f,1f,0f),
+ // Bottom
+ new Vector3(0f,0f,1f),
+ new Vector3(0f,0f,1f),
+ new Vector3(0f,0f,1f),
+ new Vector3(0f,0f,1f),
+ // Top
+ new Vector3(0f,0f,-1f),
+ new Vector3(0f,0f,-1f),
+ new Vector3(0f,0f,-1f),
+ new Vector3(0f,0f,-1f)
+ };
+
+ UpdateMeshUV(512, 512, false);
+ }
+
+ private void UpdateMeshUV(int textureWidth, int textureHeight, bool flipY)
+ {
+ _textureWidth = textureWidth;
+ _textureHeight = textureHeight;
+ _verticalFlip = flipY;
+
+ float texWidth = textureWidth;
+ float texHeight = textureHeight;
+
+ float blockWidth = texWidth / 3f;
+ float pixelOffset = Mathf.Floor(((expansion_coeff * blockWidth) - blockWidth) / 2f);
+
+ float wO = pixelOffset / texWidth;
+ float hO = pixelOffset / texHeight;
+
+ const float third = 1f / 3f;
+ const float half = 0.5f;
+
+ Vector2[] uv = null;
+ if (_layout == Layout.Facebook360Capture)
+ {
+ uv = new Vector2[]
+ {
+ //front (texture middle top) correct left
+ new Vector2(third+wO, half-hO),
+ new Vector2((third*2f)-wO, half-hO),
+ new Vector2((third*2f)-wO, 0f+hO),
+ new Vector2(third+wO, 0f+hO),
+
+ //left (texture middle bottom) correct front
+ new Vector2(third+wO,1f-hO),
+ new Vector2((third*2f)-wO, 1f-hO),
+ new Vector2((third*2f)-wO, half+hO),
+ new Vector2(third+wO, half+hO),
+
+ //bottom (texture left top) correct right
+ new Vector2(0f+wO, half-hO),
+ new Vector2(third-wO, half-hO),
+ new Vector2(third-wO, 0f+hO),
+ new Vector2(0f+wO, 0f+hO),
+
+ //top (texture right top) correct rear
+ new Vector2((third*2f)+wO, 1f-hO),
+ new Vector2(1f-wO, 1f-hO),
+ new Vector2(1f-wO, half+hO),
+ new Vector2((third*2f)+wO, half+hO),
+
+ //back (texture right bottom) correct ground
+ new Vector2((third*2f)+wO, 0f+hO),
+ new Vector2((third*2f)+wO, half-hO),
+ new Vector2(1f-wO, half-hO),
+ new Vector2(1f-wO, 0f+hO),
+
+ //right (texture left bottom) correct sky
+ new Vector2(third-wO, 1f-hO),
+ new Vector2(third-wO, half+hO),
+ new Vector2(0f+wO, half+hO),
+ new Vector2(0f+wO, 1f-hO),
+ };
+ }
+ else if (_layout == Layout.FacebookTransform32)
+ {
+ uv = new Vector2[]
+ {
+ //left
+ new Vector2(third+wO,1f-hO),
+ new Vector2((third*2f)-wO, 1f-hO),
+ new Vector2((third*2f)-wO, half+hO),
+ new Vector2(third+wO, half+hO),
+
+ //front
+ new Vector2(third+wO, half-hO),
+ new Vector2((third*2f)-wO, half-hO),
+ new Vector2((third*2f)-wO, 0f+hO),
+ new Vector2(third+wO, 0f+hO),
+
+ //right
+ new Vector2(0f+wO, 1f-hO),
+ new Vector2(third-wO, 1f-hO),
+ new Vector2(third-wO, half+hO),
+ new Vector2(0f+wO, half+hO),
+
+ //back
+ new Vector2((third*2f)+wO, half-hO),
+ new Vector2(1f-wO, half-hO),
+ new Vector2(1f-wO, 0f+hO),
+ new Vector2((third*2f)+wO, 0f+hO),
+
+ //bottom
+ new Vector2(0f+wO, 0f+hO),
+ new Vector2(0f+wO, half-hO),
+ new Vector2(third-wO, half-hO),
+ new Vector2(third-wO, 0f+hO),
+
+ //top
+ new Vector2(1f-wO, 1f-hO),
+ new Vector2(1f-wO, half+hO),
+ new Vector2((third*2f)+wO, half+hO),
+ new Vector2((third*2f)+wO, 1f-hO)
+ };
+ }
+
+ if (flipY)
+ {
+ for (int i = 0; i < uv.Length; i++)
+ {
+ uv[i].y = 1f - uv[i].y;
+ }
+ }
+
+ _mesh.uv = uv;
+ _mesh.UploadMeshData(false);
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/CubemapCube.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/CubemapCube.cs.meta
new file mode 100644
index 0000000..65f2b7b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/CubemapCube.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 683e7713922f8044c81bf497a0b5887e
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DebugOverlay.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DebugOverlay.cs
new file mode 100644
index 0000000..df89b17
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DebugOverlay.cs
@@ -0,0 +1,271 @@
+//#define AVPROVIDEO_DISABLE_DEBUG_GUI // INTERNAL TESTING
+//#define AVPROVIDEO_DEBUG_DISPLAY_EVENTS // DEV FEATURE: show event logs in the gui display
+//#define AVPROVIDEO_DEBUG_FRAMESYNC // INTERNAL TESTING
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Uses IMGUI to display a UI to show information about the MediaPlayer
+ ///
+ [AddComponentMenu("AVPro Video/Debug Overlay", -99)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class DebugOverlay : MonoBehaviour
+ {
+ [SerializeField]
+ private MediaPlayer _mediaPlayer = null;
+
+#pragma warning disable 414
+ [SerializeField]
+ private int _guiDepth = -1000;
+
+ [SerializeField]
+ private float _displaySize = 1f;
+
+ private int _debugOverlayCount;
+#pragma warning restore 414
+
+ [SerializeField]
+ private bool _displayControls = true;
+
+ public bool DisplayControls
+ {
+ get { return _displayControls; }
+ set { _displayControls = value; }
+ }
+
+ public MediaPlayer CurrentMediaPlayer
+ {
+ get
+ {
+ return _mediaPlayer;
+ }
+ set
+ {
+ if (_mediaPlayer != value)
+ {
+#if AVPROVIDEO_DEBUG_DISPLAY_EVENTS
+ if (_mediaPlayer != null)
+ {
+ _mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+#endif
+ _mediaPlayer = value;
+ }
+ }
+ }
+
+ private const int s_GuiStartWidth = 10;
+ private const int s_GuiWidth = 180;
+#if AVPROVIDEO_DISABLE_DEBUG_GUI && !UNITY_EDITOR
+#else
+ private int m_GuiPositionX = s_GuiStartWidth;
+#endif
+
+ private void SetGuiPositionFromVideoIndex(int index)
+ {
+#if AVPROVIDEO_DISABLE_DEBUG_GUI && !UNITY_EDITOR
+#else
+ m_GuiPositionX = Mathf.FloorToInt((s_GuiStartWidth * _displaySize) + (s_GuiWidth * index * _displaySize));
+#endif
+ }
+
+#if AVPROVIDEO_DEBUG_FRAMESYNC
+ private int _lastFrameCount = 0;
+ private int _sameFrameCount = 1;
+
+ public int SameFrameCount
+ {
+ get { return _sameFrameCount; }
+ }
+
+ private void UpdateFrameSyncDebugging()
+ {
+ int frameCount = TextureProducer.GetTextureFrameCount();
+ if (frameCount == _lastFrameCount)
+ {
+ _sameFrameCount++;
+ }
+ else
+ {
+ _sameFrameCount = 1;
+ }
+ _lastFrameCount = frameCount;
+ }
+#endif
+
+#if AVPROVIDEO_DEBUG_DISPLAY_EVENTS
+ private Queue _eventLog = new Queue(8);
+ private float _eventTimer = 1f;
+
+ private void AddEvent(MediaPlayerEvent.EventType et)
+ {
+ Helper.LogInfo("[MediaPlayer] Event: " + et.ToString(), this);
+ _eventLog.Enqueue(et.ToString());
+ if (_eventLog.Count > 5)
+ {
+ _eventLog.Dequeue();
+ _eventTimer = 1f;
+ }
+ }
+
+ private void UpdateEventLogs()
+ {
+ if (_eventLog != null && _eventLog.Count > 0)
+ {
+ _eventTimer -= Time.deltaTime;
+ if (_eventTimer < 0f)
+ {
+ _eventLog.Dequeue();
+ _eventTimer = 1f;
+ }
+ }
+ }
+
+ // Callback function to handle events
+ private void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ AddEvent(et);
+ }
+#endif
+
+ private void Update()
+ {
+ _debugOverlayCount = 0;
+#if AVPROVIDEO_DISABLE_DEBUG_GUI
+ // Stub code so that the variables are used and don't produce a warning
+ _guiDepth = -1000;
+ _displaySize = 1f;
+ _debugOverlayCount = 0;
+#endif
+ }
+
+#if AVPROVIDEO_DISABLE_DEBUG_GUI && !UNITY_EDITOR
+#else
+ void OnGUI()
+ {
+ if (Event.current.type == EventType.Layout)
+ {
+ SetGuiPositionFromVideoIndex(_debugOverlayCount++);
+ }
+
+ if (_mediaPlayer != null && _mediaPlayer.Info != null)
+ {
+ IMediaInfo info = _mediaPlayer.Info;
+ IMediaControl control = _mediaPlayer.Control;
+ IMediaProducer textureProducer = _mediaPlayer.TextureProducer;
+
+ GUI.depth = _guiDepth;
+ GUI.matrix = Matrix4x4.TRS(new Vector3(m_GuiPositionX, 10f, 0f), Quaternion.identity, new Vector3(_displaySize, _displaySize, 1.0f));
+
+ GUILayout.BeginVertical("box", GUILayout.MaxWidth(s_GuiWidth));
+ GUILayout.Label(System.IO.Path.GetFileName(_mediaPlayer.m_VideoPath));
+ GUILayout.Label("Dimensions: " + info.GetVideoWidth() + "x" + info.GetVideoHeight() + "@" + info.GetVideoFrameRate().ToString("F2"));
+ GUILayout.Label("Time: " + (control.GetCurrentTimeMs() * 0.001f).ToString("F1") + "s / " + (info.GetDurationMs() * 0.001f).ToString("F1") + "s");
+ GUILayout.Label("Rate: " + info.GetVideoDisplayRate().ToString("F2") + "Hz");
+
+ if (_mediaPlayer.m_Resample && _mediaPlayer.FrameResampler != null)
+ {
+ Resampler resampler = _mediaPlayer.FrameResampler;
+ GUILayout.BeginVertical();
+ GUILayout.Label("Resampler Info:");
+ GUILayout.Label("Resampler timestamp: " + resampler.TextureTimeStamp);
+ GUILayout.Label("Resampler frames dropped: " + resampler.DroppedFrames);
+ GUILayout.Label("Resampler frame displayed timer: " + resampler.FrameDisplayedTimer);
+ GUILayout.EndVertical();
+ }
+
+ if (textureProducer != null && textureProducer.GetTexture() != null)
+ {
+#if REAL_ANDROID
+ // In OES mode we can't display the texture without using a special shader, so just don't display it
+ if (!_optionsAndroid.useFastOesPath)
+#endif
+ {
+ // Show texture without and with alpha blending
+ GUILayout.BeginHorizontal();
+ Rect r1 = GUILayoutUtility.GetRect(32f, 32f);
+ GUILayout.Space(8f);
+ Rect r2 = GUILayoutUtility.GetRect(32f, 32f);
+ Matrix4x4 prevMatrix = GUI.matrix;
+ if (textureProducer.RequiresVerticalFlip())
+ {
+ GUIUtility.ScaleAroundPivot(new Vector2(1f, -1f), new Vector2(0, r1.y + (r1.height / 2f)));
+ }
+ GUI.DrawTexture(r1, textureProducer.GetTexture(), ScaleMode.ScaleToFit, false);
+ GUI.DrawTexture(r2, textureProducer.GetTexture(), ScaleMode.ScaleToFit, true);
+ GUI.matrix = prevMatrix;
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ }
+ }
+
+ if (_displayControls)
+ {
+ GUILayout.BeginHorizontal();
+ if (control.IsPaused())
+ {
+ if (GUILayout.Button("Play", GUILayout.Width(50)))
+ {
+ control.Play();
+ }
+ }
+ else
+ {
+ if (GUILayout.Button("Pause", GUILayout.Width(50)))
+ {
+ control.Pause();
+ }
+ }
+
+ float duration = info.GetDurationMs();
+ float time = control.GetCurrentTimeMs();
+ float newTime = GUILayout.HorizontalSlider(time, 0f, duration);
+ if (newTime != time)
+ {
+ control.Seek(newTime);
+ }
+ GUILayout.EndHorizontal();
+ }
+
+#if AVPROVIDEO_DEBUG_DISPLAY_EVENTS
+ // Dirty code to hack in an event monitor
+ if (Event.current.type == EventType.Repaint)
+ {
+ _mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ _mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ UpdateEventLogs();
+ }
+
+ if (_eventLog != null && _eventLog.Count > 0)
+ {
+ GUILayout.Label("Recent Events: ");
+ GUILayout.BeginVertical("box");
+ int eventIndex = 0;
+ foreach (string eventString in _eventLog)
+ {
+ GUI.color = Color.white;
+ if (eventIndex == 0)
+ {
+ GUI.color = new Color(1f, 1f, 1f, _eventTimer);
+ }
+ GUILayout.Label(eventString);
+ eventIndex++;
+ }
+ GUILayout.EndVertical();
+ GUI.color = Color.white;
+ }
+#endif
+ GUILayout.EndVertical();
+ }
+ }
+#endif
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DebugOverlay.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DebugOverlay.cs.meta
new file mode 100644
index 0000000..97b0e77
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DebugOverlay.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7954bb33da8af354bbe3cdece033bfdc
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayBackground.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayBackground.cs
new file mode 100644
index 0000000..f539622
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayBackground.cs
@@ -0,0 +1,60 @@
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Draws video over the whole background using the special "background" tag on the shader.
+ /// Useful for augmented reality.
+ /// NOTE: This doesn't work with the camera clear mode set to 'skybox'
+ ///
+ [AddComponentMenu("AVPro Video/Display Background", 200)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ [ExecuteInEditMode]
+ public class DisplayBackground : MonoBehaviour
+ {
+ public IMediaProducer _source;
+
+ public Texture2D _texture;
+ public Material _material;
+
+ //-------------------------------------------------------------------------
+
+ void OnRenderObject()
+ {
+ if (_material == null || _texture == null)
+ return;
+
+ Vector4 uv = new Vector4(0f, 0f, 1f, 1f);
+ _material.SetPass(0);
+ GL.PushMatrix();
+ GL.LoadOrtho();
+ GL.Begin(GL.QUADS);
+
+ GL.TexCoord2(uv.x, uv.y);
+ GL.Vertex3(0.0f, 0.0f, 0.1f);
+
+ GL.TexCoord2(uv.z, uv.y);
+ GL.Vertex3(1.0f, 0.0f, 0.1f);
+
+ GL.TexCoord2(uv.z, uv.w);
+ GL.Vertex3(1.0f, 1.0f, 0.1f);
+
+ GL.TexCoord2(uv.x, uv.w);
+ GL.Vertex3(0.0f, 1.0f, 0.1f);
+
+ GL.End();
+ GL.PopMatrix();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayBackground.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayBackground.cs.meta
new file mode 100644
index 0000000..8d1833b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayBackground.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 6265373c6a2e0b24f8cd817d3bb88b51
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences:
+ - _texture: {instanceID: 0}
+ - _material: {fileID: 2100000, guid: 7ccf4b555441d554484bbe799cb1c834, type: 2}
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayIMGUI.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayIMGUI.cs
new file mode 100644
index 0000000..2bdaf15
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayIMGUI.cs
@@ -0,0 +1,314 @@
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Displays the video from MediaPlayer component using IMGUI
+ ///
+ [AddComponentMenu("AVPro Video/Display IMGUI", 200)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ [ExecuteInEditMode]
+ public class DisplayIMGUI : MonoBehaviour
+ {
+ private const string PropChromaTexName = "_ChromaTex";
+ private const string PropYpCbCrTransformName = "_YpCbCrTransform";
+
+ public MediaPlayer _mediaPlayer;
+
+ public bool _displayInEditor = true;
+ public ScaleMode _scaleMode = ScaleMode.ScaleToFit;
+ public Color _color = Color.white;
+ public bool _alphaBlend = false;
+
+ [SerializeField]
+ private bool _useDepth = false;
+
+ public int _depth = 0;
+ public bool _fullScreen = true;
+ [Range(0f, 1f)]
+ public float _x = 0.0f;
+ [Range(0f, 1f)]
+ public float _y = 0.0f;
+ [Range(0f, 1f)]
+ public float _width = 1.0f;
+ [Range(0f, 1f)]
+ public float _height = 1.0f;
+
+ private static int _propAlphaPack;
+ private static int _propVertScale;
+ private static int _propApplyGamma;
+ private static int _propChromaTex;
+ private static int _propYpCbCrTransform;
+ private static Shader _shaderAlphaPacking;
+ private Material _material;
+
+ void Awake()
+ {
+ if (_propAlphaPack == 0)
+ {
+ _propAlphaPack = Shader.PropertyToID("AlphaPack");
+ _propVertScale = Shader.PropertyToID("_VertScale");
+ _propApplyGamma = Shader.PropertyToID("_ApplyGamma");
+ _propChromaTex = Shader.PropertyToID(PropChromaTexName);
+ _propYpCbCrTransform = Shader.PropertyToID(PropYpCbCrTransformName);
+ }
+ }
+
+ void Start()
+ {
+ // Disabling this lets you skip the GUI layout phase which helps performance, but this also breaks the GUI.depth usage.
+ if (!_useDepth)
+ {
+ this.useGUILayout = false;
+ }
+
+ if (_shaderAlphaPacking == null)
+ {
+ _shaderAlphaPacking = Shader.Find("AVProVideo/IMGUI/Texture Transparent");
+ if (_shaderAlphaPacking == null)
+ {
+ Debug.LogWarning("[AVProVideo] Missing shader AVProVideo/IMGUI/Transparent Packed");
+ }
+ }
+ }
+
+ void OnDestroy()
+ {
+ // Destroy existing material
+ if (_material != null)
+ {
+#if UNITY_EDITOR
+ Material.DestroyImmediate(_material);
+#else
+ Material.Destroy(_material);
+#endif
+ _material = null;
+ }
+ }
+
+ private Shader GetRequiredShader()
+ {
+ Shader result = null;
+
+ switch (_mediaPlayer.m_AlphaPacking)
+ {
+ case AlphaPacking.None:
+ break;
+ case AlphaPacking.LeftRight:
+ case AlphaPacking.TopBottom:
+ result = _shaderAlphaPacking;
+ break;
+ }
+
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ if (result == null && _mediaPlayer.Info != null)
+ {
+ // If the player does support generating sRGB textures then we need to use a shader to convert them for display via IMGUI
+ if (QualitySettings.activeColorSpace == ColorSpace.Linear && _mediaPlayer.Info.PlayerSupportsLinearColorSpace())
+ {
+ result = _shaderAlphaPacking;
+ }
+ }
+#endif
+ if (result == null && _mediaPlayer.TextureProducer != null)
+ {
+ if (_mediaPlayer.TextureProducer.GetTextureCount() == 2)
+ {
+ result = _shaderAlphaPacking;
+ }
+ }
+ return result;
+ }
+
+ void Update()
+ {
+ if (_mediaPlayer != null)
+ {
+ // Get required shader
+ Shader currentShader = null;
+ if (_material != null)
+ {
+ currentShader = _material.shader;
+ }
+ Shader nextShader = GetRequiredShader();
+
+ // If the shader requirement has changed
+ if (currentShader != nextShader)
+ {
+ // Destroy existing material
+ if (_material != null)
+ {
+#if UNITY_EDITOR
+ Material.DestroyImmediate(_material);
+#else
+ Material.Destroy(_material);
+#endif
+ _material = null;
+ }
+
+ // Create new material
+ if (nextShader != null)
+ {
+ _material = new Material(nextShader);
+ }
+ }
+
+ // Apply material changes
+ if (_material != null)
+ {
+ if (_material.HasProperty(_propAlphaPack))
+ {
+ Helper.SetupAlphaPackedMaterial(_material, _mediaPlayer.m_AlphaPacking);
+ }
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ // Apply gamma
+ if (_material.HasProperty(_propApplyGamma) && _mediaPlayer.Info != null)
+ {
+ Helper.SetupGammaMaterial(_material, !_mediaPlayer.Info.PlayerSupportsLinearColorSpace());
+ }
+#else
+ _propApplyGamma |= 0;
+#endif
+ }
+
+ }
+ }
+
+ void OnGUI()
+ {
+#if UNITY_EDITOR
+ if (!Application.isPlaying && _displayInEditor)
+ {
+ GUI.depth = _depth;
+ GUI.color = _color;
+ Rect rect = GetRect();
+ Texture2D icon = Resources.Load("AVProVideoIcon");
+ Rect uv = rect;
+ uv.x /= Screen.width;
+ uv.width /= Screen.width;
+ uv.y /= Screen.height;
+ uv.height /= Screen.height;
+ uv.width *= 16f;
+ uv.height *= 16f;
+ uv.x += 0.5f;
+ uv.y += 0.5f;
+ GUI.DrawTextureWithTexCoords(rect, icon, uv);
+ return;
+ }
+#endif
+
+ if (_mediaPlayer == null)
+ {
+ return;
+ }
+
+ bool requiresVerticalFlip = false;
+ Texture texture = null;
+
+ if (_displayInEditor)
+ {
+#if UNITY_EDITOR
+ texture = Texture2D.whiteTexture;
+#endif
+ }
+
+ if (_mediaPlayer.Info != null && !_mediaPlayer.Info.HasVideo())
+ {
+ texture = null;
+ }
+
+ if (_mediaPlayer.TextureProducer != null)
+ {
+ if (_mediaPlayer.m_Resample)
+ {
+ if (_mediaPlayer.FrameResampler.OutputTexture != null && _mediaPlayer.FrameResampler.OutputTexture[0] != null)
+ {
+ texture = _mediaPlayer.FrameResampler.OutputTexture[0];
+ requiresVerticalFlip = _mediaPlayer.TextureProducer.RequiresVerticalFlip();
+ }
+ }
+ else
+ {
+ if (_mediaPlayer.TextureProducer.GetTexture() != null)
+ {
+ texture = _mediaPlayer.TextureProducer.GetTexture();
+ requiresVerticalFlip = _mediaPlayer.TextureProducer.RequiresVerticalFlip();
+ }
+ }
+
+ if (_mediaPlayer.TextureProducer.GetTextureCount() == 2 && _material != null)
+ {
+ Texture resamplerTex = _mediaPlayer.FrameResampler == null || _mediaPlayer.FrameResampler.OutputTexture == null ? null : _mediaPlayer.FrameResampler.OutputTexture[1];
+ Texture chroma = _mediaPlayer.m_Resample ? resamplerTex : _mediaPlayer.TextureProducer.GetTexture(1);
+ _material.SetTexture(_propChromaTex, chroma);
+ _material.SetMatrix(_propYpCbCrTransform, _mediaPlayer.TextureProducer.GetYpCbCrTransform());
+ _material.EnableKeyword("USE_YPCBCR");
+ }
+ }
+
+ if (texture != null)
+ {
+ if (!_alphaBlend || _color.a > 0f)
+ {
+ GUI.depth = _depth;
+ GUI.color = _color;
+
+ Rect rect = GetRect();
+
+ if (_material != null)
+ {
+ if (requiresVerticalFlip)
+ {
+ _material.SetFloat(_propVertScale, -1f);
+ }
+ else
+ {
+ _material.SetFloat(_propVertScale, 1f);
+ }
+ Helper.DrawTexture(rect, texture, _scaleMode, _mediaPlayer.m_AlphaPacking, _material);
+ }
+ else
+ {
+ if (requiresVerticalFlip)
+ {
+ GUIUtility.ScaleAroundPivot(new Vector2(1f, -1f), new Vector2(0f, rect.y + (rect.height / 2f)));
+ }
+ GUI.DrawTexture(rect, texture, _scaleMode, _alphaBlend);
+ }
+ }
+ }
+ }
+
+ public Rect GetRect()
+ {
+ Rect rect;
+ if (_fullScreen)
+ {
+ rect = new Rect(0.0f, 0.0f, Screen.width, Screen.height);
+ }
+ else
+ {
+ rect = new Rect(_x * (Screen.width - 1), _y * (Screen.height - 1), _width * Screen.width, _height * Screen.height);
+ }
+
+ return rect;
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayIMGUI.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayIMGUI.cs.meta
new file mode 100644
index 0000000..ff9f7a3
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayIMGUI.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 75f3b319d2d69934d8bf545ab45c918d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayUGUI.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayUGUI.cs
new file mode 100644
index 0000000..08bce97
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayUGUI.cs
@@ -0,0 +1,663 @@
+#if UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_5 || UNITY_5_4_OR_NEWER
+ #define UNITY_FEATURE_UGUI
+#endif
+
+#if UNITY_ANDROID && !UNITY_EDITOR
+ #define REAL_ANDROID
+#endif
+
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+
+// Some older versions of Unity don't set the _TexelSize variable from uGUI so we need to set this manually
+#if ((!UNITY_5_4_OR_NEWER && !UNITY_5) || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3_0 || UNITY_5_3_1 || UNITY_5_3_2 || UNITY_5_3_3)
+ #define UNITY_UGUI_NOSET_TEXELSIZE
+#endif
+
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using System.Collections.Generic;
+#if UNITY_FEATURE_UGUI
+using UnityEngine;
+using UnityEngine.UI;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Displays the video from MediaPlayer component using uGUI
+ ///
+ [ExecuteInEditMode]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ [AddComponentMenu("AVPro Video/Display uGUI", 200)]
+ public class DisplayUGUI : UnityEngine.UI.MaskableGraphic
+ {
+ [SerializeField]
+ public MediaPlayer _mediaPlayer;
+
+ [SerializeField]
+ public Rect m_UVRect = new Rect(0f, 0f, 1f, 1f);
+
+ [SerializeField]
+ public bool _setNativeSize = false;
+
+ [SerializeField]
+ public ScaleMode _scaleMode = ScaleMode.ScaleToFit;
+
+ [SerializeField]
+ public bool _noDefaultDisplay = true;
+
+ [SerializeField]
+ public bool _displayInEditor = true;
+
+ [SerializeField]
+ public Texture _defaultTexture;
+
+ private int _lastWidth;
+ private int _lastHeight;
+ private bool _flipY;
+ private Texture _lastTexture;
+ private static Shader _shaderStereoPacking;
+ private static Shader _shaderAlphaPacking;
+#if REAL_ANDROID
+ private static Shader _shaderAndroidOES;
+#endif
+ private static int _propAlphaPack;
+ private static int _propVertScale;
+ private static int _propStereo;
+ private static int _propApplyGamma;
+ private static int _propUseYpCbCr;
+ private const string PropChromaTexName = "_ChromaTex";
+ private static int _propChromaTex;
+ private const string PropYpCbCrTransformName = "_YpCbCrTransform";
+ private static int _propYpCbCrTransform;
+
+#if UNITY_UGUI_NOSET_TEXELSIZE
+ private static int _propMainTextureTexelSize;
+#endif
+ private bool _userMaterial = true;
+ private Material _material;
+
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2_0 && !UNITY_5_2_1)
+ private List _vertices = new List(4);
+ private static List QuadIndices = new List(new int[] { 0, 1, 2, 2, 3, 0 });
+#endif
+
+ protected override void Awake()
+ {
+ if (_propAlphaPack == 0)
+ {
+ _propStereo = Shader.PropertyToID("Stereo");
+ _propAlphaPack = Shader.PropertyToID("AlphaPack");
+ _propVertScale = Shader.PropertyToID("_VertScale");
+ _propApplyGamma = Shader.PropertyToID("_ApplyGamma");
+ _propUseYpCbCr = Shader.PropertyToID("_UseYpCbCr");
+ _propChromaTex = Shader.PropertyToID(PropChromaTexName);
+ _propUseYpCbCr = Shader.PropertyToID("_UseYpCbCr");
+ _propYpCbCrTransform = Shader.PropertyToID(PropYpCbCrTransformName);
+#if UNITY_UGUI_NOSET_TEXELSIZE
+ _propMainTextureTexelSize = Shader.PropertyToID("_MainTex_TexelSize");
+#endif
+ }
+
+ if (_shaderAlphaPacking == null)
+ {
+ _shaderAlphaPacking = Shader.Find("AVProVideo/UI/Transparent Packed");
+ if (_shaderAlphaPacking == null)
+ {
+ Debug.LogWarning("[AVProVideo] Missing shader AVProVideo/UI/Transparent Packed");
+ }
+ }
+ if (_shaderStereoPacking == null)
+ {
+ _shaderStereoPacking = Shader.Find("AVProVideo/UI/Stereo");
+ if (_shaderStereoPacking == null)
+ {
+ Debug.LogWarning("[AVProVideo] Missing shader AVProVideo/UI/Stereo");
+ }
+ }
+#if REAL_ANDROID
+ if (_shaderAndroidOES == null)
+ {
+ _shaderAndroidOES = Shader.Find("AVProVideo/UI/AndroidOES");
+ if (_shaderAndroidOES == null)
+ {
+ Debug.LogWarning("[AVProVideo] Missing shader AVProVideo/UI/AndroidOES");
+ }
+ }
+#endif
+ base.Awake();
+ }
+
+ protected override void Start()
+ {
+ _userMaterial = (this.m_Material != null);
+
+ base.Start();
+ }
+
+
+ protected override void OnDestroy()
+ {
+ // Destroy existing material
+ if (_material != null)
+ {
+ this.material = null;
+
+#if UNITY_EDITOR
+ Material.DestroyImmediate(_material);
+#else
+ Material.Destroy(_material);
+#endif
+ _material = null;
+ }
+ base.OnDestroy();
+ }
+
+ private Shader GetRequiredShader()
+ {
+ Shader result = null;
+
+ switch (_mediaPlayer.m_StereoPacking)
+ {
+ case StereoPacking.None:
+ break;
+ case StereoPacking.LeftRight:
+ case StereoPacking.TopBottom:
+ result = _shaderStereoPacking;
+ break;
+ }
+
+ switch (_mediaPlayer.m_AlphaPacking)
+ {
+ case AlphaPacking.None:
+ break;
+ case AlphaPacking.LeftRight:
+ case AlphaPacking.TopBottom:
+ result = _shaderAlphaPacking;
+ break;
+ }
+
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ if (result == null && _mediaPlayer.Info != null)
+ {
+ if (QualitySettings.activeColorSpace == ColorSpace.Linear && !_mediaPlayer.Info.PlayerSupportsLinearColorSpace())
+ {
+ result = _shaderAlphaPacking;
+ }
+ }
+#endif
+ if (result == null && _mediaPlayer.TextureProducer != null && _mediaPlayer.TextureProducer.GetTextureCount() == 2)
+ {
+ result = _shaderAlphaPacking;
+ }
+
+#if REAL_ANDROID
+ if (_mediaPlayer.PlatformOptionsAndroid.useFastOesPath)
+ {
+ result = _shaderAndroidOES;
+ }
+#endif
+ return result;
+ }
+
+ ///
+ /// Returns the texture used to draw this Graphic.
+ ///
+ public override Texture mainTexture
+ {
+ get
+ {
+ Texture result = Texture2D.whiteTexture;
+ if (HasValidTexture())
+ {
+ Texture resamplerTex = _mediaPlayer.FrameResampler == null || _mediaPlayer.FrameResampler.OutputTexture == null ? null : _mediaPlayer.FrameResampler.OutputTexture[0];
+ result = _mediaPlayer.m_Resample ? resamplerTex : _mediaPlayer.TextureProducer.GetTexture();
+ }
+ else
+ {
+ if (_noDefaultDisplay)
+ {
+ result = null;
+ }
+ else if (_defaultTexture != null)
+ {
+ result = _defaultTexture;
+ }
+
+#if UNITY_EDITOR
+ if (result == null && _displayInEditor)
+ {
+ result = Resources.Load("AVProVideoIcon");
+ }
+#endif
+ }
+ return result;
+ }
+ }
+
+ public bool HasValidTexture()
+ {
+ return (_mediaPlayer != null && _mediaPlayer.TextureProducer != null && _mediaPlayer.TextureProducer.GetTexture() != null);
+ }
+
+ private void UpdateInternalMaterial()
+ {
+ if (_mediaPlayer != null)
+ {
+ // Get required shader
+ Shader currentShader = null;
+ if (_material != null)
+ {
+ currentShader = _material.shader;
+ }
+ Shader nextShader = GetRequiredShader();
+
+ // If the shader requirement has changed
+ if (currentShader != nextShader)
+ {
+ // Destroy existing material
+ if (_material != null)
+ {
+ this.material = null;
+#if UNITY_EDITOR
+ Material.DestroyImmediate(_material);
+#else
+ Material.Destroy(_material);
+#endif
+ _material = null;
+ }
+
+ // Create new material
+ if (nextShader != null)
+ {
+ _material = new Material(nextShader);
+ }
+ }
+
+ this.material = _material;
+ }
+ }
+
+ // We do a LateUpdate() to allow for any changes in the texture that may have happened in Update()
+ void LateUpdate()
+ {
+ if (_setNativeSize)
+ {
+ SetNativeSize();
+ }
+
+ if (_lastTexture != mainTexture)
+ {
+ _lastTexture = mainTexture;
+ SetVerticesDirty();
+ SetMaterialDirty();
+ }
+
+ if (HasValidTexture())
+ {
+ if (mainTexture != null)
+ {
+ if (mainTexture.width != _lastWidth || mainTexture.height != _lastHeight)
+ {
+ _lastWidth = mainTexture.width;
+ _lastHeight = mainTexture.height;
+ SetVerticesDirty();
+ SetMaterialDirty();
+ }
+ }
+ }
+
+ if (!_userMaterial && Application.isPlaying)
+ {
+ UpdateInternalMaterial();
+ }
+
+ if (material != null && _mediaPlayer != null)
+ {
+ // YpCbCr support
+ if (material.HasProperty(_propUseYpCbCr) && _mediaPlayer.TextureProducer != null && _mediaPlayer.TextureProducer.GetTextureCount() == 2)
+ {
+ material.EnableKeyword("USE_YPCBCR");
+ material.SetMatrix(_propYpCbCrTransform, _mediaPlayer.TextureProducer.GetYpCbCrTransform());
+ Texture resamplerTex = _mediaPlayer.FrameResampler == null || _mediaPlayer.FrameResampler.OutputTexture == null ? null : _mediaPlayer.FrameResampler.OutputTexture[1];
+ material.SetTexture(_propChromaTex, _mediaPlayer.m_Resample ? resamplerTex : _mediaPlayer.TextureProducer.GetTexture(1));
+ }
+
+ // Apply changes for alpha videos
+ if (material.HasProperty(_propAlphaPack))
+ {
+ Helper.SetupAlphaPackedMaterial(material, _mediaPlayer.m_AlphaPacking);
+
+ if (_flipY && _mediaPlayer.m_AlphaPacking != AlphaPacking.None)
+ {
+ material.SetFloat(_propVertScale, -1f);
+ }
+ else
+ {
+ material.SetFloat(_propVertScale, 1f);
+ }
+
+#if UNITY_UGUI_NOSET_TEXELSIZE
+ if (mainTexture != null)
+ {
+ material.SetVector(_propMainTextureTexelSize, new Vector4(1.0f / mainTexture.width, 1.0f / mainTexture.height, mainTexture.width, mainTexture.height));
+ }
+#endif
+ }
+
+ // Apply changes for stereo videos
+ if (material.HasProperty(_propStereo))
+ {
+ Helper.SetupStereoMaterial(material, _mediaPlayer.m_StereoPacking, _mediaPlayer.m_DisplayDebugStereoColorTint);
+ }
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ if (material.HasProperty(_propApplyGamma) && _mediaPlayer.Info != null)
+ {
+ Helper.SetupGammaMaterial(material, _mediaPlayer.Info.PlayerSupportsLinearColorSpace());
+ }
+#else
+ _propApplyGamma |= 0;
+#endif
+ }
+ }
+
+ ///
+ /// Texture to be used.
+ ///
+ public MediaPlayer CurrentMediaPlayer
+ {
+ get
+ {
+ return _mediaPlayer;
+ }
+ set
+ {
+ if (_mediaPlayer != value)
+ {
+ _mediaPlayer = value;
+ //SetVerticesDirty();
+ SetMaterialDirty();
+ }
+ }
+ }
+
+ ///
+ /// UV rectangle used by the texture.
+ ///
+ public Rect uvRect
+ {
+ get
+ {
+ return m_UVRect;
+ }
+ set
+ {
+ if (m_UVRect == value)
+ {
+ return;
+ }
+ m_UVRect = value;
+ SetVerticesDirty();
+ }
+ }
+
+ ///
+ /// Adjust the scale of the Graphic to make it pixel-perfect.
+ ///
+ [ContextMenu("Set Native Size")]
+ public override void SetNativeSize()
+ {
+ Texture tex = mainTexture;
+ if (tex != null)
+ {
+ int w = Mathf.RoundToInt(tex.width * uvRect.width);
+ int h = Mathf.RoundToInt(tex.height * uvRect.height);
+
+ if (_mediaPlayer != null)
+ {
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ if (_mediaPlayer.Info != null)
+ {
+ Orientation ori = Helper.GetOrientation(_mediaPlayer.Info.GetTextureTransform());
+ if (ori == Orientation.Portrait || ori == Orientation.PortraitFlipped)
+ {
+ w = Mathf.RoundToInt(tex.height * uvRect.width);
+ h = Mathf.RoundToInt(tex.width * uvRect.height);
+ }
+ }
+#endif
+ if (_mediaPlayer.m_AlphaPacking == AlphaPacking.LeftRight || _mediaPlayer.m_StereoPacking == StereoPacking.LeftRight)
+ {
+ w /= 2;
+ }
+ else if (_mediaPlayer.m_AlphaPacking == AlphaPacking.TopBottom || _mediaPlayer.m_StereoPacking == StereoPacking.TopBottom)
+ {
+ h /= 2;
+ }
+ }
+
+ rectTransform.anchorMax = rectTransform.anchorMin;
+ rectTransform.sizeDelta = new Vector2(w, h);
+ }
+ }
+
+ ///
+ /// Update all renderer data.
+ ///
+ // OnFillVBO deprecated by 5.2
+ // OnPopulateMesh(Mesh mesh) deprecated by 5.2 patch 1
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2_0)
+/* protected override void OnPopulateMesh(Mesh mesh)
+ {
+ List verts = new List();
+ _OnFillVBO( verts );
+
+ var quad = new UIVertex[4];
+ for (int i = 0; i < vbo.Count; i += 4)
+ {
+ vbo.CopyTo(i, quad, 0, 4);
+ vh.AddUIVertexQuad(quad);
+ }
+ vh.FillMesh( toFill );
+ }*/
+
+#if !UNITY_5_2_1
+ protected override void OnPopulateMesh(VertexHelper vh)
+ {
+ vh.Clear();
+
+ _OnFillVBO(_vertices);
+
+ vh.AddUIVertexStream(_vertices, QuadIndices );
+ }
+#endif
+#endif
+
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1)
+ [System.Obsolete("This method is not called from Unity 5.2 and above")]
+#endif
+ protected override void OnFillVBO(List vbo)
+ {
+ _OnFillVBO(vbo);
+ }
+
+ private void _OnFillVBO(List vbo)
+ {
+ _flipY = false;
+ if (HasValidTexture())
+ {
+ _flipY = _mediaPlayer.TextureProducer.RequiresVerticalFlip();
+ }
+
+ Rect uvRect = m_UVRect;
+ Vector4 v = GetDrawingDimensions(_scaleMode, ref uvRect);
+
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ Matrix4x4 m = Matrix4x4.identity;
+ if (HasValidTexture())
+ {
+ m = Helper.GetMatrixForOrientation(Helper.GetOrientation(_mediaPlayer.Info.GetTextureTransform()));
+ }
+#endif
+ vbo.Clear();
+
+ var vert = UIVertex.simpleVert;
+ vert.color = color;
+
+ vert.position = new Vector2(v.x, v.y);
+
+ vert.uv0 = new Vector2(uvRect.xMin, uvRect.yMin);
+ if (_flipY)
+ {
+ vert.uv0 = new Vector2(uvRect.xMin, 1.0f - uvRect.yMin);
+ }
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ vert.uv0 = m.MultiplyPoint3x4(vert.uv0);
+#endif
+ vbo.Add(vert);
+
+ vert.position = new Vector2(v.x, v.w);
+ vert.uv0 = new Vector2(uvRect.xMin, uvRect.yMax);
+ if (_flipY)
+ {
+ vert.uv0 = new Vector2(uvRect.xMin, 1.0f - uvRect.yMax);
+ }
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ vert.uv0 = m.MultiplyPoint3x4(vert.uv0);
+#endif
+ vbo.Add(vert);
+
+ vert.position = new Vector2(v.z, v.w);
+ vert.uv0 = new Vector2(uvRect.xMax, uvRect.yMax);
+ if (_flipY)
+ {
+ vert.uv0 = new Vector2(uvRect.xMax, 1.0f - uvRect.yMax);
+ }
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ vert.uv0 = m.MultiplyPoint3x4(vert.uv0);
+#endif
+ vbo.Add(vert);
+
+ vert.position = new Vector2(v.z, v.y);
+ vert.uv0 = new Vector2(uvRect.xMax, uvRect.yMin);
+ if (_flipY)
+ {
+ vert.uv0 = new Vector2(uvRect.xMax, 1.0f - uvRect.yMin);
+ }
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ vert.uv0 = m.MultiplyPoint3x4(vert.uv0);
+#endif
+ vbo.Add(vert);
+ }
+
+ private Vector4 GetDrawingDimensions(ScaleMode scaleMode, ref Rect uvRect)
+ {
+ Vector4 returnSize = Vector4.zero;
+
+ if (mainTexture != null)
+ {
+ var padding = Vector4.zero;
+
+ var textureSize = new Vector2(mainTexture.width, mainTexture.height);
+ {
+ // Adjust textureSize based on orientation
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ if (HasValidTexture())
+ {
+ Matrix4x4 m = Helper.GetMatrixForOrientation(Helper.GetOrientation(_mediaPlayer.Info.GetTextureTransform()));
+ textureSize = m.MultiplyVector(textureSize);
+ textureSize.x = Mathf.Abs(textureSize.x);
+ textureSize.y = Mathf.Abs(textureSize.y);
+ }
+#endif
+ // Adjust textureSize based on alpha packing
+ if (_mediaPlayer != null)
+ {
+ if (_mediaPlayer.m_AlphaPacking == AlphaPacking.LeftRight || _mediaPlayer.m_StereoPacking == StereoPacking.LeftRight)
+ {
+ textureSize.x /= 2f;
+ }
+ else if (_mediaPlayer.m_AlphaPacking == AlphaPacking.TopBottom || _mediaPlayer.m_StereoPacking == StereoPacking.TopBottom)
+ {
+ textureSize.y /= 2f;
+ }
+ }
+ }
+
+ Rect r = GetPixelAdjustedRect();
+
+ // Fit the above textureSize into rectangle r
+ int spriteW = Mathf.RoundToInt( textureSize.x );
+ int spriteH = Mathf.RoundToInt( textureSize.y );
+
+ var size = new Vector4( padding.x / spriteW,
+ padding.y / spriteH,
+ (spriteW - padding.z) / spriteW,
+ (spriteH - padding.w) / spriteH );
+
+
+ {
+ if (textureSize.sqrMagnitude > 0.0f)
+ {
+ if (scaleMode == ScaleMode.ScaleToFit)
+ {
+ float spriteRatio = textureSize.x / textureSize.y;
+ float rectRatio = r.width / r.height;
+
+ if (spriteRatio > rectRatio)
+ {
+ float oldHeight = r.height;
+ r.height = r.width * (1.0f / spriteRatio);
+ r.y += (oldHeight - r.height) * rectTransform.pivot.y;
+ }
+ else
+ {
+ float oldWidth = r.width;
+ r.width = r.height * spriteRatio;
+ r.x += (oldWidth - r.width) * rectTransform.pivot.x;
+ }
+ }
+ else if (scaleMode == ScaleMode.ScaleAndCrop)
+ {
+ float aspectRatio = textureSize.x / textureSize.y;
+ float screenRatio = r.width / r.height;
+ if (screenRatio > aspectRatio)
+ {
+ float adjust = aspectRatio / screenRatio;
+ uvRect = new Rect(0f, (1f - adjust) * 0.5f, 1f, adjust);
+ }
+ else
+ {
+ float adjust = screenRatio / aspectRatio;
+ uvRect = new Rect(0.5f - adjust * 0.5f, 0f, adjust, 1f);
+ }
+ }
+ }
+ }
+
+ returnSize = new Vector4( r.x + r.width * size.x,
+ r.y + r.height * size.y,
+ r.x + r.width * size.z,
+ r.y + r.height * size.w );
+
+ }
+
+ return returnSize;
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayUGUI.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayUGUI.cs.meta
new file mode 100644
index 0000000..a365c50
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/DisplayUGUI.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0f17cdc186456a4469a139a104d2ca72
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/MediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/MediaPlayer.cs
new file mode 100644
index 0000000..2af7781
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/MediaPlayer.cs
@@ -0,0 +1,2233 @@
+//#define AVPROVIDEO_BETA_SUPPORT_TIMESCALE // BETA FEATURE: comment this in if you want to support frame stepping based on changes in Time.timeScale or Time.captureFramerate
+//#define AVPROVIDEO_FORCE_NULL_MEDIAPLAYER // DEV FEATURE: comment this out to make all mediaplayers use the null mediaplayer
+//#define AVPROVIDEO_DISABLE_LOGGING // DEV FEATURE: disables Debug.Log from AVPro Video
+#if UNITY_ANDROID && !UNITY_EDITOR
+ #define REAL_ANDROID
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+
+#if NETFX_CORE
+using Windows.Storage.Streams;
+#endif
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// This is the primary AVPro Video component and handles all media loading,
+ /// seeking, information retrieving etc. This component does not do any display
+ /// of the video. Instead this is handled by other components such as
+ /// ApplyToMesh, ApplyToMaterial, DisplayIMGUI, DisplayUGUI.
+ ///
+ [AddComponentMenu("AVPro Video/Media Player", -100)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class MediaPlayer : MonoBehaviour
+ {
+ // These fields are just used to setup the default properties for a new video that is about to be loaded
+ // Once a video has been loaded you should use the interfaces exposed in the properties to
+ // change playback properties (eg volume, looping, mute)
+ public FileLocation m_VideoLocation = FileLocation.RelativeToStreamingAssetsFolder;
+
+ public string m_VideoPath;
+
+ public bool m_AutoOpen = true;
+ public bool m_AutoStart = true;
+ public bool m_Loop = false;
+
+ [Range(0.0f, 1.0f)]
+ public float m_Volume = 1.0f;
+
+ [SerializeField]
+ [Range(-1.0f, 1.0f)]
+ private float m_Balance = 0.0f;
+
+ public bool m_Muted = false;
+
+ [SerializeField]
+ [Range(-4.0f, 4.0f)]
+ public float m_PlaybackRate = 1.0f;
+
+ public bool m_Resample = false;
+ public Resampler.ResampleMode m_ResampleMode = Resampler.ResampleMode.POINT;
+
+ [Range(3, 10)]
+ public int m_ResampleBufferSize = 5;
+ private Resampler m_Resampler = null;
+
+ public Resampler FrameResampler
+ {
+ get { return m_Resampler; }
+ }
+
+ [System.Serializable]
+ public class Setup
+ {
+ public bool persistent;
+ }
+
+ // Component Properties
+ [SerializeField]
+ private bool m_Persistent = false;
+
+ public bool Persistent
+ {
+ get { return m_Persistent; }
+ set { m_Persistent = value; }
+ }
+
+ [SerializeField]
+ private VideoMapping m_videoMapping = VideoMapping.Unknown;
+
+ public VideoMapping VideoLayoutMapping
+ {
+ get { return m_videoMapping; }
+ set { m_videoMapping = value; }
+ }
+
+ public StereoPacking m_StereoPacking = StereoPacking.None;
+
+ public AlphaPacking m_AlphaPacking = AlphaPacking.None;
+
+ public bool m_DisplayDebugStereoColorTint = false;
+
+ public FilterMode m_FilterMode = FilterMode.Bilinear;
+
+ public TextureWrapMode m_WrapMode = TextureWrapMode.Clamp;
+
+ [Range(0, 16)]
+ public int m_AnisoLevel = 0;
+
+ [SerializeField]
+ private bool m_LoadSubtitles;
+
+ [SerializeField]
+ private FileLocation m_SubtitleLocation = FileLocation.RelativeToStreamingAssetsFolder;
+ private FileLocation m_queueSubtitleLocation;
+
+ [SerializeField]
+ private string m_SubtitlePath;
+ private string m_queueSubtitlePath;
+ private Coroutine m_loadSubtitlesRoutine;
+
+ [SerializeField]
+ private Transform m_AudioHeadTransform;
+ [SerializeField]
+ private bool m_AudioFocusEnabled;
+ [SerializeField]
+ private Transform m_AudioFocusTransform;
+ [SerializeField, Range(40, 120)]
+ private float m_AudioFocusWidthDegrees = 90;
+ [SerializeField, Range(-24, 0)]
+ private float m_AudioFocusOffLevelDB = 0;
+
+ [SerializeField]
+ private MediaPlayerEvent m_events = null;
+
+ [SerializeField]
+ private int m_eventMask = -1;
+
+ [SerializeField]
+ private FileFormat m_forceFileFormat = FileFormat.Unknown;
+
+ [SerializeField]
+ private bool _pauseMediaOnAppPause = true;
+
+ [SerializeField]
+ private bool _playMediaOnAppUnpause = true;
+
+ private IMediaControl m_Control;
+ private IMediaProducer m_Texture;
+ private IMediaInfo m_Info;
+ private IMediaPlayer m_Player;
+ private IMediaSubtitles m_Subtitles;
+ private System.IDisposable m_Dispose;
+
+ // State
+ private bool m_VideoOpened = false;
+ private bool m_AutoStartTriggered = false;
+ private bool m_WasPlayingOnPause = false;
+ private Coroutine _renderingCoroutine = null;
+
+ // Global init
+ private static bool s_GlobalStartup = false;
+
+ // Event state
+ private bool m_EventFired_ReadyToPlay = false;
+ private bool m_EventFired_Started = false;
+ private bool m_EventFired_FirstFrameReady = false;
+ private bool m_EventFired_FinishedPlaying = false;
+ private bool m_EventFired_MetaDataReady = false;
+ private bool m_EventState_PlaybackStalled = false;
+ private bool m_EventState_PlaybackBuffering = false;
+ private bool m_EventState_PlaybackSeeking = false;
+ private int m_EventState_PreviousWidth = 0;
+ private int m_EventState_PreviousHeight = 0;
+ private int m_previousSubtitleIndex = -1;
+
+ private static Camera m_DummyCamera = null;
+ private bool m_FinishedFrameOpenCheck = false;
+
+ [SerializeField]
+ private uint m_sourceSampleRate = 0;
+ [SerializeField]
+ private uint m_sourceChannels = 0;
+ [SerializeField]
+ private bool m_manuallySetAudioSourceProperties = false;
+
+ public enum FileLocation
+ {
+ AbsolutePathOrURL,
+ RelativeToProjectFolder,
+ RelativeToStreamingAssetsFolder,
+ RelativeToDataFolder,
+ RelativeToPeristentDataFolder,
+ // TODO: Resource, AssetBundle?
+ }
+
+ [System.Serializable]
+ public class PlatformOptions
+ {
+ public bool overridePath = false;
+ public FileLocation pathLocation = FileLocation.RelativeToStreamingAssetsFolder;
+ public string path;
+
+ public virtual bool IsModified()
+ {
+ return overridePath; // The other variables don't matter if overridePath is false
+ }
+
+ // Decryption support
+ public virtual string GetKeyServerURL() { return null; }
+ public virtual string GetKeyServerAuthToken() { return null; }
+ public virtual string GetDecryptionKey() { return null; }
+ }
+
+ [System.Serializable]
+ public class OptionsWindows : PlatformOptions
+ {
+ public Windows.VideoApi videoApi = Windows.VideoApi.MediaFoundation;
+ public bool useHardwareDecoding = true;
+ public bool useUnityAudio = false;
+ public bool forceAudioResample = true;
+ public bool useTextureMips = false;
+ public bool hintAlphaChannel = false;
+ public bool useLowLatency = false;
+ public string forceAudioOutputDeviceName = string.Empty;
+ public List preferredFilters = new List();
+ public bool enableAudio360 = false;
+ public Audio360ChannelMode audio360ChannelMode = Audio360ChannelMode.TBE_8_2;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified() || !useHardwareDecoding || useTextureMips || hintAlphaChannel || useLowLatency || useUnityAudio || videoApi != Windows.VideoApi.MediaFoundation || !forceAudioResample || enableAudio360 || audio360ChannelMode != Audio360ChannelMode.TBE_8_2 || !string.IsNullOrEmpty(forceAudioOutputDeviceName) || preferredFilters.Count != 0);
+ }
+ }
+
+ [System.Serializable]
+ public class OptionsApple : PlatformOptions
+ {
+ [Multiline]
+ public string httpHeaderJson = null;
+
+ // Support for handling encrypted HLS streams
+ public string keyServerURLOverride = null;
+ public string keyServerAuthToken = null;
+ [Multiline]
+ public string base64EncodedKeyBlob = null;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified())
+ || (string.IsNullOrEmpty(httpHeaderJson) == false)
+ || (string.IsNullOrEmpty(keyServerURLOverride) == false)
+ || (string.IsNullOrEmpty(keyServerAuthToken) == false)
+ || (string.IsNullOrEmpty(base64EncodedKeyBlob) == false);
+ }
+
+ public override string GetKeyServerURL() { return keyServerURLOverride; }
+ public override string GetKeyServerAuthToken() { return keyServerAuthToken; }
+ public override string GetDecryptionKey() { return base64EncodedKeyBlob; }
+ }
+
+ [System.Serializable]
+ public class OptionsMacOSX : OptionsApple
+ {
+
+ }
+
+ [System.Serializable]
+ public class OptionsIOS : OptionsApple
+ {
+ public bool useYpCbCr420Textures = true;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified())
+ || (useYpCbCr420Textures == false);
+ }
+ }
+
+ [System.Serializable]
+ public class OptionsTVOS : OptionsIOS
+ {
+
+ }
+
+ [System.Serializable]
+ public class OptionsAndroid : PlatformOptions
+ {
+ public Android.VideoApi videoApi = Android.VideoApi.ExoPlayer;
+ public bool useFastOesPath = false;
+ public bool showPosterFrame = false;
+ public bool enableAudio360 = false;
+ public Audio360ChannelMode audio360ChannelMode = Audio360ChannelMode.TBE_8_2;
+ public bool preferSoftwareDecoder = false;
+
+ [Multiline]
+ public string httpHeaderJson = null;
+
+ [SerializeField, Tooltip("Byte offset into the file where the media file is located. This is useful when hiding or packing media files within another file.")]
+ public int fileOffset = 0;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified() || fileOffset != 0 || useFastOesPath || showPosterFrame || videoApi != Android.VideoApi.ExoPlayer || !string.IsNullOrEmpty(httpHeaderJson)
+ || enableAudio360 || audio360ChannelMode != Audio360ChannelMode.TBE_8_2 || preferSoftwareDecoder);
+ }
+ }
+ [System.Serializable]
+ public class OptionsWindowsPhone : PlatformOptions
+ {
+ public bool useHardwareDecoding = true;
+ public bool useUnityAudio = false;
+ public bool forceAudioResample = true;
+ public bool useTextureMips = false;
+ public bool useLowLatency = false;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified() || !useHardwareDecoding || useTextureMips || useLowLatency || useUnityAudio || !forceAudioResample);
+ }
+ }
+ [System.Serializable]
+ public class OptionsWindowsUWP : PlatformOptions
+ {
+ public bool useHardwareDecoding = true;
+ public bool useUnityAudio = false;
+ public bool forceAudioResample = true;
+ public bool useTextureMips = false;
+ public bool useLowLatency = false;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified() || !useHardwareDecoding || useTextureMips || useLowLatency || useUnityAudio || !forceAudioResample);
+ }
+ }
+ [System.Serializable]
+ public class OptionsWebGL : PlatformOptions
+ {
+ public WebGL.ExternalLibrary externalLibrary = WebGL.ExternalLibrary.None;
+ public bool useTextureMips = false;
+
+ public override bool IsModified()
+ {
+ return (base.IsModified() || externalLibrary != WebGL.ExternalLibrary.None || useTextureMips);
+ }
+ }
+
+ [System.Serializable]
+ public class OptionsPS4 : PlatformOptions
+ {
+
+ }
+
+ public delegate void ProcessExtractedFrame(Texture2D extractedFrame);
+
+ // TODO: move these to a Setup object
+ [SerializeField]
+ private OptionsWindows _optionsWindows = new OptionsWindows();
+ [SerializeField]
+ private OptionsMacOSX _optionsMacOSX = new OptionsMacOSX();
+ [SerializeField]
+ private OptionsIOS _optionsIOS = new OptionsIOS();
+ [SerializeField]
+ private OptionsTVOS _optionsTVOS = new OptionsTVOS();
+ [SerializeField]
+ private OptionsAndroid _optionsAndroid = new OptionsAndroid();
+ [SerializeField]
+ private OptionsWindowsPhone _optionsWindowsPhone = new OptionsWindowsPhone();
+ [SerializeField]
+ private OptionsWindowsUWP _optionsWindowsUWP = new OptionsWindowsUWP();
+ [SerializeField]
+ private OptionsWebGL _optionsWebGL = new OptionsWebGL();
+ [SerializeField]
+ private OptionsPS4 _optionsPS4 = new OptionsPS4();
+
+ ///
+ /// Properties
+ ///
+
+ public virtual IMediaInfo Info
+ {
+ get { return m_Info; }
+ }
+ public virtual IMediaControl Control
+ {
+ get { return m_Control; }
+ }
+
+ public virtual IMediaPlayer Player
+ {
+ get { return m_Player; }
+ }
+
+ public virtual IMediaProducer TextureProducer
+ {
+ get { return m_Texture; }
+ }
+
+ public virtual IMediaSubtitles Subtitles
+ {
+ get { return m_Subtitles; }
+ }
+
+ public MediaPlayerEvent Events
+ {
+ get
+ {
+ if (m_events == null)
+ {
+ m_events = new MediaPlayerEvent();
+ }
+ return m_events;
+ }
+ }
+
+ public bool VideoOpened
+ {
+ get { return m_VideoOpened; }
+ }
+
+ public bool PauseMediaOnAppPause
+ {
+ get { return _pauseMediaOnAppPause; }
+ set { _pauseMediaOnAppPause = value; }
+ }
+
+ public bool PlayMediaOnAppUnpause
+ {
+ get { return _playMediaOnAppUnpause; }
+ set { _playMediaOnAppUnpause = value; }
+ }
+
+ public FileFormat ForceFileFormat { get { return m_forceFileFormat; } set { m_forceFileFormat = value; } }
+
+ public Transform AudioHeadTransform { set { m_AudioHeadTransform = value; } get { return m_AudioHeadTransform; } }
+ public bool AudioFocusEnabled { get { return m_AudioFocusEnabled; } set { m_AudioFocusEnabled = value; } }
+ public float AudioFocusOffLevelDB { get { return m_AudioFocusOffLevelDB; } set { m_AudioFocusOffLevelDB = value; } }
+ public float AudioFocusWidthDegrees { get { return m_AudioFocusWidthDegrees; } set { m_AudioFocusWidthDegrees = value; } }
+ public Transform AudioFocusTransform { get { return m_AudioFocusTransform; } set { m_AudioFocusTransform = value; } }
+
+ public OptionsWindows PlatformOptionsWindows { get { return _optionsWindows; } }
+ public OptionsMacOSX PlatformOptionsMacOSX { get { return _optionsMacOSX; } }
+ public OptionsIOS PlatformOptionsIOS { get { return _optionsIOS; } }
+ public OptionsTVOS PlatformOptionsTVOS { get { return _optionsTVOS; } }
+ public OptionsAndroid PlatformOptionsAndroid { get { return _optionsAndroid; } }
+ public OptionsWindowsPhone PlatformOptionsWindowsPhone { get { return _optionsWindowsPhone; } }
+ public OptionsWindowsUWP PlatformOptionsWindowsUWP { get { return _optionsWindowsUWP; } }
+ public OptionsWebGL PlatformOptionsWebGL { get { return _optionsWebGL; } }
+ public OptionsPS4 PlatformOptionsPS4 { get { return _optionsPS4; } }
+
+ ///
+ /// Methods
+ ///
+
+ void Awake()
+ {
+ if (m_Persistent)
+ {
+ // TODO: set "this.transform.root.gameObject" to also DontDestroyOnLoad?
+ DontDestroyOnLoad(this.gameObject);
+ }
+ }
+
+ protected void Initialise()
+ {
+ BaseMediaPlayer mediaPlayer = CreatePlatformMediaPlayer();
+ if (mediaPlayer != null)
+ {
+ // Set-up interface
+ m_Control = mediaPlayer;
+ m_Texture = mediaPlayer;
+ m_Info = mediaPlayer;
+ m_Player = mediaPlayer;
+ m_Subtitles = mediaPlayer;
+ m_Dispose = mediaPlayer;
+
+ if (!s_GlobalStartup)
+ {
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ Helper.LogInfo(string.Format("Initialising AVPro Video (script v{0} plugin v{1}) on {2}/{3} (MT {4}) on {5}", Helper.ScriptVersion, mediaPlayer.GetVersion(), SystemInfo.graphicsDeviceName, SystemInfo.graphicsDeviceVersion, SystemInfo.graphicsMultiThreaded, Application.platform));
+#else
+ Helper.LogInfo(string.Format("Initialising AVPro Video (script v{0} plugin v{1}) on {2}/{3} on {4}", Helper.ScriptVersion, mediaPlayer.GetVersion(), SystemInfo.graphicsDeviceName, SystemInfo.graphicsDeviceVersion, Application.platform));
+#endif
+
+#if AVPROVIDEO_BETA_SUPPORT_TIMESCALE
+ Debug.LogWarning("[AVProVideo] TimeScale support used. This could affect performance when changing Time.timeScale or Time.captureFramerate. This feature is useful for supporting video capture system that adjust time scale during capturing.");
+#endif
+
+#if (UNITY_HAS_GOOGLEVR || UNITY_DAYDREAM) && (UNITY_ANDROID)
+ // NOte: WE've removed this minor optimisation until Daydream support is more offical..
+ // It seems to work with the official release, but in 5.6beta UNITY_HAS_GOOGLEVR is always defined
+ // even for GearVR, which causes a problem as it doesn't use the same stereo eye determination method
+
+ // TODO: add iOS support for this once Unity supports it
+ //Helper.LogInfo("Enabling Google Daydream support");
+ //Shader.EnableKeyword("GOOGLEVR");
+#endif
+
+ s_GlobalStartup = true;
+ }
+ }
+ }
+
+ void Start()
+ {
+#if UNITY_WEBGL
+ m_Resample = false;
+#endif
+
+ if (m_Control == null)
+ {
+ Initialise();
+ }
+
+ if (m_Control != null)
+ {
+ if (m_AutoOpen)
+ {
+ OpenVideoFromFile();
+
+ if (m_LoadSubtitles && m_Subtitles != null && !string.IsNullOrEmpty(m_SubtitlePath))
+ {
+ EnableSubtitles(m_SubtitleLocation, m_SubtitlePath);
+ }
+ }
+
+ StartRenderCoroutine();
+ }
+ }
+
+ public bool OpenVideoFromFile(FileLocation location, string path, bool autoPlay = true)
+ {
+ m_VideoLocation = location;
+ m_VideoPath = path;
+ m_AutoStart = autoPlay;
+
+ if (m_Control == null)
+ {
+ m_AutoOpen = false; // If OpenVideoFromFile() is called before Start() then set m_AutoOpen to false so that it doesn't load the video a second time during Start()
+ Initialise();
+ }
+
+ return OpenVideoFromFile();
+ }
+
+ public bool OpenVideoFromBuffer(byte[] buffer, bool autoPlay = true)
+ {
+ m_VideoLocation = FileLocation.AbsolutePathOrURL;
+ m_VideoPath = "buffer";
+ m_AutoStart = autoPlay;
+
+ if (m_Control == null)
+ {
+ Initialise();
+ }
+
+ return OpenVideoFromBufferInternal(buffer);
+ }
+
+ public bool StartOpenChunkedVideoFromBuffer(ulong length, bool autoPlay = true)
+ {
+ m_VideoLocation = FileLocation.AbsolutePathOrURL;
+ m_VideoPath = "buffer";
+ m_AutoStart = autoPlay;
+
+ if (m_Control == null)
+ {
+ Initialise();
+ }
+
+ return StartOpenVideoFromBufferInternal(length);
+ }
+
+ public bool AddChunkToVideoBuffer(byte[] chunk, ulong offset, ulong chunkSize)
+ {
+ return AddChunkToBufferInternal(chunk, offset, chunkSize);
+ }
+
+ public bool EndOpenChunkedVideoFromBuffer()
+ {
+ return EndOpenVideoFromBufferInternal();
+ }
+
+#if NETFX_CORE
+ public bool OpenVideoFromStream(IRandomAccessStream ras, string path, bool autoPlay = true)
+ {
+ m_VideoLocation = FileLocation.AbsolutePathOrURL;
+ m_VideoPath = path;
+ m_AutoStart = autoPlay;
+
+ if (m_Control == null)
+ {
+ Initialise();
+ }
+
+ return OpenVideoFromStream(ras);
+ }
+#endif
+
+ public bool SubtitlesEnabled
+ {
+ get { return m_LoadSubtitles; }
+ }
+
+ public string SubtitlePath
+ {
+ get { return m_SubtitlePath; }
+ }
+
+ public FileLocation SubtitleLocation
+ {
+ get { return m_SubtitleLocation; }
+ }
+
+ public bool EnableSubtitles(FileLocation fileLocation, string filePath)
+ {
+ bool result = false;
+ if (m_Subtitles != null)
+ {
+ if (!string.IsNullOrEmpty(filePath))
+ {
+ string fullPath = GetPlatformFilePath(GetPlatform(), ref filePath, ref fileLocation);
+
+ bool checkForFileExist = true;
+ if (fullPath.Contains("://"))
+ {
+ checkForFileExist = false;
+ }
+#if (UNITY_ANDROID || (UNITY_5_2 && UNITY_WSA))
+ checkForFileExist = false;
+#endif
+
+ if (checkForFileExist && !System.IO.File.Exists(fullPath))
+ {
+ Debug.LogError("[AVProVideo] Subtitle file not found: " + fullPath, this);
+ }
+ else
+ {
+ Helper.LogInfo("Opening subtitles " + fullPath, this);
+
+ m_previousSubtitleIndex = -1;
+
+ try
+ {
+ if (fullPath.Contains("://"))
+ {
+ // Use coroutine and WWW class for loading
+ if (m_loadSubtitlesRoutine != null)
+ {
+ StopCoroutine(m_loadSubtitlesRoutine);
+ m_loadSubtitlesRoutine = null;
+ }
+ m_loadSubtitlesRoutine = StartCoroutine(LoadSubtitlesCoroutine(fullPath, fileLocation, filePath));
+ }
+ else
+ {
+ // Load directly from file
+#if !UNITY_WEBPLAYER
+ string subtitleData = System.IO.File.ReadAllText(fullPath);
+ if (m_Subtitles.LoadSubtitlesSRT(subtitleData))
+ {
+ m_SubtitleLocation = fileLocation;
+ m_SubtitlePath = filePath;
+ m_LoadSubtitles = false;
+ result = true;
+ }
+ else
+#endif
+ {
+ Debug.LogError("[AVProVideo] Failed to load subtitles" + fullPath, this);
+ }
+ }
+
+ }
+ catch (System.Exception e)
+ {
+ Debug.LogError("[AVProVideo] Failed to load subtitles " + fullPath, this);
+ Debug.LogException(e, this);
+ }
+ }
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] No subtitle file path specified", this);
+ }
+ }
+ else
+ {
+ m_queueSubtitleLocation = fileLocation;
+ m_queueSubtitlePath = filePath;
+ }
+
+ return result;
+ }
+
+ private IEnumerator LoadSubtitlesCoroutine(string url, FileLocation fileLocation, string filePath)
+ {
+ WWW www = new WWW(url);
+
+ yield return www;
+
+ string subtitleData = string.Empty;
+ if (string.IsNullOrEmpty(www.error))
+ {
+ subtitleData = www.text;
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] Error loading subtitles '" + www.error + "' from " + url);
+ }
+
+ if (m_Subtitles.LoadSubtitlesSRT(subtitleData))
+ {
+ m_SubtitleLocation = fileLocation;
+ m_SubtitlePath = filePath;
+ m_LoadSubtitles = false;
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] Failed to load subtitles" + url, this);
+ }
+
+ m_loadSubtitlesRoutine = null;
+
+ www.Dispose();
+ }
+
+ public void DisableSubtitles()
+ {
+ if (m_loadSubtitlesRoutine != null)
+ {
+ StopCoroutine(m_loadSubtitlesRoutine);
+ m_loadSubtitlesRoutine = null;
+ }
+
+ if (m_Subtitles != null)
+ {
+ m_previousSubtitleIndex = -1;
+ m_LoadSubtitles = false;
+ m_Subtitles.LoadSubtitlesSRT(string.Empty);
+ }
+ else
+ {
+ m_queueSubtitlePath = string.Empty;
+ }
+ }
+
+ private bool OpenVideoFromBufferInternal(byte[] buffer)
+ {
+ bool result = false;
+ // Open the video file
+ if (m_Control != null)
+ {
+ CloseVideo();
+
+ m_VideoOpened = true;
+ m_AutoStartTriggered = !m_AutoStart;
+
+ Helper.LogInfo("Opening buffer of length " + buffer.Length, this);
+
+ if (!m_Control.OpenVideoFromBuffer(buffer))
+ {
+ Debug.LogError("[AVProVideo] Failed to open buffer", this);
+ if (GetCurrentPlatformOptions() != PlatformOptionsWindows || PlatformOptionsWindows.videoApi != Windows.VideoApi.DirectShow)
+ {
+ Debug.LogError("[AVProVideo] Loading from buffer is currently only supported in Windows when using the DirectShow API");
+ }
+ }
+ else
+ {
+ SetPlaybackOptions();
+ result = true;
+ StartRenderCoroutine();
+ }
+ }
+ return result;
+ }
+
+ private bool StartOpenVideoFromBufferInternal(ulong length)
+ {
+ bool result = false;
+ // Open the video file
+ if (m_Control != null)
+ {
+ CloseVideo();
+
+ m_VideoOpened = true;
+ m_AutoStartTriggered = !m_AutoStart;
+
+ Helper.LogInfo("Starting Opening buffer of length " + length, this);
+
+ if (!m_Control.StartOpenVideoFromBuffer(length))
+ {
+ Debug.LogError("[AVProVideo] Failed to start open video from buffer", this);
+ if (GetCurrentPlatformOptions() != PlatformOptionsWindows || PlatformOptionsWindows.videoApi != Windows.VideoApi.DirectShow)
+ {
+ Debug.LogError("[AVProVideo] Loading from buffer is currently only supported in Windows when using the DirectShow API");
+ }
+ }
+ else
+ {
+ SetPlaybackOptions();
+ result = true;
+ StartRenderCoroutine();
+ }
+ }
+ return result;
+ }
+
+ private bool AddChunkToBufferInternal(byte[] chunk, ulong offset, ulong chunkSize)
+ {
+ if(Control != null)
+ {
+ return Control.AddChunkToVideoBuffer(chunk, offset, chunkSize);
+ }
+
+ return false;
+ }
+
+ private bool EndOpenVideoFromBufferInternal()
+ {
+ if(Control != null)
+ {
+ return Control.EndOpenVideoFromBuffer();
+ }
+
+ return false;
+ }
+
+ private bool OpenVideoFromFile()
+ {
+ bool result = false;
+ // Open the video file
+ if (m_Control != null)
+ {
+ CloseVideo();
+
+ m_VideoOpened = true;
+ m_AutoStartTriggered = !m_AutoStart;
+ m_FinishedFrameOpenCheck = true;
+
+ // Potentially override the file location
+ long fileOffset = GetPlatformFileOffset();
+ string fullPath = GetPlatformFilePath(GetPlatform(), ref m_VideoPath, ref m_VideoLocation);
+
+ if (!string.IsNullOrEmpty(m_VideoPath))
+ {
+ string httpHeaderJson = null;
+
+ bool checkForFileExist = true;
+ if (fullPath.Contains("://"))
+ {
+ checkForFileExist = false;
+ httpHeaderJson = GetPlatformHttpHeaderJson();
+ // TODO: validate the above JSON
+ }
+#if (UNITY_ANDROID || (UNITY_5_2 && UNITY_WSA))
+ checkForFileExist = false;
+#endif
+
+ if (checkForFileExist && !System.IO.File.Exists(fullPath))
+ {
+ Debug.LogError("[AVProVideo] File not found: " + fullPath, this);
+ }
+ else
+ {
+ Helper.LogInfo("Opening " + fullPath + " (offset " + fileOffset + ")", this);
+
+#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
+ if (_optionsWindows.enableAudio360)
+ {
+ m_Control.SetAudioChannelMode(_optionsWindows.audio360ChannelMode);
+ }
+ else
+ {
+ m_Control.SetAudioChannelMode(Audio360ChannelMode.INVALID);
+ }
+#endif
+ if (!m_Control.OpenVideoFromFile(fullPath, fileOffset, httpHeaderJson, m_manuallySetAudioSourceProperties ? m_sourceSampleRate : 0,
+ m_manuallySetAudioSourceProperties ? m_sourceChannels : 0, (int)m_forceFileFormat))
+ {
+ Debug.LogError("[AVProVideo] Failed to open " + fullPath, this);
+ }
+ else
+ {
+ SetPlaybackOptions();
+ result = true;
+ StartRenderCoroutine();
+ }
+ }
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] No file path specified", this);
+ }
+ }
+ return result;
+ }
+
+#if NETFX_CORE
+ private bool OpenVideoFromStream(IRandomAccessStream ras)
+ {
+ bool result = false;
+ // Open the video file
+ if (m_Control != null)
+ {
+ CloseVideo();
+
+ m_VideoOpened = true;
+ m_AutoStartTriggered = !m_AutoStart;
+
+ // Potentially override the file location
+ long fileOffset = GetPlatformFileOffset();
+
+ if (!m_Control.OpenVideoFromFile(ras, m_VideoPath, fileOffset, null, m_manuallySetAudioSourceProperties ? m_sourceSampleRate : 0,
+ m_manuallySetAudioSourceProperties ? m_sourceChannels : 0))
+ {
+ Debug.LogError("[AVProVideo] Failed to open " + m_VideoPath, this);
+ }
+ else
+ {
+ SetPlaybackOptions();
+ result = true;
+ StartRenderCoroutine();
+ }
+ }
+ return result;
+ }
+#endif
+
+ private void SetPlaybackOptions()
+ {
+ // Set playback options
+ if (m_Control != null)
+ {
+ m_Control.SetLooping(m_Loop);
+ m_Control.SetPlaybackRate(m_PlaybackRate);
+ m_Control.SetVolume(m_Volume);
+ m_Control.SetBalance(m_Balance);
+ m_Control.MuteAudio(m_Muted);
+ m_Control.SetTextureProperties(m_FilterMode, m_WrapMode, m_AnisoLevel);
+
+ // Encryption support
+ PlatformOptions options = GetCurrentPlatformOptions();
+ if (options != null)
+ {
+ m_Control.SetKeyServerURL(options.GetKeyServerURL());
+ m_Control.SetKeyServerAuthToken(options.GetKeyServerAuthToken());
+ m_Control.SetDecryptionKeyBase64(options.GetDecryptionKey());
+ }
+ }
+ }
+
+ public void CloseVideo()
+ {
+ // Close the video file
+ if (m_Control != null)
+ {
+ if (m_events != null && m_VideoOpened && m_events.HasListeners() && IsHandleEvent(MediaPlayerEvent.EventType.Closing))
+ {
+ m_events.Invoke(this, MediaPlayerEvent.EventType.Closing, ErrorCode.None);
+ }
+
+ m_AutoStartTriggered = false;
+ m_VideoOpened = false;
+ m_EventFired_MetaDataReady = false;
+ m_EventFired_ReadyToPlay = false;
+ m_EventFired_Started = false;
+ m_EventFired_FirstFrameReady = false;
+ m_EventFired_FinishedPlaying = false;
+ m_EventState_PlaybackBuffering = false;
+ m_EventState_PlaybackSeeking = false;
+ m_EventState_PlaybackStalled = false;
+ m_EventState_PreviousWidth = 0;
+ m_EventState_PreviousHeight = 0;
+
+ if (m_loadSubtitlesRoutine != null)
+ {
+ StopCoroutine(m_loadSubtitlesRoutine);
+ m_loadSubtitlesRoutine = null;
+ }
+ m_previousSubtitleIndex = -1;
+
+ m_Control.CloseVideo();
+ }
+
+ if (m_Resampler != null)
+ {
+ m_Resampler.Reset();
+ }
+
+ StopRenderCoroutine();
+ }
+
+ public void Play()
+ {
+ if (m_Control != null && m_Control.CanPlay())
+ {
+ m_Control.Play();
+
+ // Mark this event as done because it's irrelevant once playback starts
+ m_EventFired_ReadyToPlay = true;
+ }
+ else
+ {
+ // Can't play, perhaps it's still loading? Queuing play using m_AutoStart to play after loading
+ m_AutoStart = true;
+ m_AutoStartTriggered = false;
+ }
+ }
+
+ public void Pause()
+ {
+ if (m_Control != null && m_Control.IsPlaying())
+ {
+ m_Control.Pause();
+ }
+ m_WasPlayingOnPause = false;
+#if AVPROVIDEO_BETA_SUPPORT_TIMESCALE
+ _timeScaleIsControlling = false;
+#endif
+ }
+
+ public void Stop()
+ {
+ if (m_Control != null)
+ {
+ m_Control.Stop();
+ }
+#if AVPROVIDEO_BETA_SUPPORT_TIMESCALE
+ _timeScaleIsControlling = false;
+#endif
+ }
+
+ public void Rewind(bool pause)
+ {
+ if (m_Control != null)
+ {
+ if (pause)
+ {
+ Pause();
+ }
+ m_Control.Rewind();
+ }
+ }
+
+ protected virtual void Update()
+ {
+ // Auto start the playback
+ if (m_Control != null)
+ {
+ if (m_VideoOpened && m_AutoStart && !m_AutoStartTriggered && m_Control.CanPlay())
+ {
+ m_AutoStartTriggered = true;
+ Play();
+ }
+
+ if (_renderingCoroutine == null && m_Control.CanPlay())
+ {
+ StartRenderCoroutine();
+ }
+
+ if (m_Subtitles != null && !string.IsNullOrEmpty(m_queueSubtitlePath))
+ {
+ EnableSubtitles(m_queueSubtitleLocation, m_queueSubtitlePath);
+ m_queueSubtitlePath = string.Empty;
+ }
+
+#if AVPROVIDEO_BETA_SUPPORT_TIMESCALE
+ UpdateTimeScale();
+#endif
+
+ UpdateAudioHeadTransform();
+ UpdateAudioFocus();
+ // Update
+ m_Player.Update();
+
+ // Render (done in co-routine)
+ //m_Player.Render();
+
+ UpdateErrors();
+ UpdateEvents();
+ }
+ }
+
+ private void LateUpdate()
+ {
+#if !UNITY_WEBGL
+ if (m_Resample)
+ {
+ if (m_Resampler == null)
+ {
+ m_Resampler = new Resampler(this, gameObject.name, m_ResampleBufferSize, m_ResampleMode);
+ }
+ }
+#else
+ m_Resample = false;
+#endif
+
+ if (m_Resampler != null)
+ {
+ m_Resampler.Update();
+ m_Resampler.UpdateTimestamp();
+ }
+ }
+
+ void OnEnable()
+ {
+ if (m_Control != null && m_WasPlayingOnPause)
+ {
+ m_AutoStart = true;
+ m_AutoStartTriggered = false;
+ m_WasPlayingOnPause = false;
+ }
+
+ if(m_Player != null)
+ {
+ m_Player.OnEnable();
+ }
+
+ StartRenderCoroutine();
+ }
+
+ void OnDisable()
+ {
+ if (m_Control != null)
+ {
+ if (m_Control.IsPlaying())
+ {
+ m_WasPlayingOnPause = true;
+ Pause();
+ }
+ }
+
+ StopRenderCoroutine();
+ }
+
+ protected virtual void OnDestroy()
+ {
+ CloseVideo();
+
+ if (m_Dispose != null)
+ {
+ m_Dispose.Dispose();
+ m_Dispose = null;
+ }
+ m_Control = null;
+ m_Texture = null;
+ m_Info = null;
+ m_Player = null;
+
+ if(m_Resampler != null)
+ {
+ m_Resampler.Release();
+ m_Resampler = null;
+ }
+
+ // TODO: possible bug if MediaPlayers are created and destroyed manually (instantiated), OnApplicationQuit won't be called!
+ }
+
+ void OnApplicationQuit()
+ {
+ if (s_GlobalStartup)
+ {
+ Helper.LogInfo("Shutdown");
+
+ // Clean up any open media players
+ MediaPlayer[] players = Resources.FindObjectsOfTypeAll();
+ if (players != null && players.Length > 0)
+ {
+ for (int i = 0; i < players.Length; i++)
+ {
+ players[i].CloseVideo();
+ players[i].OnDestroy();
+ }
+ }
+
+#if UNITY_EDITOR
+ #if UNITY_EDITOR_WIN
+ WindowsMediaPlayer.DeinitPlatform();
+ #endif
+#else
+ #if (UNITY_STANDALONE_WIN)
+ WindowsMediaPlayer.DeinitPlatform();
+ #elif (UNITY_ANDROID)
+ AndroidMediaPlayer.DeinitPlatform();
+ #endif
+#endif
+ s_GlobalStartup = false;
+ }
+ }
+
+#region Rendering Coroutine
+
+ private void StartRenderCoroutine()
+ {
+ if (_renderingCoroutine == null)
+ {
+ // Use the method instead of the method name string to prevent garbage
+ _renderingCoroutine = StartCoroutine(FinalRenderCapture());
+ }
+ }
+
+ private void StopRenderCoroutine()
+ {
+ if (_renderingCoroutine != null)
+ {
+ StopCoroutine(_renderingCoroutine);
+ _renderingCoroutine = null;
+ }
+ }
+
+ private IEnumerator FinalRenderCapture()
+ {
+ // Preallocate the YieldInstruction to prevent garbage
+ YieldInstruction wait = new WaitForEndOfFrame();
+ while (Application.isPlaying)
+ {
+ // NOTE: in editor, if the game view isn't visible then WaitForEndOfFrame will never complete
+ yield return wait;
+
+ if (this.enabled)
+ {
+ if (m_Player != null)
+ {
+ m_Player.Render();
+ }
+ }
+ }
+ }
+#endregion
+
+#region Platform and Path
+ public static Platform GetPlatform()
+ {
+ Platform result = Platform.Unknown;
+
+ // Setup for running in the editor (Either OSX, Windows or Linux)
+#if UNITY_EDITOR
+#if (UNITY_EDITOR_OSX && UNITY_EDITOR_64)
+ result = Platform.MacOSX;
+#elif UNITY_EDITOR_WIN
+ result = Platform.Windows;
+#endif
+#else
+ // Setup for running builds
+#if (UNITY_STANDALONE_WIN)
+ result = Platform.Windows;
+#elif (UNITY_STANDALONE_OSX)
+ result = Platform.MacOSX;
+#elif (UNITY_IPHONE || UNITY_IOS)
+ result = Platform.iOS;
+#elif (UNITY_TVOS)
+ result = Platform.tvOS;
+#elif (UNITY_ANDROID)
+ result = Platform.Android;
+#elif (UNITY_WP8 || UNITY_WP81 || UNITY_WINRT_8_1)
+ result = Platform.WindowsPhone;
+#elif (UNITY_WSA_10_0)
+ result = Platform.WindowsUWP;
+#elif (UNITY_WEBGL)
+ result = Platform.WebGL;
+#elif (UNITY_PS4)
+ result = Platform.PS4;
+#endif
+
+#endif
+ return result;
+ }
+
+ public PlatformOptions GetCurrentPlatformOptions()
+ {
+ PlatformOptions result = null;
+
+#if UNITY_EDITOR
+#if (UNITY_EDITOR_OSX && UNITY_EDITOR_64)
+ result = _optionsMacOSX;
+#elif UNITY_EDITOR_WIN
+ result = _optionsWindows;
+#endif
+#else
+ // Setup for running builds
+
+#if (UNITY_STANDALONE_WIN)
+ result = _optionsWindows;
+#elif (UNITY_STANDALONE_OSX)
+ result = _optionsMacOSX;
+#elif (UNITY_IPHONE || UNITY_IOS)
+ result = _optionsIOS;
+#elif (UNITY_TVOS)
+ result = _optionsTVOS;
+#elif (UNITY_ANDROID)
+ result = _optionsAndroid;
+#elif (UNITY_WP8 || UNITY_WP81 || UNITY_WINRT_8_1)
+ result = _optionsWindowsPhone;
+#elif (UNITY_WSA_10_0)
+ result = _optionsWindowsUWP;
+#elif (UNITY_WEBGL)
+ result = _optionsWebGL;
+#elif (UNITY_PS4)
+ result = _optionsPS4;
+#endif
+
+#endif
+ return result;
+ }
+
+#if UNITY_EDITOR
+ public PlatformOptions GetPlatformOptions(Platform platform)
+ {
+ PlatformOptions result = null;
+
+ switch (platform)
+ {
+ case Platform.Windows:
+ result = _optionsWindows;
+ break;
+ case Platform.MacOSX:
+ result = _optionsMacOSX;
+ break;
+ case Platform.Android:
+ result = _optionsAndroid;
+ break;
+ case Platform.iOS:
+ result = _optionsIOS;
+ break;
+ case Platform.tvOS:
+ result = _optionsTVOS;
+ break;
+ case Platform.WindowsPhone:
+ result = _optionsWindowsPhone;
+ break;
+ case Platform.WindowsUWP:
+ result = _optionsWindowsUWP;
+ break;
+ case Platform.WebGL:
+ result = _optionsWebGL;
+ break;
+ case Platform.PS4:
+ result = _optionsPS4;
+ break;
+ }
+
+ return result;
+ }
+
+ public static string GetPlatformOptionsVariable(Platform platform)
+ {
+ string result = string.Empty;
+
+ switch (platform)
+ {
+ case Platform.Windows:
+ result = "_optionsWindows";
+ break;
+ case Platform.MacOSX:
+ result = "_optionsMacOSX";
+ break;
+ case Platform.iOS:
+ result = "_optionsIOS";
+ break;
+ case Platform.tvOS:
+ result = "_optionsTVOS";
+ break;
+ case Platform.Android:
+ result = "_optionsAndroid";
+ break;
+ case Platform.WindowsPhone:
+ result = "_optionsWindowsPhone";
+ break;
+ case Platform.WindowsUWP:
+ result = "_optionsWindowsUWP";
+ break;
+ case Platform.WebGL:
+ result = "_optionsWebGL";
+ break;
+ case Platform.PS4:
+ result = "_optionsPS4";
+ break;
+ }
+
+ return result;
+ }
+#endif
+
+ public static string GetPath(FileLocation location)
+ {
+ string result = string.Empty;
+ switch (location)
+ {
+ case FileLocation.AbsolutePathOrURL:
+ break;
+ case FileLocation.RelativeToDataFolder:
+ result = Application.dataPath;
+ break;
+ case FileLocation.RelativeToPeristentDataFolder:
+ result = Application.persistentDataPath;
+ break;
+ case FileLocation.RelativeToProjectFolder:
+#if !UNITY_WINRT_8_1
+ string path = "..";
+#if UNITY_STANDALONE_OSX && !UNITY_EDITOR_OSX
+ path += "/..";
+#endif
+ result = System.IO.Path.GetFullPath(System.IO.Path.Combine(Application.dataPath, path));
+ result = result.Replace('\\', '/');
+#endif
+ break;
+ case FileLocation.RelativeToStreamingAssetsFolder:
+ result = Application.streamingAssetsPath;
+ break;
+ }
+ return result;
+ }
+
+ public static string GetFilePath(string path, FileLocation location)
+ {
+ string result = string.Empty;
+ if (!string.IsNullOrEmpty(path))
+ {
+ switch (location)
+ {
+ case FileLocation.AbsolutePathOrURL:
+ result = path;
+ break;
+ case FileLocation.RelativeToDataFolder:
+ case FileLocation.RelativeToPeristentDataFolder:
+ case FileLocation.RelativeToProjectFolder:
+ case FileLocation.RelativeToStreamingAssetsFolder:
+ result = System.IO.Path.Combine(GetPath(location), path);
+ break;
+ }
+ }
+ return result;
+ }
+
+ private long GetPlatformFileOffset()
+ {
+ long result = 0;
+#if UNITY_EDITOR_OSX
+#elif UNITY_EDITOR_WIN
+#elif UNITY_EDITOR_LINUX
+#elif UNITY_ANDROID
+ result = _optionsAndroid.fileOffset;
+#endif
+ return result;
+ }
+
+ private string GetPlatformHttpHeaderJson()
+ {
+ string result = null;
+
+#if UNITY_EDITOR_OSX
+ result = _optionsMacOSX.httpHeaderJson;
+#elif UNITY_EDITOR_WIN
+#elif UNITY_EDITOR_LINUX
+#elif UNITY_STANDALONE_OSX
+ result = _optionsMacOSX.httpHeaderJson;
+#elif UNITY_STANDALONE_WIN
+#elif UNITY_WSA_10_0
+#elif UNITY_WINRT_8_1
+#elif UNITY_IOS || UNITY_IPHONE
+ result = _optionsIOS.httpHeaderJson;
+#elif UNITY_TVOS
+ result = _optionsTVOS.httpHeaderJson;
+#elif UNITY_ANDROID
+ result = _optionsAndroid.httpHeaderJson;
+#elif UNITY_WEBGL
+#endif
+
+ if (!string.IsNullOrEmpty(result))
+ {
+ result = result.Trim();
+ }
+
+ return result;
+ }
+
+ private string GetPlatformFilePath(Platform platform, ref string filePath, ref FileLocation fileLocation)
+ {
+ string result = string.Empty;
+
+ // Replace file path and location if overriden by platform options
+ if (platform != Platform.Unknown)
+ {
+ PlatformOptions options = GetCurrentPlatformOptions();
+ if (options != null)
+ {
+ if (options.overridePath)
+ {
+ filePath = options.path;
+ fileLocation = options.pathLocation;
+ }
+ }
+ }
+
+ result = GetFilePath(filePath, fileLocation);
+
+ return result;
+ }
+#endregion
+
+ public virtual BaseMediaPlayer CreatePlatformMediaPlayer()
+ {
+ BaseMediaPlayer mediaPlayer = null;
+
+#if !AVPROVIDEO_FORCE_NULL_MEDIAPLAYER
+
+ // Setup for running in the editor (Either OSX, Windows or Linux)
+#if UNITY_EDITOR
+#if (UNITY_EDITOR_OSX)
+#if UNITY_EDITOR_64
+ mediaPlayer = new OSXMediaPlayer();
+#else
+ Debug.LogWarning("[AVProVideo] 32-bit OS X Unity editor not supported. 64-bit required.");
+#endif
+#elif UNITY_EDITOR_WIN
+ if (WindowsMediaPlayer.InitialisePlatform())
+ {
+ mediaPlayer = new WindowsMediaPlayer(_optionsWindows.videoApi, _optionsWindows.useHardwareDecoding, _optionsWindows.useTextureMips, _optionsWindows.hintAlphaChannel, _optionsWindows.useLowLatency, _optionsWindows.forceAudioOutputDeviceName, _optionsWindows.useUnityAudio, _optionsWindows.forceAudioResample, _optionsWindows.preferredFilters);
+ }
+#endif
+#else
+ // Setup for running builds
+#if (UNITY_STANDALONE_WIN || UNITY_WSA_10_0 || UNITY_WINRT_8_1)
+ if (WindowsMediaPlayer.InitialisePlatform())
+ {
+#if UNITY_STANDALONE_WIN
+ mediaPlayer = new WindowsMediaPlayer(_optionsWindows.videoApi, _optionsWindows.useHardwareDecoding, _optionsWindows.useTextureMips, _optionsWindows.hintAlphaChannel, _optionsWindows.useLowLatency, _optionsWindows.forceAudioOutputDeviceName, _optionsWindows.useUnityAudio, _optionsWindows.forceAudioResample, _optionsWindows.preferredFilters);
+#elif UNITY_WSA_10_0
+ mediaPlayer = new WindowsMediaPlayer(Windows.VideoApi.MediaFoundation, _optionsWindowsUWP.useHardwareDecoding, _optionsWindowsUWP.useTextureMips, false, _optionsWindowsUWP.useLowLatency, string.Empty, _optionsWindowsUWP.useUnityAudio, _optionsWindowsUWP.forceAudioResample, _optionsWindows.preferredFilters);
+#elif UNITY_WINRT_8_1
+ mediaPlayer = new WindowsMediaPlayer(Windows.VideoApi.MediaFoundation, _optionsWindowsPhone.useHardwareDecoding, _optionsWindowsPhone.useTextureMips, false, _optionsWindowsPhone.useLowLatency, string.Empty, _optionsWindowsPhone.useUnityAudio, _optionsWindowsPhone.forceAudioResample, _optionsWindows.preferredFilters);
+#endif
+ }
+#elif (UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS)
+#if UNITY_TVOS
+ mediaPlayer = new OSXMediaPlayer(_optionsTVOS.useYpCbCr420Textures);
+#elif (UNITY_IOS || UNITY_IPHONE)
+ mediaPlayer = new OSXMediaPlayer(_optionsIOS.useYpCbCr420Textures);
+#else
+ mediaPlayer = new OSXMediaPlayer();
+#endif
+
+#elif (UNITY_ANDROID)
+ // Initialise platform (also unpacks videos from StreamingAsset folder (inside a jar), to the persistent data path)
+ if (AndroidMediaPlayer.InitialisePlatform())
+ {
+ mediaPlayer = new AndroidMediaPlayer(_optionsAndroid.useFastOesPath, _optionsAndroid.showPosterFrame, _optionsAndroid.videoApi,
+ _optionsAndroid.enableAudio360, _optionsAndroid.audio360ChannelMode, _optionsAndroid.preferSoftwareDecoder);
+ }
+#elif (UNITY_WEBGL)
+ WebGLMediaPlayer.InitialisePlatform();
+ mediaPlayer = new WebGLMediaPlayer(_optionsWebGL.externalLibrary, _optionsWebGL.useTextureMips);
+#elif (UNITY_PS4)
+ mediaPlayer = new PS4MediaPlayer();
+#endif
+#endif
+
+#endif
+ // Fallback
+ if (mediaPlayer == null)
+ {
+ Debug.LogError(string.Format("[AVProVideo] Not supported on this platform {0} {1} {2} {3}. Using null media player!", Application.platform, SystemInfo.deviceModel, SystemInfo.processorType, SystemInfo.operatingSystem));
+
+ mediaPlayer = new NullMediaPlayer();
+ }
+
+ return mediaPlayer;
+ }
+
+#region Support for Time Scale
+#if AVPROVIDEO_BETA_SUPPORT_TIMESCALE
+ // Adjust this value to get faster performance but may drop frames.
+ // Wait longer to ensure there is enough time for frames to process
+ private const float TimeScaleTimeoutMs = 20f;
+ private bool _timeScaleIsControlling;
+ private float _timeScaleVideoTime;
+
+ private void UpdateTimeScale()
+ {
+ if (Time.timeScale != 1f || Time.captureFramerate != 0)
+ {
+ if (m_Control.IsPlaying())
+ {
+ m_Control.Pause();
+ _timeScaleIsControlling = true;
+ _timeScaleVideoTime = m_Control.GetCurrentTimeMs();
+ }
+
+ if (_timeScaleIsControlling)
+ {
+ // Progress time
+ _timeScaleVideoTime += (Time.deltaTime * 1000f);
+
+ // Handle looping
+ if (m_Control.IsLooping() && _timeScaleVideoTime >= Info.GetDurationMs())
+ {
+ // TODO: really we should seek to (_timeScaleVideoTime % Info.GetDurationMs())
+ _timeScaleVideoTime = 0f;
+ }
+
+ int preSeekFrameCount = m_Texture.GetTextureFrameCount();
+
+ // Seek to the new time
+ {
+ float preSeekTime = Control.GetCurrentTimeMs();
+
+ // Seek
+ m_Control.Seek(_timeScaleVideoTime);
+
+ // Early out, if after the seek the time hasn't changed, the seek was probably too small to go to the next frame.
+ // TODO: This behaviour may be different on other platforms (not Windows) and needs more testing.
+ if (Mathf.Approximately(preSeekTime, m_Control.GetCurrentTimeMs()))
+ {
+ return;
+ }
+ }
+
+ // Wait for the new frame to arrive
+ if (!m_Control.WaitForNextFrame(GetDummyCamera(), preSeekFrameCount))
+ {
+ // If WaitForNextFrame fails (e.g. in android single threaded), we run the below code to asynchronously wait for the frame
+ System.DateTime startTime = System.DateTime.Now;
+ int lastFrameCount = TextureProducer.GetTextureFrameCount();
+
+ while (m_Control != null && (System.DateTime.Now - startTime).TotalMilliseconds < (double)TimeScaleTimeoutMs)
+ {
+ m_Player.Update();
+ m_Player.Render();
+ GetDummyCamera().Render();
+ if (lastFrameCount != TextureProducer.GetTextureFrameCount())
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // Restore playback when timeScale becomes 1
+ if (_timeScaleIsControlling)
+ {
+ m_Control.Play();
+ _timeScaleIsControlling = false;
+ }
+ }
+ }
+#endif
+#endregion
+
+ private bool ForceWaitForNewFrame(int lastFrameCount, float timeoutMs)
+ {
+ bool result = false;
+ // Wait for the frame to change, or timeout to happen (for the case that there is no new frame for this time)
+ System.DateTime startTime = System.DateTime.Now;
+ int iterationCount = 0;
+ while (Control != null && (System.DateTime.Now - startTime).TotalMilliseconds < (double)timeoutMs)
+ {
+ m_Player.Update();
+
+ // TODO: check if Seeking has completed! Then we don't have to wait
+
+ // If frame has changed we can continue
+ // NOTE: this will never happen because GL.IssuePlugin.Event is never called in this loop
+ if (lastFrameCount != TextureProducer.GetTextureFrameCount())
+ {
+ result = true;
+ break;
+ }
+
+ iterationCount++;
+
+ // NOTE: we tried to add Sleep for 1ms but it was very slow, so switched to this time based method which burns more CPU but about double the speed
+ // NOTE: had to add the Sleep back in as after too many iterations (over 1000000) of GL.IssuePluginEvent Unity seems to lock up
+ // NOTE: seems that GL.IssuePluginEvent can't be called if we're stuck in a while loop and they just stack up
+ //System.Threading.Thread.Sleep(0);
+ }
+
+ m_Player.Render();
+
+ return result;
+ }
+
+ private void UpdateAudioFocus()
+ {
+ // TODO: we could use gizmos to draw the focus area
+ m_Control.SetAudioFocusEnabled(m_AudioFocusEnabled);
+ m_Control.SetAudioFocusProperties(m_AudioFocusOffLevelDB, m_AudioFocusWidthDegrees);
+ m_Control.SetAudioFocusRotation(m_AudioFocusTransform == null ? Quaternion.identity : m_AudioFocusTransform.rotation);
+ }
+
+ private void UpdateAudioHeadTransform()
+ {
+ if (m_AudioHeadTransform != null)
+ {
+ m_Control.SetAudioHeadRotation(m_AudioHeadTransform.rotation);
+ }
+ else
+ {
+ m_Control.ResetAudioHeadRotation();
+ }
+ }
+
+ private void UpdateErrors()
+ {
+ ErrorCode errorCode = m_Control.GetLastError();
+ if (ErrorCode.None != errorCode)
+ {
+ Debug.LogError("[AVProVideo] Error: " + Helper.GetErrorMessage(errorCode));
+
+ if (m_events != null && m_events.HasListeners() && IsHandleEvent(MediaPlayerEvent.EventType.Error))
+ {
+ m_events.Invoke(this, MediaPlayerEvent.EventType.Error, errorCode);
+ }
+ }
+ }
+
+ private void UpdateEvents()
+ {
+ if (m_events != null && m_Control != null && m_events.HasListeners())
+ {
+ //NOTE: Fixes a bug where the event was being fired immediately, so when a file is opened, the finishedPlaying fired flag gets set but
+ //is then set to true immediately afterwards due to the returned value
+ m_FinishedFrameOpenCheck = false;
+ if (IsHandleEvent(MediaPlayerEvent.EventType.FinishedPlaying))
+ {
+ if (FireEventIfPossible(MediaPlayerEvent.EventType.FinishedPlaying, m_EventFired_FinishedPlaying))
+ {
+ m_EventFired_FinishedPlaying = !m_FinishedFrameOpenCheck;
+ }
+ }
+
+ // Reset some event states that can reset during playback
+ {
+ // Keep track of whether the Playing state has changed
+ if (m_EventFired_Started && IsHandleEvent(MediaPlayerEvent.EventType.Started) &&
+ m_Control != null && !m_Control.IsPlaying() && !m_Control.IsSeeking())
+ {
+ // Playing has stopped
+ m_EventFired_Started = false;
+ }
+
+ // NOTE: We check m_Control isn't null in case the scene is unloaded in response to the FinishedPlaying event
+ if (m_EventFired_FinishedPlaying && IsHandleEvent(MediaPlayerEvent.EventType.FinishedPlaying) &&
+ m_Control != null && m_Control.IsPlaying() && !m_Control.IsFinished())
+ {
+ bool reset = true;
+#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_WSA
+ reset = false;
+ if (m_Info.HasVideo())
+ {
+ // Don't reset if within a frame of the end of the video, important for time > duration workaround
+ float msPerFrame = 1000f / m_Info.GetVideoFrameRate();
+ //Debug.Log(m_Info.GetDurationMs() - m_Control.GetCurrentTimeMs() + " " + msPerFrame);
+ if(m_Info.GetDurationMs() - m_Control.GetCurrentTimeMs() > msPerFrame)
+ {
+ reset = true;
+ }
+ }
+ else
+ {
+ // For audio only media just check if we're not beyond the duration
+ if (m_Control.GetCurrentTimeMs() < m_Info.GetDurationMs())
+ {
+ reset = true;
+ }
+ }
+#endif
+ if (reset)
+ {
+ //Debug.Log("Reset");
+ m_EventFired_FinishedPlaying = false;
+ }
+ }
+ }
+
+ // Events that can only fire once
+ m_EventFired_MetaDataReady = FireEventIfPossible(MediaPlayerEvent.EventType.MetaDataReady, m_EventFired_MetaDataReady);
+ m_EventFired_ReadyToPlay = FireEventIfPossible(MediaPlayerEvent.EventType.ReadyToPlay, m_EventFired_ReadyToPlay);
+ m_EventFired_Started = FireEventIfPossible(MediaPlayerEvent.EventType.Started, m_EventFired_Started);
+ m_EventFired_FirstFrameReady = FireEventIfPossible(MediaPlayerEvent.EventType.FirstFrameReady, m_EventFired_FirstFrameReady);
+
+ // Events that can fire multiple times
+ {
+ // Subtitle changing
+ if (FireEventIfPossible(MediaPlayerEvent.EventType.SubtitleChange, false))
+ {
+ m_previousSubtitleIndex = m_Subtitles.GetSubtitleIndex();
+ }
+
+ // Resolution changing
+ if (FireEventIfPossible(MediaPlayerEvent.EventType.ResolutionChanged, false))
+ {
+ m_EventState_PreviousWidth = m_Info.GetVideoWidth();
+ m_EventState_PreviousHeight = m_Info.GetVideoHeight();
+ }
+
+ // Stalling
+ if (IsHandleEvent(MediaPlayerEvent.EventType.Stalled))
+ {
+ bool newState = m_Info.IsPlaybackStalled();
+ if (newState != m_EventState_PlaybackStalled)
+ {
+ m_EventState_PlaybackStalled = newState;
+
+ var newEvent = m_EventState_PlaybackStalled ? MediaPlayerEvent.EventType.Stalled : MediaPlayerEvent.EventType.Unstalled;
+ FireEventIfPossible(newEvent, false);
+ }
+ }
+ // Seeking
+ if (IsHandleEvent(MediaPlayerEvent.EventType.StartedSeeking))
+ {
+ bool newState = m_Control.IsSeeking();
+ if (newState != m_EventState_PlaybackSeeking)
+ {
+ m_EventState_PlaybackSeeking = newState;
+
+ var newEvent = m_EventState_PlaybackSeeking ? MediaPlayerEvent.EventType.StartedSeeking : MediaPlayerEvent.EventType.FinishedSeeking;
+ FireEventIfPossible(newEvent, false);
+ }
+ }
+ // Buffering
+ if (IsHandleEvent(MediaPlayerEvent.EventType.StartedBuffering))
+ {
+ bool newState = m_Control.IsBuffering();
+ if (newState != m_EventState_PlaybackBuffering)
+ {
+ m_EventState_PlaybackBuffering = newState;
+
+ var newEvent = m_EventState_PlaybackBuffering ? MediaPlayerEvent.EventType.StartedBuffering : MediaPlayerEvent.EventType.FinishedBuffering;
+ FireEventIfPossible(newEvent, false);
+ }
+ }
+ }
+ }
+ }
+
+ protected bool IsHandleEvent(MediaPlayerEvent.EventType eventType)
+ {
+ return ((uint)m_eventMask & (1 << (int)eventType)) != 0;
+ }
+
+ private bool FireEventIfPossible(MediaPlayerEvent.EventType eventType, bool hasFired)
+ {
+ if (CanFireEvent(eventType, hasFired))
+ {
+ hasFired = true;
+ m_events.Invoke(this, eventType, ErrorCode.None);
+ }
+ return hasFired;
+ }
+
+ private bool CanFireEvent(MediaPlayerEvent.EventType et, bool hasFired)
+ {
+ bool result = false;
+ if (m_events != null && m_Control != null && !hasFired && IsHandleEvent(et))
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.FinishedPlaying:
+ //Debug.Log(m_Control.GetCurrentTimeMs() + " " + m_Info.GetDurationMs());
+ result = (!m_Control.IsLooping() && m_Control.CanPlay() && m_Control.IsFinished())
+#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_WSA
+ || (m_Control.GetCurrentTimeMs() > m_Info.GetDurationMs() && !m_Control.IsLooping())
+#endif
+ ;
+ break;
+ case MediaPlayerEvent.EventType.MetaDataReady:
+ result = (m_Control.HasMetaData());
+ break;
+ case MediaPlayerEvent.EventType.FirstFrameReady:
+ result = (m_Texture != null && m_Control.CanPlay() && m_Texture.GetTextureFrameCount() > 0);
+ break;
+ case MediaPlayerEvent.EventType.ReadyToPlay:
+ result = (!m_Control.IsPlaying() && m_Control.CanPlay() && !m_AutoStart);
+ break;
+ case MediaPlayerEvent.EventType.Started:
+ result = (m_Control.IsPlaying());
+ break;
+ case MediaPlayerEvent.EventType.SubtitleChange:
+ result = (m_previousSubtitleIndex != m_Subtitles.GetSubtitleIndex());
+ break;
+ case MediaPlayerEvent.EventType.Stalled:
+ result = m_Info.IsPlaybackStalled();
+ break;
+ case MediaPlayerEvent.EventType.Unstalled:
+ result = !m_Info.IsPlaybackStalled();
+ break;
+ case MediaPlayerEvent.EventType.StartedSeeking:
+ result = m_Control.IsSeeking();
+ break;
+ case MediaPlayerEvent.EventType.FinishedSeeking:
+ result = !m_Control.IsSeeking();
+ break;
+ case MediaPlayerEvent.EventType.StartedBuffering:
+ result = m_Control.IsBuffering();
+ break;
+ case MediaPlayerEvent.EventType.FinishedBuffering:
+ result = !m_Control.IsBuffering();
+ break;
+ case MediaPlayerEvent.EventType.ResolutionChanged:
+ result = (m_Info != null && (m_EventState_PreviousWidth != m_Info.GetVideoWidth() || m_EventState_PreviousHeight != m_Info.GetVideoHeight()));
+ break;
+ default:
+ Debug.LogWarning("[AVProVideo] Unhandled event type");
+ break;
+ }
+ }
+ return result;
+ }
+
+#region Application Focus and Pausing
+#if !UNITY_EDITOR
+ void OnApplicationFocus(bool focusStatus)
+ {
+#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
+// Debug.Log("OnApplicationFocus: focusStatus: " + focusStatus);
+
+ if (focusStatus)
+ {
+ if (m_Control != null && m_WasPlayingOnPause)
+ {
+ m_WasPlayingOnPause = false;
+ m_Control.Play();
+
+ Helper.LogInfo("OnApplicationFocus: playing video again");
+ }
+ }
+#endif
+ }
+
+ void OnApplicationPause(bool pauseStatus)
+ {
+#if !(UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
+// Debug.Log("OnApplicationPause: pauseStatus: " + pauseStatus);
+
+ if (pauseStatus)
+ {
+ if (_pauseMediaOnAppPause)
+ {
+ if (m_Control!= null && m_Control.IsPlaying())
+ {
+ m_WasPlayingOnPause = true;
+ m_Control.Pause();
+
+ Helper.LogInfo("OnApplicationPause: pausing video");
+ }
+ }
+ }
+ else
+ {
+ if (_playMediaOnAppUnpause)
+ {
+ // Catch coming back from power off state when no lock screen
+ OnApplicationFocus(true);
+ }
+ }
+#endif
+ }
+#endif
+#endregion
+
+#region Save Frame To PNG
+#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
+ [ContextMenu("Save Frame To PNG")]
+ public void SaveFrameToPng()
+ {
+ Texture2D frame = ExtractFrame(null);
+ if (frame != null)
+ {
+ byte[] imageBytes = frame.EncodeToPNG();
+ if (imageBytes != null)
+ {
+#if !UNITY_WEBPLAYER
+ string timecode = Mathf.FloorToInt(Control.GetCurrentTimeMs()).ToString("D8");
+ System.IO.File.WriteAllBytes("frame-" + timecode + ".png", imageBytes);
+#else
+ Debug.LogError("Web Player platform doesn't support file writing. Change platform in Build Settings.");
+#endif
+ }
+
+ Destroy(frame);
+ }
+ }
+#endif
+#endregion
+
+#region Extract Frame
+ ///
+ /// Create or return (if cached) a camera that is inactive and renders nothing
+ /// This camera is used to call .Render() on which causes the render thread to run
+ /// This is useful for forcing GL.IssuePluginEvent() to run and is used for
+ /// wait for frames to render for ExtractFrame() and UpdateTimeScale()
+ ///
+ private static Camera GetDummyCamera()
+ {
+ if (m_DummyCamera == null)
+ {
+ const string goName = "AVPro Video Dummy Camera";
+ GameObject go = GameObject.Find(goName);
+ if (go == null)
+ {
+ go = new GameObject(goName);
+ go.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSave;
+ go.SetActive(false);
+ Object.DontDestroyOnLoad(go);
+
+ m_DummyCamera = go.AddComponent();
+ m_DummyCamera.hideFlags = HideFlags.HideInInspector | HideFlags.DontSave;
+ m_DummyCamera.cullingMask = 0;
+ m_DummyCamera.clearFlags = CameraClearFlags.Nothing;
+ m_DummyCamera.enabled = false;
+ }
+ else
+ {
+ m_DummyCamera = go.GetComponent();
+ }
+ }
+ //Debug.Assert(m_DummyCamera != null);
+ return m_DummyCamera;
+ }
+
+ private IEnumerator ExtractFrameCoroutine(Texture2D target, ProcessExtractedFrame callback, float timeSeconds = -1f, bool accurateSeek = true, int timeoutMs = 1000)
+ {
+#if REAL_ANDROID || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX || UNITY_IOS || UNITY_TVOS
+ Texture2D result = target;
+
+ Texture frame = null;
+
+ if (m_Control != null)
+ {
+ if (timeSeconds >= 0f)
+ {
+ Pause();
+
+ float seekTimeMs = timeSeconds * 1000f;
+
+ // If the frame is already available just grab it
+ if (TextureProducer.GetTexture() != null && m_Control.GetCurrentTimeMs() == seekTimeMs)
+ {
+ frame = TextureProducer.GetTexture();
+ }
+ else
+ {
+ int preSeekFrameCount = m_Texture.GetTextureFrameCount();
+
+ // Seek to the frame
+ if (accurateSeek)
+ {
+ m_Control.Seek(seekTimeMs);
+ }
+ else
+ {
+ m_Control.SeekFast(seekTimeMs);
+ }
+
+ // Wait for the new frame to arrive
+ if (!m_Control.WaitForNextFrame(GetDummyCamera(), preSeekFrameCount))
+ {
+ // If WaitForNextFrame fails (e.g. in android single threaded), we run the below code to asynchronously wait for the frame
+ int currFc = TextureProducer.GetTextureFrameCount();
+ int iterations = 0;
+ int maxIterations = 50;
+
+ //+1 as often there will be an extra frame produced after pause (so we need to wait for the second frame instead)
+ while((currFc + 1) >= TextureProducer.GetTextureFrameCount() && iterations++ < maxIterations)
+ {
+ yield return null;
+ }
+ }
+ frame = TextureProducer.GetTexture();
+ }
+ }
+ else
+ {
+ frame = TextureProducer.GetTexture();
+ }
+ }
+
+ if (frame != null)
+ {
+ result = Helper.GetReadableTexture(frame, TextureProducer.RequiresVerticalFlip(), Helper.GetOrientation(Info.GetTextureTransform()), target);
+ }
+#else
+ Texture2D result = ExtractFrame(target, timeSeconds, accurateSeek, timeoutMs);
+#endif
+ callback(result);
+
+ yield return null;
+ }
+
+ public void ExtractFrameAsync(Texture2D target, ProcessExtractedFrame callback, float timeSeconds = -1f, bool accurateSeek = true, int timeoutMs = 1000)
+ {
+ StartCoroutine(ExtractFrameCoroutine(target, callback, timeSeconds, accurateSeek, timeoutMs));
+ }
+
+ // "target" can be null or you can pass in an existing texture.
+ public Texture2D ExtractFrame(Texture2D target, float timeSeconds = -1f, bool accurateSeek = true, int timeoutMs = 1000)
+ {
+ Texture2D result = target;
+
+ // Extract frames returns the interal frame of the video player
+ Texture frame = ExtractFrame(timeSeconds, accurateSeek, timeoutMs);
+ if (frame != null)
+ {
+ result = Helper.GetReadableTexture(frame, TextureProducer.RequiresVerticalFlip(), Helper.GetOrientation(Info.GetTextureTransform()), target);
+ }
+
+ return result;
+ }
+
+ private Texture ExtractFrame(float timeSeconds = -1f, bool accurateSeek = true, int timeoutMs = 1000)
+ {
+ Texture result = null;
+
+ if (m_Control != null)
+ {
+ if (timeSeconds >= 0f)
+ {
+ Pause();
+
+ float seekTimeMs = timeSeconds * 1000f;
+
+ // If the frame is already available just grab it
+ if (TextureProducer.GetTexture() != null && m_Control.GetCurrentTimeMs() == seekTimeMs)
+ {
+ result = TextureProducer.GetTexture();
+ }
+ else
+ {
+ // Store frame count before seek
+ int frameCount = TextureProducer.GetTextureFrameCount();
+
+ // Seek to the frame
+ if (accurateSeek)
+ {
+ m_Control.Seek(seekTimeMs);
+ }
+ else
+ {
+ m_Control.SeekFast(seekTimeMs);
+ }
+
+ // Wait for frame to change
+ ForceWaitForNewFrame(frameCount, timeoutMs);
+ result = TextureProducer.GetTexture();
+ }
+ }
+ else
+ {
+ result = TextureProducer.GetTexture();
+ }
+ }
+ return result;
+ }
+#endregion
+
+#region Play/Pause Support for Unity Editor
+ // This code handles the pause/play buttons in the editor
+#if UNITY_EDITOR
+ static MediaPlayer()
+ {
+#if UNITY_2017_2_OR_NEWER
+ UnityEditor.EditorApplication.pauseStateChanged -= OnUnityPauseModeChanged;
+ UnityEditor.EditorApplication.pauseStateChanged += OnUnityPauseModeChanged;
+#else
+ UnityEditor.EditorApplication.playmodeStateChanged -= OnUnityPlayModeChanged;
+ UnityEditor.EditorApplication.playmodeStateChanged += OnUnityPlayModeChanged;
+#endif
+ }
+
+#if UNITY_2017_2_OR_NEWER
+ private static void OnUnityPauseModeChanged(UnityEditor.PauseState state)
+ {
+ OnUnityPlayModeChanged();
+ }
+#endif
+ private static void OnUnityPlayModeChanged()
+ {
+ if (UnityEditor.EditorApplication.isPlaying)
+ {
+ if (UnityEditor.EditorApplication.isPaused)
+ {
+ MediaPlayer[] players = Resources.FindObjectsOfTypeAll();
+ foreach (MediaPlayer player in players)
+ {
+ player.EditorPause();
+ }
+ }
+ else
+ {
+ MediaPlayer[] players = Resources.FindObjectsOfTypeAll();
+ foreach (MediaPlayer player in players)
+ {
+ player.EditorUnpause();
+ }
+ }
+ }
+ }
+
+ private void EditorPause()
+ {
+ if (this.isActiveAndEnabled)
+ {
+ if (m_Control != null && m_Control.IsPlaying())
+ {
+ m_WasPlayingOnPause = true;
+ m_Control.Pause();
+ }
+ StopRenderCoroutine();
+ }
+ }
+
+ private void EditorUnpause()
+ {
+ if (this.isActiveAndEnabled)
+ {
+ if (m_Control != null && m_WasPlayingOnPause)
+ {
+ m_AutoStart = true;
+ m_WasPlayingOnPause = false;
+ m_AutoStartTriggered = false;
+ }
+ StartRenderCoroutine();
+ }
+ }
+#endif
+#endregion
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/MediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/MediaPlayer.cs.meta
new file mode 100644
index 0000000..004dafd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/MediaPlayer.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 638c870cac4da414fba921606d504407
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/PlaylistMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/PlaylistMediaPlayer.cs
new file mode 100644
index 0000000..1ce5d67
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/PlaylistMediaPlayer.cs
@@ -0,0 +1,901 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ [System.Serializable]
+ public class MediaPlaylist
+ {
+ [System.Serializable]
+ public class MediaItem
+ {
+ /*public enum SourceType
+ {
+ AVProMediaPlayer,
+ Texture2D,
+ }
+
+ [SerializeField]
+ public SourceType sourceType;*/
+
+ [SerializeField]
+ public MediaPlayer.FileLocation fileLocation = MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder;
+
+ [SerializeField]
+ public string filePath;
+
+ /*[SerializeField]
+ public Texture2D texture;
+
+ [SerializeField]
+ public float textureDuration;*/
+
+ [SerializeField]
+ public bool loop = false;
+
+ [SerializeField]
+ public PlaylistMediaPlayer.StartMode startMode = PlaylistMediaPlayer.StartMode.Immediate;
+
+ [SerializeField]
+ public PlaylistMediaPlayer.ProgressMode progressMode = PlaylistMediaPlayer.ProgressMode.OnFinish;
+
+ [SerializeField]
+ public float progressTimeSeconds = 0.5f;
+
+ [SerializeField]
+ public bool autoPlay = true;
+
+ [SerializeField]
+ public StereoPacking stereoPacking = StereoPacking.None;
+
+ [SerializeField]
+ public AlphaPacking alphaPacking = AlphaPacking.None;
+
+ [SerializeField]
+ public bool isOverrideTransition = false;
+
+ [SerializeField]
+ public PlaylistMediaPlayer.Transition overrideTransition = PlaylistMediaPlayer.Transition.None;
+
+ [SerializeField]
+ public float overrideTransitionDuration = 1f;
+
+ [SerializeField]
+ public PlaylistMediaPlayer.Easing overrideTransitionEasing;
+ }
+
+ [SerializeField]
+ private List _items = new List(8);
+
+ public List Items { get { return _items; } }
+
+ public bool HasItemAt(int index)
+ {
+ return (index >= 0 && index < _items.Count);
+ }
+ }
+
+ ///
+ /// This is a BETA component
+ ///
+ [AddComponentMenu("AVPro Video/Playlist Media Player (BETA)", -100)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class PlaylistMediaPlayer : MediaPlayer, IMediaProducer
+ {
+ public enum Transition
+ {
+ None,
+ Fade,
+ Black,
+ White,
+ Transparent,
+ Horiz,
+ Vert,
+ Diag,
+ MirrorH,
+ MirrorV,
+ MirrorD,
+ ScrollV,
+ ScrollH,
+ Circle,
+ Diamond,
+ Blinds,
+ Arrows,
+ SlideH,
+ SlideV,
+ Zoom,
+ RectV,
+ Random,
+ }
+
+ public enum PlaylistLoopMode
+ {
+ None,
+ Loop,
+ }
+
+ public enum StartMode
+ {
+ Immediate,
+ //AfterSeconds,
+ Manual,
+ }
+
+ public enum ProgressMode
+ {
+ OnFinish,
+ BeforeFinish,
+ //AfterTime,
+ Manual,
+ }
+
+ [SerializeField]
+ private MediaPlayer _playerA;
+
+ [SerializeField]
+ private MediaPlayer _playerB;
+
+ [SerializeField]
+ private bool _playlistAutoProgress = true;
+
+ [SerializeField]
+ private PlaylistLoopMode _playlistLoopMode = PlaylistLoopMode.None;
+
+ [SerializeField]
+ private MediaPlaylist _playlist = new MediaPlaylist();
+
+ [SerializeField]
+ [Tooltip("Pause the previously playing video. This is useful for systems that will struggle to play 2 videos at once")]
+ private bool _pausePreviousOnTransition = true;
+
+ [SerializeField]
+ private Transition _nextTransition = Transition.None;
+
+ [SerializeField]
+ private float _transitionDuration = 1f;
+
+ [SerializeField]
+ private Easing _transitionEasing;
+
+ private static int _propFromTex;
+ private static int _propT;
+
+ private int _playlistIndex = 0;
+ private MediaPlayer _nextPlayer;
+ private Shader _shader;
+ private Material _material;
+ private Transition _currentTransition = Transition.None;
+ private string _currentTransitionName = "LERP_NONE";
+ private float _currentTransitionDuration = 1f;
+ private Easing.Preset _currentTransitionEasing;
+ private float _textureTimer;
+ private float _transitionTimer;
+ private System.Func _easeFunc;
+ private RenderTexture _rt;
+ private MediaPlaylist.MediaItem _currentItem;
+ private MediaPlaylist.MediaItem _nextItem;
+
+ public MediaPlayer CurrentPlayer
+ {
+ get
+ {
+ if (NextPlayer == _playerA)
+ {
+ return _playerB;
+ }
+ return _playerA;
+ }
+ }
+
+ public MediaPlayer NextPlayer
+ {
+ get
+ {
+ return _nextPlayer;
+ }
+ }
+
+ public MediaPlaylist Playlist { get { return _playlist; } }
+
+ public int PlaylistIndex { get { return _playlistIndex; } }
+
+ public MediaPlaylist.MediaItem PlaylistItem { get { if (_playlist.HasItemAt(_playlistIndex)) return _playlist.Items[_playlistIndex]; return null; } }
+
+ public PlaylistLoopMode LoopMode { get { return _playlistLoopMode; } set { _playlistLoopMode = value; } }
+
+ public bool AutoProgress { get { return _playlistAutoProgress; } set { _playlistAutoProgress = value; } }
+
+ public override IMediaInfo Info
+ {
+ get { if (CurrentPlayer != null) return CurrentPlayer.Info; return null; }
+ }
+
+ public override IMediaControl Control
+ {
+ get { if (CurrentPlayer != null) return CurrentPlayer.Control; return null; }
+ }
+
+ public override IMediaProducer TextureProducer
+ {
+ get
+ {
+ if (CurrentPlayer != null)
+ {
+ if (IsTransitioning())
+ {
+ return this;
+ }
+ /*if (_currentItem != null && _currentItem.sourceType == MediaPlaylist.MediaItem.SourceType.Texture2D && _currentItem.texture != null)
+ {
+ return this;
+ }*/
+ return CurrentPlayer.TextureProducer;
+ }
+ return null;
+ }
+ }
+
+ private void SwapPlayers()
+ {
+ // Pause the previously playing video
+ // This is useful for systems that will struggle to play 2 videos at once
+ if (_pausePreviousOnTransition)
+ {
+ CurrentPlayer.Pause();
+ }
+
+ // Tell listeners that the playlist item has changed
+ Events.Invoke(this, MediaPlayerEvent.EventType.PlaylistItemChanged, ErrorCode.None);
+
+ // Start the transition
+ if (_currentTransition != Transition.None)
+ {
+ // Create a new transition texture if required
+ Texture currentTexture = GetCurrentTexture();
+ Texture nextTexture = GetNextTexture();
+ if (currentTexture != null && nextTexture != null)
+ {
+ int maxWidth = Mathf.Max(nextTexture.width, currentTexture.width);
+ int maxHeight = Mathf.Max(nextTexture.height, currentTexture.height);
+ if (_rt != null)
+ {
+ if (_rt.width != maxWidth || _rt.height != maxHeight)
+ {
+ RenderTexture.ReleaseTemporary(_rt = null);
+ }
+ }
+
+ if (_rt == null)
+ {
+ _rt = RenderTexture.GetTemporary(maxWidth, maxHeight, 0, RenderTextureFormat.Default, RenderTextureReadWrite.Default, 1);
+ Graphics.Blit(currentTexture, _rt);
+ }
+
+ _material.SetTexture(_propFromTex, currentTexture);
+
+ _easeFunc = Easing.GetFunction(_currentTransitionEasing);
+ _transitionTimer = 0f;
+ }
+ else
+ {
+ _transitionTimer = _currentTransitionDuration;
+ }
+ }
+
+ // Swap the videos
+ if (NextPlayer == _playerA)
+ {
+ _nextPlayer = _playerB;
+ }
+ else
+ {
+ _nextPlayer = _playerA;
+ }
+
+ // Swap the items
+ _currentItem = _nextItem;
+ _nextItem = null;
+ }
+
+ private Texture GetCurrentTexture()
+ {
+ /*if (_currentItem != null && _currentItem.sourceType == MediaPlaylist.MediaItem.SourceType.Texture2D && _currentItem.texture != null)
+ {
+ return _currentItem.texture;
+ }*/
+ if (CurrentPlayer != null && CurrentPlayer.TextureProducer != null)
+ {
+ return CurrentPlayer.TextureProducer.GetTexture();
+ }
+ return null;
+ }
+
+ private Texture GetNextTexture()
+ {
+ /*if (_nextItem != null && _nextItem.sourceType == MediaPlaylist.MediaItem.SourceType.Texture2D && _nextItem.texture != null)
+ {
+ return _nextItem.texture;
+ }*/
+ if (_nextPlayer != null && _nextPlayer.TextureProducer != null)
+ {
+ return _nextPlayer.TextureProducer.GetTexture();
+ }
+ return null;
+ }
+
+ private void Awake()
+ {
+ _nextPlayer = _playerA;
+ _shader = Shader.Find("AVProVideo/Helper/Transition");
+ _material = new Material(_shader);
+ _propFromTex = Shader.PropertyToID("_FromTex");
+ _propT = Shader.PropertyToID("_Fade");
+ _easeFunc = Easing.GetFunction(_transitionEasing.preset);
+ }
+
+ protected override void OnDestroy()
+ {
+ if (_rt != null)
+ {
+ RenderTexture.ReleaseTemporary(_rt);
+ _rt = null;
+ }
+ if (_material != null)
+ {
+ Material.Destroy(_material);
+ _material = null;
+ }
+ base.OnDestroy();
+ }
+
+ private void Start()
+ {
+ if (CurrentPlayer)
+ {
+ CurrentPlayer.Events.AddListener(OnVideoEvent);
+
+ if (NextPlayer)
+ {
+ NextPlayer.Events.AddListener(OnVideoEvent);
+ }
+ }
+
+ JumpToItem(0);
+ }
+
+ public void OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ if (mp == CurrentPlayer)
+ {
+ Events.Invoke(mp, et, errorCode);
+ }
+
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.FirstFrameReady:
+ if (mp == NextPlayer)
+ {
+ SwapPlayers();
+ Events.Invoke(mp, et, errorCode);
+ }
+ break;
+ case MediaPlayerEvent.EventType.FinishedPlaying:
+ if (_playlistAutoProgress && mp == CurrentPlayer && _currentItem.progressMode == ProgressMode.OnFinish)
+ {
+ NextItem();
+ }
+ break;
+ }
+ }
+
+ public bool PrevItem()
+ {
+ return JumpToItem(_playlistIndex - 1);
+ }
+
+ public bool NextItem()
+ {
+ bool result = JumpToItem(_playlistIndex + 1);
+ if (!result)
+ {
+ Events.Invoke(this, MediaPlayerEvent.EventType.PlaylistFinished, ErrorCode.None);
+ }
+ return result;
+ }
+
+ public bool CanJumpToItem(int index)
+ {
+ if (_playlistLoopMode == PlaylistLoopMode.Loop)
+ {
+ if (_playlist.Items.Count > 0)
+ {
+ index %= _playlist.Items.Count;
+ if (index < 0)
+ {
+ index += _playlist.Items.Count;
+ }
+ }
+ }
+ return _playlist.HasItemAt(index);
+ }
+
+ public bool JumpToItem(int index)
+ {
+ if (_playlistLoopMode == PlaylistLoopMode.Loop)
+ {
+ if (_playlist.Items.Count > 0)
+ {
+ index %= _playlist.Items.Count;
+ if (index < 0)
+ {
+ index += _playlist.Items.Count;
+ }
+ }
+ }
+ if (_playlist.HasItemAt(index))
+ {
+ _playlistIndex = index;
+ _nextItem = _playlist.Items[_playlistIndex];
+ OpenVideoFile(_nextItem);
+ return true;
+ }
+ return false;
+ }
+
+ public void OpenVideoFile(MediaPlaylist.MediaItem mediaItem)
+ {
+ bool isMediaAlreadyLoaded = false;
+ if (NextPlayer.m_VideoPath == mediaItem.filePath && NextPlayer.m_VideoLocation == mediaItem.fileLocation)
+ {
+ isMediaAlreadyLoaded = true;
+ }
+
+ if (mediaItem.isOverrideTransition)
+ {
+ SetTransition(mediaItem.overrideTransition, mediaItem.overrideTransitionDuration, mediaItem.overrideTransitionEasing.preset);
+ }
+ else
+ {
+ SetTransition(_nextTransition, _transitionDuration, _transitionEasing.preset);
+ }
+
+ this.m_Loop = NextPlayer.m_Loop = mediaItem.loop;
+ this.m_AutoStart = NextPlayer.m_AutoStart = mediaItem.autoPlay;
+ this.m_VideoLocation = NextPlayer.m_VideoLocation = mediaItem.fileLocation;
+ this.m_VideoPath = NextPlayer.m_VideoPath = mediaItem.filePath;
+ this.m_StereoPacking = NextPlayer.m_StereoPacking = mediaItem.stereoPacking;
+ this.m_AlphaPacking = NextPlayer.m_AlphaPacking = mediaItem.alphaPacking;
+
+ if (isMediaAlreadyLoaded)
+ {
+ NextPlayer.Rewind(false);
+ if (_nextItem.startMode == StartMode.Immediate)
+ {
+ NextPlayer.Play();
+ }
+ // TODO: We probably want to wait until the new frame arrives before swapping after a Rewind()
+ SwapPlayers();
+ }
+ else
+ {
+ if (string.IsNullOrEmpty(NextPlayer.m_VideoPath))
+ {
+ NextPlayer.CloseVideo();
+ }
+ else
+ {
+ //NextPlayer.m_AutoStart = false;
+ NextPlayer.OpenVideoFromFile(NextPlayer.m_VideoLocation, NextPlayer.m_VideoPath, _nextItem.startMode == StartMode.Immediate);
+ }
+ }
+ }
+
+ private bool IsTransitioning()
+ {
+ if (_rt != null && _transitionTimer < _currentTransitionDuration && _currentTransition != Transition.None)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private void SetTransition(Transition transition, float duration, Easing.Preset easing)
+ {
+ if (transition == Transition.Random)
+ {
+ transition = (Transition)Random.Range(0, (int)Transition.Random);
+ }
+
+ if (transition != _currentTransition)
+ {
+ // Disable the previous transition
+ if (!string.IsNullOrEmpty(_currentTransitionName))
+ {
+ _material.DisableKeyword(_currentTransitionName);
+ }
+
+ // Enable the next transition
+ _currentTransition = transition;
+ _currentTransitionName = GetTransitionName(transition);
+ _material.EnableKeyword(_currentTransitionName);
+ }
+
+ _currentTransitionDuration = duration;
+ _currentTransitionEasing = easing;
+ }
+
+ protected override void Update()
+ {
+ if (IsTransitioning())
+ {
+ _transitionTimer += Time.deltaTime;
+ float t = _easeFunc(Mathf.Clamp01(_transitionTimer / _currentTransitionDuration));
+
+ // Fade the audio volume
+ NextPlayer.Control.SetVolume(1f - t);
+ CurrentPlayer.Control.SetVolume(t);
+
+ // TODO: support going from mono to stereo
+ // TODO: support videos of different aspect ratios by rendering with scaling to fit
+ // This can be done by blitting twice, once for each eye
+ // If the stereo mode is different for playera/b then both should be set to stereo during the transition
+ // if (CurrentPlayer.m_StereoPacking == StereoPacking.TopBottom)....
+ _material.SetFloat(_propT, t);
+ _rt.DiscardContents();
+ Graphics.Blit(GetCurrentTexture(), _rt, _material);
+
+ // After the transition is complete, pause the previous video
+ if (!_pausePreviousOnTransition && !IsTransitioning())
+ {
+ if (NextPlayer != null && NextPlayer.Control.IsPlaying())
+ {
+ NextPlayer.Pause();
+ }
+ }
+ }
+ else
+ {
+ if (_playlistAutoProgress && _nextItem == null && _currentItem != null && _currentItem.progressMode == ProgressMode.BeforeFinish && Control != null && Control.GetCurrentTimeMs() >= (Info.GetDurationMs() - (_currentItem.progressTimeSeconds * 1000f)))
+ {
+ this.NextItem();
+ }
+ }
+
+ base.Update();
+ }
+
+ public Texture GetTexture(int index = 0)
+ {
+ // TODO: support iOS YCbCr by supporting multiple textures
+ /*if (!IsTransitioning())
+ {
+ if (_currentItem != null && _currentItem.sourceType == MediaPlaylist.MediaItem.SourceType.Texture2D && _currentItem.texture != null)
+ {
+ return _currentItem.texture;
+ }
+ }*/
+ return _rt;
+ }
+
+ public int GetTextureCount()
+ {
+ return CurrentPlayer.TextureProducer.GetTextureCount();
+ }
+
+ public int GetTextureFrameCount()
+ {
+ return CurrentPlayer.TextureProducer.GetTextureFrameCount();
+ }
+
+ public bool SupportsTextureFrameCount()
+ {
+ return CurrentPlayer.TextureProducer.SupportsTextureFrameCount();
+ }
+
+ public long GetTextureTimeStamp()
+ {
+ return CurrentPlayer.TextureProducer.GetTextureTimeStamp();
+ }
+
+ public bool RequiresVerticalFlip()
+ {
+ return CurrentPlayer.TextureProducer.RequiresVerticalFlip();
+ }
+
+ public Matrix4x4 GetYpCbCrTransform()
+ {
+ return CurrentPlayer.TextureProducer.GetYpCbCrTransform();
+ }
+
+ private static string GetTransitionName(Transition transition)
+ {
+ switch (transition)
+ {
+ case Transition.None: return "LERP_NONE";
+ case Transition.Fade: return "LERP_FADE";
+ case Transition.Black: return "LERP_BLACK";
+ case Transition.White: return "LERP_WHITE";
+ case Transition.Transparent:return "LERP_TRANSP";
+ case Transition.Horiz: return "LERP_HORIZ";
+ case Transition.Vert: return "LERP_VERT";
+ case Transition.Diag: return "LERP_DIAG";
+ case Transition.MirrorH: return "LERP_HORIZ_MIRROR";
+ case Transition.MirrorV: return "LERP_VERT_MIRROR";
+ case Transition.MirrorD: return "LERP_DIAG_MIRROR";
+ case Transition.ScrollV: return "LERP_SCROLL_VERT";
+ case Transition.ScrollH: return "LERP_SCROLL_HORIZ";
+ case Transition.Circle: return "LERP_CIRCLE";
+ case Transition.Diamond: return "LERP_DIAMOND";
+ case Transition.Blinds: return "LERP_BLINDS";
+ case Transition.Arrows: return "LERP_ARROW";
+ case Transition.SlideH: return "LERP_SLIDE_HORIZ";
+ case Transition.SlideV: return "LERP_SLIDE_VERT";
+ case Transition.Zoom: return "LERP_ZOOM_FADE";
+ case Transition.RectV: return "LERP_RECTS_VERT";
+ }
+ return string.Empty;
+ }
+
+#region Easing
+
+ ///
+ /// Easing functions
+ ///
+ [System.Serializable]
+ public class Easing
+ {
+ public Preset preset = Preset.Linear;
+
+ public enum Preset
+ {
+ Step,
+ Linear,
+ InQuad,
+ OutQuad,
+ InOutQuad,
+ InCubic,
+ OutCubic,
+ InOutCubic,
+ InQuint,
+ OutQuint,
+ InOutQuint,
+ InQuart,
+ OutQuart,
+ InOutQuart,
+ InExpo,
+ OutExpo,
+ InOutExpo,
+ Random,
+ RandomNotStep,
+ }
+
+ public static System.Func GetFunction(Preset preset)
+ {
+ System.Func result = null;
+ switch (preset)
+ {
+ case Preset.Step:
+ result = Step;
+ break;
+ case Preset.Linear:
+ result = Linear;
+ break;
+ case Preset.InQuad:
+ result = InQuad;
+ break;
+ case Preset.OutQuad:
+ result = OutQuad;
+ break;
+ case Preset.InOutQuad:
+ result = InOutQuad;
+ break;
+ case Preset.InCubic:
+ result = InCubic;
+ break;
+ case Preset.OutCubic:
+ result = OutCubic;
+ break;
+ case Preset.InOutCubic:
+ result = InOutCubic;
+ break;
+ case Preset.InQuint:
+ result = InQuint;
+ break;
+ case Preset.OutQuint:
+ result = OutQuint;
+ break;
+ case Preset.InOutQuint:
+ result = InOutQuint;
+ break;
+ case Preset.InQuart:
+ result = InQuart;
+ break;
+ case Preset.OutQuart:
+ result = OutQuart;
+ break;
+ case Preset.InOutQuart:
+ result = InOutQuart;
+ break;
+ case Preset.InExpo:
+ result = InExpo;
+ break;
+ case Preset.OutExpo:
+ result = OutExpo;
+ break;
+ case Preset.InOutExpo:
+ result = InOutExpo;
+ break;
+ case Preset.Random:
+ result = GetFunction((Preset)Random.Range(0, (int)Preset.Random));
+ break;
+ case Preset.RandomNotStep:
+ result = GetFunction((Preset)Random.Range((int)Preset.Step+1, (int)Preset.Random));
+ break;
+ }
+ return result;
+ }
+
+ public static float PowerEaseIn(float t, float power)
+ {
+ return Mathf.Pow(t, power);
+ }
+
+ public static float PowerEaseOut(float t, float power)
+ {
+ return 1f - Mathf.Abs(Mathf.Pow(t - 1f, power));
+ }
+
+ public static float PowerEaseInOut(float t, float power)
+ {
+ float result;
+ if (t < 0.5f)
+ {
+ result = PowerEaseIn(t * 2f, power) / 2f;
+ }
+ else
+ {
+ result = PowerEaseOut(t * 2f - 1f, power) / 2f + 0.5f;
+ }
+ return result;
+ }
+
+ public static float Step(float t)
+ {
+ float result = 0f;
+ if (t >= 0.5f)
+ {
+ result = 1f;
+ }
+ return result;
+ }
+
+ public static float Linear(float t)
+ {
+ return t;
+ }
+
+ public static float InQuad(float t)
+ {
+ return PowerEaseIn(t, 2f);
+ }
+
+ public static float OutQuad(float t)
+ {
+ return PowerEaseOut(t, 2f);
+ //return t * (2f - t);
+ }
+
+ public static float InOutQuad(float t)
+ {
+ return PowerEaseInOut(t, 2f);
+ //return t < 0.5 ? (2f * t * t) : (-1f + (4f - 2f * t) * t);
+ }
+
+ public static float InCubic(float t)
+ {
+ return PowerEaseIn(t, 3f);
+ //return t * t * t;
+ }
+
+ public static float OutCubic(float t)
+ {
+ return PowerEaseOut(t, 3f);
+ //return (--t) * t * t + 1f;
+ }
+
+ public static float InOutCubic(float t)
+ {
+ return PowerEaseInOut(t, 3f);
+ //return t < .5f ? (4f * t * t * t) : ((t - 1f) * (2f * t - 2f) * (2f * t - 2f) + 1f);
+ }
+
+ public static float InQuart(float t)
+ {
+ return PowerEaseIn(t, 4f);
+ //return t * t * t * t;
+ }
+
+ public static float OutQuart(float t)
+ {
+ return PowerEaseOut(t, 4f);
+ //return 1f - (--t) * t * t * t;
+ }
+
+ public static float InOutQuart(float t)
+ {
+ return PowerEaseInOut(t, 4f);
+ //return t < 0.5f ? (8f * t * t * t * t) : (1f - 8f * (--t) * t * t * t);
+ }
+
+ public static float InQuint(float t)
+ {
+ return PowerEaseIn(t, 5f);
+ //return t * t * t * t * t;
+ }
+
+ public static float OutQuint(float t)
+ {
+ return PowerEaseOut(t, 5f);
+ //return 1f + (--t) * t * t * t * t;
+ }
+
+ public static float InOutQuint(float t)
+ {
+ return PowerEaseInOut(t, 5f);
+ //return t < 0.5f ? (16f * t * t * t * t * t) : (1f + 16f * (--t) * t * t * t * t);
+ }
+
+ public static float InExpo(float t)
+ {
+ float result = 0f;
+ if (t != 0f)
+ {
+ result = Mathf.Pow(2f, 10f * (t - 1f));
+ }
+ return result;
+ }
+
+ public static float OutExpo(float t)
+ {
+ float result = 1f;
+ if (t != 1f)
+ {
+ result = -Mathf.Pow(2f, -10f * t) + 1f;
+ }
+ return result;
+ }
+
+ public static float InOutExpo(float t)
+ {
+ float result = 0f;
+ if (t > 0f)
+ {
+ result = 1f;
+ if (t < 1f)
+ {
+ t *= 2f;
+ if (t < 1f)
+ {
+ result = 0.5f * Mathf.Pow(2f, 10f * (t - 1f));
+ }
+ else
+ {
+ t--;
+ result = 0.5f * (-Mathf.Pow(2f, -10f * t) + 2f);
+ }
+ }
+ }
+ return result;
+ }
+ }
+#endregion Easing
+
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/PlaylistMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/PlaylistMediaPlayer.cs.meta
new file mode 100644
index 0000000..3cc5bf7
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/PlaylistMediaPlayer.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e9ea31f33222f4b418e4e051a8a5ed24
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/StreamParser.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/StreamParser.cs
new file mode 100644
index 0000000..66eb750
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/StreamParser.cs
@@ -0,0 +1,129 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+using System.Threading;
+using System.Collections.Generic;
+using UnityEngine;
+using System;
+
+namespace RenderHeads.Media.AVProVideo
+{
+ [System.Serializable]
+ public class StreamParserEvent : UnityEngine.Events.UnityEvent
+ {
+ public enum EventType
+ {
+ Success,
+ Failed
+ }
+ }
+
+ ///
+ /// Utility class for parsing adaptive media streams, such as HLS
+ /// A URL is specified, loaded and then the hierarchy of the stream elements are exposed
+ ///
+ public class StreamParser : MonoBehaviour // TODO: make this not a component
+ {
+ public enum StreamType { HLS }
+
+ public string _url;
+ public StreamType _streamType;
+ public bool _autoLoad = true;
+
+ private Stream _parser;
+ private bool _loaded = false;
+ private List _substreams;
+ private List _chunks;
+ private StreamParserEvent _events;
+
+ public StreamParserEvent Events
+ {
+ get
+ {
+ if (_events == null)
+ {
+ _events = new StreamParserEvent();
+ }
+
+ return _events;
+ }
+ }
+
+ private void LoadFile()
+ {
+ try
+ {
+ switch(_streamType)
+ {
+ case StreamType.HLS:
+ _parser = new HLSStream(_url);
+ break;
+ default:
+ _parser = new HLSStream(_url);
+ break;
+ }
+
+ _substreams = _parser.GetAllStreams();
+ _chunks = _parser.GetAllChunks();
+
+ _loaded = true;
+
+ Debug.Log("[AVProVideo] Stream parser completed parsing stream file " + _url);
+ if (_events != null)
+ {
+ _events.Invoke(this, StreamParserEvent.EventType.Success);
+ }
+ }
+ catch (Exception e)
+ {
+ _loaded = false;
+
+ Debug.LogError("[AVProVideo] Parser unable to read stream " + e.Message);
+
+ if (_events != null)
+ {
+ _events.Invoke(this, StreamParserEvent.EventType.Failed);
+ }
+ }
+ }
+
+ public bool Loaded
+ {
+ get { return _loaded; }
+ }
+
+ public Stream Root
+ {
+ get { return _loaded ? _parser : null; }
+ }
+
+ public List SubStreams
+ {
+ get { return _loaded ? _substreams : null; }
+ }
+
+ public List Chunks
+ {
+ get { return _loaded ? _chunks : null; }
+ }
+
+ public void ParseStream()
+ {
+#if UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_WSA
+ LoadFile();
+#else
+ Thread loadThread = new Thread(new ThreadStart(LoadFile));
+ loadThread.Start();
+#endif
+ }
+
+ void Start()
+ {
+ if(_autoLoad)
+ {
+ ParseStream();
+ }
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/StreamParser.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/StreamParser.cs.meta
new file mode 100644
index 0000000..2a240b8
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/StreamParser.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0a25ab4952e3b924c8d193758f43e236
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/SubtitlesUGUI.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/SubtitlesUGUI.cs
new file mode 100644
index 0000000..f32bf3c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/SubtitlesUGUI.cs
@@ -0,0 +1,76 @@
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+using UnityEngine.UI;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Update a standard uGUI Text element with subtitle text as it plays from the MediaPlayer
+ ///
+ [AddComponentMenu("AVPro Video/Subtitles uGUI", 201)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class SubtitlesUGUI : MonoBehaviour
+ {
+ [SerializeField]
+ private MediaPlayer _mediaPlayer = null;
+
+ [SerializeField]
+ private Text _text = null;
+
+ void Start()
+ {
+ ChangeMediaPlayer(_mediaPlayer);
+ }
+
+ void OnDestroy()
+ {
+ ChangeMediaPlayer(null);
+ }
+
+ public void ChangeMediaPlayer(MediaPlayer newPlayer)
+ {
+ // When changing the media player, handle event subscriptions
+ if (_mediaPlayer != null)
+ {
+ _mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ _mediaPlayer = null;
+ }
+
+ if (newPlayer != null)
+ {
+ newPlayer.Events.AddListener(OnMediaPlayerEvent);
+ _mediaPlayer = newPlayer;
+ }
+ }
+
+ // Callback function to handle events
+ private void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.SubtitleChange:
+ {
+ string text = _mediaPlayer.Subtitles.GetSubtitleText();
+
+ // Change RichText for Unity uGUI Text
+ text = text.Replace("", "");
+ text = text.Replace("", string.Empty);
+ text = text.Replace("", string.Empty);
+
+ _text.text = text;
+ }
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/SubtitlesUGUI.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/SubtitlesUGUI.cs.meta
new file mode 100644
index 0000000..ea5abc0
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/SubtitlesUGUI.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2d4bbe43657314a49a5f730e66dafebd
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support.meta
new file mode 100644
index 0000000..e8c809a
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 1d0986c1ab4c9b24fae2420421f4463f
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI.meta
new file mode 100644
index 0000000..38e9a86
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 2cdcd5c0df033154a8ee88d8ef66a304
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI/ApplyToTextureWidgetNGUI.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI/ApplyToTextureWidgetNGUI.cs
new file mode 100644
index 0000000..d5b5b2d
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI/ApplyToTextureWidgetNGUI.cs
@@ -0,0 +1,182 @@
+//#define NGUI
+using UnityEngine;
+using System.Collections;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if NGUI
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Integrates AVPro Video with NGUI
+ /// Applies the video texture to the NGUI UITexture component
+ ///
+ [AddComponentMenu("AVPro Video/Display NGUI")]
+ public class ApplyToTextureWidgetNGUI : MonoBehaviour
+ {
+ #region Fields
+ [SerializeField]
+ private UITexture _uiTexture = null;
+
+ [SerializeField]
+ private MediaPlayer _mediaPlayer = null;
+
+ public MediaPlayer Player
+ {
+ get { return _mediaPlayer; }
+ set { if (_mediaPlayer != value) { ChangeMediaPlayer(value); _isDirty = true; } }
+ }
+
+ [SerializeField]
+ private Texture2D _defaultTexture;
+
+ public Texture2D DefaultTexture
+ {
+ get { return _defaultTexture; }
+ set { if (_defaultTexture != value) { _defaultTexture = value; _isDirty = true; } }
+ }
+
+ [SerializeField]
+ private bool _makePixelPerfect = false;
+
+ public bool MakePixelPerfect
+ {
+ get { return _makePixelPerfect; }
+ set { if (_makePixelPerfect != value) { _makePixelPerfect = value; _isDirty = true; } }
+ }
+
+ private bool _isDirty;
+ private Texture _lastTextureApplied;
+ #endregion
+
+ private void TryUpdateTexture()
+ {
+ bool applied = false;
+
+ // Try to apply texture from media
+ if (_mediaPlayer != null && _mediaPlayer.TextureProducer != null)
+ {
+ Texture texture = _mediaPlayer.TextureProducer.GetTexture();
+ if (texture != null)
+ {
+ // Check for changing texture
+ if (texture != _lastTextureApplied)
+ {
+ _isDirty = true;
+ }
+
+ if (_isDirty)
+ {
+ Apply(texture, _mediaPlayer.TextureProducer.RequiresVerticalFlip());
+ }
+ applied = true;
+ }
+ }
+
+ // If the media didn't apply a texture, then try to apply the default texture
+ if (!applied)
+ {
+ if (_defaultTexture != _lastTextureApplied)
+ {
+ _isDirty = true;
+ }
+ if (_isDirty)
+ {
+ Apply(_defaultTexture, false);
+ }
+ }
+ }
+
+ private void Apply(Texture texture, bool requiresYFlip)
+ {
+ if (_uiTexture != null)
+ {
+ _isDirty = false;
+ if (requiresYFlip)
+ {
+ _uiTexture.flip = UITexture.Flip.Vertically;
+ }
+ else
+ {
+ _uiTexture.flip = UITexture.Flip.Nothing;
+ }
+
+ _lastTextureApplied = _uiTexture.mainTexture = texture;
+
+ if (_makePixelPerfect)
+ {
+ _uiTexture.MakePixelPerfect();
+ }
+ }
+ }
+
+ private void ChangeMediaPlayer(MediaPlayer newPlayer)
+ {
+ // When changing the media player, handle event subscriptions
+ if (_mediaPlayer != null)
+ {
+ _mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ _mediaPlayer = null;
+ }
+
+ _mediaPlayer = newPlayer;
+ if (_mediaPlayer != null)
+ {
+ _mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ }
+
+ // Callback function to handle events
+ private void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Closing:
+ Apply(_defaultTexture, false);
+ break;
+ case MediaPlayerEvent.EventType.Started:
+ case MediaPlayerEvent.EventType.FirstFrameReady:
+ TryUpdateTexture();
+ break;
+ }
+ }
+
+ void Start()
+ {
+ if (_defaultTexture == null)
+ {
+ _defaultTexture = Texture2D.blackTexture;
+ }
+ ChangeMediaPlayer(_mediaPlayer);
+ }
+
+ void Update()
+ {
+ TryUpdateTexture();
+ }
+
+ // We do a LateUpdate() to allow for any changes in the texture that may have happened in Update()
+ void LateUpdate()
+ {
+ TryUpdateTexture();
+ }
+
+ void OnEnable()
+ {
+ TryUpdateTexture();
+ }
+
+ void OnDisable()
+ {
+ Apply(_defaultTexture, false);
+ }
+
+ void OnDestroy()
+ {
+ ChangeMediaPlayer(null);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI/ApplyToTextureWidgetNGUI.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI/ApplyToTextureWidgetNGUI.cs.meta
new file mode 100644
index 0000000..86bfd75
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/NGUI/ApplyToTextureWidgetNGUI.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 706300e4503130449aa3a10d0b54516d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker.meta
new file mode 100644
index 0000000..427a25d
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 9d82b8b5ea0494b3992233eb5e47a12f
+folderAsset: yes
+timeCreated: 1490962214
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions.meta
new file mode 100644
index 0000000..64a3b1d
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: e534f83f7f15547868b8cbc8ce335151
+folderAsset: yes
+timeCreated: 1490962219
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoControl.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoControl.cs
new file mode 100644
index 0000000..8d281d6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoControl.cs
@@ -0,0 +1,2194 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+
+using HutongGames.PlayMaker;
+using HutongGames.PlayMaker.Actions;
+using Tooltip = HutongGames.PlayMaker.TooltipAttribute;
+
+using RenderHeads.Media.AVProVideo;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the CanPlay value of a MediaPlayer media controller.")]
+ public class AVProVideoControlCanPlay : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the CanPlay.")]
+ public FsmBool canPlay;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is looping")]
+ public FsmEvent canPlayEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not looping")]
+ public FsmEvent canNotPlayEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _canPlay = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ canPlay = null;
+ canPlayEvent = null;
+ canNotPlayEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache (Fsm.GetOwnerDefaultTarget (gameObject)))
+ {
+ ExecuteAction ();
+ }
+
+ if (!everyframe)
+ {
+ Finish ();
+ }
+ }
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache (Fsm.GetOwnerDefaultTarget (gameObject)))
+ {
+ ExecuteAction ();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event (missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.CanPlay ())
+ {
+ canPlay.Value = true;
+ if (_canPlay!=1)
+ {
+ Fsm.Event (canPlayEvent);
+ }
+ _canPlay = 1;
+ } else
+ {
+ canPlay.Value = false;
+ if (_canPlay != 0)
+ {
+ Fsm.Event (canNotPlayEvent);
+ }
+ _canPlay = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Close the video of a MediaPlayer.")]
+ public class AVProVideoControlCloseVideo : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer media controller.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ missingControlEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.CloseVideo();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the Buffered Time Range of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetBufferedTimeRange : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The Buffered index ( from AVProControlGetBufferedTimeRangeCount )")]
+ public FsmInt index;
+
+ [ActionSection("Result")]
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The start time of that buffer index")]
+ public FsmFloat startTime;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The end time of that buffer index")]
+ public FsmFloat endtime;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("buffer flag")]
+ public FsmBool isBuffered;
+
+ [Tooltip("Event Sent if the result of this buffer range is true")]
+ public FsmEvent isBufferedEvent;
+
+ [Tooltip("Event Sent if the result of this buffer range is false")]
+ public FsmEvent isNotBufferedEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ float _startTime;
+ float _endTime;
+ bool _result;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+
+ index = null;
+
+ startTime = null;
+ endtime = null;
+ isBuffered = null;
+ isBufferedEvent = null;
+ isNotBufferedEvent = null;
+
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ _result = this.mediaPlayer.Control.GetBufferedTimeRange(index.Value, ref _startTime, ref _endTime);
+ startTime.Value = _startTime;
+ endtime.Value = _endTime;
+
+ if (_result)
+ {
+ isBuffered.Value = true;
+ Fsm.Event(isBufferedEvent);
+ }
+ else
+ {
+ isBuffered.Value = false;
+ Fsm.Event(isNotBufferedEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the Buffered Time Range progress of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetBufferedTimeRangeCount : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The Buffered Time Range count")]
+ public FsmInt bufferedTimeRange;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ bufferedTimeRange = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ bufferedTimeRange.Value = this.mediaPlayer.Control.GetBufferedTimeRangeCount();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the buffering progress of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetBufferingProgress : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The buffering progress")]
+ public FsmFloat bufferingProgress;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ bufferingProgress = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ bufferingProgress.Value = this.mediaPlayer.Control.GetBufferingProgress();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the current audio track id of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetCurrentAudioTrack : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current audio track Id")]
+ public FsmInt trackId;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackId = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ trackId.Value = this.mediaPlayer.Control.GetCurrentAudioTrack();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the current playback time in ms of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetCurrentTime : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current time in ms")]
+ public FsmFloat currentTime;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ currentTime = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ currentTime.Value = this.mediaPlayer.Control.GetCurrentTimeMs();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the current video track id of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetCurrentVideoTrack : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current video track Id")]
+ public FsmInt trackId;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackId = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ trackId.Value = this.mediaPlayer.Control.GetCurrentVideoTrack();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the last error of a MediaPlayer controller.")]
+ public class AVProVideoControlGetLastError : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The last error code as int")]
+ public FsmInt lastErrorAsInt;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The last error code")]
+ [ObjectType(typeof(ErrorCode))]
+ public FsmEnum lastError;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ lastError = ErrorCode.None;
+ lastErrorAsInt = null;
+
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+ lastError.Value = this.mediaPlayer.Control.GetLastError();
+ lastErrorAsInt.Value = (int)this.mediaPlayer.Control.GetLastError();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the playback rate of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetPlayBackRate : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The playback rate")]
+ public FsmFloat playbackRate;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ playbackRate = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ playbackRate.Value = this.mediaPlayer.Control.GetPlaybackRate();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the volume value of a MediaPlayer media controller.")]
+ public class AVProVideoControlGetVolume : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the volume.")]
+ public FsmFloat volume;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ volume = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ volume.Value = this.mediaPlayer.Control.GetVolume();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the hasMetada value of a MediaPlayer media controller.")]
+ public class AVProVideoControlHasMetaData : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Flag wether Media has metadata or not.")]
+ public FsmBool hasMetaData;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media has metaData")]
+ public FsmEvent hasMetadataEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media does not have metaData")]
+ public FsmEvent hasNotMetadataEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _hasMetaData = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ hasMetaData = null;
+ hasMetadataEvent = null;
+ hasNotMetadataEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.HasMetaData())
+ {
+ hasMetaData.Value = true;
+ if (_hasMetaData != 1)
+ {
+ Fsm.Event(hasMetadataEvent);
+ }
+ _hasMetaData = 1;
+ }
+ else
+ {
+ hasMetaData.Value = false;
+ if (_hasMetaData != 0)
+ {
+ Fsm.Event(hasNotMetadataEvent);
+ }
+ _hasMetaData = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsBuffering value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsBuffering : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the IsBuffering.")]
+ public FsmBool isBuffering;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is buffering")]
+ public FsmEvent isBufferingEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not buffering")]
+ public FsmEvent isNotBufferingEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isBuffering = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isBuffering = null;
+ isBufferingEvent = null;
+ isNotBufferingEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsBuffering())
+ {
+ isBuffering.Value = true;
+ if (_isBuffering != 1)
+ {
+ Fsm.Event(isBufferingEvent);
+ }
+ _isBuffering = 1;
+ }
+ else
+ {
+ isBuffering.Value = false;
+ if (_isBuffering != 0)
+ {
+ Fsm.Event(isNotBufferingEvent);
+ }
+ _isBuffering = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsFinished value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsFinished : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the IsFinished.")]
+ public FsmBool isFinished;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is finished")]
+ public FsmEvent isFinishedEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not finished")]
+ public FsmEvent isNotFinishedEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isFinished = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isFinished = null;
+ isFinishedEvent = null;
+ isNotFinishedEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsFinished())
+ {
+ isFinished.Value = true;
+ if (_isFinished != 1)
+ {
+ Fsm.Event(isFinishedEvent);
+ }
+ _isFinished = 1;
+ }
+ else
+ {
+ isFinished.Value = false;
+ if (_isFinished != 0)
+ {
+ Fsm.Event(isNotFinishedEvent);
+ }
+ _isFinished = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsLooping value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsLooping : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the looping.")]
+ public FsmBool isLooping;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is looping")]
+ public FsmEvent isLoopingEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not looping")]
+ public FsmEvent isNotLoopingEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isLooping = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isLooping = null;
+ isLoopingEvent = null;
+ isNotLoopingEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsLooping())
+ {
+ isLooping.Value = true;
+ if (_isLooping != 1)
+ {
+ Fsm.Event(isLoopingEvent);
+ }
+ _isLooping = 1;
+ }
+ else
+ {
+ isLooping.Value = false;
+ if (_isLooping != 0)
+ {
+ Fsm.Event(isNotLoopingEvent);
+ }
+ _isLooping = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsMuted value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsMuted : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the isMuted.")]
+ public FsmBool isMuted;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is Muted")]
+ public FsmEvent isMutedEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not Muted")]
+ public FsmEvent isNotMutedEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isMuted = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isMuted = null;
+ isMutedEvent = null;
+ isNotMutedEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsMuted())
+ {
+ isMuted.Value = true;
+ if (_isMuted != 1)
+ {
+ Fsm.Event(isMutedEvent);
+ }
+ _isMuted = 1;
+ }
+ else
+ {
+ isMuted.Value = false;
+ if (_isMuted != 0)
+ {
+ Fsm.Event(isNotMutedEvent);
+ }
+ _isMuted = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsPaused value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsPaused : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the isPaused.")]
+ public FsmBool isPaused;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is paused")]
+ public FsmEvent isPausedEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not paused")]
+ public FsmEvent isNotPausedEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isPaused = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isPaused = null;
+ isPausedEvent = null;
+ isNotPausedEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsPaused())
+ {
+ isPaused.Value = true;
+ if (_isPaused != 1)
+ {
+ Fsm.Event(isPausedEvent);
+ }
+ _isPaused = 1;
+ }
+ else
+ {
+ isPaused.Value = false;
+ if (_isPaused != 0)
+ {
+ Fsm.Event(isNotPausedEvent);
+ }
+ _isPaused = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsPlaying value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsPlaying : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the isPlaying.")]
+ public FsmBool isPlaying;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is playing")]
+ public FsmEvent isPlayingEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not playing")]
+ public FsmEvent isNotPlayingEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isPlaying = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isPlaying = null;
+ isPlayingEvent = null;
+ isNotPlayingEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsPlaying())
+ {
+ isPlaying.Value = true;
+ if (_isPlaying != 1)
+ {
+ Fsm.Event(isPlayingEvent);
+ }
+ _isPlaying = 1;
+ }
+ else
+ {
+ isPlaying.Value = false;
+ if (_isPlaying != 0)
+ {
+ Fsm.Event(isNotPlayingEvent);
+ }
+ _isPlaying = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Get the IsSeeking value of a MediaPlayer media controller.")]
+ public class AVProVideoControlIsSeeking : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the isSeeking.")]
+ public FsmBool isSeeking;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is seeking")]
+ public FsmEvent isSeekingEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media is not seeking")]
+ public FsmEvent isNotSeekingEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ // cache to check if event needs sending or not
+ int _isSeeking = -1;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isSeeking = null;
+ isSeekingEvent = null;
+ isNotSeekingEvent = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.IsSeeking())
+ {
+ isSeeking.Value = true;
+ if (_isSeeking != 1)
+ {
+ Fsm.Event(isSeekingEvent);
+ }
+ _isSeeking = 1;
+ }
+ else
+ {
+ isSeeking.Value = false;
+ if (_isSeeking != 0)
+ {
+ Fsm.Event(isNotSeekingEvent);
+ }
+ _isSeeking = 0;
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Sets the audio mute value of a MediaPlayer media controller.")]
+ public class AVProVideoControlMuteAudio : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The value of the audio mute.")]
+ public FsmBool mute;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ mute = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.MuteAudio(mute.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Pauses playback of a MediaPlayer.")]
+ public class AVProVideoControlPause : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer media controller.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ missingControlEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.Pause();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Starts playback of a MediaPlayer media controller.")]
+ public class AVProVideoControlPlay : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event Sent if playback started")]
+ public FsmEvent successEvent;
+
+ [Tooltip("Event Sent if MediaPlayer can not play")]
+ public FsmEvent canNotPlayEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+
+ canNotPlayEvent = null;
+ missingControlEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Control.CanPlay())
+ {
+ this.mediaPlayer.Control.Play();
+ }
+ else
+ {
+ Fsm.Event(canNotPlayEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Rewinds a MediaPlayer media controller.")]
+ public class AVProVideoControlRewind : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ missingControlEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.Rewind();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Seeks on a MediaPlayer media controller.")]
+ public class AVProVideoControlSeek : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The value of seek in ms.")]
+ public FsmFloat seek;
+
+ [Tooltip("If true will seek with a faster system")]
+ public FsmBool seekFast;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+
+ seek = null;
+ seekFast = null;
+
+ missingControlEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ if (seekFast.Value)
+ {
+ this.mediaPlayer.Control.SeekFast(seek.Value);
+ }
+ else
+ {
+ this.mediaPlayer.Control.Seek(seek.Value);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Sets the audio track of a MediaPlayer media controller.")]
+ public class AVProVideoControlSetAudioTrack : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The audio track")]
+ public FsmInt audioTrack;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ audioTrack = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.SetAudioTrack(audioTrack.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Set the looping value of a MediaPlayer media controller.")]
+ public class AVProVideoControlSetLooping : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The value of the looping.")]
+ public FsmBool isLooping;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isLooping = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.SetLooping(isLooping.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Sets the playback rate of a MediaPlayer media controller.")]
+ public class AVProVideoControlSetPlayBackRate : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The playback rate")]
+ public FsmFloat playbackRate;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ playbackRate = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.SetPlaybackRate(playbackRate.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Set the texture properties of a MediaPlayer media controller.")]
+ public class AVProVideoControlSetTextureProperties : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("The filter mode")]
+ [ObjectType(typeof(FilterMode))]
+ public FsmEnum filterMode;
+
+ [Tooltip("The textureWrapMode mode")]
+ [ObjectType(typeof(TextureWrapMode))]
+ public FsmEnum textureWrapMode;
+
+ [Tooltip("The anisoLevel Value")]
+ public FsmInt anisoLevel;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ filterMode = FilterMode.Bilinear;
+ textureWrapMode = TextureWrapMode.Clamp;
+ anisoLevel = 1;
+
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.SetTextureProperties((FilterMode)filterMode.Value, (TextureWrapMode)textureWrapMode.Value, anisoLevel.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Sets the video track of a MediaPlayer media controller.")]
+ public class AVProVideoControlSetVideoTrack : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The video track")]
+ public FsmInt videoTrack;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ videoTrack = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.SetVideoTrack(videoTrack.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Set the volume value of a MediaPlayer media controller.")]
+ public class AVProVideoControlSetVolume : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The value of the volume.")]
+ public FsmFloat volume;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ [Tooltip("Execute action everyframe.")]
+ public bool everyframe;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ volume = null;
+ missingControlEvent = null;
+ everyframe = false;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ if (!everyframe)
+ {
+ Finish();
+ }
+ }
+
+ public override void OnUpdate()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.SetVolume(volume.Value);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Stops playback of a MediaPlayer media controller.")]
+ public class AVProVideoControlStop : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event Sent if MediaPlayer media control is missing (null)")]
+ public FsmEvent missingControlEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ missingControlEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Control == null)
+ {
+ Fsm.Event(missingControlEvent);
+ return;
+ }
+
+ this.mediaPlayer.Control.Stop();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoControl.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoControl.cs.meta
new file mode 100644
index 0000000..ca5794c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoControl.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3cff8309e08b7e844a0d84f74b6dc6ad
+timeCreated: 1495729132
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoDisplayUGUI.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoDisplayUGUI.cs
new file mode 100644
index 0000000..735a296
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoDisplayUGUI.cs
@@ -0,0 +1,65 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+
+using HutongGames.PlayMaker;
+using HutongGames.PlayMaker.Actions;
+using Tooltip = HutongGames.PlayMaker.TooltipAttribute;
+
+using RenderHeads.Media.AVProVideo;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the MediaPlayer of a DisplayUGUI Component.")]
+ public class AVProVideoDisplayUGUIGetMediaPlayer : ComponentAction
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(DisplayUGUI))]
+ [Tooltip("The GameObject with a DisplayUGUI component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip(“The MediaPlayer GameObject.”)]
+ [UIHint(UIHint.Variable)]
+ public FsmGameObject mediaPlayerGameObject;
+
+ [Tooltip("Event Sent if no MediaPlayer is referenced on the DisplayUGUI component")]
+ public FsmEvent missingMediaPlayerEvent;
+
+
+ public override void Reset()
+ {
+ gameObject = null;
+ mediaPlayerGameObject = null;
+ missingMediaPlayerEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ mediaPlayerGameObject.Value = this.cachedComponent._mediaPlayer ? this.cachedComponent._mediaPlayer.gameObject : null;
+
+ if (missingMediaPlayerEvent != null && this.cachedComponent._mediaPlayer == null)
+ {
+ Fsm.Event(missingMediaPlayerEvent);
+ }
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoDisplayUGUI.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoDisplayUGUI.cs.meta
new file mode 100644
index 0000000..cfee6f8
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoDisplayUGUI.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 62092c03003fbff4ab67d7eeef490d23
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoEvent.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoEvent.cs
new file mode 100644
index 0000000..b162b58
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoEvent.cs
@@ -0,0 +1,563 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+
+using HutongGames.PlayMaker;
+using HutongGames.PlayMaker.Actions;
+using Tooltip = HutongGames.PlayMaker.TooltipAttribute;
+
+using RenderHeads.Media.AVProVideo;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the Closing Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventClosing: AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a Closing event")]
+ public FsmEvent closingEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ closingEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Closing:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget (gameObject);
+ Fsm.Event (closingEvent);
+ Finish();
+ break;
+
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache (Fsm.GetOwnerDefaultTarget (gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener (OnMediaPlayerEvent);
+ } else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer!=null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the Error Event of a MediaPlayer and sends an event. Error Code is passed in the event data as an int. 100 = loadFailed 200 = decodeFailed")]
+ public class AVProVideoEventError : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a Error event")]
+ public FsmEvent errorEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ errorEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Error:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.EventData.IntData = (int)errorCode;
+ Fsm.Event(errorEvent);
+ Finish();
+ break;
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the FinishedPlaying Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventFinishedPlaying : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a FinishedPlaying event")]
+ public FsmEvent finishedPlayingEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ finishedPlayingEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.FinishedPlaying:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(finishedPlayingEvent);
+ Finish();
+ break;
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the FirstFrameReady Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventFirstFrameReady : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a FirstFrameReady event")]
+ public FsmEvent firstFrameReadyEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ firstFrameReadyEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.FirstFrameReady:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(firstFrameReadyEvent);
+ Finish();
+ break;
+
+ }
+ }
+
+ public override void OnEnter()
+ {
+
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the MetaDataReady Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventMetaDataReady : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a metaDataReady event")]
+ public FsmEvent metaDataReadyEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ metaDataReadyEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.MetaDataReady:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(metaDataReadyEvent);
+ Finish();
+ break;
+
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the ReadytoPlay Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventReadyToPlay : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a ReadyToPlay event")]
+ public FsmEvent readyToPlayEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ readyToPlayEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.ReadyToPlay:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(readyToPlayEvent);
+ Finish();
+ break;
+
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the Stalled Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventStalled : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a Stalled event")]
+ public FsmEvent stalledEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ stalledEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Stalled:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(stalledEvent);
+ Finish();
+ break;
+
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the ReadytoPlay Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventStarted : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a Started event")]
+ public FsmEvent startedEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ startedEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Started:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(startedEvent);
+ Finish();
+ break;
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the SubtitleChange Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventSubtitleChange : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a SubtitleChange event")]
+ public FsmEvent subtitleChangeEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ subtitleChangeEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.SubtitleChange:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(subtitleChangeEvent);
+ Finish();
+ break;
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Listen to the Unstalled Event of a MediaPlayer and sends an event.")]
+ public class AVProVideoEventUnstalled : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("Event fired when MediaPlayer sends a Unstalled event")]
+ public FsmEvent unstalledEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ unstalledEvent = null;
+ }
+
+ // Callback function to handle events
+ public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.Unstalled:
+ Fsm.EventData.GameObjectData = Fsm.GetOwnerDefaultTarget(gameObject);
+ Fsm.Event(unstalledEvent);
+ Finish();
+ break;
+ }
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ this.mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
+ }
+ else
+ {
+ Finish();
+ }
+ }
+
+ public override void OnExit()
+ {
+ if (this.mediaPlayer != null)
+ {
+ this.mediaPlayer.Events.RemoveListener(OnMediaPlayerEvent);
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoEvent.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoEvent.cs.meta
new file mode 100644
index 0000000..33d8d44
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoEvent.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: ad557c974d443cc44a6839862e394f55
+timeCreated: 1495729140
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoInfo.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoInfo.cs
new file mode 100644
index 0000000..0aa27be
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoInfo.cs
@@ -0,0 +1,836 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+
+using HutongGames.PlayMaker;
+using HutongGames.PlayMaker.Actions;
+using Tooltip = HutongGames.PlayMaker.TooltipAttribute;
+
+using RenderHeads.Media.AVProVideo;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets Whether this MediaPlayer instance supports linear color space from media info a MediaPlayer. If it doesn't then a correction may have to be made in the shader")]
+ public class AVProVideoInfoDoesSupportsLinearColorSpace : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("True if player supports linear color space")]
+ public FsmBool doesSupportsLCS;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if player supports linear color space")]
+ public FsmEvent doesSupportsLCSEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if player does not supports linear color space")]
+ public FsmEvent doesNotSupportsLCSEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ doesSupportsLCS = null;
+ doesSupportsLCSEvent = null;
+ doesNotSupportsLCSEvent = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache (Fsm.GetOwnerDefaultTarget (gameObject)))
+ {
+ ExecuteAction ();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event (missingMediaInfoEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Info.PlayerSupportsLinearColorSpace())
+ {
+ doesSupportsLCS.Value = true;
+ Fsm.Event (doesSupportsLCSEvent);
+
+ } else
+ {
+ doesSupportsLCS.Value = false;
+ Fsm.Event (doesNotSupportsLCSEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the number of audio tracks from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetAudioTrackCount : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The number of audio tracks")]
+ public FsmInt trackCount;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackCount = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ trackCount.Value = this.mediaPlayer.Info.GetAudioTrackCount();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the current audio bitrate from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetCurrentAudioTrackBitrate : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current audio bitrate")]
+ public FsmInt trackBitrate;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackBitrate = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ trackBitrate.Value = this.mediaPlayer.Info.GetCurrentAudioTrackBitrate();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the current audio track identification from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetCurrentAudioTrackId : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current audio track identification")]
+ public FsmString trackId;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackId = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ trackId.Value = this.mediaPlayer.Info.GetCurrentAudioTrackId();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the current video bitrate from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetCurrentVideoTrackBitrate : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current video bitrate")]
+ public FsmInt trackBitrate;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackBitrate = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ trackBitrate.Value = this.mediaPlayer.Info.GetCurrentVideoTrackBitrate();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the current video track identification from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetCurrentVideoTrackId : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The current video track identification")]
+ public FsmString trackId;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackId = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ trackId.Value = this.mediaPlayer.Info.GetCurrentVideoTrackId();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets video duration from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetDurationMs : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the video duration in ms.")]
+ public FsmFloat duration;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ duration = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ duration.Value = this.mediaPlayer.Info.GetDurationMs();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the description of which playback path is used internally from media info a MediaPlayer.")]
+ public class AVProVideoInfoAVProInfoGetPlayerDescription : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The description of the playback")]
+ public FsmString description;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ description = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ description.Value = this.mediaPlayer.Info.GetPlayerDescription();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the current achieved display rate in frames per second from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetVideoDisplayRate : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [RequiredField]
+ [Tooltip("The achieved framerate of the video")]
+ public FsmFloat framerate;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ framerate = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ framerate.Value = this.mediaPlayer.Info.GetVideoDisplayRate();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets video frame rate from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetVideoFrameRate : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The framerate of the video")]
+ public FsmFloat framerate;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ framerate = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ framerate.Value = this.mediaPlayer.Info.GetVideoFrameRate();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets video size ( width and height ) from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetVideoSize : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The width of the video")]
+ public FsmFloat width;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The height of the video")]
+ public FsmFloat height;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The width and height of the video")]
+ public FsmVector2 size;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ width = null;
+ height = null;
+ size = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ if (!width.IsNone) width.Value = this.mediaPlayer.Info.GetVideoWidth();
+ if (!height.IsNone) height.Value = this.mediaPlayer.Info.GetVideoHeight();
+
+ if (!size.IsNone) size.Value = new Vector2(this.mediaPlayer.Info.GetVideoWidth(), this.mediaPlayer.Info.GetVideoHeight());
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets the number of video tracks from media info a MediaPlayer.")]
+ public class AVProVideoInfoGetVideoTrackCount : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [RequiredField]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The number of video tracks")]
+ public FsmInt trackCount;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ trackCount = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ trackCount.Value = this.mediaPlayer.Info.GetVideoTrackCount();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets hasAudio from media info a MediaPlayer.")]
+ public class AVProVideoInfoHasAudio : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the hasAudio.")]
+ public FsmBool hasAudio;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media has audio")]
+ public FsmEvent hasAudioEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media doesn't have audio")]
+ public FsmEvent hasNoAudioEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ hasAudio = null;
+ hasAudioEvent = null;
+ hasNoAudioEvent = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Info.HasAudio())
+ {
+ hasAudio.Value = true;
+ Fsm.Event(hasNoAudioEvent);
+ }
+ else
+ {
+ hasAudio.Value = false;
+ Fsm.Event(hasNoAudioEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Gets hasVideo from media info a MediaPlayer.")]
+ public class AVProVideoInfoHasVideo : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("The value of the hasVideo.")]
+ public FsmBool hasVideo;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media has video")]
+ public FsmEvent hasVideoEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if media doesn't have video")]
+ public FsmEvent hasNoVideoEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ hasVideo = null;
+ hasVideoEvent = null;
+ hasNoVideoEvent = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Info.HasVideo())
+ {
+ hasVideo.Value = true;
+ Fsm.Event(hasNoVideoEvent);
+ }
+ else
+ {
+ hasVideo.Value = false;
+ Fsm.Event(hasNoVideoEvent);
+ }
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Checks if the playback is in a stalled state from media info a MediaPlayer.")]
+ public class AVProVideoInfoIsPlaybackStalled : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [ActionSection("Result")]
+ [UIHint(UIHint.Variable)]
+ [Tooltip("True if the playback is in a stalled state")]
+ public FsmBool isStalled;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if the playback is in a stalled state")]
+ public FsmEvent isStalledEvent;
+
+ [UIHint(UIHint.Variable)]
+ [Tooltip("Event Sent if the playback is not in a stalled state")]
+ public FsmEvent isNotStalledEvent;
+
+ [Tooltip("Event Sent if MediaPlayer media info is missing (null)")]
+ public FsmEvent missingMediaInfoEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ isStalled = null;
+ isStalledEvent = null;
+ isNotStalledEvent = null;
+ missingMediaInfoEvent = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ if (this.mediaPlayer.Info == null)
+ {
+ Fsm.Event(missingMediaInfoEvent);
+ return;
+ }
+
+ if (this.mediaPlayer.Info.IsPlaybackStalled())
+ {
+ isStalled.Value = true;
+ Fsm.Event(isStalledEvent);
+ }
+ else
+ {
+ isStalled.Value = false;
+ Fsm.Event(isNotStalledEvent);
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoInfo.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoInfo.cs.meta
new file mode 100644
index 0000000..accb98b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoInfo.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 92b2a1405a335834c8c9b198fb66b9a3
+timeCreated: 1495729148
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoPlayer.cs
new file mode 100644
index 0000000..74d4637
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoPlayer.cs
@@ -0,0 +1,335 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+
+using HutongGames.PlayMaker;
+using HutongGames.PlayMaker.Actions;
+using Tooltip = HutongGames.PlayMaker.TooltipAttribute;
+
+using RenderHeads.Media.AVProVideo;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Closes Video of a MediaPlayer.")]
+ public class AVProVideoPlayerCloseVideo : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ public override void Reset()
+ {
+ gameObject = null;
+
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache (Fsm.GetOwnerDefaultTarget (gameObject)))
+ {
+ ExecuteAction ();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ this.mediaPlayer.CloseVideo ();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Disable subtitles of a MediaPlayer.")]
+ public class AVProVideoPlayerDisableSubtitles : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ public override void Reset()
+ {
+ gameObject = null;
+
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ this.mediaPlayer.DisableSubtitles();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Enable subtitles of a MediaPlayer.")]
+ public class AVProVideoPlayerEnableSubtitles : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The file location")]
+ [ObjectType(typeof(MediaPlayer.FileLocation))]
+ public FsmEnum fileLocation;
+
+ [RequiredField]
+ [Tooltip("The file path, depending on the file Location")]
+ public FsmString filePath;
+
+ [ActionSection("Result")]
+
+ [Tooltip("true if subtitle were enabled")]
+ public FsmBool success;
+
+ [Tooltip("event sent if subtitle enabling succeded")]
+ public FsmEvent successEvent;
+
+ [Tooltip("event sent if subtitle enabling failed")]
+ public FsmEvent failureEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ fileLocation = MediaPlayer.FileLocation.AbsolutePathOrURL;
+ filePath = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ bool ok = this.mediaPlayer.EnableSubtitles((MediaPlayer.FileLocation)fileLocation.Value, filePath.Value);
+
+ success.Value = ok;
+
+ Fsm.Event(ok ? successEvent : failureEvent);
+
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Open a video at a location in a MediaPlayer.")]
+ public class AVProVideoPlayerOpenVideoLocation : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [RequiredField]
+ [Tooltip("The file location")]
+ [ObjectType(typeof(MediaPlayer.FileLocation))]
+ public FsmEnum fileLocation;
+
+ [RequiredField]
+ [Tooltip("The file path, depending on the file Location")]
+ public FsmString filePath;
+
+ [Tooltip("Auto play when video is loaded")]
+ public FsmBool autoPlay;
+
+ [ActionSection("Result")]
+
+ [Tooltip("true if video is loading successfully")]
+ public FsmBool success;
+
+ [Tooltip("event sent if video is loading successfully")]
+ public FsmEvent successEvent;
+
+ [Tooltip("event sent if video loading failed")]
+ public FsmEvent failureEvent;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ fileLocation = MediaPlayer.FileLocation.AbsolutePathOrURL;
+ filePath = null;
+ autoPlay = true;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ bool ok = this.mediaPlayer.OpenVideoFromFile((MediaPlayer.FileLocation)fileLocation.Value, filePath.Value, autoPlay.Value);
+
+ success.Value = ok;
+
+ Fsm.Event(ok ? successEvent : failureEvent);
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Pauses playback of a MediaPlayer.")]
+ public class AVProVideoPlayerPause : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ this.mediaPlayer.Pause();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Starts playback of a MediaPlayer.")]
+ public class AVProVideoPlayerPlay : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ this.mediaPlayer.Play();
+ }
+ }
+
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Rewinds the video of a MediaPlayer.")]
+ public class AVProVideoPlayerRewind : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ [Tooltip("The pause value when calling rewind. leave to none for default")]
+ public FsmBool pause;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ pause = new FsmBool() { UseVariable = true };
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ this.mediaPlayer.Rewind(pause.Value);
+ }
+ }
+ [ActionCategory("AVProVideo")]
+ [Tooltip("Stops playback of a MediaPlayer.")]
+ public class AVProVideoPlayerStop : AVProVideoActionBase
+ {
+ public AVProVideoActionHeader headerImage;
+
+ [RequiredField]
+ [CheckForComponent(typeof(MediaPlayer))]
+ [Tooltip("The GameObject with a MediaPlayer component.")]
+ public FsmOwnerDefault gameObject;
+
+ public override void Reset()
+ {
+ gameObject = null;
+ }
+
+ public override void OnEnter()
+ {
+ if (this.UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
+ {
+ ExecuteAction();
+ }
+
+ Finish();
+ }
+
+ void ExecuteAction()
+ {
+ this.mediaPlayer.Stop();
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoPlayer.cs.meta
new file mode 100644
index 0000000..b44e18f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/AVProVideoPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 22ab3ed79468e454fb4d81f6d449b193
+timeCreated: 1495729169
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal.meta
new file mode 100644
index 0000000..1181181
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: a68611aad62c44efebd86c1318f2d3e4
+folderAsset: yes
+timeCreated: 1493967530
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal/AVProVideoActionBase.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal/AVProVideoActionBase.cs
new file mode 100644
index 0000000..36041fe
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal/AVProVideoActionBase.cs
@@ -0,0 +1,49 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+
+using HutongGames.PlayMaker;
+using HutongGames.PlayMaker.Actions;
+using Tooltip = HutongGames.PlayMaker.TooltipAttribute;
+
+using RenderHeads.Media.AVProVideo;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ public class AVProVideoActionHeader
+ {
+
+ }
+
+ ///
+ /// AVProVideo action base.
+ /// Gets and Caches MediaPlayer for perfs and code reuse
+ ///
+ public abstract class AVProVideoActionBase : FsmStateAction
+ {
+ protected GameObject cachedGameObject;
+
+ protected MediaPlayer mediaPlayer;
+
+ protected bool UpdateCache(GameObject go)
+ {
+ if (go == null)
+ {
+ return false;
+ }
+
+ if (mediaPlayer == null || cachedGameObject != go)
+ {
+ mediaPlayer = go.GetComponent();
+ cachedGameObject = go;
+ }
+
+ return mediaPlayer != null;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal/AVProVideoActionBase.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal/AVProVideoActionBase.cs.meta
new file mode 100644
index 0000000..48ece26
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Actions/Internal/AVProVideoActionBase.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 26061aaf4d9de48eabaacb0e6f46de11
+timeCreated: 1493967542
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor.meta
new file mode 100644
index 0000000..eac2b05
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 8fd62e7c161a3244c884a26dd4545b9c
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor/AVProVideoActionHeaderPropertyDrawer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor/AVProVideoActionHeaderPropertyDrawer.cs
new file mode 100644
index 0000000..2ffcaf0
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor/AVProVideoActionHeaderPropertyDrawer.cs
@@ -0,0 +1,79 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if PLAYMAKER
+
+using UnityEngine;
+using HutongGames.PlayMakerEditor;
+
+namespace RenderHeads.Media.AVProVideo.PlayMaker.Actions
+{
+ ///
+ /// Draws the AVPro Video logo above each PlayMaker action
+ ///
+ [PropertyDrawer(typeof(AVProVideoActionHeader))]
+ public class AVProVideoActionHeaderPropertyDrawer : PropertyDrawer
+ {
+ private Rect _rect;
+
+ public override object OnGUI(GUIContent label, object obj, bool isSceneObject, params object[] attributes)
+ {
+ // always keep this enabled to avoid transparency artifact ( unless someone tells me how to style up GUIStyle for disable state)
+ bool _enabled = GUI.enabled;
+ GUI.enabled = true;
+
+ _rect = GUILayoutUtility.GetLastRect();
+ GUIDrawRect(_rect, Color.black);
+
+ _rect.Set(_rect.x,_rect.y+1,_rect.width,_rect.height-2);
+ if (HeaderTexture != null)
+ {
+ GUI.DrawTexture(_rect, HeaderTexture, ScaleMode.ScaleToFit);
+ }
+
+ GUI.enabled = _enabled;
+
+ return null;
+ }
+
+ private static Texture2D _headerTexture = null;
+ internal static Texture2D HeaderTexture
+ {
+ get
+ {
+ if (_headerTexture == null)
+ _headerTexture = Resources.Load("AVProVideoIcon");
+ if (_headerTexture != null)
+ _headerTexture.hideFlags = HideFlags.DontSaveInEditor;
+ return _headerTexture;
+ }
+ }
+
+ private static Texture2D _staticRectTexture;
+ private static GUIStyle _staticRectStyle;
+
+ // Note that this function is only meant to be called from OnGUI() functions.
+ public static void GUIDrawRect(Rect position, Color color)
+ {
+ if (_staticRectTexture == null)
+ {
+ _staticRectTexture = new Texture2D(1, 1);
+ }
+
+ if (_staticRectStyle == null)
+ {
+ _staticRectStyle = new GUIStyle();
+ }
+
+ _staticRectTexture.SetPixel(0, 0, color);
+ _staticRectTexture.Apply();
+
+ _staticRectStyle.normal.background = _staticRectTexture;
+
+ GUI.Box(position, GUIContent.none, _staticRectStyle);
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor/AVProVideoActionHeaderPropertyDrawer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor/AVProVideoActionHeaderPropertyDrawer.cs.meta
new file mode 100644
index 0000000..6ab76ea
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/Support/PlayMaker/Editor/AVProVideoActionHeaderPropertyDrawer.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e6c8e0ab6139dc34093af8219078a671
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/UpdateStereoMaterial.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/UpdateStereoMaterial.cs
new file mode 100644
index 0000000..15b6787
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/UpdateStereoMaterial.cs
@@ -0,0 +1,112 @@
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0)
+ #define UNITY_HELPATTRIB
+#endif
+
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// This script is needed to send the camera position to the stereo shader so that
+ /// it can determine which eye it is rendering. In the future this script won't
+ /// be needed once we have support for single-pass stereo rendering.
+ ///
+ [AddComponentMenu("AVPro Video/Update Stereo Material", 400)]
+#if UNITY_HELPATTRIB
+ [HelpURL("http://renderheads.com/product/avpro-video/")]
+#endif
+ public class UpdateStereoMaterial : MonoBehaviour
+ {
+ [Header("Stereo camera")]
+ public Camera _camera;
+
+ [Header("Rendering elements")]
+ public MeshRenderer _renderer;
+ public UnityEngine.UI.Graphic _uGuiComponent;
+ public Material _material;
+
+ [SerializeField]
+ private StereoEye _forceEyeMode;
+
+ private static int _cameraPositionId;
+ private static int _viewMatrixId;
+ private StereoEye _setForceEyeMode = StereoEye.Both;
+ public StereoEye ForceEyeMode { get { return _forceEyeMode; } set { _forceEyeMode = value; } }
+
+ private Camera _foundCamera;
+
+ void Awake()
+ {
+ if (_cameraPositionId == 0)
+ {
+ _cameraPositionId = Shader.PropertyToID("_cameraPosition");
+ }
+ if (_viewMatrixId == 0)
+ {
+ _viewMatrixId = Shader.PropertyToID("_ViewMatrix");
+ }
+ if (_camera == null)
+ {
+ Debug.LogWarning("[AVProVideo] No camera set for UpdateStereoMaterial component. If you are rendering in stereo then it is recommended to set this.");
+ }
+ }
+
+ private void SetupMaterial(Material m, Camera camera)
+ {
+ m.SetVector(_cameraPositionId, camera.transform.position);
+ m.SetMatrix(_viewMatrixId, camera.worldToCameraMatrix.transpose);
+ if (_forceEyeMode != _setForceEyeMode)
+ {
+ Helper.SetupStereoEyeModeMaterial(m, _forceEyeMode);
+ _setForceEyeMode = _forceEyeMode;
+ }
+ }
+
+ // We do a LateUpdate() to allow for any changes in the camera position that may have happened in Update()
+ private void LateUpdate()
+ {
+ if (_camera != null && _foundCamera != _camera)
+ {
+ _foundCamera = _camera;
+ }
+ if (_foundCamera == null)
+ {
+ _foundCamera = Camera.main;
+ if (_foundCamera == null)
+ {
+ Debug.LogWarning("[AVPro Video] Cannot find main camera for UpdateStereoMaterial, this can lead to eyes flickering");
+ if (Camera.allCameras.Length > 0)
+ {
+ _foundCamera = Camera.allCameras[0];
+ Debug.LogWarning("[AVPro Video] UpdateStereoMaterial using camera " + _foundCamera.name);
+ }
+ }
+ }
+
+ if (_renderer == null && _material == null)
+ {
+ _renderer = this.gameObject.GetComponent();
+ }
+
+ if (_foundCamera != null)
+ {
+ if (_renderer != null)
+ {
+ SetupMaterial(_renderer.material, _foundCamera);
+ }
+ if (_material != null)
+ {
+ SetupMaterial(_material, _foundCamera);
+ }
+ if (_uGuiComponent != null)
+ {
+ SetupMaterial(_uGuiComponent.material, _foundCamera);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/UpdateStereoMaterial.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/UpdateStereoMaterial.cs.meta
new file mode 100644
index 0000000..9a3ad13
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Components/UpdateStereoMaterial.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 4ed685e8c5f1f584aa28b32dcf9bdab1
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {fileID: 2800000, guid: bb83b41b53a59874692b83eab5873998, type: 3}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor.meta
new file mode 100644
index 0000000..2f7c69a
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 37a82bdb47c2a6f4cad5a64014975955
+folderAsset: yes
+timeCreated: 1438707297
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/ApplyToMeshEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/ApplyToMeshEditor.cs
new file mode 100644
index 0000000..3db083e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/ApplyToMeshEditor.cs
@@ -0,0 +1,102 @@
+using UnityEngine;
+using UnityEditor;
+using System.Collections.Generic;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// Editor for the ApplyToMesh component
+ ///
+ [CanEditMultipleObjects]
+ [CustomEditor(typeof(ApplyToMesh))]
+ public class ApplyToMeshEditor : UnityEditor.Editor
+ {
+ private static readonly GUIContent _guiTextTextureProperty = new GUIContent("Texture Property");
+
+ private SerializedProperty _propTextureOffset;
+ private SerializedProperty _propTextureScale;
+ private SerializedProperty _propMediaPlayer;
+ private SerializedProperty _propRenderer;
+ private SerializedProperty _propTexturePropertyName;
+ private SerializedProperty _propDefaultTexture;
+ private GUIContent[] _materialTextureProperties = new GUIContent[0];
+
+ void OnEnable()
+ {
+ _propTextureOffset = serializedObject.FindProperty("_offset");
+ _propTextureScale = serializedObject.FindProperty("_scale");
+ _propMediaPlayer = serializedObject.FindProperty("_media");
+ _propRenderer = serializedObject.FindProperty("_mesh");
+ _propTexturePropertyName = serializedObject.FindProperty("_texturePropertyName");
+ _propDefaultTexture = serializedObject.FindProperty("_defaultTexture");
+ }
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+
+ if (_propRenderer == null)
+ {
+ return;
+ }
+
+ EditorGUILayout.PropertyField(_propMediaPlayer);
+ EditorGUILayout.PropertyField(_propDefaultTexture);
+ EditorGUILayout.PropertyField(_propRenderer);
+
+ bool hasKeywords = false;
+ int texturePropertyIndex = 0;
+ if (_propRenderer.objectReferenceValue != null)
+ {
+ Renderer r = (Renderer)(_propRenderer.objectReferenceValue);
+
+ Material[] materials = r.sharedMaterials;
+
+ MaterialProperty[] matProps = MaterialEditor.GetMaterialProperties(materials);
+
+ foreach (Material mat in materials)
+ {
+ if (mat.shaderKeywords.Length > 0)
+ {
+ hasKeywords = true;
+ break;
+ }
+ }
+
+ List items = new List(8);
+ foreach (MaterialProperty matProp in matProps)
+ {
+ if (matProp.type == MaterialProperty.PropType.Texture)
+ {
+ if (matProp.name == _propTexturePropertyName.stringValue)
+ {
+ texturePropertyIndex = items.Count;
+ }
+ items.Add(new GUIContent(matProp.name));
+ }
+ }
+ _materialTextureProperties = items.ToArray();
+ }
+
+ int newTexturePropertyIndex = EditorGUILayout.Popup(_guiTextTextureProperty, texturePropertyIndex, _materialTextureProperties);
+ if (newTexturePropertyIndex != texturePropertyIndex)
+ {
+ _propTexturePropertyName.stringValue = _materialTextureProperties[newTexturePropertyIndex].text;
+ }
+
+ if (hasKeywords && _propTexturePropertyName.stringValue != "_MainTex")
+ {
+ EditorGUILayout.HelpBox("When using an uber shader you may need to enable the keywords on a material for certain texture slots to take effect. You can sometimes achieve this (eg with Standard shader) by putting a dummy texture into the texture slot.", MessageType.Info);
+ }
+
+ EditorGUILayout.PropertyField(_propTextureOffset);
+ EditorGUILayout.PropertyField(_propTextureScale);
+
+ serializedObject.ApplyModifiedProperties();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/ApplyToMeshEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/ApplyToMeshEditor.cs.meta
new file mode 100644
index 0000000..62838bc
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/ApplyToMeshEditor.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 114ac842bfcaf0745a5e45cb2a7d6559
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/AudioOutputEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/AudioOutputEditor.cs
new file mode 100644
index 0000000..2be2beb
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/AudioOutputEditor.cs
@@ -0,0 +1,59 @@
+using UnityEditor;
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// Editor for the AudioOutput component
+ ///
+ [CanEditMultipleObjects]
+ [CustomEditor(typeof(AudioOutput))]
+ public class AudioOutputEditor : UnityEditor.Editor
+ {
+ private static readonly GUIContent _guiTextChannel = new GUIContent("Channel");
+ private static readonly GUIContent _guiTextChannels = new GUIContent("Channels");
+ private static readonly string[] _channelMaskOptions = { "1", "2", "3", "4", "5", "6", "7", "8" };
+
+ private AudioOutput _target;
+ private SerializedProperty _channelMaskProperty;
+
+ void OnEnable()
+ {
+ _target = (this.target) as AudioOutput;
+ _channelMaskProperty = serializedObject.FindProperty("_channelMask");
+ }
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+
+ DrawDefaultInspector();
+
+ if(_target._audioOutputMode == AudioOutput.AudioOutputMode.Multiple)
+ {
+ _channelMaskProperty.intValue = EditorGUILayout.MaskField(_guiTextChannels, _channelMaskProperty.intValue, _channelMaskOptions);
+ }
+ else
+ {
+ int prevVal = 0;
+ for(int i = 0; i < 8; ++i)
+ {
+ if((_channelMaskProperty.intValue & (1 << i)) > 0)
+ {
+ prevVal = i;
+ break;
+ }
+ }
+
+ int newVal = Mathf.Clamp(EditorGUILayout.IntSlider(_guiTextChannel, prevVal, 0, 7), 0, 7);
+ _channelMaskProperty.intValue = 1 << newVal;
+ }
+
+ serializedObject.ApplyModifiedProperties();
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/AudioOutputEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/AudioOutputEditor.cs.meta
new file mode 100644
index 0000000..8c87243
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/AudioOutputEditor.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f7852924144fc064aad785e5985b5402
+timeCreated: 1495783665
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/DisplayUGUIEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/DisplayUGUIEditor.cs
new file mode 100644
index 0000000..b57a15f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/DisplayUGUIEditor.cs
@@ -0,0 +1,170 @@
+#if UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_5 || UNITY_5_4_OR_NEWER
+ #define UNITY_FEATURE_UGUI
+#endif
+
+using UnityEngine;
+using UnityEditor;
+#if UNITY_FEATURE_UGUI
+using UnityEditor.UI;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// Editor for the DisplayUGUI component
+ ///
+ [CustomEditor(typeof(DisplayUGUI), true)]
+ [CanEditMultipleObjects]
+ public class DisplayUGUIEditor : GraphicEditor
+ {
+ // Note we have precedence for calling rectangle for just rect, even in the Inspector.
+ // For example in the Camera component's Viewport Rect.
+ // Hence sticking with Rect here to be consistent with corresponding property in the API.
+ private static readonly GUIContent m_guiTextUVRectContent = new GUIContent("UV Rect");
+
+ private SerializedProperty m_Movie;
+ private SerializedProperty m_UVRect;
+ private SerializedProperty m_DefaultTexture;
+ private SerializedProperty m_NoDefaultDisplay;
+ private SerializedProperty m_DisplayInEditor;
+ private SerializedProperty m_SetNativeSize;
+ private SerializedProperty m_ScaleMode;
+
+ [MenuItem("GameObject/UI/AVPro Video uGUI", false, 0)]
+ public static void CreateGameObject()
+ {
+ GameObject parent = Selection.activeGameObject;
+ RectTransform parentCanvasRenderer = ( parent != null ) ? parent.GetComponent() : null;
+ if( parentCanvasRenderer )
+ {
+ GameObject go = new GameObject("AVPro Video");
+ go.transform.SetParent(parent.transform, false);
+ go.AddComponent();
+ go.AddComponent();
+ go.AddComponent();
+ Selection.activeGameObject = go;
+ }
+ else
+ {
+ EditorUtility.DisplayDialog("AVPro Video", "You must make the AVPro Video uGUI object as a child of a Canvas.", "Ok");
+ }
+ }
+
+ public override bool RequiresConstantRepaint()
+ {
+ DisplayUGUI displayComponent = target as DisplayUGUI;
+ return (displayComponent != null && displayComponent.HasValidTexture());
+ }
+
+ protected override void OnEnable()
+ {
+ base.OnEnable();
+
+ m_Movie = serializedObject.FindProperty("_mediaPlayer");
+ m_UVRect = serializedObject.FindProperty("m_UVRect");
+ m_SetNativeSize = serializedObject.FindProperty("_setNativeSize");
+ m_ScaleMode = serializedObject.FindProperty("_scaleMode");
+
+ m_NoDefaultDisplay = serializedObject.FindProperty("_noDefaultDisplay");
+ m_DisplayInEditor = serializedObject.FindProperty("_displayInEditor");
+ m_DefaultTexture = serializedObject.FindProperty("_defaultTexture");
+
+ SetShowNativeSize(true);
+ }
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+
+ EditorGUILayout.PropertyField(m_Movie);
+ EditorGUILayout.PropertyField(m_DefaultTexture);
+ EditorGUILayout.PropertyField(m_NoDefaultDisplay);
+ EditorGUILayout.PropertyField(m_DisplayInEditor);
+ AppearanceControlsGUI();
+#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4_OR_NEWER
+ RaycastControlsGUI();
+#endif
+ EditorGUILayout.PropertyField(m_UVRect, m_guiTextUVRectContent);
+
+ EditorGUILayout.PropertyField(m_SetNativeSize);
+ EditorGUILayout.PropertyField(m_ScaleMode);
+
+ SetShowNativeSize(false);
+ NativeSizeButtonGUI();
+
+ serializedObject.ApplyModifiedProperties();
+ }
+
+ private void SetShowNativeSize(bool instant)
+ {
+ base.SetShowNativeSize(m_Movie.objectReferenceValue != null, instant);
+ }
+
+ ///
+ /// Allow the texture to be previewed.
+ ///
+ public override bool HasPreviewGUI()
+ {
+ DisplayUGUI rawImage = target as DisplayUGUI;
+ return rawImage != null;
+ }
+
+ ///
+ /// Draw the Image preview.
+ ///
+ public override void OnPreviewGUI(Rect drawArea, GUIStyle background)
+ {
+ DisplayUGUI rawImage = target as DisplayUGUI;
+ Texture tex = rawImage.mainTexture;
+
+ if (tex == null)
+ return;
+
+ // Create the texture rectangle that is centered inside rect.
+ Rect outerRect = drawArea;
+
+ Matrix4x4 m = GUI.matrix;
+ // Flip the image vertically
+ if (rawImage.HasValidTexture())
+ {
+ if (rawImage._mediaPlayer.TextureProducer.RequiresVerticalFlip())
+ {
+ GUIUtility.ScaleAroundPivot(new Vector2(1f, -1f), new Vector2(0, outerRect.y + (outerRect.height / 2f)));
+ }
+ }
+
+ EditorGUI.DrawTextureTransparent(outerRect, tex, ScaleMode.ScaleToFit);//, outer.width / outer.height);
+ //SpriteDrawUtility.DrawSprite(tex, rect, outer, rawImage.uvRect, rawImage.canvasRenderer.GetColor());
+
+ GUI.matrix = m;
+ }
+
+ ///
+ /// Info String drawn at the bottom of the Preview
+ ///
+ public override string GetInfoString()
+ {
+ DisplayUGUI rawImage = target as DisplayUGUI;
+
+ string text = string.Empty;
+ if (rawImage.HasValidTexture())
+ {
+ text += string.Format("Video Size: {0}x{1}\n",
+ Mathf.RoundToInt(Mathf.Abs(rawImage.mainTexture.width)),
+ Mathf.RoundToInt(Mathf.Abs(rawImage.mainTexture.height)));
+ }
+
+ // Image size Text
+ text += string.Format("Display Size: {0}x{1}",
+ Mathf.RoundToInt(Mathf.Abs(rawImage.rectTransform.rect.width)),
+ Mathf.RoundToInt(Mathf.Abs(rawImage.rectTransform.rect.height)));
+
+ return text;
+ }
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/DisplayUGUIEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/DisplayUGUIEditor.cs.meta
new file mode 100644
index 0000000..46439c5
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/DisplayUGUIEditor.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0e20933bfdb909544b98bc0de2926c4c
+timeCreated: 1438726873
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/MediaPlayerEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/MediaPlayerEditor.cs
new file mode 100644
index 0000000..b8e189c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/MediaPlayerEditor.cs
@@ -0,0 +1,2874 @@
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3_0)
+ #define AVPRO_UNITY_PLATFORM_TVOS
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2_0)
+ #define AVPRO_UNITY_IOS_ALLOWHTTPDOWNLOAD
+#endif
+#if !UNITY_5 && !UNITY_5_4_OR_NEWER
+ #define AVPRO_UNITY_METRO
+#endif
+#if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3_0)
+ #define AVPRO_UNITY_WP8_DEPRECATED
+#endif
+using UnityEngine;
+using UnityEditor;
+using System.Collections.Generic;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// Editor for the MediaPlayer component
+ ///
+ [CanEditMultipleObjects]
+ [CustomEditor(typeof(MediaPlayer))]
+ public class MediaPlayerEditor : UnityEditor.Editor
+ {
+ private SerializedProperty _propLocation;
+ private SerializedProperty _propPath;
+ private SerializedProperty _propAutoOpen;
+ private SerializedProperty _propAutoStart;
+ private SerializedProperty _propLoop;
+ private SerializedProperty _propRate;
+ private SerializedProperty _propVolume;
+ private SerializedProperty _propBalance;
+ private SerializedProperty _propMuted;
+ private SerializedProperty _propPersistent;
+ private SerializedProperty _propEvents;
+ private SerializedProperty _propEventMask;
+ private SerializedProperty _propPauseMediaOnAppPause;
+ private SerializedProperty _propPlayMediaOnAppUnpause;
+ private SerializedProperty _propFilter;
+ private SerializedProperty _propWrap;
+ private SerializedProperty _propAniso;
+ private SerializedProperty _propStereoPacking;
+ private SerializedProperty _propAlphaPacking;
+ private SerializedProperty _propDisplayStereoTint;
+ private SerializedProperty _propSubtitles;
+ private SerializedProperty _propSubtitleLocation;
+ private SerializedProperty _propSubtitlePath;
+ private SerializedProperty _propResample;
+ private SerializedProperty _propResampleMode;
+ private SerializedProperty _propResampleBufferSize;
+ private SerializedProperty _propAudioHeadTransform;
+ private SerializedProperty _propAudioEnableFocus;
+ private SerializedProperty _propAudioFocusOffLevelDB;
+ private SerializedProperty _propAudioFocusWidthDegrees;
+ private SerializedProperty _propAudioFocusTransform;
+ private SerializedProperty _propSourceAudioSampleRate;
+ private SerializedProperty _propSourceAudioChannels;
+ private SerializedProperty _propManualSetAudioProps;
+ private SerializedProperty _propVideoMapping;
+ private SerializedProperty _propForceFileFormat;
+
+ private static bool _isTrialVersion = false;
+ private static Texture2D _icon;
+ private static int _platformIndex = -1;
+ private static bool _expandPlatformOverrides = false;
+ private static bool _expandMediaProperties = false;
+ private static bool _expandGlobalSettings = false;
+ private static bool _expandMain = true;
+ private static bool _expandAudio = false;
+ private static bool _expandEvents = false;
+ private static bool _expandPreview = false;
+ private static bool _expandAbout = false;
+ private static bool _expandSubtitles = false;
+ private static List _recentFiles = new List(16);
+
+ private static GUIStyle _mediaNameStyle = null;
+ private static GUIStyle _sectionBoxStyle = null;
+
+ private static bool _showMessage_UpdatStereoMaterial = false;
+
+ private const string SettingsPrefix = "AVProVideo-MediaPlayerEditor-";
+ private const int MaxRecentFiles = 16;
+
+#if UNITY_EDITOR_OSX
+ private const string MediaExtensions = "mp4,m4v,mov,avi,mp3,m4a,aac,ac3,au,aiff,wav";
+ private const string SubtitleExtensions = "srt";
+#else
+ private const string MediaExtensions = "Media Files;*.mp4;*.mov;*.m4v;*.avi;*.mkv;*.ts;*.webm;*.flv;*.vob;*.ogg;*.ogv;*.mpg;*.wmv;*.3gp;Audio Files;*wav;*.mp3;*.mp2;*.m4a;*.wma;*.aac;*.au;*.flac";
+ private const string SubtitleExtensions = "Subtitle Files;*.srt";
+#endif
+
+ public const string LinkPluginWebsite = "http://renderheads.com/product/avpro-video/";
+ public const string LinkForumPage = "http://forum.unity3d.com/threads/released-avpro-video-complete-video-playback-solution.385611/";
+ public const string LinkForumLastPage = "http://forum.unity3d.com/threads/released-avpro-video-complete-video-playback-solution.385611/page-60";
+ public const string LinkAssetStorePage = "https://www.assetstore.unity3d.com/#!/content/56355";
+ public const string LinkEmailSupport = "mailto:unitysupport@renderheads.com";
+ public const string LinkUserManual = "http://downloads.renderheads.com/docs/UnityAVProVideo.pdf";
+ public const string LinkScriptingClassReference = "http://www.renderheads.com/content/docs/AVProVideoClassReference/";
+
+ private const string SupportMessage = "If you are reporting a bug, please include any relevant files and details so that we may remedy the problem as fast as possible.\n\n" +
+ "Essential details:\n" +
+ "+ Error message\n" +
+ " + The exact error message\n" +
+ " + The console/output log if possible\n" +
+ "+ Hardware\n" +
+ " + Phone / tablet / device type and OS version\n" +
+ "+ Development environment\n" +
+ " + Unity version\n" +
+ " + Development OS version\n" +
+ " + AVPro Video plugin version\n" +
+ " + Video details\n" +
+ " + Resolution\n" +
+ " + Codec\n" +
+ " + Frame Rate\n" +
+ " + Better still, include a link to the video file\n";
+
+ private static bool _showAlpha = false;
+ private static string[] _platformNames;
+
+ [MenuItem("GameObject/AVPro Video/Media Player", false, 0)]
+ public static void CreateMediaPlayerEditor()
+ {
+ GameObject go = new GameObject("MediaPlayer");
+ go.AddComponent();
+ Selection.activeGameObject = go;
+ }
+
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ [MenuItem("GameObject/AVPro Video/Media Player with Unity Audio", false, 0)]
+ public static void CreateMediaPlayerWithUnityAudioEditor()
+ {
+ GameObject go = new GameObject("MediaPlayer");
+ go.AddComponent();
+ go.AddComponent();
+ AudioOutput ao = go.AddComponent();
+ // Move the AudioOutput component above the AudioSource so that it acts as the audio generator
+ UnityEditorInternal.ComponentUtility.MoveComponentUp(ao);
+ Selection.activeGameObject = go;
+ }
+#endif
+
+ private static void LoadSettings()
+ {
+ _expandPlatformOverrides = EditorPrefs.GetBool(SettingsPrefix + "ExpandPlatformOverrides", false);
+ _expandMediaProperties = EditorPrefs.GetBool(SettingsPrefix + "ExpandMediaProperties", false);
+ _expandGlobalSettings = EditorPrefs.GetBool(SettingsPrefix + "ExpandGlobalSettings", false);
+ _expandMain = EditorPrefs.GetBool(SettingsPrefix + "ExpandMain", true);
+ _expandAudio = EditorPrefs.GetBool(SettingsPrefix + "ExpandAudio", false);
+ _expandEvents = EditorPrefs.GetBool(SettingsPrefix + "ExpandEvents", false);
+ _expandPreview = EditorPrefs.GetBool(SettingsPrefix + "ExpandPreview", false);
+ _expandSubtitles = EditorPrefs.GetBool(SettingsPrefix + "ExpandSubtitles", false);
+ _platformIndex = EditorPrefs.GetInt(SettingsPrefix + "PlatformIndex", -1);
+ _showAlpha = EditorPrefs.GetBool(SettingsPrefix + "ShowAlphaChannel", false);
+
+ string recentFilesString = EditorPrefs.GetString(SettingsPrefix + "RecentFiles", string.Empty);
+ _recentFiles = new List(recentFilesString.Split(new string[] { ";" }, System.StringSplitOptions.RemoveEmptyEntries));
+ }
+
+ private static void SaveSettings()
+ {
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandPlatformOverrides", _expandPlatformOverrides);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandMediaProperties", _expandMediaProperties);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandGlobalSettings", _expandGlobalSettings);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandMain", _expandMain);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandAudio", _expandAudio);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandEvents", _expandEvents);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandPreview", _expandPreview);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandSubtitles", _expandSubtitles);
+ EditorPrefs.SetInt(SettingsPrefix + "PlatformIndex", _platformIndex);
+ EditorPrefs.SetBool(SettingsPrefix + "ShowAlphaChannel", _showAlpha);
+
+ string recentFilesString = string.Empty;
+ if (_recentFiles.Count > 0)
+ {
+ recentFilesString = string.Join(";", _recentFiles.ToArray());
+ }
+ EditorPrefs.SetString(SettingsPrefix + "RecentFiles", recentFilesString);
+ }
+
+ private static bool IsTrialVersion()
+ {
+ string version = GetPluginVersion();
+ return version.Contains("t");
+ }
+
+ private void OnEnable()
+ {
+ LoadSettings();
+
+ _isTrialVersion = IsTrialVersion();
+ _platformNames = Helper.GetPlatformNames();
+
+ _propLocation = serializedObject.FindProperty("m_VideoLocation");
+ _propPath = serializedObject.FindProperty("m_VideoPath");
+ _propAutoOpen = serializedObject.FindProperty("m_AutoOpen");
+ _propAutoStart = serializedObject.FindProperty("m_AutoStart");
+ _propLoop = serializedObject.FindProperty("m_Loop");
+ _propRate = serializedObject.FindProperty("m_PlaybackRate");
+ _propVolume = serializedObject.FindProperty("m_Volume");
+ _propBalance = serializedObject.FindProperty("m_Balance");
+ _propMuted = serializedObject.FindProperty("m_Muted");
+ _propPersistent = serializedObject.FindProperty("m_Persistent");
+ _propEvents = serializedObject.FindProperty("m_events");
+ _propEventMask = serializedObject.FindProperty("m_eventMask");
+ _propPauseMediaOnAppPause = serializedObject.FindProperty("_pauseMediaOnAppPause");
+ _propPlayMediaOnAppUnpause = serializedObject.FindProperty("_playMediaOnAppUnpause");
+ _propFilter = serializedObject.FindProperty("m_FilterMode");
+ _propWrap = serializedObject.FindProperty("m_WrapMode");
+ _propAniso = serializedObject.FindProperty("m_AnisoLevel");
+ _propStereoPacking = serializedObject.FindProperty("m_StereoPacking");
+ _propAlphaPacking = serializedObject.FindProperty("m_AlphaPacking");
+ _propDisplayStereoTint = serializedObject.FindProperty("m_DisplayDebugStereoColorTint");
+ _propVideoMapping = serializedObject.FindProperty("m_videoMapping");
+ _propForceFileFormat = serializedObject.FindProperty("m_forceFileFormat");
+
+ _propSubtitles = serializedObject.FindProperty("m_LoadSubtitles");
+ _propSubtitleLocation = serializedObject.FindProperty("m_SubtitleLocation");
+ _propSubtitlePath = serializedObject.FindProperty("m_SubtitlePath");
+ _propResample = serializedObject.FindProperty("m_Resample");
+ _propResampleMode = serializedObject.FindProperty("m_ResampleMode");
+ _propResampleBufferSize = serializedObject.FindProperty("m_ResampleBufferSize");
+ _propAudioHeadTransform = serializedObject.FindProperty("m_AudioHeadTransform");
+ _propAudioEnableFocus = serializedObject.FindProperty("m_AudioFocusEnabled");
+ _propAudioFocusOffLevelDB = serializedObject.FindProperty("m_AudioFocusOffLevelDB");
+ _propAudioFocusWidthDegrees = serializedObject.FindProperty("m_AudioFocusWidthDegrees");
+ _propAudioFocusTransform = serializedObject.FindProperty("m_AudioFocusTransform");
+ _propSourceAudioSampleRate = serializedObject.FindProperty("m_sourceSampleRate");
+ _propSourceAudioChannels = serializedObject.FindProperty("m_sourceChannels");
+ _propManualSetAudioProps = serializedObject.FindProperty("m_manuallySetAudioSourceProperties");
+
+ CheckStereoPackingField();
+ }
+
+ private void OnDisable()
+ {
+ SaveSettings();
+ }
+
+ private static bool IsPathWithin(string fullPath, string targetPath)
+ {
+ return fullPath.StartsWith(targetPath);
+ }
+
+ private static string GetPathRelativeTo(string root, string fullPath)
+ {
+ string result = fullPath.Remove(0, root.Length);
+ if (result.StartsWith(System.IO.Path.DirectorySeparatorChar.ToString()) || result.StartsWith(System.IO.Path.AltDirectorySeparatorChar.ToString()))
+ {
+ result = result.Remove(0, 1);
+ }
+ return result;
+ }
+
+ public override bool RequiresConstantRepaint()
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+ return (_expandPreview && media != null && media.Control != null && media.isActiveAndEnabled);
+ }
+
+ public override void OnInspectorGUI()
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ serializedObject.Update();
+
+ if (media == null || _propLocation == null)
+ {
+ return;
+ }
+
+ if (_sectionBoxStyle == null)
+ {
+ _sectionBoxStyle = new GUIStyle(GUI.skin.box);
+ _sectionBoxStyle.padding.top = 0;
+ _sectionBoxStyle.padding.bottom = 0;
+ }
+
+
+ GUILayout.Space(6f);
+
+ _icon = GetIcon(_icon);
+ if (_icon != null)
+ {
+ GUI.backgroundColor = new Color(0.96f, 0.25f, 0.47f);
+ if (GUILayout.Button("â—„ AVPro Video â–º\nHelp & Support"))
+ {
+ SupportWindow.Init();
+ }
+ GUI.backgroundColor = Color.white;
+ }
+
+ // Describe the watermark for trial version
+ if (_isTrialVersion && Application.isPlaying)
+ {
+ string message = string.Empty;
+#if UNITY_EDITOR_WIN
+ message = "The watermark is the horizontal bar that moves vertically and the small 'AVPRO TRIAL' text.";
+ if (media.Info != null && media.Info.GetPlayerDescription().Contains("MF-MediaEngine-Hardware"))
+ {
+ message = "The watermark is the RenderHeads logo that moves around the image.";
+ }
+#elif UNITY_EDITOR_OSX
+ message = "The RenderHeads logo is the watermark.";
+#endif
+
+ GUI.backgroundColor = Color.yellow;
+ EditorGUILayout.BeginVertical(GUI.skin.box);
+ GUI.color = Color.yellow;
+ GUILayout.Label("AVPRO VIDEO - TRIAL WATERMARK", EditorStyles.boldLabel);
+ GUI.color = Color.white;
+ GUILayout.Label(message, EditorStyles.wordWrappedLabel);
+ EditorGUILayout.EndVertical();
+ GUI.backgroundColor = Color.white;
+ GUI.color = Color.white;
+ }
+
+ // Warning about not using multi-threaded rendering
+ {
+ bool showWarningMT = false;
+
+ if (/*EditorUserBuildSettings.selectedBuildTargetGroup == BuildTargetGroup.iOS ||
+#if AVPRO_UNITY_PLATFORM_TVOS
+ EditorUserBuildSettings.selectedBuildTargetGroup == BuildTargetGroup.tvOS ||
+#endif*/
+ EditorUserBuildSettings.selectedBuildTargetGroup == BuildTargetGroup.Android)
+ {
+#if UNITY_2017_2_OR_NEWER
+ showWarningMT = !UnityEditor.PlayerSettings.GetMobileMTRendering(BuildTargetGroup.Android);
+#else
+ showWarningMT = !UnityEditor.PlayerSettings.mobileMTRendering;
+#endif
+ }
+ /*if (EditorUserBuildSettings.selectedBuildTargetGroup == BuildTargetGroup.WSA)
+ {
+ }*/
+ if (showWarningMT)
+ {
+ GUI.backgroundColor = Color.yellow;
+ EditorGUILayout.BeginVertical(GUI.skin.box);
+ GUI.color = Color.yellow;
+ GUILayout.Label("Performance Warning", EditorStyles.boldLabel);
+ GUI.color = Color.white;
+ GUILayout.Label("Deploying to Android with multi-threaded rendering disabled is not recommended. Enable multi-threaded rendering in the Player Settings > Other Settings panel.", EditorStyles.wordWrappedLabel);
+ EditorGUILayout.EndVertical();
+ GUI.backgroundColor = Color.white;
+ GUI.color = Color.white;
+ }
+ }
+
+ /*
+#if UNITY_WEBGL
+ // Warning about not using WebGL 2.0 or above
+ {
+ bool showWarningWebGL2 = false;
+ if (EditorUserBuildSettings.selectedBuildTargetGroup == BuildTargetGroup.WebGL)
+ {
+#if UNITY_2017_1_OR_NEWER
+ showWarningWebGL2 = UnityEditor.PlayerSettings.GetUseDefaultGraphicsAPIs(BuildTarget.WebGL);
+ if (!showWarningWebGL2)
+ {
+ UnityEngine.Rendering.GraphicsDeviceType[] devices = UnityEditor.PlayerSettings.GetGraphicsAPIs(BuildTarget.WebGL);
+ foreach (UnityEngine.Rendering.GraphicsDeviceType device in devices)
+ {
+ if (device != UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2)
+ {
+ showWarningWebGL2 = true;
+ break;
+ }
+ }
+ }
+#else
+ showWarningWebGL2 =
+#endif
+ }
+ if (showWarningWebGL2)
+ {
+ GUI.backgroundColor = Color.yellow;
+ EditorGUILayout.BeginVertical(GUI.skin.box);
+ GUI.color = Color.yellow;
+ GUILayout.Label("Compatibility Warning", EditorStyles.boldLabel);
+ GUI.color = Color.white;
+ GUILayout.Label("WebGL 2.0 is not supported. Please go to Player Settings > Other Settings > Auto Graphics API and remove WebGL 2.0 from the list. Only WebGL 1.0 is supported.", EditorStyles.wordWrappedLabel);
+ EditorGUILayout.EndVertical();
+ GUI.backgroundColor = Color.white;
+ GUI.color = Color.white;
+ }
+ }
+#endif*/
+
+ // Warning about linear colour space with GPU decoding
+ /*if (Application.isPlaying && media.Control != null)
+ {
+ if (QualitySettings.activeColorSpace == ColorSpace.Linear && media.Info.GetPlayerDescription().Contains("MF-MediaEngine-Hardware"))
+ {
+ GUI.backgroundColor = Color.magenta;
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("NOTE", EditorStyles.boldLabel);
+ GUILayout.Label("You're using the GPU video decoder with linear color-space set in Unity. This can cause videos to become washed out due to our GPU decoder path not supporting sRGB textures.\n\nThis can be fixed easily by:\n1) Switching back to Gamma colour space in Player Settings\n2) Disabling hardware decoding\n3) Adding 'col.rgb = pow(col.rgb, 2.2);' to any shader rendering the video texture.\n\nIf you're using the InsideSphere shader, make sure to tick 'Apply Gamma' on the material.", EditorStyles.wordWrappedLabel);
+ EditorGUILayout.EndVertical();
+ GUI.backgroundColor = Color.white;
+ }
+ }*/
+
+ /////////////////// FILE PATH
+
+ // Display the file name and buttons to load new files
+ {
+ EditorGUILayout.BeginVertical("box");
+
+ OnInspectorGUI_CopyableFilename(media.m_VideoPath);
+
+ EditorGUILayout.LabelField("Source Path", EditorStyles.boldLabel);
+
+ EditorGUILayout.PropertyField(_propLocation, GUIContent.none);
+
+ {
+ string oldPath = _propPath.stringValue;
+ string newPath = EditorGUILayout.TextField(string.Empty, _propPath.stringValue);
+ if (newPath != oldPath)
+ {
+ // Check for invalid characters
+ if (0 > newPath.IndexOfAny(System.IO.Path.GetInvalidPathChars()))
+ {
+ _propPath.stringValue = newPath.Replace("\\", "/");
+ EditorUtility.SetDirty(target);
+ }
+ }
+ }
+
+ //if (!Application.isPlaying)
+ {
+ GUILayout.BeginHorizontal();
+ OnInspectorGUI_RecentButton(_propPath, _propLocation);
+ OnInspectorGUI_StreamingAssetsButton(_propPath, _propLocation);
+ GUI.color = Color.green;
+ if (GUILayout.Button("BROWSE"))
+ {
+ string startFolder = GetStartFolder(_propPath.stringValue, (MediaPlayer.FileLocation)_propLocation.enumValueIndex);
+ string videoPath = media.m_VideoPath;
+ string fullPath = string.Empty;
+ MediaPlayer.FileLocation fileLocation = media.m_VideoLocation;
+ if (Browse(startFolder, ref videoPath, ref fileLocation, ref fullPath, MediaExtensions))
+ {
+ _propPath.stringValue = videoPath.Replace("\\", "/");
+ _propLocation.enumValueIndex = (int)fileLocation;
+ EditorUtility.SetDirty(target);
+
+ AddToRecentFiles(fullPath);
+ }
+ }
+ GUI.color = Color.white;
+ GUILayout.EndHorizontal();
+
+ ShowFileWarningMessages(_propPath.stringValue, (MediaPlayer.FileLocation)_propLocation.enumValueIndex, media.m_AutoOpen, Platform.Unknown);
+ GUI.color = Color.white;
+ }
+
+ if (Application.isPlaying)
+ {
+ if (GUILayout.Button("Load"))
+ {
+ media.OpenVideoFromFile(media.m_VideoLocation, media.m_VideoPath, media.m_AutoStart);
+ }
+ }
+
+ EditorGUILayout.EndVertical();
+ }
+
+ /////////////////// MAIN
+
+ OnInspectorGUI_Main();
+
+ /////////////////// AUDIO
+
+ OnInspectorGUI_Audio();
+
+ /////////////////// MEDIA PROPERTIES
+
+ if (!Application.isPlaying)
+ {
+ OnInspectorGUI_MediaProperties();
+ }
+
+ /////////////////// SUBTITLES
+
+ OnInspectorGUI_Subtitles();
+
+ /////////////////// GLOBAL SETTINGS
+
+ if (!Application.isPlaying)
+ {
+ OnInspectorGUI_GlobalSettings();
+ }
+
+ //////////////////// PREVIEW
+
+ OnInspectorGUI_Preview();
+
+ /////////////////// EVENTS
+
+ OnInspectorGUI_Events();
+
+ /////////////////// PLATFORM OVERRIDES
+
+ //if (!Application.isPlaying)
+ {
+ OnInspectorGUI_PlatformOverrides();
+ }
+
+ if (serializedObject.ApplyModifiedProperties())
+ {
+ EditorUtility.SetDirty(target);
+ }
+
+ if (!Application.isPlaying)
+ {
+ OnInspectorGUI_About();
+ }
+ }
+
+ struct RecentFileData
+ {
+ public RecentFileData(string path, SerializedProperty propPath, SerializedProperty propLocation, Object target)
+ {
+ this.path = path;
+ this.propPath = propPath;
+ this.propLocation = propLocation;
+ this.target = target;
+ }
+
+ public string path;
+ public SerializedProperty propPath;
+ public SerializedProperty propLocation;
+ public Object target;
+ }
+
+ private static void AddToRecentFiles(string path)
+ {
+ if (!_recentFiles.Contains(path))
+ {
+ _recentFiles.Insert(0, path);
+ if (_recentFiles.Count > MaxRecentFiles)
+ {
+ // Remove the oldest item from the list
+ _recentFiles.RemoveAt(_recentFiles.Count - 1);
+ }
+ }
+ else
+ {
+ // If it already contains the item, then move it to the top
+ _recentFiles.Remove(path);
+ _recentFiles.Insert(0, path);
+ }
+ }
+
+ void RecentMenuCallback_Select(object obj)
+ {
+ RecentFileData data = (RecentFileData)obj;
+
+ string videoPath = string.Empty;
+ MediaPlayer.FileLocation fileLocation = MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder;
+ GetRelativeLocationFromPath(data.path, ref videoPath, ref fileLocation);
+
+ // Move it to the top of the list
+ AddToRecentFiles(data.path);
+
+ data.propPath.stringValue = videoPath.Replace("\\", "/");
+ data.propLocation.enumValueIndex = (int)fileLocation;
+
+ serializedObject.ApplyModifiedProperties();
+ EditorUtility.SetDirty(data.target);
+ }
+
+ private void RecentMenuCallback_Clear()
+ {
+ _recentFiles.Clear();
+ }
+
+ private void RecentMenuCallback_ClearMissing()
+ {
+ if (_recentFiles != null && _recentFiles.Count > 0)
+ {
+ List newList = new List(_recentFiles.Count);
+ for (int i = 0; i < _recentFiles.Count; i++)
+ {
+ string path = _recentFiles[i];
+ if (System.IO.File.Exists(path))
+ {
+ newList.Add(path);
+ }
+ }
+ _recentFiles = newList;
+ }
+ }
+
+ private void RecentMenuCallback_Add()
+ {
+ // TODO: implement me
+ }
+
+ private void OnInspectorGUI_CopyableFilename(string path)
+ {
+ // Display the file name so it's easy to read and copy to the clipboard
+ if (!string.IsNullOrEmpty(path) && 0 > path.IndexOfAny(System.IO.Path.GetInvalidPathChars()))
+ {
+ // Some GUI hacks here because SelectableLabel wants to be double height and it doesn't want to be centered because it's an EditorGUILayout function...
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ GUI.color = Color.cyan;
+ }
+ string text = System.IO.Path.GetFileName(path);
+
+ if (_mediaNameStyle == null)
+ {
+ _mediaNameStyle = new GUIStyle(EditorStyles.wordWrappedLabel);
+ _mediaNameStyle.fontStyle = FontStyle.Bold;
+ _mediaNameStyle.stretchWidth = true;
+ _mediaNameStyle.stretchHeight = true;
+ _mediaNameStyle.alignment = TextAnchor.MiddleCenter;
+ _mediaNameStyle.margin.top = 8;
+ _mediaNameStyle.margin.bottom = 16;
+ }
+
+ float height = _mediaNameStyle.CalcHeight(new GUIContent(text), Screen.width)*1.5f;
+ EditorGUILayout.SelectableLabel(text, _mediaNameStyle, GUILayout.Height(height), GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(true));
+
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.white;
+ }
+ }
+
+ private void OnInspectorGUI_RecentButton(SerializedProperty propPath, SerializedProperty propLocation)
+ {
+ GUI.color = Color.white;
+
+ if (GUILayout.Button("RECENT", GUILayout.Width(60f)))
+ {
+ GenericMenu toolsMenu = new GenericMenu();
+ toolsMenu.AddDisabledItem(new GUIContent("Recent Files:"));
+
+ // TODO: allow current path to be added. Perhaps add it automatically when file is loaded?
+ /*if (!string.IsNullOrEmpty(propPath.stringValue))
+ {
+ string path = propPath.stringValue.Replace("/", ">").Replace("\\", ">");
+ toolsMenu.AddItem(new GUIContent("Add Current: " + path), false, RecentMenuCallback_Add);
+ }*/
+ toolsMenu.AddSeparator("");
+
+ int missingCount = 0;
+ for (int i = 0; i < _recentFiles.Count; i++)
+ {
+ string path = _recentFiles[i];
+ string itemName = path.Replace("/", ">").Replace("\\", ">");
+ if (System.IO.File.Exists(path))
+ {
+ toolsMenu.AddItem(new GUIContent(itemName), false, RecentMenuCallback_Select, new RecentFileData(path, propPath, propLocation, target));
+ }
+ else
+ {
+ toolsMenu.AddDisabledItem(new GUIContent(itemName));
+ missingCount++;
+ }
+ }
+ if (_recentFiles.Count > 0)
+ {
+ toolsMenu.AddSeparator("");
+ toolsMenu.AddItem(new GUIContent("Clear"), false, RecentMenuCallback_Clear);
+ if (missingCount > 0)
+ {
+ toolsMenu.AddItem(new GUIContent("Clear Missing (" + missingCount + ")"), false, RecentMenuCallback_ClearMissing);
+ }
+ }
+
+ toolsMenu.ShowAsContext();
+ }
+ }
+
+ private void OnInspectorGUI_StreamingAssetsButton(SerializedProperty propPath, SerializedProperty propLocation)
+ {
+ GUI.color = Color.white;
+
+ if (GUILayout.Button("SA", GUILayout.Width(32f)))
+ {
+ GenericMenu toolsMenu = new GenericMenu();
+ toolsMenu.AddDisabledItem(new GUIContent("StreamingAssets Files:"));
+ toolsMenu.AddSeparator("");
+
+ if (System.IO.Directory.Exists(Application.streamingAssetsPath))
+ {
+ List files = new List();
+
+ string[] allFiles = System.IO.Directory.GetFiles(Application.streamingAssetsPath, "*", System.IO.SearchOption.AllDirectories);
+ if (allFiles != null && allFiles.Length > 0)
+ {
+ // Filter by type
+ for (int i = 0; i < allFiles.Length; i++)
+ {
+ bool remove = false;
+ if (allFiles[i].EndsWith(".meta", System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ remove = true;
+ }
+ if (!remove)
+ {
+ files.Add(allFiles[i]);
+ }
+ }
+ }
+
+ if (files.Count > 0)
+ {
+ for (int i = 0; i < files.Count; i++)
+ {
+ string path = files[i];
+ if (System.IO.File.Exists(path))
+ {
+ string itemName = path.Replace(Application.streamingAssetsPath, "");
+ if (itemName.StartsWith("/") || itemName.StartsWith("\\"))
+ {
+ itemName = itemName.Remove(0, 1);
+ }
+ itemName = itemName.Replace("\\", "/");
+
+ toolsMenu.AddItem(new GUIContent(itemName), false, RecentMenuCallback_Select, new RecentFileData(path, propPath, propLocation, target));
+ }
+ }
+ }
+ else
+ {
+ toolsMenu.AddDisabledItem(new GUIContent("StreamingAssets folder contains no files"));
+ }
+ }
+ else
+ {
+ toolsMenu.AddDisabledItem(new GUIContent("StreamingAssets folder doesn't exist"));
+ }
+
+ toolsMenu.ShowAsContext();
+ }
+ }
+
+ private static void ShowNoticeBox(MessageType messageType, string message)
+ {
+ //GUI.backgroundColor = Color.yellow;
+ //EditorGUILayout.HelpBox(message, messageType);
+
+ switch (messageType)
+ {
+ case MessageType.Error:
+ GUI.color = Color.red;
+ message = "Error: " + message;
+ break;
+ case MessageType.Warning:
+ GUI.color = Color.yellow;
+ message = "Warning: " + message;
+ break;
+ }
+
+ //GUI.color = Color.yellow;
+ GUILayout.TextArea(message);
+ GUI.color = Color.white;
+ }
+
+ private static void ShowFileWarningMessages(string filePath, MediaPlayer.FileLocation fileLocation, bool isAutoOpen, Platform platform)
+ {
+ string finalPath = MediaPlayer.GetFilePath(filePath, fileLocation);
+
+ if (string.IsNullOrEmpty(filePath))
+ {
+ if (isAutoOpen)
+ {
+ ShowNoticeBox(MessageType.Error, "No file specified");
+ }
+ else
+ {
+ ShowNoticeBox(MessageType.Warning, "No file specified");
+ }
+ }
+ else
+ {
+ bool isPlatformAndroid = (platform == Platform.Android) || (platform == Platform.Unknown && BuildTargetGroup.Android == UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup);
+ bool isPlatformIOS = (platform == Platform.iOS);
+#if AVPRO_UNITY_IOS_ALLOWHTTPDOWNLOAD
+ isPlatformIOS |= (platform == Platform.Unknown && BuildTargetGroup.iOS == UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup);
+#endif
+#if AVPRO_UNITY_PLATFORM_TVOS
+ bool isPlatformTVOS = (platform == Platform.tvOS);
+
+ isPlatformTVOS |= (platform == Platform.Unknown && BuildTargetGroup.tvOS == UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup);
+#endif
+
+ // Test file extensions
+ {
+ bool isExtensionAVI = filePath.ToLower().EndsWith(".avi");
+ bool isExtensionMOV = filePath.ToLower().EndsWith(".mov");
+ bool isExtensionMKV = filePath.ToLower().EndsWith(".mkv");
+
+ if (isPlatformAndroid && isExtensionMOV)
+ {
+ ShowNoticeBox(MessageType.Warning, "MOV file detected. Android doesn't support MOV files, you should change the container file.");
+ }
+ if (isPlatformAndroid && isExtensionAVI)
+ {
+ ShowNoticeBox(MessageType.Warning, "AVI file detected. Android doesn't support AVI files, you should change the container file.");
+ }
+ if (isPlatformAndroid && isExtensionMKV)
+ {
+ ShowNoticeBox(MessageType.Warning, "MKV file detected. Android doesn't support MKV files until Android 5.0.");
+ }
+ if (isPlatformIOS && isExtensionAVI)
+ {
+ ShowNoticeBox(MessageType.Warning, "AVI file detected. iOS doesn't support AVI files, you should change the container file.");
+ }
+ }
+
+ if (finalPath.Contains("://"))
+ {
+ if (filePath.ToLower().Contains("rtmp://"))
+ {
+ ShowNoticeBox(MessageType.Warning, "RTMP protocol is not supported by AVPro Video, except when Windows DirectShow is used with an external codec library (eg LAV Filters)");
+ }
+ if (filePath.ToLower().Contains("youtube.com/watch"))
+ {
+ ShowNoticeBox(MessageType.Warning, "YouTube URL detected. YouTube website URL contains no media, a direct media file URL (eg MP4 or M3U8) is required. See the documentation FAQ for YouTube support.");
+ }
+ if (fileLocation != MediaPlayer.FileLocation.AbsolutePathOrURL)
+ {
+ ShowNoticeBox(MessageType.Warning, "URL detected, change location type to URL?");
+ }
+ else
+ {
+#if AVPRO_UNITY_IOS_ALLOWHTTPDOWNLOAD
+ // Display warning to iOS users if they're trying to use HTTP url without setting the permission
+
+ if (isPlatformIOS
+#if AVPRO_UNITY_PLATFORM_TVOS
+ || isPlatformTVOS
+#endif
+ )
+ {
+ if (!PlayerSettings.iOS.allowHTTPDownload && filePath.StartsWith("http://"))
+ {
+ ShowNoticeBox(MessageType.Warning, "Starting with iOS 9 'allow HTTP downloads' must be enabled for HTTP connections (see Player Settings)");
+ }
+ }
+#endif
+ // Display warning for Android users if they're trying to use a URL without setting permission
+ if (isPlatformAndroid && !PlayerSettings.Android.forceInternetPermission)
+ {
+ ShowNoticeBox(MessageType.Warning, "You may need to set 'Internet Access' to 'require' in your Player Settings for Android builds when using URLs");
+ }
+
+ // Display warning for UWP users if they're trying to use a URL without setting permission
+ if (platform == Platform.WindowsUWP || (platform == Platform.Unknown && (
+#if !AVPRO_UNITY_WP8_DEPRECATED
+ BuildTargetGroup.WP8 == UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup ||
+#endif
+#if AVPRO_UNITY_METRO
+ BuildTargetGroup.Metro == UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup
+#else
+ BuildTargetGroup.WSA == UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup
+#endif
+ )))
+ {
+#if AVPRO_UNITY_METRO
+ if (!PlayerSettings.Metro.GetCapability(PlayerSettings.MetroCapability.InternetClient))
+#else
+ if (!PlayerSettings.WSA.GetCapability(PlayerSettings.WSACapability.InternetClient))
+#endif
+ {
+ ShowNoticeBox(MessageType.Warning, "You may need to set 'InternetClient' capability in your Player Settings when using URLs");
+ }
+ }
+ }
+ }
+ else
+ {
+ if (fileLocation != MediaPlayer.FileLocation.AbsolutePathOrURL && filePath.StartsWith("/"))
+ {
+ ShowNoticeBox(MessageType.Warning, "Absolute path detected, change location to Absolute path?");
+ }
+
+ // Display warning for Android users if they're trying to use absolute file path without permission
+ if (isPlatformAndroid && !PlayerSettings.Android.forceSDCardPermission)
+ {
+ ShowNoticeBox(MessageType.Warning, "You may need to access the local file system you may need to set 'Write Access' to 'External(SDCard)' in your Player Settings for Android");
+ }
+
+ if (platform == Platform.Unknown || platform == MediaPlayer.GetPlatform())
+ {
+ if (!System.IO.File.Exists(finalPath))
+ {
+ ShowNoticeBox(MessageType.Error, "File not found");
+ }
+ else
+ {
+ // Check the case
+ // This approach is very slow, so we only run it when the app isn't playing
+ if (!Application.isPlaying)
+ {
+ string comparePath = finalPath.Replace('\\', '/');
+ string folderPath = System.IO.Path.GetDirectoryName(comparePath);
+ if (!string.IsNullOrEmpty(folderPath))
+ {
+
+ string[] files = System.IO.Directory.GetFiles(folderPath, "*", System.IO.SearchOption.TopDirectoryOnly);
+ bool caseMatch = false;
+ if (files != null && files.Length > 0)
+ {
+ //Debug.Log("final: " + comparePath);
+ for (int i = 0; i < files.Length; i++)
+ {
+ //Debug.Log("comp: " + files[i].Replace('\\', '/'));
+ if (files[i].Replace('\\', '/') == comparePath)
+ {
+ caseMatch = true;
+ break;
+ }
+ }
+ }
+ if (!caseMatch)
+ {
+ ShowNoticeBox(MessageType.Warning, "File found but case doesn't match");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (fileLocation == MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder)
+ {
+ if (!System.IO.Directory.Exists(Application.streamingAssetsPath))
+ {
+ GUILayout.BeginHorizontal();
+ GUI.color = Color.yellow;
+ GUILayout.TextArea("Warning: No StreamingAssets folder found");
+
+ if (GUILayout.Button("Create Folder"))
+ {
+ System.IO.Directory.CreateDirectory(Application.streamingAssetsPath);
+ AssetDatabase.Refresh();
+ }
+ GUILayout.EndHorizontal();
+ }
+ else
+ {
+ bool checkAndroidFileSize = false;
+#if UNITY_ANDROID
+ if (platform == Platform.Unknown)
+ {
+ checkAndroidFileSize = true;
+ }
+#endif
+ if (platform == Platform.Android)
+ {
+ checkAndroidFileSize = true;
+ }
+
+ if (checkAndroidFileSize)
+ {
+ try
+ {
+ System.IO.FileInfo info = new System.IO.FileInfo(finalPath);
+ if (info != null && info.Length > (1024 * 1024 * 512))
+ {
+ ShowNoticeBox(MessageType.Warning, "Using this very large file inside StreamingAssets folder on Android isn't recommended. Deployments will be slow and mapping the file from the StreamingAssets JAR may cause storage and memory issues. We recommend loading from another folder on the device.");
+ }
+ }
+ catch (System.Exception)
+ {
+ }
+ }
+ }
+ }
+
+ GUI.color = Color.white;
+ }
+
+ private void OnInspectorGUI_VideoPreview(MediaPlayer media, IMediaProducer textureSource)
+ {
+ Texture texture = null;
+ if (textureSource != null)
+ {
+ texture = textureSource.GetTexture();
+ }
+ if (texture == null)
+ {
+ texture = EditorGUIUtility.whiteTexture;
+ }
+
+ float ratio = (float)texture.width / (float)texture.height;
+
+ // Reserve rectangle for texture
+ GUILayout.BeginHorizontal();
+ GUILayout.FlexibleSpace();
+ Rect textureRect;
+ Rect alphaRect = new Rect(0f, 0f, 1f, 1f);
+ if (texture != EditorGUIUtility.whiteTexture)
+ {
+ textureRect = GUILayoutUtility.GetRect(Screen.width / 2, Screen.width / 2, (Screen.width / 2) / ratio, (Screen.width / 2) / ratio);
+ if (_showAlpha)
+ {
+ alphaRect = GUILayoutUtility.GetRect(Screen.width / 2, Screen.width / 2, (Screen.width / 2) / ratio, (Screen.width / 2) / ratio);
+ }
+ }
+ else
+ {
+ textureRect = GUILayoutUtility.GetRect(1920f / 40f, 1080f / 40f);
+ if (_showAlpha)
+ {
+ alphaRect = GUILayoutUtility.GetRect(1920f / 40f, 1080f / 40f);
+ }
+ }
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ // Dimensions
+ string dimensionText = string.Format("{0}x{1}@{2}", 0, 0, 0.0f);
+ if (texture != EditorGUIUtility.whiteTexture && media.Info != null)
+ {
+ dimensionText = string.Format("{0}x{1}@{2:F2}", texture.width, texture.height, media.Info.GetVideoFrameRate());
+ }
+
+ CentreLabel(dimensionText);
+
+ string rateText = "0";
+ string playerText = string.Empty;
+ if (media.Info != null)
+ {
+ rateText = media.Info.GetVideoDisplayRate().ToString("F2");
+ playerText = media.Info.GetPlayerDescription();
+ }
+
+ EditorGUILayout.LabelField("Display Rate", rateText);
+ EditorGUILayout.LabelField("Using", playerText);
+ _showAlpha = EditorGUILayout.Toggle("Show Alpha", _showAlpha);
+
+ // Draw the texture
+ Matrix4x4 prevMatrix = GUI.matrix;
+ if (textureSource != null && textureSource.RequiresVerticalFlip())
+ {
+ GUIUtility.ScaleAroundPivot(new Vector2(1f, -1f), new Vector2(0, textureRect.y + (textureRect.height / 2)));
+ }
+
+ if (!GUI.enabled)
+ {
+ GUI.color = Color.grey;
+ GUI.DrawTexture(textureRect, texture, ScaleMode.ScaleToFit, false);
+ GUI.color = Color.white;
+ }
+ else
+ {
+ if (!_showAlpha)
+ {
+ // TODO: In Linear mode, this displays the texture too bright, but GUI.DrawTexture displays it correctly
+ EditorGUI.DrawTextureTransparent(textureRect, texture, ScaleMode.ScaleToFit);
+ }
+ else
+ {
+ GUI.DrawTexture(textureRect, texture, ScaleMode.ScaleToFit, false);
+ EditorGUI.DrawTextureAlpha(alphaRect, texture, ScaleMode.ScaleToFit);
+ }
+ }
+ GUI.matrix = prevMatrix;
+
+ // Select texture button
+ GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
+ GUILayout.FlexibleSpace();
+ if (GUILayout.Button("Select Texture", GUILayout.ExpandWidth(false)))
+ {
+ Selection.activeObject = texture;
+ }
+ if (GUILayout.Button("Save PNG", GUILayout.ExpandWidth(true)))
+ {
+ media.SaveFrameToPng();
+ }
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ }
+
+ private void OnInspectorGUI_PlayControls(IMediaControl control, IMediaInfo info)
+ {
+ GUILayout.Space(8.0f);
+
+ // Slider
+ EditorGUILayout.BeginHorizontal();
+ bool isPlaying = false;
+ if (control != null)
+ {
+ isPlaying = control.IsPlaying();
+ }
+ float currentTime = 0f;
+ if (control != null)
+ {
+ currentTime = control.GetCurrentTimeMs();
+ }
+
+ float durationTime = 0f;
+ if (info != null)
+ {
+ durationTime = info.GetDurationMs();
+ if (float.IsNaN(durationTime))
+ {
+ durationTime = 0f;
+ }
+ }
+ string timeUsed = Helper.GetTimeString(currentTime / 1000f, true);
+ GUILayout.Label(timeUsed, GUILayout.ExpandWidth(false));
+
+ float newTime = GUILayout.HorizontalSlider(currentTime, 0f, durationTime, GUILayout.ExpandWidth(true));
+ if (newTime != currentTime)
+ {
+ control.Seek(newTime);
+ }
+
+ string timeTotal = "Infinity";
+ if (!float.IsInfinity(durationTime))
+ {
+ timeTotal = Helper.GetTimeString(durationTime / 1000f, true);
+ }
+
+ GUILayout.Label(timeTotal, GUILayout.ExpandWidth(false));
+
+ EditorGUILayout.EndHorizontal();
+
+ // Buttons
+ EditorGUILayout.BeginHorizontal();
+ if (GUILayout.Button("Rewind", GUILayout.ExpandWidth(false)))
+ {
+ control.Rewind();
+ }
+
+ if (!isPlaying)
+ {
+ GUI.color = Color.green;
+ if (GUILayout.Button("Play", GUILayout.ExpandWidth(true)))
+ {
+ control.Play();
+ }
+ }
+ else
+ {
+ GUI.color = Color.yellow;
+ if (GUILayout.Button("Pause", GUILayout.ExpandWidth(true)))
+ {
+ control.Pause();
+ }
+ }
+ GUI.color = Color.white;
+ EditorGUILayout.EndHorizontal();
+ }
+
+ private struct Native
+ {
+#if UNITY_EDITOR_WIN
+ [System.Runtime.InteropServices.DllImport("AVProVideo")]
+ public static extern System.IntPtr GetPluginVersion();
+#elif UNITY_EDITOR_OSX
+ [System.Runtime.InteropServices.DllImport("AVProVideo")]
+ public static extern string AVPGetVersion();
+#endif
+ }
+
+ private static string GetPluginVersion()
+ {
+ string version = "Unknown";
+ try
+ {
+#if UNITY_EDITOR_WIN
+ version = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(Native.GetPluginVersion());
+#elif UNITY_EDITOR_OSX
+ version = Native.AVPGetVersion();
+#endif
+ }
+ catch (System.DllNotFoundException e)
+ {
+ Debug.LogError("[AVProVideo] Failed to load DLL. " + e.Message);
+#if (UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
+#if !UNITY_5 && !UNITY_5_4_OR_NEWER
+ Debug.LogError("[AVProVideo] You may need to copy the Audio360 DLL into the root folder of your project (the folder above Assets)");
+#endif
+#endif
+ }
+ return version;
+ }
+
+ private static Texture2D GetIcon(Texture2D icon)
+ {
+ if (icon == null)
+ {
+ icon = Resources.Load("AVProVideoIcon");
+ }
+ return icon;
+ }
+
+ private void OnInspectorGUI_About()
+ {
+ //GUILayout.Space(8f);
+
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandAbout)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+ if (GUILayout.Button("About / Help", EditorStyles.toolbarButton))
+ {
+ _expandAbout = !_expandAbout;
+ }
+ GUI.color = Color.white;
+
+ if (_expandAbout)
+ {
+ EditorGUILayout.BeginHorizontal();
+ GUILayout.FlexibleSpace();
+ _icon = GetIcon(_icon);
+ if (_icon != null)
+ {
+ GUILayout.Label(new GUIContent(_icon));
+ }
+ GUILayout.FlexibleSpace();
+ EditorGUILayout.EndHorizontal();
+
+ GUI.color = Color.yellow;
+ CentreLabel("AVPro Video by RenderHeads Ltd", EditorStyles.boldLabel);
+ CentreLabel("version " + GetPluginVersion() + " (scripts v" + Helper.ScriptVersion + ")");
+ GUI.color = Color.white;
+
+
+ GUILayout.Space(32f);
+ GUI.backgroundColor = Color.white;
+
+ EditorGUILayout.LabelField("Links", EditorStyles.boldLabel);
+
+ GUILayout.Space(8f);
+
+ EditorGUILayout.LabelField("Documentation");
+ if (GUILayout.Button("User Manual, FAQ, Release Notes", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(LinkUserManual);
+ }
+ if (GUILayout.Button("Scripting Class Reference", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(LinkScriptingClassReference);
+ }
+
+ GUILayout.Space(16f);
+
+ GUILayout.Label("Rate and Review (★★★★☆)", GUILayout.ExpandWidth(false));
+ if (GUILayout.Button("Unity Asset Store Page", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(LinkAssetStorePage);
+ }
+
+ GUILayout.Space(16f);
+
+ GUILayout.Label("Community");
+ if (GUILayout.Button("Unity Forum Page", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(LinkForumPage);
+ }
+
+ GUILayout.Space(16f);
+
+ GUILayout.Label("Homepage", GUILayout.ExpandWidth(false));
+ if (GUILayout.Button("AVPro Video Website", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(LinkPluginWebsite);
+ }
+
+ GUILayout.Space(16f);
+
+ GUILayout.Label("Bugs and Support");
+ EditorGUILayout.BeginHorizontal();
+ if (GUILayout.Button("Open Help & Support", GUILayout.ExpandWidth(false)))
+ {
+ SupportWindow.Init();
+ }
+ EditorGUILayout.EndHorizontal();
+
+ GUILayout.Space(32f);
+
+ EditorGUILayout.LabelField("Credits", EditorStyles.boldLabel);
+ GUILayout.Space(8f);
+
+ CentreLabel("Programming", EditorStyles.boldLabel);
+ CentreLabel("Andrew Griffiths");
+ CentreLabel("Morris Butler");
+ CentreLabel("Sunrise Wang");
+ CentreLabel("Ste Butcher");
+ CentreLabel("Muano Mainganye");
+ CentreLabel("Shane Marks");
+ GUILayout.Space(8f);
+ CentreLabel("Graphics", EditorStyles.boldLabel);
+ GUILayout.Space(8f);
+ CentreLabel("Jeff Rusch");
+ CentreLabel("Luke Godward");
+
+ GUILayout.Space(32f);
+
+ EditorGUILayout.LabelField("Bug Reporting Notes", EditorStyles.boldLabel);
+
+ EditorGUILayout.SelectableLabel(SupportMessage, EditorStyles.wordWrappedLabel, GUILayout.Height(300f));
+ }
+
+ EditorGUILayout.EndVertical();
+ }
+
+ private void OnInspectorGUI_Events()
+ {
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandEvents)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Events", EditorStyles.toolbarButton))
+ {
+ _expandEvents = !_expandEvents;
+ }
+ GUI.color = Color.white;
+
+ if (_expandEvents)
+ {
+ EditorGUILayout.PropertyField(_propEvents);
+
+ _propEventMask.intValue = EditorGUILayout.MaskField("Triggered Events", _propEventMask.intValue, System.Enum.GetNames(typeof(MediaPlayerEvent.EventType)));
+
+ EditorGUILayout.BeginHorizontal();
+ GUILayout.Label("Pause Media On App Pause");
+ _propPauseMediaOnAppPause.boolValue = EditorGUILayout.Toggle(_propPauseMediaOnAppPause.boolValue);
+ EditorGUILayout.EndHorizontal();
+ EditorGUILayout.BeginHorizontal();
+ GUILayout.Label("Play Media On App Unpause");
+ _propPlayMediaOnAppUnpause.boolValue = EditorGUILayout.Toggle(_propPlayMediaOnAppUnpause.boolValue);
+ EditorGUILayout.EndHorizontal();
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ private void OnInspectorGUI_Main()
+ {
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandMain)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Main", EditorStyles.toolbarButton))
+ {
+ _expandMain = !_expandMain;
+ }
+ GUI.color = Color.white;
+
+ if (_expandMain)
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ /////////////////// STARTUP FIELDS
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Startup", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propAutoOpen);
+ EditorGUILayout.PropertyField(_propAutoStart, new GUIContent("Auto Play"));
+ EditorGUILayout.EndVertical();
+
+ /////////////////// PLAYBACK FIELDS
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Playback", EditorStyles.boldLabel);
+
+ if (!Application.isPlaying || !media.VideoOpened)
+ {
+ EditorGUILayout.PropertyField(_propLoop);
+ EditorGUILayout.PropertyField(_propRate);
+ }
+ else if (media.Control != null)
+ {
+ media.m_Loop = media.Control.IsLooping();
+ bool newLooping = EditorGUILayout.Toggle("Loop", media.m_Loop);
+ if (newLooping != media.m_Loop)
+ {
+ media.Control.SetLooping(newLooping);
+ }
+
+ media.m_PlaybackRate = media.Control.GetPlaybackRate();
+ float newPlaybackRate = EditorGUILayout.Slider("Rate", media.m_PlaybackRate, -4f, 4f);
+ if (newPlaybackRate != media.m_PlaybackRate)
+ {
+ media.Control.SetPlaybackRate(newPlaybackRate);
+ }
+ }
+
+ EditorGUILayout.EndVertical();
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Other", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propPersistent, new GUIContent("Persistent", "Use DontDestroyOnLoad so this object isn't destroyed between level loads"));
+
+ EditorGUILayout.PropertyField(_propForceFileFormat);
+
+ EditorGUILayout.EndVertical();
+ }
+ GUILayout.EndVertical();
+ }
+
+ private void OnInspectorGUI_Audio()
+ {
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandAudio)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Audio", EditorStyles.toolbarButton))
+ {
+ _expandAudio = !_expandAudio;
+ }
+ GUI.color = Color.white;
+
+ if (_expandAudio)
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Audio", EditorStyles.boldLabel);
+ if (!Application.isPlaying || !media.VideoOpened)
+ {
+ EditorGUILayout.PropertyField(_propVolume);
+ EditorGUILayout.PropertyField(_propBalance);
+ EditorGUILayout.PropertyField(_propMuted);
+ }
+ else if (media.Control != null)
+ {
+ media.m_Volume = media.Control.GetVolume();
+ float newVolume = EditorGUILayout.Slider("Volume", media.m_Volume, 0f, 1f);
+ if (newVolume != media.m_Volume)
+ {
+ media.Control.SetVolume(newVolume);
+ }
+
+ float balance = media.Control.GetBalance();
+ float newBalance = EditorGUILayout.Slider("Balance", balance, -1f, 1f);
+ if (newBalance != balance)
+ {
+ media.Control.SetBalance(newBalance);
+ _propBalance.floatValue = newBalance;
+ }
+
+ media.m_Muted = media.Control.IsMuted();
+ bool newMuted = EditorGUILayout.Toggle("Muted", media.m_Muted);
+ if (newMuted != media.m_Muted)
+ {
+ media.Control.MuteAudio(newMuted);
+ }
+
+
+ /*
+ int selectedTrackIndex = media.Control.GetCurrentAudioTrack();
+ int numTracks = media.Info.GetAudioTrackCount();
+ if (numTracks > 0)
+ {
+ string[] trackNames = new string[numTracks];
+ for (int i = 0; i < numTracks; i++)
+ {
+ trackNames[i] = (i+1).ToString();
+ }
+ int newSelectedTrackIndex = EditorGUILayout.Popup("Audio Track", selectedTrackIndex, trackNames);
+ if (newSelectedTrackIndex != selectedTrackIndex)
+ {
+ media.Control.SetAudioTrack(newSelectedTrackIndex);
+ }
+ }*/
+ }
+
+ EditorGUILayout.EndVertical();
+
+ {
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Facebook Audio 360", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propAudioHeadTransform, new GUIContent("Head Transform", "Set this to your head camera transform. Only currently used for TBE Audio360"));
+ EditorGUILayout.PropertyField(_propAudioEnableFocus, new GUIContent("Enable Focus", "Enables focus control. Only currently used for TBE Audio360"));
+ if (_propAudioEnableFocus.boolValue)
+ {
+ EditorGUILayout.PropertyField(_propAudioFocusOffLevelDB, new GUIContent("Off Focus Level DB", "Sets the off-focus level in DB, with the range being between -24 to 0 DB. Only currently used for TBE Audio360"));
+ EditorGUILayout.PropertyField(_propAudioFocusWidthDegrees, new GUIContent("Focus Width Degrees", "Set the focus width in degrees, with the range being between 40 and 120 degrees. Only currently used for TBE Audio360"));
+ EditorGUILayout.PropertyField(_propAudioFocusTransform, new GUIContent("Focus Transform", "Set this to where you wish to focus on the video. Only currently used for TBE Audio360"));
+ }
+ EditorGUILayout.EndVertical();
+ }
+
+
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ private void OnInspectorGUI_MediaProperties()
+ {
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandMediaProperties)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Visual", EditorStyles.toolbarButton))
+ {
+ _expandMediaProperties = !_expandMediaProperties;
+ }
+ GUI.color = Color.white;
+
+ if (_expandMediaProperties)
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ EditorGUILayout.BeginVertical();
+ GUILayout.Label("Texture", EditorStyles.boldLabel);
+
+ EditorGUILayout.PropertyField(_propFilter, new GUIContent("Filter"));
+ EditorGUILayout.PropertyField(_propWrap, new GUIContent("Wrap"));
+ EditorGUILayout.PropertyField(_propAniso, new GUIContent("Aniso"));
+
+ if (_propWrap.enumValueIndex != (int)media.m_WrapMode ||
+ _propFilter.enumValueIndex != (int)media.m_FilterMode ||
+ _propAniso.intValue != media.m_AnisoLevel)
+ {
+ if (media.Control != null)
+ {
+ media.Control.SetTextureProperties((FilterMode)_propFilter.enumValueIndex, (TextureWrapMode)_propWrap.enumValueIndex, _propAniso.intValue);
+ }
+ }
+
+ EditorGUILayout.EndVertical();
+
+ EditorGUILayout.BeginVertical();
+ GUILayout.Label("Layout Mapping", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propVideoMapping);
+ EditorGUILayout.EndVertical();
+
+ EditorGUILayout.BeginVertical();
+ GUILayout.Label("Transparency", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propAlphaPacking, new GUIContent("Packing"));
+ EditorGUILayout.EndVertical();
+
+ EditorGUILayout.BeginVertical();
+ GUILayout.Label("Stereo", EditorStyles.boldLabel);
+
+ EditorGUI.BeginChangeCheck();
+ EditorGUILayout.PropertyField(_propStereoPacking, new GUIContent("Packing"));
+ if (EditorGUI.EndChangeCheck())
+ {
+ CheckStereoPackingField();
+ }
+
+ if (_showMessage_UpdatStereoMaterial)
+ {
+ ShowNoticeBox(MessageType.Warning, "No UpdateStereoMaterial component found in scene. UpdateStereoMaterial is required for stereo display.");
+ }
+
+ EditorGUI.BeginDisabledGroup(_propStereoPacking.enumValueIndex == 0);
+ EditorGUILayout.PropertyField(_propDisplayStereoTint, new GUIContent("Debug Eye Tint", "Tints the left eye green and the right eye red so you can confirm stereo is working"));
+ EditorGUI.EndDisabledGroup();
+ EditorGUILayout.EndVertical();
+
+ {
+ //EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Resampler (BETA)", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propResample);
+ EditorGUI.BeginDisabledGroup(!_propResample.boolValue);
+
+ EditorGUILayout.PropertyField(_propResampleMode);
+ EditorGUILayout.PropertyField(_propResampleBufferSize);
+
+ EditorGUI.EndDisabledGroup();
+ //EditorGUILayout.EndVertical();
+ }
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ private void CheckStereoPackingField()
+ {
+ if (_propStereoPacking != null)
+ {
+ _showMessage_UpdatStereoMaterial = false;
+ if (_propStereoPacking.enumValueIndex != 0 && null == FindObjectOfType())
+ {
+ _showMessage_UpdatStereoMaterial = true;
+ }
+ }
+ }
+
+ private void OnInspectorGUI_Subtitles()
+ {
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandSubtitles)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Subtitles", EditorStyles.toolbarButton))
+ {
+ _expandSubtitles = !_expandSubtitles;
+ }
+ GUI.color = Color.white;
+
+ if (_expandSubtitles)
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ EditorGUILayout.BeginVertical();
+ EditorGUILayout.PropertyField(_propSubtitles, new GUIContent("Load External Subtitles"));
+ {
+ EditorGUI.BeginDisabledGroup(!_propSubtitles.boolValue);
+
+ EditorGUILayout.BeginVertical("box");
+
+ OnInspectorGUI_CopyableFilename(_propSubtitlePath.stringValue);
+
+ EditorGUILayout.LabelField("Source Path", EditorStyles.boldLabel);
+
+ EditorGUILayout.PropertyField(_propSubtitleLocation, GUIContent.none);
+
+ {
+ string oldPath = _propSubtitlePath.stringValue;
+ string newPath = EditorGUILayout.TextField(string.Empty, _propSubtitlePath.stringValue);
+ if (newPath != oldPath)
+ {
+ // Check for invalid characters
+ if (0 > newPath.IndexOfAny(System.IO.Path.GetInvalidPathChars()))
+ {
+ _propSubtitlePath.stringValue = newPath.Replace("\\", "/");
+ EditorUtility.SetDirty(target);
+ }
+ }
+ }
+
+ //if (!Application.isPlaying)
+ {
+ GUILayout.BeginHorizontal();
+ OnInspectorGUI_RecentButton(_propSubtitlePath, _propSubtitleLocation);
+ OnInspectorGUI_StreamingAssetsButton(_propSubtitlePath, _propSubtitleLocation);
+ GUI.color = Color.green;
+ if (GUILayout.Button("BROWSE"))
+ {
+ string startFolder = GetStartFolder(_propSubtitlePath.stringValue, (MediaPlayer.FileLocation)_propSubtitleLocation.enumValueIndex);
+ string videoPath = media.SubtitlePath;
+ string fullPath = string.Empty;
+ MediaPlayer.FileLocation fileLocation = media.SubtitleLocation;
+ if (Browse(startFolder, ref videoPath, ref fileLocation, ref fullPath, SubtitleExtensions))
+ {
+ _propSubtitlePath.stringValue = videoPath.Replace("\\", "/");
+ _propSubtitleLocation.enumValueIndex = (int)fileLocation;
+ EditorUtility.SetDirty(target);
+
+ AddToRecentFiles(fullPath);
+ }
+ }
+ GUI.color = Color.white;
+ GUILayout.EndHorizontal();
+
+ ShowFileWarningMessages(_propSubtitlePath.stringValue, (MediaPlayer.FileLocation)_propSubtitleLocation.enumValueIndex, media.m_AutoOpen, Platform.Unknown);
+ GUI.color = Color.white;
+ }
+
+ if (Application.isPlaying)
+ {
+ GUILayout.BeginHorizontal();
+ if (GUILayout.Button("Load"))
+ {
+ media.EnableSubtitles((MediaPlayer.FileLocation)_propSubtitleLocation.enumValueIndex, _propSubtitlePath.stringValue);
+ }
+ if (GUILayout.Button("Clear"))
+ {
+ media.DisableSubtitles();
+ }
+ GUILayout.EndHorizontal();
+ }
+
+ EditorGUILayout.EndVertical();
+ }
+
+ EditorGUILayout.EndVertical();
+ EditorGUI.EndDisabledGroup();
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ private static void CentreLabel(string text, GUIStyle style = null)
+ {
+ GUILayout.BeginHorizontal();
+ GUILayout.FlexibleSpace();
+ if (style == null)
+ {
+ GUILayout.Label(text);
+ }
+ else
+ {
+ GUILayout.Label(text, style);
+ }
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ }
+
+ private void OnInspectorGUI_GlobalSettings()
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandGlobalSettings)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Global Settings", EditorStyles.toolbarButton))
+ {
+ _expandGlobalSettings = !_expandGlobalSettings;
+ }
+ GUI.color = Color.white;
+
+ if (_expandGlobalSettings)
+ {
+ EditorGUI.BeginDisabledGroup(Application.isPlaying);
+ EditorGUILayout.LabelField("Current Platform", EditorUserBuildSettings.selectedBuildTargetGroup.ToString());
+
+ GUILayout.Label("BETA", EditorStyles.boldLabel);
+
+ // TimeScale
+ {
+ const string TimeScaleDefine = "AVPROVIDEO_BETA_SUPPORT_TIMESCALE";
+
+ string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
+ bool supportsTimeScale = defines.Contains(TimeScaleDefine);
+ bool supportsTimeScaleNew = EditorGUILayout.Toggle("TimeScale Support", supportsTimeScale);
+ if (supportsTimeScale != supportsTimeScaleNew)
+ {
+ if (supportsTimeScaleNew)
+ {
+ defines += ";" + TimeScaleDefine + ";";
+ }
+ else
+ {
+ defines = defines.Replace(TimeScaleDefine, "");
+ }
+
+ PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defines);
+ }
+
+ if (supportsTimeScaleNew)
+ {
+ ShowNoticeBox(MessageType.Warning, "This will affect performance if you change Time.timeScale or Time.captureFramerate. This feature is useful for supporting video capture system that adjust time scale during capturing.");
+ }
+ }
+
+ GUILayout.Label("Performance", EditorStyles.boldLabel);
+
+ // Disable Debug GUI
+ {
+ const string DisableDebugGUIDefine = "AVPROVIDEO_DISABLE_DEBUG_GUI";
+
+ string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
+ bool disableDebugGUI = defines.Contains(DisableDebugGUIDefine);
+ EditorGUILayout.BeginHorizontal();
+ bool disableDebugGUINew = EditorGUILayout.Toggle("Disable Debug GUI", disableDebugGUI);
+ GUILayout.Label("(in builds only)");
+ EditorGUILayout.EndHorizontal();
+ if (disableDebugGUI != disableDebugGUINew)
+ {
+ if (disableDebugGUINew)
+ {
+ defines += ";" + DisableDebugGUIDefine + ";";
+ }
+ else
+ {
+ defines = defines.Replace(DisableDebugGUIDefine, "");
+ }
+
+ PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defines);
+ }
+ if (!disableDebugGUI)
+ {
+ GUI.color = Color.white;
+ GUILayout.TextArea("The Debug GUI can be disabled globally for builds to help reduce garbage generation each frame.");
+ GUI.color = Color.white;
+ }
+ }
+
+ // Disable Logging
+ {
+ const string DisableLogging = "AVPROVIDEO_DISABLE_LOGGING";
+
+ string defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
+ bool disableLogging = defines.Contains(DisableLogging);
+ bool disableLoggingNew = EditorGUILayout.Toggle("Disable Logging", disableLogging);
+ if (disableLogging != disableLoggingNew)
+ {
+ if (disableLoggingNew)
+ {
+ defines += ";" + DisableLogging + ";";
+ }
+ else
+ {
+ defines = defines.Replace(DisableLogging, "");
+ }
+
+ PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defines);
+ }
+ }
+
+ EditorGUI.EndDisabledGroup();
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ private void OnInspectorGUI_PlatformOverrides()
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_expandPlatformOverrides)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ if (GUILayout.Button("Platform Specific", EditorStyles.toolbarButton))
+ {
+ _expandPlatformOverrides = !_expandPlatformOverrides;
+ }
+ GUI.color = Color.white;
+
+ if (_expandPlatformOverrides)
+ {
+ int rowCount = 0;
+ int platformIndex = _platformIndex;
+ for (int i = 0; i < _platformNames.Length; i++)
+ {
+ if (i % 3 == 0)
+ {
+ GUILayout.BeginHorizontal();
+ rowCount++;
+ }
+ MediaPlayer.PlatformOptions options = media.GetPlatformOptions((Platform)i);
+
+ Color hilight = Color.yellow;
+
+ if (i == _platformIndex)
+ {
+ // Selected, unmodified
+ if (!options.IsModified())
+ {
+ GUI.contentColor = Color.white;
+ }
+ else
+ {
+ // Selected, modified
+ GUI.color = hilight;
+ GUI.contentColor = Color.white;
+ }
+ }
+ else if (options.IsModified())
+ {
+ // Unselected, modified
+ GUI.backgroundColor = Color.grey* hilight;
+ GUI.contentColor = hilight;
+ }
+ else
+ {
+ // Unselected, unmodified
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.grey;
+ GUI.color = new Color(0.65f, 0.66f, 0.65f);// Color.grey;
+ }
+ }
+
+ if (i == _platformIndex)
+ {
+ if (!GUILayout.Toggle(true, _platformNames[i], GUI.skin.button))
+ {
+ platformIndex = -1;
+ }
+ }
+ else
+ {
+ if (GUILayout.Button(_platformNames[i]))
+ {
+ platformIndex = i;
+ }
+ }
+ if ((i+1) % 3 == 0)
+ {
+ rowCount--;
+ GUILayout.EndHorizontal();
+ }
+ GUI.backgroundColor = Color.white;
+ GUI.contentColor = Color.white;
+ GUI.color = Color.white;
+ }
+
+ if (rowCount > 0)
+ {
+ GUILayout.EndHorizontal();
+ }
+
+ //platformIndex = GUILayout.SelectionGrid(_platformIndex, Helper.GetPlatformNames(), 3);
+ //int platformIndex = GUILayout.Toolbar(_platformIndex, Helper.GetPlatformNames());
+
+ if (platformIndex != _platformIndex)
+ {
+ _platformIndex = platformIndex;
+
+ // We do this to clear the focus, otherwise a focused text field will not change when the Toolbar index changes
+ EditorGUI.FocusTextInControl("ClearFocus");
+ }
+
+ OnInspectorGUI_PathOverrides();
+ switch ((Platform)_platformIndex)
+ {
+ case Platform.Windows:
+ OnInspectorGUI_Override_Windows();
+ break;
+ case Platform.MacOSX:
+ OnInspectorGUI_Override_MacOSX();
+ break;
+ case Platform.iOS:
+ OnInspectorGUI_Override_iOS();
+ break;
+ case Platform.tvOS:
+ OnInspectorGUI_Override_tvOS();
+ break;
+ case Platform.Android:
+ OnInspectorGUI_Override_Android();
+ break;
+ case Platform.WindowsPhone:
+ OnInspectorGUI_Override_WindowsPhone();
+ break;
+ case Platform.WindowsUWP:
+ OnInspectorGUI_Override_WindowsUWP();
+ break;
+ case Platform.WebGL:
+ OnInspectorGUI_Override_WebGL();
+ break;
+ }
+ }
+ GUILayout.EndVertical();
+ }
+
+ void OnInspectorGUI_Preview()
+ {
+ MediaPlayer media = (this.target) as MediaPlayer;
+
+ //GUILayout.Space(8f);
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+
+ if (_expandPreview)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+ GUILayout.BeginVertical(_sectionBoxStyle);
+ GUI.backgroundColor = Color.white;
+
+ GUI.backgroundColor = Color.cyan;
+ if (GUILayout.Button("Preview", EditorStyles.toolbarButton))
+ {
+ _expandPreview = !_expandPreview;
+ }
+ GUI.color = Color.white;
+ GUI.backgroundColor = Color.white;
+
+ if (_expandPreview)
+ {
+ EditorGUI.BeginDisabledGroup(!(media.TextureProducer != null && media.Info.HasVideo()));
+ OnInspectorGUI_VideoPreview(media, media.TextureProducer);
+ EditorGUI.EndDisabledGroup();
+
+ EditorGUI.BeginDisabledGroup(!(media.Control != null && media.Control.CanPlay() && media.isActiveAndEnabled && !EditorApplication.isPaused));
+ OnInspectorGUI_PlayControls(media.Control, media.Info);
+ EditorGUI.EndDisabledGroup();
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ private static string GetStartFolder(string path, MediaPlayer.FileLocation fileLocation)
+ {
+ // Try to resolve based on file path + file location
+ string result = MediaPlayer.GetFilePath(path, fileLocation);
+ if (!string.IsNullOrEmpty(result))
+ {
+ if (System.IO.File.Exists(result))
+ {
+ result = System.IO.Path.GetDirectoryName(result);
+ }
+ }
+
+ if (!System.IO.Directory.Exists(result))
+ {
+ // Just resolve on file location
+ result = MediaPlayer.GetPath(fileLocation);
+ }
+ if (string.IsNullOrEmpty(result))
+ {
+ // Fallback
+ result = Application.streamingAssetsPath;
+ }
+ return result;
+ }
+
+ private void GUI_OverridePath(int platformIndex)
+ {
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)platformIndex);
+
+ SerializedProperty propLocation = serializedObject.FindProperty(optionsVarName + ".pathLocation");
+ if (propLocation != null)
+ {
+ EditorGUILayout.PropertyField(propLocation, GUIContent.none);
+ }
+ SerializedProperty propPath = serializedObject.FindProperty(optionsVarName + ".path");
+ if (propPath != null)
+ {
+
+ {
+ string oldPath = propPath.stringValue;
+ string newPath = EditorGUILayout.TextField(string.Empty, propPath.stringValue);
+ if (newPath != oldPath)
+ {
+ // Check for invalid characters
+ if (0 > newPath.IndexOfAny(System.IO.Path.GetInvalidPathChars()))
+ {
+ propPath.stringValue = newPath.Replace("\\", "/");
+ EditorUtility.SetDirty(target);
+ }
+ }
+ }
+ }
+
+ GUILayout.BeginHorizontal();
+ OnInspectorGUI_RecentButton(propPath, propLocation);
+ OnInspectorGUI_StreamingAssetsButton(propPath, propLocation);
+ GUI.color = Color.green;
+ if (GUILayout.Button("BROWSE"))
+ {
+ string result = string.Empty;
+ MediaPlayer.FileLocation fileLocation = MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder;
+ string startFolder = GetStartFolder(propPath.stringValue, (MediaPlayer.FileLocation)propLocation.enumValueIndex);
+ string fullPath = string.Empty;
+ if (Browse(startFolder, ref result, ref fileLocation, ref fullPath, MediaExtensions))
+ {
+ propPath.stringValue = result.Replace("\\", "/");
+
+ propLocation.enumValueIndex = (int)fileLocation;
+ EditorUtility.SetDirty(target); // TODO: not sure if we need this any more. Was put here to help prefabs save values I think
+ }
+ }
+
+ GUILayout.EndHorizontal();
+
+ GUI.color = Color.white;
+
+ // Display the file name so it's easy to read and copy to the clipboard
+ OnInspectorGUI_CopyableFilename(propPath.stringValue);
+
+ if (GUI.enabled)
+ {
+ ShowFileWarningMessages(propPath.stringValue, (MediaPlayer.FileLocation)propLocation.enumValueIndex, false, (Platform)platformIndex);
+ }
+ }
+
+ private void OnInspectorGUI_PathOverrides()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+
+ //MediaPlayer.PlatformOptions options = media.GetPlatformOptions((Platform)_platformIndex);
+ //if (options != null)
+
+ if (_platformIndex >= 0)
+ {
+ EditorGUILayout.BeginVertical("box");
+ //GUILayout.Label("Media Foundation Options", EditorStyles.boldLabel);
+ {
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+ SerializedProperty propOverridePath = serializedObject.FindProperty(optionsVarName + ".overridePath");
+ if (propOverridePath != null)
+ {
+ EditorGUILayout.PropertyField(propOverridePath, new GUIContent("Override Path"));
+
+ //if (propOverridePath.boolValue)
+ {
+ EditorGUI.BeginDisabledGroup(!propOverridePath.boolValue);
+ GUI_OverridePath(_platformIndex);
+ EditorGUI.EndDisabledGroup();
+ }
+ }
+ }
+ EditorGUILayout.EndVertical();
+ }
+ }
+
+ private readonly static GUIContent[] _audioModesWindows =
+ {
+ new GUIContent("System Direct"),
+ new GUIContent("Facebook Audio 360", "Initialises player with Facebook Audio 360 support"),
+ new GUIContent("Unity", "Allows the AudioOutput component to grab audio from the video and play it through Unity to the AudioListener"),
+ };
+
+ private readonly static GUIContent[] _audioModesUWP =
+ {
+ new GUIContent("System Direct"),
+ new GUIContent("Unity", "Allows the AudioOutput component to grab audio from the video and play it through Unity to the AudioListener"),
+ };
+
+ private readonly static GUIContent[] _audioModesAndroid =
+ {
+ new GUIContent("System Direct"),
+ new GUIContent("Facebook Audio 360", "Initialises player with Facebook Audio 360 support"),
+ };
+
+ private readonly static GUIContent[] _audio360ChannelMapGuiNames =
+ {
+ new GUIContent("(TBE_8_2) 8 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio"),
+ new GUIContent("(TBE_8) 8 channels of hybrid TBE ambisonics. NO head-locked stereo audio"),
+ new GUIContent("(TBE_6_2) 6 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio"),
+ new GUIContent("(TBE_6) 6 channels of hybrid TBE ambisonics. NO head-locked stereo audio"),
+ new GUIContent("(TBE_4_2) 4 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio"),
+ new GUIContent("(TBE_4) 4 channels of hybrid TBE ambisonics. NO head-locked stereo audio"),
+
+ new GUIContent("(TBE_8_PAIR0) Channels 1 and 2 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_8_PAIR1) Channels 3 and 4 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_8_PAIR2) Channels 5 and 6 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_8_PAIR3) Channels 7 and 8 of TBE hybrid ambisonics"),
+
+ new GUIContent("(TBE_CHANNEL0) Channels 1 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL1) Channels 2 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL2) Channels 3 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL3) Channels 4 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL4) Channels 5 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL5) Channels 6 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL6) Channels 7 of TBE hybrid ambisonics"),
+ new GUIContent("(TBE_CHANNEL7) Channels 8 of TBE hybrid ambisonics"),
+
+ new GUIContent("(HEADLOCKED_STEREO) Head-locked stereo audio"),
+ new GUIContent("(HEADLOCKED_CHANNEL0) Channels 1 or left of head-locked stereo audio"),
+ new GUIContent("(HEADLOCKED_CHANNEL1) Channels 2 or right of head-locked stereo audio"),
+
+ new GUIContent("(AMBIX_4) 4 channels of first order ambiX"),
+ new GUIContent("(AMBIX_9) 9 channels of second order ambiX"),
+ new GUIContent("(AMBIX_9_2) 9 channels of second order ambiX with 2 channels of head-locked audio"),
+ new GUIContent("(AMBIX_16) 16 channels of third order ambiX"),
+ new GUIContent("(AMBIX_16_2) 16 channels of third order ambiX with 2 channels of head-locked audio"),
+
+ new GUIContent("(STEREO) Stereo audio"),
+ };
+
+ private void OnInspectorGUI_AudioOutput()
+ {
+ EditorGUILayout.PropertyField(_propManualSetAudioProps, new GUIContent("Specify Properties", "Manually set source audio properties, in case auto detection fails and the audio needs to be resampled"));
+
+ if (_propManualSetAudioProps.boolValue)
+ {
+ EditorGUILayout.PropertyField(_propSourceAudioSampleRate, new GUIContent("Sample rate", "Sample rate of source video"));
+ EditorGUILayout.PropertyField(_propSourceAudioChannels, new GUIContent("Channel count", "Number of channels in source video"));
+ }
+ }
+
+ private void OnInspectorGUI_Override_Windows()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsWindows options = media._optionsWindows;
+
+ GUILayout.Space(8f);
+
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+ SerializedProperty propVideoApi = serializedObject.FindProperty(optionsVarName + ".videoApi");
+ if (propVideoApi != null)
+ {
+ EditorGUILayout.PropertyField(propVideoApi, new GUIContent("Preferred Video API", "The preferred video API to use"));
+
+ GUILayout.Space(8f);
+
+ {
+ SerializedProperty propUseTextureMips = serializedObject.FindProperty(optionsVarName + ".useTextureMips");
+ if (propUseTextureMips != null)
+ {
+ EditorGUILayout.PropertyField(propUseTextureMips, new GUIContent("Generate Texture Mips", "Automatically create mip-maps for the texture to reducing aliasing when texture is scaled down"));
+ if (propUseTextureMips.boolValue && ((FilterMode)_propFilter.enumValueIndex) != FilterMode.Trilinear)
+ {
+ ShowNoticeBox(MessageType.Info, "Recommend changing the texture filtering mode to Trilinear when using mip-maps.");
+ }
+ }
+ }
+
+ GUILayout.Space(8f);
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("Media Foundation Options", EditorStyles.boldLabel);
+ SerializedProperty propUseHardwareDecoding = serializedObject.FindProperty(optionsVarName + ".useHardwareDecoding");
+ if (propUseHardwareDecoding != null)
+ {
+ EditorGUILayout.PropertyField(propUseHardwareDecoding, new GUIContent("Hardware Decoding"));
+ }
+
+ {
+ SerializedProperty propUseLowLatency = serializedObject.FindProperty(optionsVarName + ".useLowLatency");
+ if (propUseLowLatency != null)
+ {
+ EditorGUILayout.PropertyField(propUseLowLatency, new GUIContent("Use Low Latency", "Provides a hint to the decoder to use less buffering"));
+ }
+ }
+
+ int audioModeIndex = 0;
+ {
+ SerializedProperty propUseUnityAudio = serializedObject.FindProperty(optionsVarName + ".useUnityAudio");
+ SerializedProperty propEnableAudio360 = serializedObject.FindProperty(optionsVarName + ".enableAudio360");
+
+ if (propEnableAudio360.boolValue)
+ {
+ audioModeIndex = 1;
+ }
+ if (propUseUnityAudio.boolValue)
+ {
+ audioModeIndex = 2;
+ }
+ int newAudioModeIndex = EditorGUILayout.Popup(new GUIContent("Audio Mode"), audioModeIndex, _audioModesWindows);
+ if (newAudioModeIndex != audioModeIndex)
+ {
+ switch (newAudioModeIndex)
+ {
+ case 0:
+ propUseUnityAudio.boolValue = false;
+ propEnableAudio360.boolValue = false;
+ break;
+ case 1:
+ propUseUnityAudio.boolValue = false;
+ propEnableAudio360.boolValue = true;
+ break;
+ case 2:
+ propUseUnityAudio.boolValue = true;
+ propEnableAudio360.boolValue = false;
+ break;
+ }
+ }
+ }
+
+ if (audioModeIndex == 2)
+ {
+ EditorGUILayout.Space();
+ EditorGUILayout.LabelField("Unity Audio", EditorStyles.boldLabel);
+
+ SerializedProperty propForceAudioResample = serializedObject.FindProperty(optionsVarName + ".forceAudioResample");
+ if (propForceAudioResample != null)
+ {
+ EditorGUILayout.PropertyField(propForceAudioResample, new GUIContent("Stereo", "Forces plugin to resample the video's audio to 2 channels"));
+ }
+
+ OnInspectorGUI_AudioOutput();
+ }
+ else if (audioModeIndex == 1)
+ {
+ EditorGUILayout.Space();
+ EditorGUILayout.LabelField("Facebook Audio 360", EditorStyles.boldLabel);
+
+ SerializedProperty prop360AudioChannelMode = serializedObject.FindProperty(optionsVarName + ".audio360ChannelMode");
+ if (prop360AudioChannelMode != null)
+ {
+ GUIContent label = new GUIContent("Channel Mode", "Specifies what channel mode Facebook Audio 360 needs to be initialised with");
+ prop360AudioChannelMode.enumValueIndex = EditorGUILayout.Popup(label, prop360AudioChannelMode.enumValueIndex, _audio360ChannelMapGuiNames);
+ }
+
+ SerializedProperty propForceAudioOutputDeviceName = serializedObject.FindProperty(optionsVarName + ".forceAudioOutputDeviceName");
+ if (propForceAudioOutputDeviceName != null)
+ {
+ string[] deviceNames = { "Default", Windows.AudioDeviceOutputName_Rift, Windows.AudioDeviceOutputName_Vive, "Custom" };
+ int index = 0;
+ if (!string.IsNullOrEmpty(propForceAudioOutputDeviceName.stringValue))
+ {
+ switch (propForceAudioOutputDeviceName.stringValue)
+ {
+ case Windows.AudioDeviceOutputName_Rift:
+ index = 1;
+ break;
+ case Windows.AudioDeviceOutputName_Vive:
+ index = 2;
+ break;
+ default:
+ index = 3;
+ break;
+ }
+ }
+ int newIndex = EditorGUILayout.Popup("Audio Device Name", index, deviceNames);
+ if (newIndex == 0)
+ {
+ propForceAudioOutputDeviceName.stringValue = string.Empty;
+ }
+ else if (newIndex == 3)
+ {
+ if (index != newIndex)
+ {
+ if (string.IsNullOrEmpty(propForceAudioOutputDeviceName.stringValue) ||
+ propForceAudioOutputDeviceName.stringValue == Windows.AudioDeviceOutputName_Rift ||
+ propForceAudioOutputDeviceName.stringValue == Windows.AudioDeviceOutputName_Vive)
+ {
+ propForceAudioOutputDeviceName.stringValue = "?";
+ }
+ }
+ EditorGUILayout.PropertyField(propForceAudioOutputDeviceName, new GUIContent("Audio Device Name", "Useful for VR when you need to output to the VR audio device"));
+ }
+ else
+ {
+ propForceAudioOutputDeviceName.stringValue = deviceNames[newIndex];
+ }
+ }
+ }
+
+ EditorGUILayout.EndVertical();
+
+ GUILayout.Space(8f);
+
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("DirectShow Options", EditorStyles.boldLabel);
+ {
+ SerializedProperty propHintAlphaChannel = serializedObject.FindProperty(optionsVarName + ".hintAlphaChannel");
+ if (propHintAlphaChannel != null)
+ {
+ EditorGUILayout.PropertyField(propHintAlphaChannel, new GUIContent("Alpha Channel Hint", "If a video is detected as 32-bit, use or ignore the alpha channel"));
+ }
+ }
+ {
+ SerializedProperty propForceAudioOutputDeviceName = serializedObject.FindProperty(optionsVarName + ".forceAudioOutputDeviceName");
+ if (propForceAudioOutputDeviceName != null)
+ {
+ EditorGUILayout.PropertyField(propForceAudioOutputDeviceName, new GUIContent("Force Audio Output Device Name", "Useful for VR when you need to output to the VR audio device"));
+ }
+ }
+ {
+ int prevIndentLevel = EditorGUI.indentLevel;
+ EditorGUI.indentLevel = 1;
+ SerializedProperty propPreferredFilter = serializedObject.FindProperty(optionsVarName + ".preferredFilters");
+ if (propPreferredFilter != null)
+ {
+ EditorGUILayout.PropertyField(propPreferredFilter, new GUIContent("Preferred Filters", "Priority list for preferred filters to be used instead of default"), true);
+ if (propPreferredFilter.arraySize > 0)
+ {
+ ShowNoticeBox(MessageType.Info, "Command filter names are:\n1) \"Microsoft DTV-DVD Video Decoder\" (best for compatibility when playing H.264 videos)\n2) \"LAV Video Decoder\"\n3) \"LAV Audio Decoder\"");
+ }
+ }
+ EditorGUI.indentLevel = prevIndentLevel;
+ }
+
+ EditorGUILayout.EndVertical();
+
+ }
+ }
+
+ private void OnInspectorGUI_Override_Apple(string optionsVarName)
+ {
+ // HTTP header fields
+ SerializedProperty prop = serializedObject.FindProperty(optionsVarName + ".httpHeaderJson");
+ if (prop != null)
+ {
+ EditorGUILayout.PropertyField(prop, new GUIContent("HTTP Header (JSON)", "Allows custom http fields."));
+ }
+
+ GUILayout.Space(8f);
+
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("HLS Decryption", EditorStyles.boldLabel);
+
+ // Key server auth token
+ prop = serializedObject.FindProperty(optionsVarName + ".keyServerAuthToken");
+ if (prop != null)
+ {
+ EditorGUILayout.PropertyField(prop, new GUIContent("Key Server Authorization Token", "Token to pass to the key server in the 'Authorization' header field"));
+ }
+
+ GUILayout.Label("Overrides");
+ EditorGUI.indentLevel++;
+
+ // Key server override
+ prop = serializedObject.FindProperty(optionsVarName + ".keyServerURLOverride");
+ if (prop != null)
+ {
+ EditorGUILayout.PropertyField(prop, new GUIContent("Key Server URL", "Overrides the key server URL if present in a HLS manifest."));
+ }
+
+ // Key data blob override
+ prop = serializedObject.FindProperty(optionsVarName + ".base64EncodedKeyBlob");
+ if (prop != null)
+ {
+ EditorGUILayout.PropertyField(prop, new GUIContent("Key (Base64)", "Override Base64 encoded key to use for decoding encrypted HLS streams."));
+ }
+
+ EditorGUI.indentLevel--;
+
+ EditorGUILayout.EndVertical();
+ }
+
+ private void OnInspectorGUI_Override_MacOSX()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsMacOSX options = media._optionsMacOSX;
+
+ GUILayout.Space(8f);
+
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+ OnInspectorGUI_Override_Apple(optionsVarName);
+ }
+
+ private void OnInspectorGUI_Override_iOS()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsIOS options = media._optionsIOS;
+
+ GUILayout.Space(8f);
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+
+ SerializedProperty prop = serializedObject.FindProperty(optionsVarName + ".useYpCbCr420Textures");
+ if (prop != null)
+ EditorGUILayout.PropertyField(prop, new GUIContent("Use YpCbCr420", "Reduces memory usage, REQUIRES shader support."));
+
+ GUILayout.Space(8f);
+ OnInspectorGUI_Override_Apple(optionsVarName);
+ }
+
+ private void OnInspectorGUI_Override_tvOS()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsTVOS options = media._optionsTVOS;
+
+ GUILayout.Space(8f);
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+
+ SerializedProperty prop = serializedObject.FindProperty(optionsVarName + ".useYpCbCr420Textures");
+ if (prop != null)
+ EditorGUILayout.PropertyField(prop, new GUIContent("Use YpCbCr420", "Reduces memory usage, REQUIRES shader support."));
+
+ GUILayout.Space(8f);
+ OnInspectorGUI_Override_Apple(optionsVarName);
+ }
+
+ private void OnInspectorGUI_Override_Android()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsAndroid options = media._optionsAndroid;
+
+ GUILayout.Space(8f);
+
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+
+ SerializedProperty propVideoApi = serializedObject.FindProperty(optionsVarName + ".videoApi");
+ if (propVideoApi != null)
+ {
+ EditorGUILayout.PropertyField(propVideoApi, new GUIContent("Preferred Video API", "The preferred video API to use"));
+
+ GUILayout.Space(8f);
+
+ SerializedProperty propFileOffset = serializedObject.FindProperty(optionsVarName + ".fileOffset");
+ if (propFileOffset != null)
+ {
+ EditorGUILayout.PropertyField(propFileOffset);
+ propFileOffset.intValue = Mathf.Max(0, propFileOffset.intValue);
+ }
+
+ SerializedProperty propUseFastOesPath = serializedObject.FindProperty(optionsVarName + ".useFastOesPath");
+ if (propUseFastOesPath != null)
+ {
+ EditorGUILayout.PropertyField(propUseFastOesPath, new GUIContent("Use Fast OES Path", "Enables a faster rendering path using OES textures. This requires that all rendering in Unity uses special GLSL shaders."));
+ if (propUseFastOesPath.boolValue)
+ {
+ ShowNoticeBox(MessageType.Info, "OES can require special shaders. Make sure you assign an AVPro Video OES shader to your meshes/materials that need to display video.");
+#if UNITY_5_6_0 || UNITY_5_6_1
+ ShowNoticeBox(MessageType.Warning, "Unity 5.6.0 and 5.6.1 have a known bug with OES path. Please use another version of Unity for this feature and vote to fix bug #899502.");
+#endif
+ ShowNoticeBox(MessageType.Warning, "OES is not supported in the trial version. If your Android plugin is not trial then you can ignore this warning.");
+ }
+ }
+
+ SerializedProperty propShowPosterFrame = serializedObject.FindProperty(optionsVarName + ".showPosterFrame");
+ if (propShowPosterFrame != null)
+ {
+ EditorGUILayout.PropertyField(propShowPosterFrame, new GUIContent("Show Poster Frame", "Allows a paused loaded video to display the initial frame. This uses up decoder resources."));
+ }
+
+ SerializedProperty propHttpHeaderJson = serializedObject.FindProperty(optionsVarName + ".httpHeaderJson");
+ if (propHttpHeaderJson != null)
+ {
+ EditorGUILayout.PropertyField(propHttpHeaderJson, new GUIContent("HTTP Header (JSON)", "Allows custom http fields."));
+ }
+
+ if ((Android.VideoApi)propVideoApi.intValue == Android.VideoApi.ExoPlayer)
+ {
+ EditorGUILayout.BeginVertical("box");
+ GUILayout.Label("ExoPlayer Options", EditorStyles.boldLabel);
+
+ SerializedProperty propPreferSoftwareDecoder = serializedObject.FindProperty(optionsVarName + ".preferSoftwareDecoder");
+ if(propPreferSoftwareDecoder != null)
+ {
+ EditorGUILayout.PropertyField(propPreferSoftwareDecoder);
+ }
+
+ int audioModeIndex = 0;
+ {
+ SerializedProperty propEnableAudio360 = serializedObject.FindProperty(optionsVarName + ".enableAudio360");
+
+ if (propEnableAudio360.boolValue)
+ {
+ audioModeIndex = 1;
+ }
+ int newAudioModeIndex = EditorGUILayout.Popup(new GUIContent("Audio Mode"), audioModeIndex, _audioModesAndroid);
+ if (newAudioModeIndex != audioModeIndex)
+ {
+ switch (newAudioModeIndex)
+ {
+ case 0:
+ propEnableAudio360.boolValue = false;
+ break;
+ case 1:
+ propEnableAudio360.boolValue = true;
+ break;
+ }
+ }
+ }
+
+ if (audioModeIndex == 1)
+ {
+ EditorGUILayout.Space();
+ EditorGUILayout.LabelField("Facebook Audio 360", EditorStyles.boldLabel);
+
+ SerializedProperty prop360AudioChannelMode = serializedObject.FindProperty(optionsVarName + ".audio360ChannelMode");
+ if (prop360AudioChannelMode != null)
+ {
+ GUIContent label = new GUIContent("Channel Mode", "Specifies what channel mode Facebook Audio 360 needs to be initialised with");
+ prop360AudioChannelMode.enumValueIndex = EditorGUILayout.Popup(label, prop360AudioChannelMode.enumValueIndex, _audio360ChannelMapGuiNames);
+ }
+ }
+
+ EditorGUILayout.EndVertical();
+ }
+ GUI.enabled = true;
+ }
+
+ /*
+ SerializedProperty propFileOffsetLow = serializedObject.FindProperty(optionsVarName + ".fileOffsetLow");
+ SerializedProperty propFileOffsetHigh = serializedObject.FindProperty(optionsVarName + ".fileOffsetHigh");
+ if (propFileOffsetLow != null && propFileOffsetHigh != null)
+ {
+ propFileOffsetLow.intValue = ;
+
+ EditorGUILayout.PropertyField(propFileOFfset);
+ }*/
+ }
+
+ private void OnInspectorGUI_Override_WindowsPhone()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsWindowsPhone options = media._optionsWindowsPhone;
+
+ GUILayout.Space(8f);
+
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+
+ {
+ SerializedProperty propUseHardwareDecoding = serializedObject.FindProperty(optionsVarName + ".useHardwareDecoding");
+ if (propUseHardwareDecoding != null)
+ {
+ EditorGUILayout.PropertyField(propUseHardwareDecoding, new GUIContent("Hardware Decoding"));
+ }
+ }
+ {
+ SerializedProperty propUseTextureMips = serializedObject.FindProperty(optionsVarName + ".useTextureMips");
+ if (propUseTextureMips != null)
+ {
+ EditorGUILayout.PropertyField(propUseTextureMips, new GUIContent("Generate Texture Mips", "Automatically create mip-maps for the texture to reducing aliasing when texture is scaled down"));
+ if (propUseTextureMips.boolValue && ((FilterMode)_propFilter.enumValueIndex) != FilterMode.Trilinear)
+ {
+ ShowNoticeBox(MessageType.Info, "Recommend changing the texture filtering mode to Trilinear when using mip-maps.");
+ }
+ }
+ }
+ {
+ SerializedProperty propUseLowLatency = serializedObject.FindProperty(optionsVarName + ".useLowLatency");
+ if (propUseLowLatency != null)
+ {
+ EditorGUILayout.PropertyField(propUseLowLatency, new GUIContent("Use Low Latency", "Provides a hint to the decoder to use less buffering"));
+ }
+ }
+
+ int audioModeIndex = 0;
+ {
+ SerializedProperty propUseUnityAudio = serializedObject.FindProperty(optionsVarName + ".useUnityAudio");
+ if (propUseUnityAudio.boolValue)
+ {
+ audioModeIndex = 1;
+ }
+ int newAudioModeIndex = EditorGUILayout.Popup(new GUIContent("Audio Mode"), audioModeIndex, _audioModesUWP);
+ if (newAudioModeIndex != audioModeIndex)
+ {
+ switch (newAudioModeIndex)
+ {
+ case 0:
+ propUseUnityAudio.boolValue = false;
+ break;
+ case 1:
+ propUseUnityAudio.boolValue = true;
+ break;
+ }
+ }
+ }
+
+ if (audioModeIndex == 1)
+ {
+ EditorGUILayout.Space();
+ EditorGUILayout.LabelField("Unity Audio", EditorStyles.boldLabel);
+
+ SerializedProperty propForceAudioResample = serializedObject.FindProperty(optionsVarName + ".forceAudioResample");
+ if (propForceAudioResample != null)
+ {
+ EditorGUILayout.PropertyField(propForceAudioResample, new GUIContent("Stereo", "Forces plugin to resample the video's audio to 2 channels"));
+ }
+
+ OnInspectorGUI_AudioOutput();
+ }
+
+ GUI.enabled = true;
+ }
+
+ private void OnInspectorGUI_Override_WindowsUWP()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsWindowsUWP options = media._optionsWindowsUWP;
+
+ GUILayout.Space(8f);
+
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+
+ {
+ SerializedProperty propUseHardwareDecoding = serializedObject.FindProperty(optionsVarName + ".useHardwareDecoding");
+ if (propUseHardwareDecoding != null)
+ {
+ EditorGUILayout.PropertyField(propUseHardwareDecoding, new GUIContent("Hardware Decoding"));
+ }
+ }
+ {
+ SerializedProperty propUseTextureMips = serializedObject.FindProperty(optionsVarName + ".useTextureMips");
+ if (propUseTextureMips != null)
+ {
+ EditorGUILayout.PropertyField(propUseTextureMips, new GUIContent("Generate Texture Mips", "Automatically create mip-maps for the texture to reducing aliasing when texture is scaled down"));
+ if (propUseTextureMips.boolValue && ((FilterMode)_propFilter.enumValueIndex) != FilterMode.Trilinear)
+ {
+ ShowNoticeBox(MessageType.Info, "Recommend changing the texture filtering mode to Trilinear when using mip-maps.");
+ }
+ }
+ }
+ {
+ SerializedProperty propUseLowLatency = serializedObject.FindProperty(optionsVarName + ".useLowLatency");
+ if (propUseLowLatency != null)
+ {
+ EditorGUILayout.PropertyField(propUseLowLatency, new GUIContent("Use Low Latency", "Provides a hint to the decoder to use less buffering"));
+ }
+ }
+
+ int audioModeIndex = 0;
+ {
+ SerializedProperty propUseUnityAudio = serializedObject.FindProperty(optionsVarName + ".useUnityAudio");
+ if (propUseUnityAudio.boolValue)
+ {
+ audioModeIndex = 1;
+ }
+ int newAudioModeIndex = EditorGUILayout.Popup(new GUIContent("Audio Mode"), audioModeIndex, _audioModesUWP);
+ if (newAudioModeIndex != audioModeIndex)
+ {
+ switch (newAudioModeIndex)
+ {
+ case 0:
+ propUseUnityAudio.boolValue = false;
+ break;
+ case 1:
+ propUseUnityAudio.boolValue = true;
+ break;
+ }
+ }
+ }
+
+ if (audioModeIndex == 1)
+ {
+ EditorGUILayout.Space();
+ EditorGUILayout.LabelField("Unity Audio", EditorStyles.boldLabel);
+
+ SerializedProperty propForceAudioResample = serializedObject.FindProperty(optionsVarName + ".forceAudioResample");
+ if (propForceAudioResample != null)
+ {
+ EditorGUILayout.PropertyField(propForceAudioResample, new GUIContent("Stereo", "Forces plugin to resample the video's audio to 2 channels"));
+ }
+
+ OnInspectorGUI_AudioOutput();
+ }
+
+ GUI.enabled = true;
+ }
+
+ private void OnInspectorGUI_Override_WebGL()
+ {
+ //MediaPlayer media = (this.target) as MediaPlayer;
+ //MediaPlayer.OptionsWebGL options = media._optionsWebGL;
+ string optionsVarName = MediaPlayer.GetPlatformOptionsVariable((Platform)_platformIndex);
+
+ SerializedProperty propExternalLibrary = serializedObject.FindProperty(optionsVarName + ".externalLibrary");
+ if (propExternalLibrary != null)
+ {
+ EditorGUILayout.PropertyField(propExternalLibrary);
+ }
+
+ {
+ SerializedProperty propUseTextureMips = serializedObject.FindProperty(optionsVarName + ".useTextureMips");
+ if (propUseTextureMips != null)
+ {
+ EditorGUILayout.PropertyField(propUseTextureMips, new GUIContent("Generate Texture Mips", "Automatically create mip-maps for the texture to reducing aliasing when texture is scaled down"));
+ if (propUseTextureMips.boolValue && ((FilterMode)_propFilter.enumValueIndex) != FilterMode.Trilinear)
+ {
+ ShowNoticeBox(MessageType.Info, "Recommend changing the texture filtering mode to Trilinear when using mip-maps.");
+ }
+ }
+ }
+ }
+
+ private static bool Browse(string startPath, ref string filePath, ref MediaPlayer.FileLocation fileLocation, ref string fullPath, string extensions)
+ {
+ bool result = false;
+
+ string path = UnityEditor.EditorUtility.OpenFilePanel("Browse Video File", startPath, extensions);
+ if (!string.IsNullOrEmpty(path) && !path.EndsWith(".meta"))
+ {
+ fullPath = path;
+ GetRelativeLocationFromPath(path, ref filePath, ref fileLocation);
+ result = true;
+ }
+
+ return result;
+ }
+
+ private static void GetRelativeLocationFromPath(string path, ref string filePath, ref MediaPlayer.FileLocation fileLocation)
+ {
+ string projectRoot = System.IO.Path.GetFullPath(System.IO.Path.Combine(Application.dataPath, ".."));
+ projectRoot = projectRoot.Replace('\\', '/');
+
+ if (path.StartsWith(projectRoot))
+ {
+ if (path.StartsWith(Application.streamingAssetsPath))
+ {
+ // Must be StreamingAssets relative path
+ filePath = GetPathRelativeTo(Application.streamingAssetsPath, path);
+ fileLocation = MediaPlayer.FileLocation.RelativeToStreamingAssetsFolder;
+ }
+ else if (path.StartsWith(Application.dataPath))
+ {
+ // Must be Assets relative path
+ filePath = GetPathRelativeTo(Application.dataPath, path);
+ fileLocation = MediaPlayer.FileLocation.RelativeToDataFolder;
+ }
+ else
+ {
+ // Must be project relative path
+ filePath = GetPathRelativeTo(projectRoot, path);
+ fileLocation = MediaPlayer.FileLocation.RelativeToProjectFolder;
+ }
+ }
+ else
+ {
+ // Must be persistant data
+ if (path.StartsWith(Application.persistentDataPath))
+ {
+ filePath = GetPathRelativeTo(Application.persistentDataPath, path);
+ fileLocation = MediaPlayer.FileLocation.RelativeToPeristentDataFolder;
+ }
+
+ // Must be absolute path
+ filePath = path;
+ fileLocation = MediaPlayer.FileLocation.AbsolutePathOrURL;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/MediaPlayerEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/MediaPlayerEditor.cs.meta
new file mode 100644
index 0000000..7962d76
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/MediaPlayerEditor.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 8fdcfef6a9f4f724486d3374e03f4864
+timeCreated: 1448902492
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PlaylistMediaPlayerEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PlaylistMediaPlayerEditor.cs
new file mode 100644
index 0000000..c3333dd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PlaylistMediaPlayerEditor.cs
@@ -0,0 +1,359 @@
+using UnityEngine;
+using UnityEditor;
+using System.Collections.Generic;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// Editor for the MediaPlaylist.MediaItem class
+ ///
+ [CustomPropertyDrawer(typeof(MediaPlaylist))]
+ public class MediaPlaylistDrawer : PropertyDrawer
+ {
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+ // Using BeginProperty / EndProperty on the parent property means that
+ // prefab override logic works on the entire property.
+ EditorGUI.BeginProperty(position, label, property);
+
+ EditorGUILayout.LabelField("Items");
+
+ SerializedProperty propItems = property.FindPropertyRelative("_items");
+
+ for (int i = 0; i < propItems.arraySize; i++)
+ {
+ SerializedProperty propItem = propItems.GetArrayElementAtIndex(i);
+
+ GUILayout.BeginVertical(GUI.skin.box);
+ propItem.isExpanded = EditorGUILayout.ToggleLeft("Item " + i, propItem.isExpanded);
+ if (propItem.isExpanded)
+ {
+ EditorGUILayout.PropertyField(propItem);
+ GUILayout.BeginHorizontal();
+ if (GUILayout.Button("Insert"))
+ {
+ propItems.InsertArrayElementAtIndex(i);
+ }
+ if (GUILayout.Button("Delete"))
+ {
+ propItems.DeleteArrayElementAtIndex(i);
+ }
+ EditorGUI.BeginDisabledGroup((i - 1) < 0);
+ if (GUILayout.Button("Up"))
+ {
+ propItems.MoveArrayElement(i, i - 1);
+ }
+ EditorGUI.EndDisabledGroup();
+ EditorGUI.BeginDisabledGroup((i + 1) >= propItems.arraySize);
+ if (GUILayout.Button("Down"))
+ {
+ propItems.MoveArrayElement(i, i + 1);
+ }
+ EditorGUI.EndDisabledGroup();
+ GUILayout.EndHorizontal();
+ }
+
+ GUILayout.EndVertical();
+ }
+
+ EditorGUI.EndProperty();
+ }
+ }
+
+ ///
+ /// Editor for the MediaPlaylist.MediaItem class
+ ///
+ [CustomPropertyDrawer(typeof(MediaPlaylist.MediaItem))]
+ public class MediaPlaylistItemDrawer : PropertyDrawer
+ {
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+ //SerializedProperty propSourceType = property.FindPropertyRelative("sourceType");
+ SerializedProperty propIsOverrideTransition = property.FindPropertyRelative("isOverrideTransition");
+
+ //EditorGUILayout.PropertyField(propSourceType);
+ //if (propSourceType.enumValueIndex == 0)
+ {
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("fileLocation"));
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("filePath"));
+ }
+ /*else
+ {
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("texture"));
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("textureDuration"));
+ }*/
+
+ EditorGUILayout.Space();
+
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("stereoPacking"));
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("alphaPacking"));
+
+ EditorGUILayout.Space();
+
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("loop"));
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("autoPlay"));
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("startMode"));
+ SerializedProperty propProgressMode = property.FindPropertyRelative("progressMode");
+ EditorGUILayout.PropertyField(propProgressMode);
+ if (propProgressMode.enumValueIndex == (int)PlaylistMediaPlayer.ProgressMode.BeforeFinish)
+ {
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("progressTimeSeconds"));
+ }
+
+ EditorGUILayout.Space();
+
+ EditorGUILayout.PropertyField(propIsOverrideTransition, new GUIContent("Override Transition"));
+ if (propIsOverrideTransition.boolValue)
+ {
+ EditorGUI.indentLevel++;
+ SerializedProperty propTransitionMode = property.FindPropertyRelative("overrideTransition");
+ EditorGUILayout.PropertyField(propTransitionMode, new GUIContent("Transition"));
+ if (propTransitionMode.enumValueIndex != (int)PlaylistMediaPlayer.Transition.None)
+ {
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("overrideTransitionDuration"), new GUIContent("Duration"));
+ EditorGUILayout.PropertyField(property.FindPropertyRelative("overrideTransitionEasing.preset"), new GUIContent("Easing"));
+ }
+ EditorGUI.indentLevel--;
+ }
+ }
+ }
+
+ ///
+ /// Editor for the PlaylistMediaPlayer component
+ ///
+ [CanEditMultipleObjects]
+ [CustomEditor(typeof(PlaylistMediaPlayer))]
+ public class PlaylistMediaPlayerEditor : UnityEditor.Editor
+ {
+ private SerializedProperty _propPlayerA;
+ private SerializedProperty _propPlayerB;
+ private SerializedProperty _propNextTransition;
+ private SerializedProperty _propPlaylist;
+ private SerializedProperty _propPlaylistAutoProgress;
+ private SerializedProperty _propPlaylistLoopMode;
+ private SerializedProperty _propPausePreviousOnTransition;
+ private SerializedProperty _propTransitionDuration;
+ private SerializedProperty _propTransitionEasing;
+
+ private void OnEnable()
+ {
+ _propPlayerA = serializedObject.FindProperty("_playerA");
+ _propPlayerB = serializedObject.FindProperty("_playerB");
+ _propNextTransition = serializedObject.FindProperty("_nextTransition");
+ _propTransitionDuration = serializedObject.FindProperty("_transitionDuration");
+ _propTransitionEasing = serializedObject.FindProperty("_transitionEasing.preset");
+ _propPausePreviousOnTransition = serializedObject.FindProperty("_pausePreviousOnTransition");
+ _propPlaylist = serializedObject.FindProperty("_playlist");
+ _propPlaylistAutoProgress = serializedObject.FindProperty("_playlistAutoProgress");
+ _propPlaylistLoopMode = serializedObject.FindProperty("_playlistLoopMode");
+ }
+
+ public override bool RequiresConstantRepaint()
+ {
+ PlaylistMediaPlayer media = (this.target) as PlaylistMediaPlayer;
+ return (media.Control != null && media.isActiveAndEnabled);
+ }
+
+ public override void OnInspectorGUI()
+ {
+ PlaylistMediaPlayer media = (this.target) as PlaylistMediaPlayer;
+
+ serializedObject.Update();
+
+ if (media == null || _propPlayerA == null)
+ {
+ return;
+ }
+
+ EditorGUILayout.PropertyField(_propPlayerA);
+ EditorGUILayout.PropertyField(_propPlayerB);
+ EditorGUILayout.Space();
+ EditorGUILayout.Space();
+ GUILayout.Label("Playlist", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propPlaylistAutoProgress, new GUIContent("Auto Progress"));
+ EditorGUILayout.PropertyField(_propPlaylistLoopMode, new GUIContent("Loop Mode"));
+ EditorGUILayout.PropertyField(_propPlaylist);
+ EditorGUILayout.Space();
+ EditorGUILayout.Space();
+ GUILayout.Label("Transition", EditorStyles.boldLabel);
+ EditorGUILayout.PropertyField(_propNextTransition, new GUIContent("Next"));
+ EditorGUILayout.PropertyField(_propTransitionEasing, new GUIContent("Easing"));
+ EditorGUILayout.PropertyField(_propTransitionDuration, new GUIContent("Duration"));
+ EditorGUILayout.PropertyField(_propPausePreviousOnTransition, new GUIContent("Pause Previous"));
+ EditorGUILayout.Space();
+ EditorGUILayout.Space();
+
+ if (Application.isPlaying)
+ {
+ IMediaProducer textureSource = media.TextureProducer;
+
+ Texture texture = null;
+ if (textureSource != null)
+ {
+ texture = textureSource.GetTexture();
+ }
+ if (texture == null)
+ {
+ texture = EditorGUIUtility.whiteTexture;
+ }
+
+ float ratio = 1f;// (float)texture.width / (float)texture.height;
+
+ // Reserve rectangle for texture
+ GUILayout.BeginHorizontal();
+ GUILayout.FlexibleSpace();
+ Rect textureRect;
+ Rect alphaRect = new Rect(0f, 0f, 1f, 1f);
+ if (texture != EditorGUIUtility.whiteTexture)
+ {
+ textureRect = GUILayoutUtility.GetRect(Screen.width / 2, Screen.width / 2, (Screen.width / 2) / ratio, (Screen.width / 2) / ratio);
+ }
+ else
+ {
+ textureRect = GUILayoutUtility.GetRect(1920f / 40f, 1080f / 40f);
+ }
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ string rateText = "0";
+ string playerText = string.Empty;
+ if (media.Info != null)
+ {
+ rateText = media.Info.GetVideoDisplayRate().ToString("F2");
+ playerText = media.Info.GetPlayerDescription();
+ }
+
+ EditorGUILayout.LabelField("Display Rate", rateText);
+ EditorGUILayout.LabelField("Using", playerText);
+
+ // Draw the texture
+ Matrix4x4 prevMatrix = GUI.matrix;
+ if (textureSource != null && textureSource.RequiresVerticalFlip())
+ {
+ GUIUtility.ScaleAroundPivot(new Vector2(1f, -1f), new Vector2(0, textureRect.y + (textureRect.height / 2)));
+ }
+
+ if (!GUI.enabled)
+ {
+ GUI.color = Color.grey;
+ GUI.DrawTexture(textureRect, texture, ScaleMode.ScaleToFit, false);
+ GUI.color = Color.white;
+ }
+ else
+ {
+ {
+ GUI.DrawTexture(textureRect, texture, ScaleMode.ScaleToFit, false);
+ EditorGUI.DrawTextureAlpha(alphaRect, texture, ScaleMode.ScaleToFit);
+ }
+ }
+ GUI.matrix = prevMatrix;
+ }
+
+ EditorGUI.BeginDisabledGroup(!(media.Control != null && media.Control.CanPlay() && media.isActiveAndEnabled && !EditorApplication.isPaused));
+ OnInspectorGUI_PlayControls(media.Control, media.Info);
+ EditorGUI.EndDisabledGroup();
+
+ EditorGUILayout.Space();
+ EditorGUILayout.Space();
+
+ EditorGUI.BeginDisabledGroup(!Application.isPlaying);
+
+ GUILayout.Label("Current Item: " + media.PlaylistIndex + " / " + Mathf.Max(0, media.Playlist.Items.Count - 1) );
+
+ GUILayout.BeginHorizontal();
+ EditorGUI.BeginDisabledGroup(!media.CanJumpToItem(media.PlaylistIndex - 1));
+ if (GUILayout.Button("Prev"))
+ {
+ media.PrevItem();
+ }
+ EditorGUI.EndDisabledGroup();
+ EditorGUI.BeginDisabledGroup(!media.CanJumpToItem(media.PlaylistIndex + 1));
+ if (GUILayout.Button("Next"))
+ {
+ media.NextItem();
+ }
+ EditorGUI.EndDisabledGroup();
+ GUILayout.EndHorizontal();
+ EditorGUI.EndDisabledGroup();
+
+ serializedObject.ApplyModifiedProperties();
+ }
+
+
+ private void OnInspectorGUI_PlayControls(IMediaControl control, IMediaInfo info)
+ {
+ GUILayout.Space(8.0f);
+
+ // Slider
+ EditorGUILayout.BeginHorizontal();
+ bool isPlaying = false;
+ if (control != null)
+ {
+ isPlaying = control.IsPlaying();
+ }
+ float currentTime = 0f;
+ if (control != null)
+ {
+ currentTime = control.GetCurrentTimeMs();
+ }
+
+ float durationTime = 0f;
+ if (info != null)
+ {
+ durationTime = info.GetDurationMs();
+ if (float.IsNaN(durationTime))
+ {
+ durationTime = 0f;
+ }
+ }
+ string timeUsed = Helper.GetTimeString(currentTime / 1000f, true);
+ GUILayout.Label(timeUsed, GUILayout.ExpandWidth(false));
+
+ float newTime = GUILayout.HorizontalSlider(currentTime, 0f, durationTime, GUILayout.ExpandWidth(true));
+ if (newTime != currentTime)
+ {
+ control.Seek(newTime);
+ }
+
+ string timeTotal = "Infinity";
+ if (!float.IsInfinity(durationTime))
+ {
+ timeTotal = Helper.GetTimeString(durationTime / 1000f, true);
+ }
+
+ GUILayout.Label(timeTotal, GUILayout.ExpandWidth(false));
+
+ EditorGUILayout.EndHorizontal();
+
+ // Buttons
+ EditorGUILayout.BeginHorizontal();
+ if (GUILayout.Button("Rewind", GUILayout.ExpandWidth(false)))
+ {
+ control.Rewind();
+ }
+
+ if (!isPlaying)
+ {
+ GUI.color = Color.green;
+ if (GUILayout.Button("Play", GUILayout.ExpandWidth(true)))
+ {
+ control.Play();
+ }
+ }
+ else
+ {
+ GUI.color = Color.yellow;
+ if (GUILayout.Button("Pause", GUILayout.ExpandWidth(true)))
+ {
+ control.Pause();
+ }
+ }
+ GUI.color = Color.white;
+ EditorGUILayout.EndHorizontal();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PlaylistMediaPlayerEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PlaylistMediaPlayerEditor.cs.meta
new file mode 100644
index 0000000..4bc8796
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PlaylistMediaPlayerEditor.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c9328411ef862884f97a993c4daa9b68
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PostProcessBuild.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PostProcessBuild.cs
new file mode 100644
index 0000000..bc3ea9f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PostProcessBuild.cs
@@ -0,0 +1,33 @@
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
+using System.IO;
+using UnityEngine;
+using UnityEditor;
+using UnityEditor.Callbacks;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ public class PostProcessBuild
+ {
+ [PostProcessBuild]
+ public static void OnPostProcessBuild(BuildTarget target, string path)
+ {
+ bool x86 = false;
+#if UNITY_2017_3_OR_NEWER
+ // 64-bit only from here on out, woo hoo!!! \o/
+#else
+ x86 = target == BuildTarget.StandaloneOSXIntel || target == BuildTarget.StandaloneOSXUniversal;
+#endif
+ if (x86)
+ {
+ string message = "AVPro Video doesn't support target StandaloneOSXIntel (32-bit), please use StandaloneOSXIntel64 (64-bit) or remove this PostProcessBuild script";
+ Debug.LogError(message);
+ EditorUtility.DisplayDialog("AVPro Video", message, "Ok");
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PostProcessBuild.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PostProcessBuild.cs.meta
new file mode 100644
index 0000000..aae8acd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/PostProcessBuild.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1e59c97bf0125284dab6c83833518fcf
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/SupportWindow.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/SupportWindow.cs
new file mode 100644
index 0000000..459a900
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/SupportWindow.cs
@@ -0,0 +1,383 @@
+#if UNITY_5_4_OR_NEWER || UNITY_5
+ #if !UNITY_5_0
+ #define AVPROVIDEO_WINDOWTITLE_51
+ #endif
+#endif
+
+using UnityEngine;
+using UnityEditor;
+
+//-----------------------------------------------------------------------------
+// Copyright 2016-2018 RenderHeads Ltd. All rights reserved.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// A window to display options to the user to help them report bugs
+ /// Also collects some metadata about the machine specs, plugin version etc
+ ///
+ public class SupportWindow : EditorWindow
+ {
+ private class MyPopupWindow : PopupWindowContent
+ {
+ private string _text;
+
+ public MyPopupWindow(string text)
+ {
+ _text = text;
+ }
+
+ public override Vector2 GetWindowSize()
+ {
+ return new Vector2(400, 520);
+ }
+
+ public override void OnGUI(Rect rect)
+ {
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Copy-Paste this text, then ", EditorStyles.boldLabel);
+ GUI.color = Color.green;
+ if (GUILayout.Button("Go to Forum", GUILayout.ExpandWidth(true)))
+ {
+ Application.OpenURL(MediaPlayerEditor.LinkForumLastPage);
+ }
+ GUILayout.EndHorizontal();
+ GUI.color = Color.white;
+ EditorGUILayout.TextArea(_text);
+ }
+ }
+
+ private static bool _isCreated = false;
+ private static bool _isInit = false;
+
+ private const string SettingsPrefix = "AVProVideo.SupportWindow.";
+
+ private string _emailDescription = string.Empty;
+ private string _emailTopic = string.Empty;
+ private string _emailVideoFormat = string.Empty;
+ private string _emailDeviceSpecs = string.Empty;
+
+ //private bool _askForHelp = false;
+ private bool _trySelfSolve = false;
+ private Vector2 _scroll = Vector2.zero;
+
+ private int _selectionIndex = 0;
+ private static string[] _gridNames = { "Ask for Help", "Help Resources", "FAQ" };
+
+ [MenuItem("Window/AVPro Video Support")]
+ public static void Init()
+ {
+ // Close window if it is already open
+ if (_isInit || _isCreated)
+ {
+ SupportWindow window = (SupportWindow)EditorWindow.GetWindow(typeof(SupportWindow));
+ window.Close();
+ return;
+ }
+
+ _isCreated = true;
+
+ // Get existing open window or if none, make a new one:
+ SupportWindow window2 = ScriptableObject.CreateInstance();
+ if (window2 != null)
+ {
+ window2.SetupWindow();
+ }
+ }
+
+ private void SetupWindow()
+ {
+ _isCreated = true;
+ float width = 512f;
+ float height = 512f;
+ this.position = new Rect((Screen.width / 2) - (width / 2f), (Screen.height / 2) - (height / 2f), width, height);
+ this.minSize = new Vector2(530f, 510f);
+#if AVPROVIDEO_WINDOWTITLE_51
+ this.titleContent = new GUIContent("AVPro Video - Help & Support");
+#else
+ this.title = "AVPro Video - Support";
+#endif
+ this.CreateGUI();
+ LoadSettings();
+ this.ShowUtility();
+ this.Repaint();
+ }
+
+ private void CreateGUI()
+ {
+ _isInit = true;
+ }
+
+ void OnEnable()
+ {
+ if (!_isCreated)
+ {
+ SetupWindow();
+ }
+ }
+
+ void OnDisable()
+ {
+ _isInit = false;
+ _isCreated = false;
+ SaveSettings();
+ Repaint();
+ }
+
+ private void SaveSettings()
+ {
+ EditorPrefs.SetString(SettingsPrefix + "EmailTopic", _emailTopic);
+ EditorPrefs.SetString(SettingsPrefix + "EmailDescription", _emailDescription);
+ EditorPrefs.SetString(SettingsPrefix + "EmailDeviceSpecs", _emailDeviceSpecs);
+ EditorPrefs.SetString(SettingsPrefix + "EmailVideoSpecs", _emailVideoFormat);
+ EditorPrefs.SetBool(SettingsPrefix + "ExpandSelfSolve", _trySelfSolve);
+ EditorPrefs.SetInt(SettingsPrefix + "SelectionIndex", _selectionIndex);
+ }
+
+ private void LoadSettings()
+ {
+ _emailTopic = EditorPrefs.GetString(SettingsPrefix + "EmailTopic", _emailTopic);
+ _emailDescription = EditorPrefs.GetString(SettingsPrefix + "EmailDescription", _emailDescription);
+ _emailDeviceSpecs = EditorPrefs.GetString(SettingsPrefix + "EmailDeviceSpecs", _emailDeviceSpecs);
+ _emailVideoFormat = EditorPrefs.GetString(SettingsPrefix + "EmailVideoSpecs", _emailVideoFormat);
+ _trySelfSolve = EditorPrefs.GetBool(SettingsPrefix + "ExpandSelfSolve", _trySelfSolve);
+ _selectionIndex = EditorPrefs.GetInt(SettingsPrefix + "SelectionIndex", _selectionIndex);
+ }
+
+ private string CollectSupportData()
+ {
+ string nl = System.Environment.NewLine;
+
+ string version = string.Format("AVPro Video: plugin v{0} scripts v{1}", GetPluginVersion(), Helper.ScriptVersion);
+ string targetPlatform = "Target Platform: " + EditorUserBuildSettings.selectedBuildTargetGroup.ToString();
+ string unityVersion = "Unity: v" + Application.unityVersion + " " + Application.platform.ToString();
+
+ string deviceInfo = "OS: " + SystemInfo.deviceType + " - " + SystemInfo.deviceModel + " - " + SystemInfo.operatingSystem + " - " + Application.systemLanguage;
+ string cpuInfo = "CPU: " + SystemInfo.processorType + " - " + SystemInfo.processorCount + " threads - " + + SystemInfo.systemMemorySize + "KB";
+ string gfxInfo = "GPU: " + SystemInfo.graphicsDeviceName + " - " + SystemInfo.graphicsDeviceVendor + " - " + SystemInfo.graphicsDeviceVersion + " - " + SystemInfo.graphicsMemorySize + "KB - " + SystemInfo.maxTextureSize;
+
+ return version + nl + targetPlatform + nl + unityVersion + nl + deviceInfo + nl + cpuInfo + nl + gfxInfo;
+ }
+
+ void OnGUI()
+ {
+ if (!_isInit)
+ {
+ EditorGUILayout.LabelField("Initialising...");
+ return;
+ }
+
+ GUILayout.Label("Having problems? We'll do our best to help.\n\nBelow is a collection of resources to help solve any issues you may encounter.", EditorStyles.wordWrappedLabel);
+ GUILayout.Space(16f);
+
+ /*GUI.color = Color.white;
+ GUI.backgroundColor = Color.clear;
+ if (_trySelfSolve)
+ {
+ GUI.color = Color.white;
+ GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f, 0.1f);
+ if (EditorGUIUtility.isProSkin)
+ {
+ GUI.backgroundColor = Color.black;
+ }
+ }
+ GUILayout.BeginVertical("box");
+ GUI.backgroundColor = Color.white;*/
+
+ _selectionIndex = GUILayout.Toolbar(_selectionIndex, _gridNames);
+
+ GUILayout.Space(16f);
+ /*if (GUILayout.Button("Try Solve the Issue Yourself", EditorStyles.toolbarButton))
+ {
+ //_trySelfSolve = !_trySelfSolve;
+ _trySelfSolve = true;
+ }
+ GUI.color = Color.white;
+ if (_trySelfSolve)*/
+ if (_selectionIndex == 1)
+ {
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("1) ");
+ GUILayout.Label("Check you're using the latest version of AVPro Video via the Asset Store. This is version " + Helper.ScriptVersion, EditorStyles.wordWrappedLabel);
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("2) ");
+ GUILayout.Label("Look at the example projects and scripts in the Demos folder");
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("3) ");
+ GUI.color = Color.green;
+ if (GUILayout.Button("Read the Documentation", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(MediaPlayerEditor.LinkUserManual);
+ }
+ GUI.color = Color.white;
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("4) ");
+ GUI.color = Color.green;
+ if (GUILayout.Button("Read the Scripting Reference", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(MediaPlayerEditor.LinkScriptingClassReference);
+ }
+ GUI.color = Color.white;
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("5) ");
+ GUI.color = Color.green;
+ if (GUILayout.Button("Visit the AVPro Video Website", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(MediaPlayerEditor.LinkPluginWebsite);
+ }
+ GUI.color = Color.white;
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("6) ");
+ GUI.color = Color.green;
+ if (GUILayout.Button("Browse the Unity Forum", GUILayout.ExpandWidth(false)))
+ {
+ Application.OpenURL(MediaPlayerEditor.LinkForumPage);
+ }
+ GUI.color = Color.white;
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ }
+ else if (_selectionIndex == 2)
+ {
+ GUILayout.Label("Coming soon...");
+ }
+ else if (_selectionIndex == 0)
+ {
+ GUILayout.Label("Please fill out these fields when sending us a new issue.\nThis makes it much easier and faster to resolve the issue.", EditorStyles.wordWrappedLabel);
+ GUILayout.Space(16f);
+
+ GUILayout.BeginVertical("box");
+ _scroll = GUILayout.BeginScrollView(_scroll);
+
+ GUILayout.Label("Issue/Question Title", EditorStyles.boldLabel);
+ _emailTopic = GUILayout.TextField(_emailTopic);
+
+ GUILayout.Space(8f);
+ GUILayout.Label("What's the problem?", EditorStyles.boldLabel);
+ _emailDescription = EditorGUILayout.TextArea(_emailDescription, GUILayout.Height(64f));
+
+ GUILayout.Space(8f);
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Tell us about your videos", EditorStyles.boldLabel);
+ GUILayout.Label("- Number of videos, resolution, codec, frame-rate, example URLs", EditorStyles.miniBoldLabel);
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ _emailVideoFormat = EditorGUILayout.TextArea(_emailVideoFormat, GUILayout.Height(32f));
+
+ GUILayout.Space(8f);
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Which devices are you having the issue with?", EditorStyles.boldLabel);
+ GUILayout.Label("- Model, OS version number", EditorStyles.miniBoldLabel);
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ _emailDeviceSpecs = EditorGUILayout.TextField(_emailDeviceSpecs);
+
+ //GUILayout.Space(16f);
+ ////GUILayout.Label("System Information");
+ //GUILayout.TextArea(CollectSupportData());
+
+ string emailSubject = "AVPro Video - " + _emailTopic;
+
+ string emailBody = System.Environment.NewLine + System.Environment.NewLine;
+ emailBody += "Problem description:" + System.Environment.NewLine + System.Environment.NewLine + _emailDescription + System.Environment.NewLine + System.Environment.NewLine;
+ emailBody += "Device (which devices are you having the issue with - model, OS version number):" + System.Environment.NewLine + System.Environment.NewLine + _emailDeviceSpecs + System.Environment.NewLine + System.Environment.NewLine;
+ emailBody += "Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):" + System.Environment.NewLine + System.Environment.NewLine + _emailVideoFormat + System.Environment.NewLine + System.Environment.NewLine;
+ emailBody += "System Information:" + System.Environment.NewLine + System.Environment.NewLine + CollectSupportData() + System.Environment.NewLine + System.Environment.NewLine;
+
+ //GUILayout.Space(16f);
+//
+ //GUILayout.Label("Email Content");
+ //EditorGUILayout.TextArea(emailBody);
+
+ GUILayout.EndScrollView();
+ GUILayout.EndVertical();
+
+ GUILayout.Space(16f);
+
+ GUILayout.BeginHorizontal();
+ GUILayout.FlexibleSpace();
+ GUI.color = Color.green;
+ if (GUILayout.Button("Send via Email âž”\nunitysupport@renderheads.com", GUILayout.ExpandWidth(false), GUILayout.Height(32f)))
+ {
+ emailBody = emailBody.Replace(System.Environment.NewLine, "%0D%0A");
+ Application.OpenURL(string.Format("mailto:unitysupport@renderheads.com?subject={0}&body={1}", emailSubject, emailBody));
+ }
+ if (GUILayout.Button("Send at the Unity Forum âž”", GUILayout.ExpandWidth(false), GUILayout.Height(32f)))
+ {
+ PopupWindow.Show(buttonRect, new MyPopupWindow(emailBody));
+ //SupportWindowPopup.Init(emailBody);
+ //EditorUtility.DisplayDialog("AVPro Video", "Please include as much information as you can in the forum post", "OK");
+ }
+
+ if (Event.current.type == EventType.Repaint)
+ {
+ buttonRect = GUILayoutUtility.GetLastRect();
+ }
+
+ GUI.color = Color.white;
+ GUILayout.FlexibleSpace();
+ GUILayout.EndHorizontal();
+ }
+ //GUILayout.EndVertical();
+
+ GUILayout.FlexibleSpace();
+
+ if (GUILayout.Button("Close"))
+ {
+ this.Close();
+ }
+ }
+
+ private Rect buttonRect;
+
+ private struct Native
+ {
+#if UNITY_EDITOR_WIN
+ [System.Runtime.InteropServices.DllImport("AVProVideo")]
+ public static extern System.IntPtr GetPluginVersion();
+#elif UNITY_EDITOR_OSX
+ [System.Runtime.InteropServices.DllImport("AVProVideo")]
+ public static extern string AVPGetVersion();
+#endif
+ }
+
+ private static string GetPluginVersion()
+ {
+ string version = "Unknown";
+ try
+ {
+#if UNITY_EDITOR_WIN
+ version = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(Native.GetPluginVersion());
+#elif UNITY_EDITOR_OSX
+ version = Native.AVPGetVersion();
+#endif
+ }
+ catch (System.DllNotFoundException e)
+ {
+ Debug.LogError("[AVProVideo] Failed to load DLL. " + e.Message);
+#if (UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
+#if !UNITY_5 && !UNITY_5_4_OR_NEWER
+ Debug.LogError("[AVProVideo] You may need to copy the Audio360 DLL into the root folder of your project (the folder above Assets)");
+#endif
+#endif
+ }
+ return version;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/SupportWindow.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/SupportWindow.cs.meta
new file mode 100644
index 0000000..1aa9f65
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/SupportWindow.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e7d92cb5b84798a44b49bb610befa0cf
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/UpdateStereoMaterialEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/UpdateStereoMaterialEditor.cs
new file mode 100644
index 0000000..54d745c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/UpdateStereoMaterialEditor.cs
@@ -0,0 +1,107 @@
+using UnityEngine;
+using UnityEditor;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo.Editor
+{
+ ///
+ /// Editor for UpdateStereoMaterial component
+ ///
+ [CanEditMultipleObjects]
+ [CustomEditor(typeof(UpdateStereoMaterial))]
+ public class UpdateStereoMaterialEditor : UnityEditor.Editor
+ {
+ private SerializedProperty _propCamera;
+ private SerializedProperty _propRenderer;
+ private SerializedProperty _propGraphic;
+ private SerializedProperty _propMaterial;
+ private SerializedProperty _propForceEyeMode;
+
+ void OnEnable()
+ {
+ _propCamera = serializedObject.FindProperty("_camera");
+ _propRenderer = serializedObject.FindProperty("_renderer");
+ _propGraphic = serializedObject.FindProperty("_uGuiComponent");
+ _propForceEyeMode = serializedObject.FindProperty("_forceEyeMode");
+ _propMaterial = serializedObject.FindProperty("_material");
+ }
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+
+ if (_propCamera == null)
+ {
+ return;
+ }
+
+ EditorGUILayout.PropertyField(_propCamera);
+ if (_propCamera.objectReferenceValue == null)
+ {
+ if (Camera.main == null)
+ {
+ ShowNoticeBox(MessageType.Error, "No 'main' camera found in scene and no camera assigned.");
+ }
+ else
+ {
+ ShowNoticeBox(MessageType.Warning, "No camera assigned. Using 'main' camera: " + Camera.main.name);
+ }
+ }
+ if (DetectMultipleMainCameras())
+ {
+ ShowNoticeBox(MessageType.Warning, "Multiple 'main' cameras found in scene. Make sure the correct camera is assigned.");
+ }
+
+ EditorGUILayout.PropertyField(_propRenderer);
+ EditorGUILayout.PropertyField(_propGraphic);
+ EditorGUILayout.PropertyField(_propMaterial);
+ EditorGUILayout.PropertyField(_propForceEyeMode);
+ if (_propRenderer.objectReferenceValue == null && _propGraphic.objectReferenceValue == null && _propMaterial.objectReferenceValue == null)
+ {
+ ShowNoticeBox(MessageType.Error, "At least one of the renderers (MeshRenderer, uGUI Graphic or Material) need to be assigned.");
+ }
+
+ serializedObject.ApplyModifiedProperties();
+ }
+
+
+ private static void ShowNoticeBox(MessageType messageType, string message)
+ {
+ switch (messageType)
+ {
+ case MessageType.Error:
+ GUI.color = Color.red;
+ message = "Error: " + message;
+ break;
+ case MessageType.Warning:
+ GUI.color = Color.yellow;
+ message = "Warning: " + message;
+ break;
+ }
+
+ GUILayout.TextArea(message);
+ GUI.color = Color.white;
+ }
+
+ private static bool DetectMultipleMainCameras()
+ {
+ bool result = false;
+ if (Camera.main != null)
+ {
+ Camera[] cameras = Camera.allCameras;
+ foreach (Camera cam in cameras)
+ {
+ if (cam != Camera.main && cam.CompareTag("MainCamera"))
+ {
+ result = true;
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/UpdateStereoMaterialEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/UpdateStereoMaterialEditor.cs.meta
new file mode 100644
index 0000000..7a41e6f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Editor/UpdateStereoMaterialEditor.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 845a007e07f3a2e4b86326374fa992df
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal.meta
new file mode 100644
index 0000000..eb1444d
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal.meta
@@ -0,0 +1,5 @@
+fileFormatVersion: 2
+guid: 1bb8f28c4529a1343b4430d732bb5f2a
+folderAsset: yes
+DefaultImporter:
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AndroidMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AndroidMediaPlayer.cs
new file mode 100644
index 0000000..7b70c4f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AndroidMediaPlayer.cs
@@ -0,0 +1,1186 @@
+#define DLL_METHODS
+
+#if UNITY_ANDROID
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ #if !UNITY_5_0 && !UNITY_5_1
+ #define AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ #endif
+ #if !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4_0 && !UNITY_5_4_1
+ #define AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ #endif
+#endif
+
+using UnityEngine;
+using System;
+using System.Runtime.InteropServices;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Android implementation of BaseMediaPlayer
+ ///
+ // TODO: seal this class
+ public class AndroidMediaPlayer : BaseMediaPlayer
+ {
+ protected static AndroidJavaObject s_ActivityContext = null;
+ protected static AndroidJavaObject s_Interface = null;
+ protected static bool s_bInitialised = false;
+
+ private static string s_Version = "Plug-in not yet initialised";
+
+ private static System.IntPtr _nativeFunction_RenderEvent = System.IntPtr.Zero;
+
+ protected AndroidJavaObject m_Video;
+ private Texture2D m_Texture;
+ private int m_TextureHandle;
+ private bool m_UseFastOesPath;
+
+ private float m_DurationMs = 0.0f;
+ private int m_Width = 0;
+ private int m_Height = 0;
+
+ protected int m_iPlayerIndex = -1;
+
+ private Android.VideoApi m_API;
+ private bool m_HeadRotationEnabled = false;
+ private bool m_FocusEnabled = false;
+ private System.IntPtr m_Method_Update;
+ private System.IntPtr m_Method_SetHeadRotation;
+ private System.IntPtr m_Method_GetCurrentTimeMs;
+ private System.IntPtr m_Method_GetSourceVideoFrameRate;
+ private System.IntPtr m_Method_IsPlaying;
+ private System.IntPtr m_Method_IsPaused;
+ private System.IntPtr m_Method_IsFinished;
+ private System.IntPtr m_Method_IsSeeking;
+ private System.IntPtr m_Method_IsBuffering;
+ private System.IntPtr m_Method_IsLooping;
+ private System.IntPtr m_Method_HasVideo;
+ private System.IntPtr m_Method_HasAudio;
+ private System.IntPtr m_Method_SetFocusProps;
+ private System.IntPtr m_Method_SetFocusEnabled;
+ private System.IntPtr m_Method_SetFocusRotation;
+ private jvalue[] m_Value0 = new jvalue[0];
+ private jvalue[] m_Value1 = new jvalue[1];
+ private jvalue[] m_Value2 = new jvalue[2];
+ private jvalue[] m_Value4 = new jvalue[4];
+
+#if AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ private int _textureQuality = QualitySettings.masterTextureLimit;
+#endif
+ public static bool InitialisePlatform()
+ {
+ // Get the activity context
+ if (s_ActivityContext == null)
+ {
+ AndroidJavaClass activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
+ if (activityClass != null)
+ {
+ s_ActivityContext = activityClass.GetStatic("currentActivity");
+ }
+ }
+
+ if (!s_bInitialised)
+ {
+ s_Interface = new AndroidJavaObject("com.RenderHeads.AVProVideo.AVProMobileVideo");
+ if (s_Interface != null)
+ {
+ s_Version = s_Interface.Call("GetPluginVersion");
+ s_Interface.Call("SetContext", s_ActivityContext);
+
+ // Calling this native function cause the .SO library to become loaded
+ // This is important for Unity < 5.2.0 where GL.IssuePluginEvent works differently
+ _nativeFunction_RenderEvent = Native.GetRenderEventFunc();
+
+ s_bInitialised = true;
+ }
+ }
+
+ return s_bInitialised;
+ }
+
+ public static void DeinitPlatform()
+ {
+ if (s_bInitialised)
+ {
+ if (s_Interface != null)
+ {
+ s_Interface.CallStatic("Deinitialise");
+ s_Interface = null;
+ }
+ s_ActivityContext = null;
+ s_bInitialised = false;
+ }
+ }
+
+ private static void IssuePluginEvent(Native.AVPPluginEvent type, int param)
+ {
+ // Build eventId from the type and param.
+ int eventId = 0x5d5ac000 | ((int)type << 8);
+
+ switch (type)
+ {
+ case Native.AVPPluginEvent.PlayerSetup:
+ case Native.AVPPluginEvent.PlayerUpdate:
+ case Native.AVPPluginEvent.PlayerDestroy:
+ case Native.AVPPluginEvent.ExtractFrame:
+ {
+ eventId |= param & 0xff;
+ }
+ break;
+ }
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ GL.IssuePluginEvent(_nativeFunction_RenderEvent, eventId);
+#else
+ GL.IssuePluginEvent(eventId);
+#endif
+ }
+
+ private System.IntPtr GetMethod(string methodName, string signature)
+ {
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ Debug.Assert(m_Video != null);
+#endif
+ System.IntPtr result = AndroidJNIHelper.GetMethodID(m_Video.GetRawClass(), methodName, signature, false);
+
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ Debug.Assert(result != System.IntPtr.Zero);
+#endif
+ if (result == System.IntPtr.Zero)
+ {
+ Debug.LogError("[AVProVideo] Unable to get method " + methodName + " " + signature);
+ throw new System.Exception("[AVProVideo] Unable to get method " + methodName + " " + signature);
+ }
+
+ return result;
+ }
+
+ public AndroidMediaPlayer(bool useFastOesPath, bool showPosterFrame, Android.VideoApi api, bool enable360Audio, Audio360ChannelMode channelMode, bool preferSoftware)
+ {
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ Debug.Assert(s_Interface != null);
+ Debug.Assert(s_bInitialised);
+#endif
+ m_API = api;
+ // Create a java-size video class up front
+ m_Video = s_Interface.Call("CreatePlayer", (int)m_API, useFastOesPath, enable360Audio, (int)channelMode, preferSoftware);
+
+ if (m_Video != null)
+ {
+ m_Method_Update = GetMethod("Update", "()V");
+ m_Method_SetHeadRotation = GetMethod("SetHeadRotation", "(FFFF)V");
+ m_Method_SetFocusProps = GetMethod("SetFocusProps", "(FF)V");
+ m_Method_SetFocusEnabled = GetMethod("SetFocusEnabled", "(Z)V");
+ m_Method_SetFocusRotation = GetMethod("SetFocusRotation", "(FFFF)V");
+ m_Method_GetCurrentTimeMs = GetMethod("GetCurrentTimeMs", "()J");
+ m_Method_GetSourceVideoFrameRate = GetMethod("GetSourceVideoFrameRate", "()F");
+ m_Method_IsPlaying = GetMethod("IsPlaying", "()Z");
+ m_Method_IsPaused = GetMethod("IsPaused", "()Z");
+ m_Method_IsFinished = GetMethod("IsFinished", "()Z");
+ m_Method_IsSeeking = GetMethod("IsSeeking", "()Z");
+ m_Method_IsBuffering = GetMethod("IsBuffering", "()Z");
+ m_Method_IsLooping = GetMethod("IsLooping", "()Z");
+ m_Method_HasVideo = GetMethod("HasVideo", "()Z");
+ m_Method_HasAudio = GetMethod("HasAudio", "()Z");
+
+ m_iPlayerIndex = m_Video.Call("GetPlayerIndex");
+ Helper.LogInfo("Creating player " + m_iPlayerIndex);
+ //Debug.Log( "AVPro: useFastOesPath: " + useFastOesPath );
+ SetOptions(useFastOesPath, showPosterFrame);
+
+ // Initialise renderer, on the render thread
+ AndroidMediaPlayer.IssuePluginEvent(Native.AVPPluginEvent.PlayerSetup, m_iPlayerIndex);
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] Failed to create player instance");
+ }
+ }
+
+ public void SetOptions(bool useFastOesPath, bool showPosterFrame)
+ {
+ m_UseFastOesPath = useFastOesPath;
+ if (m_Video != null)
+ {
+ m_Video.Call("SetPlayerOptions", m_UseFastOesPath, showPosterFrame);
+ }
+ }
+
+ public override long GetEstimatedTotalBandwidthUsed()
+ {
+ long result = -1;
+ if (s_Interface != null)
+ {
+ result = m_Video.Call("GetEstimatedBandwidthUsed");
+ }
+ return result;
+ }
+
+
+ public override string GetVersion()
+ {
+ return s_Version;
+ }
+
+ public override bool OpenVideoFromFile(string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0)
+ {
+ bool bReturn = false;
+
+ if( m_Video != null )
+ {
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ Debug.Assert(m_Width == 0 && m_Height == 0 && m_DurationMs == 0.0f);
+#endif
+
+ bReturn = m_Video.Call("OpenVideoFromFile", path, offset, httpHeaderJson, forceFileFormat);
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] m_Video is null!");
+ }
+
+ return bReturn;
+ }
+
+ public override TimeRange[] GetSeekableTimeRanges()
+ {
+ float[] rangeArray = m_Video.Call("GetSeekableTimeRange");
+
+ TimeRange[] result = new TimeRange[1];
+ result[0].startTime = rangeArray[0];
+ result[0].duration = rangeArray[1] - rangeArray[0];
+
+ return result;
+ }
+
+ public override void CloseVideo()
+ {
+ if (m_Texture != null)
+ {
+ Texture2D.Destroy(m_Texture);
+ m_Texture = null;
+ }
+ m_TextureHandle = 0;
+
+ m_DurationMs = 0.0f;
+ m_Width = 0;
+ m_Height = 0;
+
+ if (m_Video != null)
+ {
+ m_Video.Call("CloseVideo");
+ }
+
+ base.CloseVideo();
+ }
+
+ public override void SetLooping( bool bLooping )
+ {
+ if( m_Video != null )
+ {
+ m_Video.Call("SetLooping", bLooping);
+ }
+ }
+
+ public override bool IsLooping()
+ {
+ bool result = false;
+ if( m_Video != null )
+ {
+ if (m_Method_IsLooping != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_IsLooping, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("IsLooping");
+ }
+ }
+ return result;
+ }
+
+ public override bool HasVideo()
+ {
+ bool result = false;
+ if( m_Video != null )
+ {
+ if (m_Method_HasVideo != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_HasVideo, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("HasVideo");
+ }
+ }
+ return result;
+ }
+
+ public override bool HasAudio()
+ {
+ bool result = false;
+ if( m_Video != null )
+ {
+ if (m_Method_HasAudio != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_HasAudio, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("HasAudio");
+ }
+ }
+ return result;
+ }
+
+ public override bool HasMetaData()
+ {
+ bool result = false;
+ if( m_DurationMs > 0.0f )
+ {
+ result = true;
+
+ if( HasVideo() )
+ {
+ result = ( m_Width > 0 && m_Height > 0 );
+ }
+ }
+ return result;
+ }
+
+ public override bool CanPlay()
+ {
+ bool result = false;
+#if DLL_METHODS
+ result = Native._CanPlay( m_iPlayerIndex );
+#else
+ if (m_Video != null)
+ {
+ result = m_Video.Call("CanPlay");
+ }
+#endif
+ return result;
+ }
+
+ public override void Play()
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("Play");
+ }
+ }
+
+ public override void Pause()
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("Pause");
+ }
+ }
+
+ public override void Stop()
+ {
+ if (m_Video != null)
+ {
+ // On Android we never need to actually Stop the playback, pausing is fine
+ m_Video.Call("Pause");
+ }
+ }
+
+ public override void Seek(float timeMs)
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("Seek", Mathf.FloorToInt(timeMs));
+ }
+ }
+
+ public override void SeekFast(float timeMs)
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("SeekFast", Mathf.FloorToInt(timeMs));
+ }
+ }
+
+ public override float GetCurrentTimeMs()
+ {
+ float result = 0.0f;
+ if (m_Video != null)
+ {
+ if (m_Method_GetCurrentTimeMs != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallLongMethod(m_Video.GetRawObject(), m_Method_GetCurrentTimeMs, m_Value0);
+ }
+ else
+ {
+ result = (float)m_Video.Call("GetCurrentTimeMs");
+ }
+ }
+ return result;
+ }
+
+ public override void SetPlaybackRate(float rate)
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("SetPlaybackRate", rate);
+ }
+ }
+
+ public override float GetPlaybackRate()
+ {
+ float result = 0.0f;
+ if (m_Video != null)
+ {
+ result = m_Video.Call("GetPlaybackRate");
+ }
+ return result;
+ }
+
+ public override void SetAudioHeadRotation(Quaternion q)
+ {
+ if (m_Video != null)
+ {
+ if (!m_HeadRotationEnabled)
+ {
+ m_Video.Call("SetPositionTrackingEnabled", true);
+ m_HeadRotationEnabled = true;
+ }
+
+ if (m_Method_SetHeadRotation != System.IntPtr.Zero)
+ {
+ m_Value4[0].f = q.x;
+ m_Value4[1].f = q.y;
+ m_Value4[2].f = q.z;
+ m_Value4[3].f = q.w;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetHeadRotation, m_Value4);
+ }
+ else
+ {
+ m_Video.Call("SetHeadRotation", q.x, q.y, q.z, q.w);
+ }
+ }
+ }
+
+ public override void ResetAudioHeadRotation()
+ {
+ if(m_Video != null && m_HeadRotationEnabled)
+ {
+ m_Video.Call("SetPositionTrackingEnabled", false);
+ m_HeadRotationEnabled = false;
+ }
+ }
+
+ public override void SetAudioFocusEnabled(bool enabled)
+ {
+ if (m_Video != null && enabled != m_FocusEnabled)
+ {
+ if (m_Method_SetFocusEnabled != System.IntPtr.Zero)
+ {
+ m_Value1[0].z = enabled;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetFocusEnabled, m_Value1);
+ }
+ else
+ {
+ m_Video.Call("SetFocusEnabled", enabled);
+ }
+ m_FocusEnabled = enabled;
+ }
+ }
+
+ public override void SetAudioFocusProperties(float offFocusLevel, float widthDegrees)
+ {
+ if(m_Video != null && m_FocusEnabled)
+ {
+ if (m_Method_SetFocusProps != System.IntPtr.Zero)
+ {
+ m_Value2[0].f = offFocusLevel;
+ m_Value2[1].f = widthDegrees;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetFocusProps, m_Value2);
+ }
+ else
+ {
+ m_Video.Call("SetFocusProps", offFocusLevel, widthDegrees);
+ }
+ }
+ }
+
+ public override void SetAudioFocusRotation(Quaternion q)
+ {
+ if (m_Video != null && m_FocusEnabled)
+ {
+ if (m_Method_SetFocusRotation != System.IntPtr.Zero)
+ {
+ m_Value4[0].f = q.x;
+ m_Value4[1].f = q.y;
+ m_Value4[2].f = q.z;
+ m_Value4[3].f = q.w;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetFocusRotation, m_Value4);
+ }
+ else
+ {
+ m_Video.Call("SetFocusRotation", q.x, q.y, q.z, q.w);
+ }
+ }
+ }
+
+ public override void ResetAudioFocus()
+ {
+ if (m_Video != null)
+ {
+
+ if (m_Method_SetFocusProps != System.IntPtr.Zero &&
+ m_Method_SetFocusEnabled != System.IntPtr.Zero &&
+ m_Method_SetFocusRotation != System.IntPtr.Zero)
+ {
+ m_Value2[0].f = 0f;
+ m_Value2[1].f = 90f;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetFocusProps, m_Value2);
+ m_Value1[0].z = false;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetFocusEnabled, m_Value1);
+ m_Value4[0].f = 0f;
+ m_Value4[1].f = 0f;
+ m_Value4[2].f = 0f;
+ m_Value4[3].f = 1f;
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_SetFocusRotation, m_Value4);
+ }
+ else
+ {
+ m_Video.Call("SetFocusProps", 0f, 90f);
+ m_Video.Call("SetFocusEnabled", false);
+ m_Video.Call("SetFocusRotation", 0f, 0f, 0f, 1f);
+ }
+ }
+ }
+
+ public override float GetDurationMs()
+ {
+ return m_DurationMs;
+ }
+
+ public override int GetVideoWidth()
+ {
+ return m_Width;
+ }
+
+ public override int GetVideoHeight()
+ {
+ return m_Height;
+ }
+
+ public override float GetVideoFrameRate()
+ {
+ float result = 0.0f;
+ if( m_Video != null )
+ {
+ if (m_Method_GetSourceVideoFrameRate != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallFloatMethod(m_Video.GetRawObject(), m_Method_GetSourceVideoFrameRate, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("GetSourceVideoFrameRate");
+ }
+ }
+ return result;
+ }
+
+ public override float GetBufferingProgress()
+ {
+ float result = 0.0f;
+ if( m_Video != null )
+ {
+ result = m_Video.Call("GetBufferingProgressPercent") * 0.01f;
+ }
+ return result;
+ }
+
+ public override float GetVideoDisplayRate()
+ {
+ float result = 0.0f;
+#if DLL_METHODS
+ result = Native._GetVideoDisplayRate( m_iPlayerIndex );
+#else
+ if (m_Video != null)
+ {
+ result = m_Video.Call("GetDisplayRate");
+ }
+#endif
+ return result;
+ }
+
+ public override bool IsSeeking()
+ {
+ bool result = false;
+ if (m_Video != null)
+ {
+ if (m_Method_IsSeeking != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_IsSeeking, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("IsSeeking");
+ }
+ }
+ return result;
+ }
+
+ public override bool IsPlaying()
+ {
+ bool result = false;
+ if (m_Video != null)
+ {
+ if (m_Method_IsPlaying != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_IsPlaying, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("IsPlaying");
+ }
+ }
+ return result;
+ }
+
+ public override bool IsPaused()
+ {
+ bool result = false;
+ if (m_Video != null)
+ {
+ if (m_Method_IsPaused != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_IsPaused, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("IsPaused");
+ }
+ }
+ return result;
+ }
+
+ public override bool IsFinished()
+ {
+ bool result = false;
+ if (m_Video != null)
+ {
+ if (m_Method_IsFinished != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_IsFinished, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("IsFinished");
+ }
+ }
+ return result;
+ }
+
+ public override bool IsBuffering()
+ {
+ bool result = false;
+ if (m_Video != null)
+ {
+ if (m_Method_IsBuffering != System.IntPtr.Zero)
+ {
+ result = AndroidJNI.CallBooleanMethod(m_Video.GetRawObject(), m_Method_IsBuffering, m_Value0);
+ }
+ else
+ {
+ result = m_Video.Call("IsBuffering");
+ }
+ }
+ return result;
+ }
+
+ public override Texture GetTexture( int index )
+ {
+ Texture result = null;
+ if (GetTextureFrameCount() > 0)
+ {
+ result = m_Texture;
+ }
+ return result;
+ }
+
+ public override int GetTextureFrameCount()
+ {
+ int result = 0;
+#if DLL_METHODS
+ result = Native._GetFrameCount( m_iPlayerIndex );
+#else
+ if (m_Video != null)
+ {
+ result = m_Video.Call("GetFrameCount");
+ }
+#endif
+ return result;
+ }
+
+ public override bool RequiresVerticalFlip()
+ {
+ return false;
+ }
+
+ public override void MuteAudio(bool bMuted)
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("MuteAudio", bMuted);
+ }
+ }
+
+ public override bool IsMuted()
+ {
+ bool result = false;
+ if( m_Video != null )
+ {
+ result = m_Video.Call("IsMuted");
+ }
+ return result;
+ }
+
+ public override void SetVolume(float volume)
+ {
+ if (m_Video != null)
+ {
+ m_Video.Call("SetVolume", volume);
+ }
+ }
+
+ public override float GetVolume()
+ {
+ float result = 0.0f;
+ if( m_Video != null )
+ {
+ result = m_Video.Call("GetVolume");
+ }
+ return result;
+ }
+
+ public override void SetBalance(float balance)
+ {
+ if( m_Video != null )
+ {
+ m_Video.Call("SetAudioPan", balance);
+ }
+ }
+
+ public override float GetBalance()
+ {
+ float result = 0.0f;
+ if( m_Video != null )
+ {
+ result = m_Video.Call("GetAudioPan");
+ }
+ return result;
+ }
+
+ public override int GetAudioTrackCount()
+ {
+ int result = 0;
+ if( m_Video != null )
+ {
+ result = m_Video.Call("GetNumberAudioTracks");
+ }
+ return result;
+ }
+
+ public override int GetCurrentAudioTrack()
+ {
+ int result = 0;
+ if( m_Video != null )
+ {
+ result = m_Video.Call("GetCurrentAudioTrackIndex");
+ }
+ return result;
+ }
+
+ public override void SetAudioTrack( int index )
+ {
+ if( m_Video != null )
+ {
+ m_Video.Call("SetAudioTrack", index);
+ }
+ }
+
+ public override string GetCurrentAudioTrackId()
+ {
+ /*string id = "";
+ if( m_Video != null )
+ {
+ id = m_Video.Call("GetCurrentAudioTrackIndex");
+ }
+ return id;*/
+
+ return GetCurrentAudioTrack().ToString();
+ }
+
+ public override int GetCurrentAudioTrackBitrate()
+ {
+ int result = 0;
+ /*if( m_Video != null )
+ {
+ result = m_Video.Call("GetCurrentAudioTrackIndex");
+ }*/
+ return result;
+ }
+
+ public override int GetVideoTrackCount()
+ {
+ int result = 0;
+ if( m_Video != null )
+ {
+ if (HasVideo())
+ {
+ result = 1;
+ }
+ //result = m_Video.Call("GetNumberVideoTracks");
+ }
+ return result;
+ }
+
+ public override int GetCurrentVideoTrack()
+ {
+ int result = 0;
+ /*if( m_Video != null )
+ {
+ result = m_Video.Call("GetCurrentVideoTrackIndex");
+ }*/
+ return result;
+ }
+
+ public override void SetVideoTrack( int index )
+ {
+ /*if( m_Video != null )
+ {
+ m_Video.Call("SetVideoTrack", index);
+ }*/
+ }
+
+ public override string GetCurrentVideoTrackId()
+ {
+ string id = "";
+ /*if( m_Video != null )
+ {
+ id = m_Video.Call("GetCurrentVideoTrackId");
+ }*/
+ return id;
+ }
+
+ public override int GetCurrentVideoTrackBitrate()
+ {
+ int bitrate = 0;
+ /*if( m_Video != null )
+ {
+ bitrate = m_Video.Call("GetCurrentVideoTrackBitrate");
+ }*/
+ return bitrate;
+ }
+
+ public override bool WaitForNextFrame(Camera dummyCamera, int previousFrameCount)
+ {
+ // Mark as extracting
+ bool isMultiThreaded = m_Video.Call("StartExtractFrame");
+
+ // In single threaded Android this method won't work, so just return
+ if (isMultiThreaded)
+ {
+ // Queue up render thread event to wait for the new frame
+ IssuePluginEvent(Native.AVPPluginEvent.ExtractFrame, m_iPlayerIndex);
+
+ // Force render thread to run
+ dummyCamera.Render();
+
+ // Wait for the frame to change
+ m_Video.Call("WaitForExtract");
+
+ // Return whether the frame changed
+ return (previousFrameCount != GetTextureFrameCount());
+ }
+ return false;
+ }
+
+ public override long GetTextureTimeStamp()
+ {
+ long timeStamp = long.MinValue;
+ if (m_Video != null)
+ {
+ timeStamp = m_Video.Call("GetTextureTimeStamp");
+ }
+ return timeStamp;
+ }
+
+ public override void Render()
+ {
+ if (m_Video != null)
+ {
+ if (m_UseFastOesPath)
+ {
+ // This is needed for at least Unity 5.5.0, otherwise it just renders black in OES mode
+ GL.InvalidateState();
+ }
+ AndroidMediaPlayer.IssuePluginEvent( Native.AVPPluginEvent.PlayerUpdate, m_iPlayerIndex );
+ if (m_UseFastOesPath)
+ {
+ GL.InvalidateState();
+ }
+
+ // Check if we can create the texture
+ // Scan for a change in resolution
+ int newWidth = -1;
+ int newHeight = -1;
+ if (m_Texture != null)
+ {
+#if DLL_METHODS
+ newWidth = Native._GetWidth( m_iPlayerIndex );
+ newHeight = Native._GetHeight( m_iPlayerIndex );
+#else
+ newWidth = m_Video.Call("GetWidth");
+ newHeight = m_Video.Call("GetHeight");
+#endif
+ if (newWidth != m_Width || newHeight != m_Height)
+ {
+ m_Texture = null;
+ m_TextureHandle = 0;
+ }
+ }
+#if DLL_METHODS
+ int textureHandle = Native._GetTextureHandle( m_iPlayerIndex );
+#else
+ int textureHandle = m_Video.Call("GetTextureHandle");
+#endif
+ if (textureHandle != 0 && textureHandle != m_TextureHandle )
+ {
+ // Already got? (from above)
+ if( newWidth == -1 || newHeight == -1 )
+ {
+#if DLL_METHODS
+ newWidth = Native._GetWidth( m_iPlayerIndex );
+ newHeight = Native._GetHeight( m_iPlayerIndex );
+#else
+ newWidth = m_Video.Call("GetWidth");
+ newHeight = m_Video.Call("GetHeight");
+#endif
+ }
+
+ if (Mathf.Max(newWidth, newHeight) > SystemInfo.maxTextureSize)
+ {
+ m_Width = newWidth;
+ m_Height = newHeight;
+ m_TextureHandle = textureHandle;
+ Debug.LogError("[AVProVideo] Video dimensions larger than maxTextureSize");
+ }
+ else if( newWidth > 0 && newHeight > 0 )
+ {
+ m_Width = newWidth;
+ m_Height = newHeight;
+ m_TextureHandle = textureHandle;
+
+ switch(m_API)
+ {
+ case Android.VideoApi.MediaPlayer:
+ _playerDescription = "MediaPlayer";
+ break;
+ case Android.VideoApi.ExoPlayer:
+ _playerDescription = "ExoPlayer";
+ break;
+ default:
+ _playerDescription = "UnknownPlayer";
+ break;
+ }
+
+ if (m_UseFastOesPath)
+ {
+ _playerDescription += " OES";
+ }
+ else
+ {
+ _playerDescription += " NonOES";
+ }
+
+ Helper.LogInfo("Using playback path: " + _playerDescription + " (" + m_Width + "x" + m_Height + "@" + GetVideoFrameRate().ToString("F2") + ")");
+
+ // NOTE: From Unity 5.4.x when using OES textures, an error "OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_OPERATION: Operation illegal in current state" will be logged.
+ // We assume this is because we're passing in TextureFormat.RGBA32 which isn't the true texture format. This error should be safe to ignore.
+ m_Texture = Texture2D.CreateExternalTexture(m_Width, m_Height, TextureFormat.RGBA32, false, false, new System.IntPtr(textureHandle));
+ if (m_Texture != null)
+ {
+ ApplyTextureProperties(m_Texture);
+ }
+ Helper.LogInfo("Texture ID: " + textureHandle);
+ }
+ }
+
+#if AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ // In Unity 5.4.2 and above the video texture turns black when changing the TextureQuality in the Quality Settings
+ // The code below gets around this issue. A bug report has been sent to Unity. So far we have tested and replicated the
+ // "bug" in Windows only, but a user has reported it in Android too.
+ // Texture.GetNativeTexturePtr() must sync with the rendering thread, so this is a large performance hit!
+ if (_textureQuality != QualitySettings.masterTextureLimit)
+ {
+ if (m_Texture != null && textureHandle > 0 && m_Texture.GetNativeTexturePtr() == System.IntPtr.Zero)
+ {
+ //Debug.Log("RECREATING");
+ m_Texture.UpdateExternalTexture(new System.IntPtr(textureHandle));
+ }
+
+ _textureQuality = QualitySettings.masterTextureLimit;
+ }
+#endif
+ }
+ }
+
+ protected override void ApplyTextureProperties(Texture texture)
+ {
+ // NOTE: According to OES_EGL_image_external: For external textures, the default min filter is GL_LINEAR and the default S and T wrap modes are GL_CLAMP_TO_EDGE
+ // See https://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external_essl3.txt
+ // But there is a new extension that allows some wrap modes:
+ // https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_EGL_image_external_wrap_modes.txt
+ // So really we need to detect whether these extensions exist when m_UseFastOesPath is true
+ //if (!m_UseFastOesPath)
+ {
+ base.ApplyTextureProperties(texture);
+ }
+ }
+
+ public override void OnEnable()
+ {
+ base.OnEnable();
+
+#if DLL_METHODS
+ int textureHandle = Native._GetTextureHandle(m_iPlayerIndex);
+#else
+ int textureHandle = m_Video.Call("GetTextureHandle");
+#endif
+
+ if (m_Texture != null && textureHandle > 0 && m_Texture.GetNativeTexturePtr() == System.IntPtr.Zero)
+ {
+ //Debug.Log("RECREATING");
+ m_Texture.UpdateExternalTexture(new System.IntPtr(textureHandle));
+ }
+
+#if AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ _textureQuality = QualitySettings.masterTextureLimit;
+#endif
+ }
+
+ public override double GetCurrentDateTimeSecondsSince1970()
+ {
+ double result = 0.0;
+ if (m_Video != null)
+ {
+ result = m_Video.Call("GetCurrentAbsoluteTimestamp");
+ }
+ return result;
+ }
+
+ public override void Update()
+ {
+ if (m_Video != null)
+ {
+ if (m_Method_Update != System.IntPtr.Zero)
+ {
+ AndroidJNI.CallVoidMethod(m_Video.GetRawObject(), m_Method_Update, m_Value0);
+ }
+ else
+ {
+ m_Video.Call("Update");
+ }
+
+ // _lastError = (ErrorCode)( m_Video.Call("GetLastErrorCode") );
+ _lastError = (ErrorCode)( Native._GetLastErrorCode( m_iPlayerIndex) );
+ }
+
+ UpdateSubtitles();
+
+ if(Mathf.Approximately(m_DurationMs, 0f))
+ {
+#if DLL_METHODS
+ m_DurationMs = (float)( Native._GetDuration( m_iPlayerIndex ) );
+#else
+ m_DurationMs = (float)(m_Video.Call("GetDurationMs"));
+#endif
+// if( m_DurationMs > 0.0f ) { Helper.LogInfo("Duration: " + m_DurationMs); }
+ }
+ }
+
+ public override bool PlayerSupportsLinearColorSpace()
+ {
+ return false;
+ }
+
+ public override void Dispose()
+ {
+ //Debug.LogError("DISPOSE");
+
+ if (m_Video != null)
+ {
+ m_Video.Call("SetDeinitialiseFlagged");
+
+ m_Video.Dispose();
+ m_Video = null;
+ }
+
+ if (s_Interface != null)
+ {
+ s_Interface.Call("DestroyPlayer", m_iPlayerIndex);
+ }
+
+ if (m_Texture != null)
+ {
+ Texture2D.Destroy(m_Texture);
+ m_Texture = null;
+ }
+
+ // Deinitialise player (replaces call directly as GL textures are involved)
+ AndroidMediaPlayer.IssuePluginEvent( Native.AVPPluginEvent.PlayerDestroy, m_iPlayerIndex );
+ }
+
+ private struct Native
+ {
+ [DllImport ("AVProLocal")]
+ public static extern IntPtr GetRenderEventFunc();
+
+ [DllImport ("AVProLocal")]
+ public static extern int _GetWidth( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern int _GetHeight( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern int _GetTextureHandle( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern long _GetDuration( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern int _GetLastErrorCode( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern int _GetFrameCount( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern float _GetVideoDisplayRate( int iPlayerIndex );
+
+ [DllImport ("AVProLocal")]
+ public static extern bool _CanPlay( int iPlayerIndex );
+
+ public enum AVPPluginEvent
+ {
+ Nop,
+ PlayerSetup,
+ PlayerUpdate,
+ PlayerDestroy,
+ ExtractFrame,
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AndroidMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AndroidMediaPlayer.cs.meta
new file mode 100644
index 0000000..36c0d73
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AndroidMediaPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 80eb525dd677aa440823910b09b23ae0
+timeCreated: 1438698292
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AudioOutputManager.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AudioOutputManager.cs
new file mode 100644
index 0000000..c37b28d
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AudioOutputManager.cs
@@ -0,0 +1,137 @@
+using System.Collections.Generic;
+using UnityEngine;
+using System;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// A singleton to handle mulitple instances of the AudioOutput component
+ ///
+ public class AudioOutputManager
+ {
+ private static AudioOutputManager _instance = null;
+
+ public static AudioOutputManager Instance
+ {
+ get
+ {
+ if (_instance == null)
+ {
+ _instance = new AudioOutputManager();
+ }
+
+ return _instance;
+ }
+ }
+
+ private Dictionary> _accessTrackers;
+ private Dictionary _pcmData;
+
+ private AudioOutputManager()
+ {
+ _accessTrackers = new Dictionary>();
+ _pcmData = new Dictionary();
+ }
+
+ public void RequestAudio(AudioOutput _outputComponent, MediaPlayer mediaPlayer, float[] data, int channelMask, int totalChannels, AudioOutput.AudioOutputMode audioOutputMode)
+ {
+ if (mediaPlayer == null || mediaPlayer.Control == null || !mediaPlayer.Control.IsPlaying())
+ {
+ return;
+ }
+
+ int channels = mediaPlayer.Control.GetNumAudioChannels();
+ if(channels <= 0)
+ {
+ return;
+ }
+
+ //total samples requested should be multiple of channels
+#if (UNITY_5 && !UNITY_5_0) || UNITY_5_4_OR_NEWER
+ Debug.Assert(data.Length % totalChannels == 0);
+#endif
+
+ if (!_accessTrackers.ContainsKey(mediaPlayer))
+ {
+ _accessTrackers[mediaPlayer] = new HashSet();
+ }
+
+ //requests data if it hasn't been requested yet for the current cycle
+ if (_accessTrackers[mediaPlayer].Contains(_outputComponent) || _accessTrackers[mediaPlayer].Count == 0 || _pcmData[mediaPlayer] == null)
+ {
+ _accessTrackers[mediaPlayer].Clear();
+
+ int actualDataRequired = data.Length / totalChannels * channels;
+ _pcmData[mediaPlayer] = new float[actualDataRequired];
+
+ GrabAudio(mediaPlayer, _pcmData[mediaPlayer], channels);
+
+ _accessTrackers[mediaPlayer].Add(_outputComponent);
+ }
+
+ //calculate how many samples and what channels are needed and then copy over the data
+ int samples = Math.Min(data.Length / totalChannels, _pcmData[mediaPlayer].Length / channels);
+ int storedPos = 0;
+ int requestedPos = 0;
+
+ //multiple mode, copies over audio from desired channels into the same channels on the audiosource
+ if (audioOutputMode == AudioOutput.AudioOutputMode.Multiple)
+ {
+ int lesserChannels = Math.Min(channels, totalChannels);
+
+ for (int i = 0; i < samples; ++i)
+ {
+ for (int j = 0; j < lesserChannels; ++j)
+ {
+ if ((1 << j & channelMask) > 0)
+ {
+ data[requestedPos + j] = _pcmData[mediaPlayer][storedPos + j];
+ }
+ }
+
+ storedPos += channels;
+ requestedPos += totalChannels;
+ }
+ }
+
+ //Mono mode, copies over single channel to all output channels
+ else if(audioOutputMode == AudioOutput.AudioOutputMode.Single)
+ {
+ int desiredChannel = 0;
+
+ for (int i = 0; i < 8; ++i)
+ {
+ if ((channelMask & (1 << i)) > 0)
+ {
+ desiredChannel = i;
+ break;
+ }
+ }
+
+ if(desiredChannel < channels)
+ {
+ for (int i = 0; i < samples; ++i)
+ {
+ for (int j = 0; j < totalChannels; ++j)
+ {
+ data[requestedPos + j] = _pcmData[mediaPlayer][storedPos + desiredChannel];
+ }
+
+ storedPos += channels;
+ requestedPos += totalChannels;
+ }
+ }
+ }
+ }
+
+ private void GrabAudio(MediaPlayer player, float[] data, int channels)
+ {
+ player.Control.GrabAudio(data, data.Length, channels);
+ }
+ }
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AudioOutputManager.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AudioOutputManager.cs.meta
new file mode 100644
index 0000000..6ea845b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/AudioOutputManager.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 714026a371bd2d64c86edb3dab5607d9
+timeCreated: 1495699104
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/BaseMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/BaseMediaPlayer.cs
new file mode 100644
index 0000000..8c33037
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/BaseMediaPlayer.cs
@@ -0,0 +1,318 @@
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+
+using UnityEngine;
+using System.Collections.Generic;
+
+#if NETFX_CORE
+using Windows.Storage.Streams;
+#endif
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserved.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Base class for all platform specific MediaPlayers
+ ///
+ public abstract class BaseMediaPlayer : IMediaPlayer, IMediaControl, IMediaInfo, IMediaProducer, IMediaSubtitles, System.IDisposable
+ {
+ public abstract string GetVersion();
+
+ public abstract bool OpenVideoFromFile(string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0);
+
+#if NETFX_CORE
+ public virtual bool OpenVideoFromFile(IRandomAccessStream ras, string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0){return false;}
+#endif
+
+ public virtual bool OpenVideoFromBuffer(byte[] buffer) { return false; }
+ public virtual bool StartOpenVideoFromBuffer(ulong length) { return false; }
+ public virtual bool AddChunkToVideoBuffer(byte[] chunk, ulong offset, ulong length) { return false; }
+ public virtual bool EndOpenVideoFromBuffer() { return false; }
+
+ public virtual void CloseVideo()
+ {
+ _stallDetectionTimer = 0f;
+ _stallDetectionFrame = 0;
+ _lastError = ErrorCode.None;
+ }
+
+ public abstract void SetLooping(bool bLooping);
+ public abstract bool IsLooping();
+
+ public abstract bool HasMetaData();
+ public abstract bool CanPlay();
+ public abstract void Play();
+ public abstract void Pause();
+ public abstract void Stop();
+ public virtual void Rewind() { SeekFast(0.0f); }
+
+ public abstract void Seek(float timeMs);
+ public abstract void SeekFast(float timeMs);
+ public virtual void SeekWithTolerance(float timeMs, float beforeMs, float afterMs) { Seek(timeMs); }
+ public abstract float GetCurrentTimeMs();
+ public virtual double GetCurrentDateTimeSecondsSince1970() { return 0.0; }
+ public virtual TimeRange[] GetSeekableTimeRanges() { return _seekableTimeRanges; }
+
+ public abstract float GetPlaybackRate();
+ public abstract void SetPlaybackRate(float rate);
+
+ public abstract float GetDurationMs();
+ public abstract int GetVideoWidth();
+ public abstract int GetVideoHeight();
+ public virtual Rect GetCropRect() { return new Rect(0f, 0f, 0f, 0f); }
+ public abstract float GetVideoDisplayRate();
+ public abstract bool HasAudio();
+ public abstract bool HasVideo();
+
+ public abstract bool IsSeeking();
+ public abstract bool IsPlaying();
+ public abstract bool IsPaused();
+ public abstract bool IsFinished();
+ public abstract bool IsBuffering();
+ public virtual bool WaitForNextFrame(Camera dummyCamera, int previousFrameCount) { return false; }
+
+ public virtual void SetPlayWithoutBuffering(bool playWithoutBuffering) { }
+
+ public virtual void SetKeyServerURL(string url) { }
+ public virtual void SetKeyServerAuthToken(string token) { }
+ public virtual void SetDecryptionKeyBase64(string key) { }
+ public virtual void SetDecryptionKey(byte[] key) { }
+
+ public virtual int GetTextureCount() { return 1; }
+ public abstract Texture GetTexture(int index = 0);
+ public abstract int GetTextureFrameCount();
+ public virtual bool SupportsTextureFrameCount() { return true; }
+ public virtual long GetTextureTimeStamp() { return long.MinValue; }
+ public abstract bool RequiresVerticalFlip();
+ public virtual float[] GetTextureTransform() { return new float[] { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f }; }
+ public virtual Matrix4x4 GetYpCbCrTransform() { return Matrix4x4.identity; }
+
+ public abstract void MuteAudio(bool bMuted);
+ public abstract bool IsMuted();
+ public abstract void SetVolume(float volume);
+ public virtual void SetBalance(float balance) { }
+ public abstract float GetVolume();
+ public virtual float GetBalance() { return 0f; }
+
+ public abstract int GetAudioTrackCount();
+ public virtual string GetAudioTrackId(int index) { return index.ToString(); }
+ public abstract int GetCurrentAudioTrack();
+ public abstract void SetAudioTrack(int index);
+ public abstract string GetCurrentAudioTrackId();
+ public abstract int GetCurrentAudioTrackBitrate();
+ public virtual int GetNumAudioChannels() { return -1; }
+ public virtual void SetAudioHeadRotation(Quaternion q) { }
+ public virtual void ResetAudioHeadRotation() { }
+ public virtual void SetAudioChannelMode(Audio360ChannelMode channelMode) { }
+ public virtual void SetAudioFocusEnabled(bool enabled) { }
+ public virtual void SetAudioFocusProperties(float offFocusLevel, float widthDegrees) { }
+ public virtual void SetAudioFocusRotation(Quaternion q) { }
+ public virtual void ResetAudioFocus() { }
+
+ public abstract int GetVideoTrackCount();
+ public virtual string GetVideoTrackId(int index) { return index.ToString(); }
+ public abstract int GetCurrentVideoTrack();
+ public abstract void SetVideoTrack(int index);
+ public abstract string GetCurrentVideoTrackId();
+ public abstract int GetCurrentVideoTrackBitrate();
+
+ public abstract float GetVideoFrameRate();
+
+ public virtual long GetEstimatedTotalBandwidthUsed() { return -1; }
+
+ public abstract float GetBufferingProgress();
+
+ public abstract void Update();
+ public abstract void Render();
+ public abstract void Dispose();
+
+ public ErrorCode GetLastError()
+ {
+ return _lastError;
+ }
+
+ public virtual long GetLastExtendedErrorCode()
+ {
+ return 0;
+ }
+
+ public string GetPlayerDescription()
+ {
+ return _playerDescription;
+ }
+
+ public virtual bool PlayerSupportsLinearColorSpace()
+ {
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ return true;
+#else
+ return false;
+#endif
+ }
+
+ public virtual int GetBufferedTimeRangeCount() { return 0; }
+ public virtual bool GetBufferedTimeRange(int index, ref float startTimeMs, ref float endTimeMs) { return false; }
+
+ protected string _playerDescription = string.Empty;
+ protected ErrorCode _lastError = ErrorCode.None;
+ protected FilterMode _defaultTextureFilterMode = FilterMode.Bilinear;
+ protected TextureWrapMode _defaultTextureWrapMode = TextureWrapMode.Clamp;
+ protected int _defaultTextureAnisoLevel = 1;
+
+ protected TimeRange[] _seekableTimeRanges = new TimeRange[0];
+
+ public void SetTextureProperties(FilterMode filterMode = FilterMode.Bilinear, TextureWrapMode wrapMode = TextureWrapMode.Clamp, int anisoLevel = 0)
+ {
+ _defaultTextureFilterMode = filterMode;
+ _defaultTextureWrapMode = wrapMode;
+ _defaultTextureAnisoLevel = anisoLevel;
+ for (int i = 0; i < GetTextureCount(); ++i)
+ {
+ ApplyTextureProperties(GetTexture(i));
+ }
+ }
+
+ protected virtual void ApplyTextureProperties(Texture texture)
+ {
+ if (texture != null)
+ {
+ texture.filterMode = _defaultTextureFilterMode;
+ texture.wrapMode = _defaultTextureWrapMode;
+ texture.anisoLevel = _defaultTextureAnisoLevel;
+ }
+ }
+
+ public virtual void GrabAudio(float[] buffer, int floatCount, int channelCount)
+ {
+
+ }
+
+ protected bool IsExpectingNewVideoFrame()
+ {
+ if (HasVideo())
+ {
+ // If we're playing then we expect a new frame
+ if (!IsFinished() && (!IsPaused() || IsPlaying()))
+ {
+ // NOTE: if a new frame isn't available then we could either be seeking or stalled
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public virtual bool IsPlaybackStalled()
+ {
+ const float StallDetectionDuration = 0.75f;
+
+ // Manually detect stalled video if the platform doesn't have native support to detect it
+ if (SupportsTextureFrameCount() && IsExpectingNewVideoFrame())
+ {
+ int frameCount = GetTextureFrameCount();
+ if (frameCount != _stallDetectionFrame)
+ {
+ _stallDetectionTimer = 0f;
+ _stallDetectionFrame = frameCount;
+ }
+ else
+ {
+ _stallDetectionTimer += Time.deltaTime;
+ }
+ return (_stallDetectionTimer > StallDetectionDuration);
+ }
+ else
+ {
+ _stallDetectionTimer = 0f;
+ }
+ return false;
+ }
+
+ private float _stallDetectionTimer;
+ private int _stallDetectionFrame;
+
+ protected List _subtitles;
+ protected Subtitle _currentSubtitle;
+
+ public bool LoadSubtitlesSRT(string data)
+ {
+ if (string.IsNullOrEmpty(data))
+ {
+ // Disable subtitles
+ _subtitles = null;
+ _currentSubtitle = null;
+ }
+ else
+ {
+ _subtitles = Helper.LoadSubtitlesSRT(data);
+ _currentSubtitle = null;
+ }
+ return (_subtitles != null);
+ }
+
+ public virtual void UpdateSubtitles()
+ {
+ if (_subtitles != null)
+ {
+ float time = GetCurrentTimeMs();
+
+ // TODO: implement a more effecient subtitle index searcher
+ int searchIndex = 0;
+ if (_currentSubtitle != null)
+ {
+ if (!_currentSubtitle.IsTime(time))
+ {
+ if (time > _currentSubtitle.timeEndMs)
+ {
+ searchIndex = _currentSubtitle.index + 1;
+ }
+ _currentSubtitle = null;
+ }
+ }
+
+ if (_currentSubtitle == null)
+ {
+ for (int i = searchIndex; i < _subtitles.Count; i++)
+ {
+ if (_subtitles[i].IsTime(time))
+ {
+ _currentSubtitle = _subtitles[i];
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ public virtual int GetSubtitleIndex()
+ {
+ int result = -1;
+ if (_currentSubtitle != null)
+ {
+ result = _currentSubtitle.index;
+ }
+ return result;
+ }
+
+ public virtual string GetSubtitleText()
+ {
+ string result = string.Empty;
+ if (_currentSubtitle != null)
+ {
+ result = _currentSubtitle.text;
+ }
+ return result;
+ }
+
+ public virtual void OnEnable()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/BaseMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/BaseMediaPlayer.cs.meta
new file mode 100644
index 0000000..b799a78
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/BaseMediaPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4f59504ca098e7d41b036917f4764ee0
+timeCreated: 1447782861
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/HLSStream.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/HLSStream.cs
new file mode 100644
index 0000000..76aaa87
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/HLSStream.cs
@@ -0,0 +1,317 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+#if !UNITY_WSA_10_0 && !UNITY_WINRT_8_1 && !UNITY_WSA && !UNITY_WEBPLAYER
+ #define SUPPORT_SSL
+#endif
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using UnityEngine;
+#if SUPPORT_SSL
+using System.Security.Cryptography.X509Certificates;
+using System.Net.Security;
+using System.Net;
+#endif
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Utility class to parses an HLS(m3u8) adaptive stream from a URL to
+ /// allow easy inspection and navitation of the stream data
+ ///
+ public class HLSStream : Stream
+ {
+ private const string BANDWITH_NAME = "BANDWIDTH=";
+ private const string RESOLUTION_NAME = "RESOLUTION=";
+ private const string CHUNK_TAG = "#EXTINF";
+ private const string STREAM_TAG = "#EXT-X-STREAM-INF";
+
+ private List _streams;
+ private List _chunks;
+ private string _streamURL;
+ private int _width;
+ private int _height;
+ private int _bandwidth;
+
+ public override int Width
+ {
+ get { return _width; }
+ }
+
+ public override int Height
+ {
+ get { return _height; }
+ }
+
+ public override int Bandwidth
+ {
+ get { return _bandwidth; }
+ }
+
+ public override string URL
+ {
+ get { return _streamURL; }
+ }
+
+ public override List GetAllChunks()
+ {
+ List chunks = new List();
+
+ for(int i = 0; i < _streams.Count; ++i)
+ {
+ var streamChunks = _streams[i].GetAllChunks();
+ chunks.AddRange(streamChunks);
+ }
+
+ chunks.AddRange(_chunks);
+
+ return chunks;
+ }
+
+ public override List GetChunks()
+ {
+ return _chunks;
+ }
+
+ public override List GetAllStreams()
+ {
+ List streams = new List();
+ for(int i = 0; i < _streams.Count; ++i)
+ {
+ var childrenStreams = _streams[i].GetAllStreams();
+ streams.AddRange(childrenStreams);
+ }
+
+ streams.AddRange(_streams);
+
+ return streams;
+ }
+
+ public override List GetStreams()
+ {
+ return _streams;
+ }
+
+ private bool ExtractStreamInfo(string line, ref int width, ref int height, ref int bandwidth)
+ {
+ if (line.StartsWith(STREAM_TAG))
+ {
+ int bandwidthPos = line.IndexOf(BANDWITH_NAME);
+ if (bandwidthPos >= 0)
+ {
+ int endPos = line.IndexOf(',', bandwidthPos + BANDWITH_NAME.Length);
+ if (endPos < 0)
+ {
+ endPos = line.Length - 1;
+ }
+
+ if (endPos >= 0 && endPos - BANDWITH_NAME.Length > bandwidthPos)
+ {
+ int length = endPos - bandwidthPos - BANDWITH_NAME.Length;
+
+ string bandwidthString = line.Substring(bandwidthPos + BANDWITH_NAME.Length, length);
+ if (!int.TryParse(bandwidthString, out bandwidth))
+ {
+ bandwidth = 0;
+ }
+ }
+ }
+ else
+ {
+ bandwidth = 0;
+ }
+
+ int resolutionPos = line.IndexOf(RESOLUTION_NAME);
+ if (resolutionPos >= 0)
+ {
+ int endPos = line.IndexOf(',', resolutionPos + RESOLUTION_NAME.Length);
+ if (endPos < 0)
+ {
+ endPos = line.Length - 1;
+ }
+
+ if (endPos >= 0 && endPos - RESOLUTION_NAME.Length > resolutionPos)
+ {
+ int length = endPos - resolutionPos - RESOLUTION_NAME.Length;
+ string resolutionString = line.Substring(resolutionPos + RESOLUTION_NAME.Length, length);
+ int xPos = resolutionString.IndexOf('x');
+
+ if (xPos < 0 || !int.TryParse(resolutionString.Substring(0, xPos), out width) ||
+ !int.TryParse(resolutionString.Substring(xPos + 1, resolutionString.Length - (xPos + 1)), out height))
+ {
+ width = height = 0;
+ }
+ }
+ }
+ else
+ {
+ width = height = 0;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool IsChunk(string line)
+ {
+ return line.StartsWith(CHUNK_TAG);
+ }
+
+ private void ParseFile(string[] text, string path)
+ {
+ bool nextIsChunk = false;
+ bool nextIsStream = false;
+ int width = 0, height = 0, bitrate = 0;
+
+ for (int i = 0; i < text.Length; ++i)
+ {
+ if (ExtractStreamInfo(text[i], ref width, ref height, ref bitrate))
+ {
+ nextIsStream = true;
+ nextIsChunk = false;
+ }
+ else if (IsChunk(text[i]))
+ {
+ nextIsChunk = true;
+ nextIsStream = false;
+ }
+ else if (nextIsChunk)
+ {
+ Chunk chunk;
+ chunk.name = path + text[i];
+ _chunks.Add(chunk);
+
+ nextIsChunk = false;
+ nextIsStream = false;
+ }
+ else if (nextIsStream)
+ {
+ try
+ {
+ string fullpath = text[i].IndexOf("://") < 0 ? path + text[i] : text[i];
+ HLSStream stream = new HLSStream(fullpath, width, height, bitrate);
+ _streams.Add(stream);
+ }
+ catch (Exception e)
+ {
+ Debug.LogError("[AVProVideo]HLSParser cannot parse stream " + path + text[i] + ", " + e.Message);
+ }
+
+ nextIsChunk = false;
+ nextIsStream = false;
+ }
+ else
+ {
+ nextIsChunk = false;
+ nextIsStream = false;
+ }
+ }
+ }
+
+ public HLSStream(string filename, int width = 0, int height = 0, int bandwidth = 0)
+ {
+ _streams = new List();
+ _chunks = new List();
+
+ _width = width;
+ _height = height;
+ _bandwidth = bandwidth;
+ _streamURL = filename;
+
+ try
+ {
+ string[] fileLines = null;
+
+ if (filename.ToLower().StartsWith("http://") || filename.ToLower().StartsWith("https://"))
+ {
+#if UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_WSA
+ WWW www = new WWW(filename);
+ int watchdog = 0;
+ while (!www.isDone && watchdog < 5000)
+ {
+#if NETFX_CORE
+ System.Threading.Tasks.Task.Delay(1).Wait();
+#else
+ System.Threading.Thread.Sleep(1);
+#endif
+ watchdog++;
+ }
+ if (www.isDone && watchdog < 5000)
+ {
+ string fileString = www.text;
+ fileLines = fileString.Split('\n');
+ }
+#else
+
+#if SUPPORT_SSL
+ if (filename.ToLower().StartsWith("https://"))
+ {
+ ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback;
+ }
+#endif
+ using (System.Net.WebClient webClient = new System.Net.WebClient())
+ {
+ string fileString = webClient.DownloadString(filename);
+ fileLines = fileString.Split('\n');
+ }
+#endif
+ }
+ else
+ {
+ fileLines = File.ReadAllLines(filename);
+ }
+
+ int lastDash = filename.LastIndexOf('/');
+ if(lastDash < 0)
+ {
+ lastDash = filename.LastIndexOf('\\');
+ }
+
+ string path = _streamURL.Substring(0, lastDash + 1);
+
+ ParseFile(fileLines, path);
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ }
+
+#if SUPPORT_SSL
+ private bool MyRemoteCertificateValidationCallback(System.Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
+ {
+ bool isOk = true;
+ // If there are errors in the certificate chain,
+ // look at each error to determine the cause.
+ if (sslPolicyErrors != SslPolicyErrors.None)
+ {
+ for (int i = 0; i < chain.ChainStatus.Length; i++)
+ {
+ if (chain.ChainStatus[i].Status == X509ChainStatusFlags.RevocationStatusUnknown)
+ {
+ continue;
+ }
+ chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
+ chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
+ chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0);
+ // Note: change flags to X509VerificationFlags.AllFlags to skip all security checks
+ chain.ChainPolicy.VerificationFlags = X509VerificationFlags.NoFlag;
+ bool chainIsValid = chain.Build((X509Certificate2)certificate);
+ if (!chainIsValid)
+ {
+ isOk = false;
+ break;
+ }
+ }
+ }
+ return isOk;
+ }
+#endif
+ }
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/HLSStream.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/HLSStream.cs.meta
new file mode 100644
index 0000000..c6b609e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/HLSStream.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a9879a5f11eabdf4fac86f6632482b72
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Interfaces.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Interfaces.cs
new file mode 100644
index 0000000..9f81529
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Interfaces.cs
@@ -0,0 +1,1079 @@
+#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+#elif UNITY_IOS || UNITY_ANDROID
+ #if UNITY_5_5_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4)
+ #define UNITY_PLATFORM_SUPPORTS_LINEAR
+ #endif
+#endif
+
+using UnityEngine;
+using System.Collections.Generic;
+
+#if NETFX_CORE
+using Windows.Storage.Streams;
+#endif
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ [System.Serializable]
+ public class MediaPlayerEvent : UnityEngine.Events.UnityEvent
+ {
+ public enum EventType
+ {
+ MetaDataReady, // Triggered when meta data(width, duration etc) is available
+ ReadyToPlay, // Triggered when the video is loaded and ready to play
+ Started, // Triggered when the playback starts
+ FirstFrameReady, // Triggered when the first frame has been rendered
+ FinishedPlaying, // Triggered when a non-looping video has finished playing
+ Closing, // Triggered when the media is closed
+ Error, // Triggered when an error occurs
+ SubtitleChange, // Triggered when the subtitles change
+ Stalled, // Triggered when media is stalled (eg. when lost connection to media stream) - Currently only suported on Windows platforms
+ Unstalled, // Triggered when media is resumed form a stalled state (eg. when lost connection is re-established)
+ ResolutionChanged, // Triggered when the resolution of the video has changed (including the load) Useful for adaptive streams
+ StartedSeeking, // Triggered whhen seeking begins
+ FinishedSeeking, // Triggered when seeking has finished
+ StartedBuffering, // Triggered when buffering begins
+ FinishedBuffering, // Triggered when buffering has finished
+ PropertiesChanged, // Triggered when any properties (eg stereo packing are changed) - this has to be triggered manually
+ PlaylistItemChanged,// Triggered when the new item is played in the playlist
+ PlaylistFinished, // Triggered when the playlist reaches the end
+
+ // TODO:
+ //StartLoop, // Triggered when the video starts and is in loop mode
+ //EndLoop, // Triggered when the video ends and is in loop mode
+ }
+
+ private List> _listeners = new List>(4);
+
+ public bool HasListeners()
+ {
+ return (_listeners.Count > 0) || (GetPersistentEventCount() > 0);
+ }
+
+ new public void AddListener(UnityEngine.Events.UnityAction call)
+ {
+ if (!_listeners.Contains(call))
+ {
+ _listeners.Add(call);
+ base.AddListener(call);
+ }
+ }
+
+ new public void RemoveListener(UnityEngine.Events.UnityAction call)
+ {
+ int index = _listeners.IndexOf(call);
+ if (index >= 0)
+ {
+ _listeners.RemoveAt(index);
+ base.RemoveListener(call);
+ }
+ }
+ }
+
+ public interface IMediaPlayer
+ {
+ void OnEnable();
+ void Update();
+ void Render();
+ }
+
+ public interface IMediaSubtitles
+ {
+ bool LoadSubtitlesSRT(string data);
+ int GetSubtitleIndex();
+ string GetSubtitleText();
+ }
+
+ public interface IMediaControl
+ {
+ ///
+ /// Be careful using this method directly. It is best to instead use the OpenVideoFromFile() method in the MediaPlayer component as this will set up the events correctly and also perform other checks
+ ///
+ bool OpenVideoFromFile(string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0);
+ bool OpenVideoFromBuffer(byte[] buffer);
+ bool StartOpenVideoFromBuffer(ulong length);
+ bool AddChunkToVideoBuffer(byte[] chunk, ulong offset, ulong length);
+ bool EndOpenVideoFromBuffer();
+
+#if NETFX_CORE
+ bool OpenVideoFromFile(IRandomAccessStream ras, string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0);
+#endif
+
+ void CloseVideo();
+
+ void SetLooping(bool bLooping);
+ bool IsLooping();
+
+ bool HasMetaData();
+ bool CanPlay();
+ bool IsPlaying();
+ bool IsSeeking();
+ bool IsPaused();
+ bool IsFinished();
+ bool IsBuffering();
+
+ void Play();
+ void Pause();
+ void Stop();
+ void Rewind();
+
+ ///
+ /// The time seeked will be to the exact time
+ /// This can take a long time is the keyframes are far apart
+ /// Some platforms don't support this and instead seek to the closet keyframe
+ ///
+ void Seek(float timeMs);
+
+ ///
+ /// The time seeked will be to the closet keyframe
+ ///
+ void SeekFast(float timeMs);
+
+ ///
+ /// The time seeked to will be within the range [timeMS-beforeMs, timeMS+afterMs] for efficiency.
+ /// Only supported on macOS, iOS and tvOS.
+ /// Other platforms will automatically pass through to Seek()
+ ///
+ void SeekWithTolerance(float timeMs, float beforeMs, float afterMs);
+
+ float GetCurrentTimeMs();
+
+ ///
+ /// Returns the current video time in number of seconds since 1 Jan 1970
+ /// This can be converted into a DateTime using ConvertSecondsSince1970ToDateTime()
+ /// Only supported on macOS, iOS, tvOS and Android (using ExoPlayer API)
+ ///
+ double GetCurrentDateTimeSecondsSince1970();
+
+ ///
+ /// Returns a range of time values that can be seeked in milliseconds
+ /// Only supported on macOS, iOS, tvOS and Android (using ExoPlayer API)
+ ///
+ TimeRange[] GetSeekableTimeRanges();
+
+ float GetPlaybackRate();
+ void SetPlaybackRate(float rate);
+
+ void MuteAudio(bool bMute);
+ bool IsMuted();
+ void SetVolume(float volume);
+ void SetBalance(float balance);
+ float GetVolume();
+ float GetBalance();
+
+ int GetCurrentAudioTrack();
+ void SetAudioTrack(int index);
+
+ int GetCurrentVideoTrack();
+ void SetVideoTrack(int index);
+
+ float GetBufferingProgress();
+ int GetBufferedTimeRangeCount();
+ bool GetBufferedTimeRange(int index, ref float startTimeMs, ref float endTimeMs);
+
+ ErrorCode GetLastError();
+ long GetLastExtendedErrorCode();
+
+ void SetTextureProperties(FilterMode filterMode = FilterMode.Bilinear, TextureWrapMode wrapMode = TextureWrapMode.Clamp, int anisoLevel = 1);
+
+ void GrabAudio(float[] buffer, int floatCount, int channelCount);
+
+ int GetNumAudioChannels();
+ void SetAudioHeadRotation(Quaternion q);
+ void ResetAudioHeadRotation();
+ void SetAudioChannelMode(Audio360ChannelMode channelMode);
+ void SetAudioFocusEnabled(bool enabled);
+ void SetAudioFocusProperties(float offFocusLevel, float widthDegrees);
+ void SetAudioFocusRotation(Quaternion q);
+ void ResetAudioFocus();
+
+ bool WaitForNextFrame(Camera dummyCamera, int previousFrameCount);
+
+ void SetPlayWithoutBuffering(bool playWithoutBuffering);
+
+ // Encrypted stream support
+ void SetKeyServerURL(string url);
+ void SetKeyServerAuthToken(string token);
+ void SetDecryptionKeyBase64(string key);
+ void SetDecryptionKey(byte[] key);
+ }
+
+ public interface IMediaInfo
+ {
+ ///
+ /// Returns media duration in milliseconds
+ ///
+ float GetDurationMs();
+
+ ///
+ /// Returns video width in pixels
+ ///
+ int GetVideoWidth();
+
+ ///
+ /// Returns video height in pixels
+ ///
+ int GetVideoHeight();
+
+ ///
+ ///
+ ///
+ ///
+ Rect GetCropRect();
+
+ ///
+ /// Returns the frame rate of the media.
+ ///
+ float GetVideoFrameRate();
+
+ ///
+ /// Returns the current achieved display rate in frames per second
+ ///
+ float GetVideoDisplayRate();
+
+ ///
+ /// Returns true if the media has a visual track
+ ///
+ bool HasVideo();
+
+ ///
+ /// Returns true if the media has a audio track
+ ///
+ bool HasAudio();
+
+ ///
+ /// Returns the number of audio tracks contained in the media
+ ///
+ int GetAudioTrackCount();
+
+ ///
+ /// Returns the identifier of the audio track at the index specified.
+ ///
+ string GetAudioTrackId(int index);
+
+ ///
+ /// Returns the current audio track identification
+ ///
+ string GetCurrentAudioTrackId();
+
+ ///
+ /// Returns the current audio track bitrate
+ ///
+ int GetCurrentAudioTrackBitrate();
+
+ ///
+ /// Returns the number of video tracks contained in the media
+ ///
+ int GetVideoTrackCount();
+
+ ///
+ /// Returns the identifier of the video track at the index specified.
+ ///
+ string GetVideoTrackId(int index);
+
+ ///
+ /// Returns the current video track identification
+ ///
+ string GetCurrentVideoTrackId();
+
+ ///
+ /// Returns the current video track bitrate
+ ///
+ int GetCurrentVideoTrackBitrate();
+
+ ///
+ /// Returns the a description of which playback path is used internally.
+ /// This can for example expose whether CPU or GPU decoding is being performed
+ /// For Windows the available player descriptions are:
+ /// "DirectShow" - legacy Microsoft API but still very useful especially with modern filters such as LAV
+ /// "MF-MediaEngine-Software" - uses the Windows 8.1 features of the Microsoft Media Foundation API, but software decoding
+ /// "MF-MediaEngine-Hardware" - uses the Windows 8.1 features of the Microsoft Media Foundation API, but GPU decoding
+ /// Android has "MediaPlayer" and "ExoPlayer"
+ /// macOS / tvOS / iOS just has "AVfoundation"
+ ///
+ string GetPlayerDescription();
+
+ ///
+ /// Whether this MediaPlayer instance supports linear color space
+ /// If it doesn't then a correction may have to be made in the shader
+ ///
+ bool PlayerSupportsLinearColorSpace();
+
+ ///
+ /// Checks if the playback is in a stalled state
+ ///
+ bool IsPlaybackStalled();
+
+ ///
+ /// The affine transform of the texture as an array of six floats: a, b, c, d, tx, ty.
+ ///
+ float[] GetTextureTransform();
+
+ ///
+ /// Gets the estimated bandwidth used by all video players (in bits per second)
+ /// Currently only supported on Android when using ExoPlayer API
+ ///
+ long GetEstimatedTotalBandwidthUsed();
+
+ /*
+ string GetMediaDescription();
+ string GetVideoDescription();
+ string GetAudioDescription();*/
+ }
+
+ public interface IMediaProducer
+ {
+ ///
+ /// Gets the number of textures produced by the media player.
+ ///
+ int GetTextureCount();
+
+ ///
+ /// Returns the Unity texture containing the current frame image.
+ /// The texture pointer will return null while the video is loading
+ /// This texture usually remains the same for the duration of the video.
+ /// There are cases when this texture can change, for instance: if the graphics device is recreated,
+ /// a new video is loaded, or if an adaptive stream (eg HLS) is used and it switches video streams.
+ ///
+ Texture GetTexture(int index = 0);
+
+ ///
+ /// Returns a count of how many times the texture has been updated
+ ///
+ int GetTextureFrameCount();
+
+ ///
+ /// Returns whether this platform supports counting the number of times the texture has been updated
+ ///
+ bool SupportsTextureFrameCount();
+
+ ///
+ /// Returns the presentation time stamp of the current texture
+ ///
+ long GetTextureTimeStamp();
+
+ ///
+ /// Returns true if the image on the texture is upside-down
+ ///
+ bool RequiresVerticalFlip();
+
+ ///
+ /// Returns the current transformation required to convert from YpCbCr to RGB colorspaces.
+ ///
+ Matrix4x4 GetYpCbCrTransform();
+ }
+
+ public enum Platform
+ {
+ Windows,
+ MacOSX,
+ iOS,
+ tvOS,
+ Android,
+ WindowsPhone,
+ WindowsUWP,
+ WebGL,
+ PS4,
+ Count = 9,
+ Unknown = 100,
+ }
+
+ public enum StereoPacking
+ {
+ None,
+ TopBottom, // Top is the left eye, bottom is the right eye
+ LeftRight, // Left is the left eye, right is the right eye
+ CustomUV, // Custom packing, use the mesh UV to unpack, uv0=left eye, uv1=right eye
+ }
+
+ public enum StereoEye
+ {
+ Both,
+ Left,
+ Right,
+ }
+
+ public enum AlphaPacking
+ {
+ None,
+ TopBottom,
+ LeftRight,
+ }
+
+ public enum ErrorCode
+ {
+ None = 0,
+ LoadFailed = 100,
+ DecodeFailed = 200,
+ }
+
+ public enum Orientation
+ {
+ Landscape, // Landscape Right (0 degrees)
+ LandscapeFlipped, // Landscape Left (180 degrees)
+ Portrait, // Portrait Up (90 degrees)
+ PortraitFlipped, // Portrait Down (-90 degrees)
+ }
+
+ public enum VideoMapping
+ {
+ Unknown,
+ Normal,
+ EquiRectangular360,
+ EquiRectangular180,
+ CubeMap3x2,
+ }
+
+ public enum FileFormat
+ {
+ Unknown,
+ HLS,
+ DASH,
+ SmoothStreaming,
+ }
+
+ public static class Windows
+ {
+ public enum VideoApi
+ {
+ MediaFoundation,
+ DirectShow,
+ };
+
+ // WIP: Experimental feature to allow overriding audio device for VR headsets
+ public const string AudioDeviceOutputName_Vive = "HTC VIVE USB Audio";
+ public const string AudioDeviceOutputName_Rift = "Rift Audio";
+ }
+
+ public static class Android
+ {
+ public enum VideoApi
+ {
+ MediaPlayer = 1,
+ ExoPlayer,
+ }
+ }
+
+ public static class WebGL
+ {
+ public enum ExternalLibrary
+ {
+ None,
+ DashJs,
+ HlsJs,
+ Custom,
+ }
+ }
+
+ // Facebooks Audio360 channel mapping
+ public enum Audio360ChannelMode
+ {
+ TBE_8_2 = 0, /// 8 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio
+ TBE_8, /// 8 channels of hybrid TBE ambisonics. NO head-locked stereo audio
+ TBE_6_2, /// 6 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio
+ TBE_6, /// 6 channels of hybrid TBE ambisonics. NO head-locked stereo audio
+ TBE_4_2, /// 4 channels of hybrid TBE ambisonics and 2 channels of head-locked stereo audio
+ TBE_4, /// 4 channels of hybrid TBE ambisonics. NO head-locked stereo audio
+ TBE_8_PAIR0, /// Channels 1 and 2 of TBE hybrid ambisonics
+ TBE_8_PAIR1, /// Channels 3 and 4 of TBE hybrid ambisonics
+ TBE_8_PAIR2, /// Channels 5 and 6 of TBE hybrid ambisonics
+ TBE_8_PAIR3, /// Channels 7 and 8 of TBE hybrid ambisonics
+ TBE_CHANNEL0, /// Channels 1 of TBE hybrid ambisonics
+ TBE_CHANNEL1, /// Channels 2 of TBE hybrid ambisonics
+ TBE_CHANNEL2, /// Channels 3 of TBE hybrid ambisonics
+ TBE_CHANNEL3, /// Channels 4 of TBE hybrid ambisonics
+ TBE_CHANNEL4, /// Channels 5 of TBE hybrid ambisonics
+ TBE_CHANNEL5, /// Channels 6 of TBE hybrid ambisonics
+ TBE_CHANNEL6, /// Channels 7 of TBE hybrid ambisonics
+ TBE_CHANNEL7, /// Channels 8 of TBE hybrid ambisonics
+ HEADLOCKED_STEREO, /// Head-locked stereo audio
+ HEADLOCKED_CHANNEL0, /// Channels 1 or left of head-locked stereo audio
+ HEADLOCKED_CHANNEL1, /// Channels 2 or right of head-locked stereo audio
+ AMBIX_4, /// 4 channels of first order ambiX
+ AMBIX_9, /// 9 channels of second order ambiX
+ AMBIX_9_2, /// 9 channels of second order ambiX with 2 channels of head-locked audio
+ AMBIX_16, /// 16 channels of third order ambiX
+ AMBIX_16_2, /// 16 channels of third order ambiX with 2 channels of head-locked audio
+ STEREO, /// Stereo audio
+ INVALID, /// Invalid/unknown map. This must always be last.
+ }
+
+ public struct TimeRange
+ {
+ public float startTime, duration;
+ }
+
+ public class Subtitle
+ {
+ public int index;
+ public string text;
+ public int timeStartMs, timeEndMs;
+
+ public bool IsBefore(float time)
+ {
+ return (time > timeStartMs && time > timeEndMs);
+ }
+
+ public bool IsTime(float time)
+ {
+ return (time >= timeStartMs && time < timeEndMs);
+ }
+ }
+
+ public static class Helper
+ {
+ public const string ScriptVersion = "1.9.5";
+
+ public static string GetName(Platform platform)
+ {
+ string result = "Unknown";
+ switch (platform)
+ {
+ case Platform.WindowsPhone:
+ result = "Windows Phone";
+ break;
+ case Platform.WindowsUWP:
+ result = "Windows UWP";
+ break;
+ case Platform.MacOSX:
+ result = "macOS";
+ break;
+ default:
+ result = platform.ToString();
+ break;
+ }
+
+ return result;
+ }
+
+ public static string GetErrorMessage(ErrorCode code)
+ {
+ string result = string.Empty;
+ switch (code)
+ {
+ case ErrorCode.None:
+ result = "No Error";
+ break;
+ case ErrorCode.LoadFailed:
+ result = "Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.";
+#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
+ // Add extra information for older Windows versions that don't have support for modern codecs
+ if (SystemInfo.operatingSystem.StartsWith("Windows XP") ||
+ SystemInfo.operatingSystem.StartsWith("Windows Vista"))
+ {
+ result += " NOTE: Windows XP and Vista don't have native support for H.264 codec. Consider using an older codec such as DivX or installing 3rd party codecs such as LAV Filters.";
+ }
+#endif
+ break;
+ case ErrorCode.DecodeFailed:
+ result = "Decode failed. Possible codec not supported, video resolution/bit-depth too high, or insufficient system resources.";
+#if UNITY_ANDROID
+ result += " On Android this is generally due to the hardware not having enough resources to decode the video. Most Android devices can only handle a maximum of one 4K video at once.";
+#endif
+ break;
+ }
+ return result;
+ }
+
+ public static string[] GetPlatformNames()
+ {
+ return new string[] {
+ GetName(Platform.Windows),
+ GetName(Platform.MacOSX),
+ GetName(Platform.iOS),
+ GetName(Platform.tvOS),
+ GetName(Platform.Android),
+ GetName(Platform.WindowsPhone),
+ GetName(Platform.WindowsUWP),
+ GetName(Platform.WebGL),
+ GetName(Platform.PS4),
+ };
+ }
+
+#if AVPROVIDEO_DISABLE_LOGGING
+ [System.Diagnostics.Conditional("ALWAYS_FALSE")]
+#endif
+ public static void LogInfo(string message, Object context = null)
+ {
+ if (context == null)
+ {
+ Debug.Log("[AVProVideo] " + message);
+ }
+ else
+ {
+ Debug.Log("[AVProVideo] " + message, context);
+ }
+ }
+
+ public static string GetTimeString(float totalSeconds, bool showMilliseconds = false)
+ {
+ int hours = Mathf.FloorToInt(totalSeconds / (60f * 60f));
+ float usedSeconds = hours * 60f * 60f;
+
+ int minutes = Mathf.FloorToInt((totalSeconds - usedSeconds) / 60f);
+ usedSeconds += minutes * 60f;
+
+ int seconds = Mathf.FloorToInt(totalSeconds - usedSeconds);
+
+ string result;
+ if (hours <= 0)
+ {
+ if (showMilliseconds)
+ {
+ int milliSeconds = (int)((totalSeconds - Mathf.Floor(totalSeconds)) * 1000f);
+ result = string.Format("{0:00}:{1:00}:{2:000}", minutes, seconds, milliSeconds);
+ }
+ else
+ {
+ result = string.Format("{0:00}:{1:00}", minutes, seconds);
+ }
+ }
+ else
+ {
+ if (showMilliseconds)
+ {
+ int milliSeconds = (int)((totalSeconds - Mathf.Floor(totalSeconds)) * 1000f);
+ result = string.Format("{2}:{0:00}:{1:00}:{3:000}", minutes, seconds, hours, milliSeconds);
+ }
+ else
+ {
+ result = string.Format("{2}:{0:00}:{1:00}", minutes, seconds, hours);
+ }
+ }
+
+ return result;
+ }
+
+ ///
+ /// Convert texture transform matrix to an enum of orientation types
+ ///
+ public static Orientation GetOrientation(float[] t)
+ {
+ Orientation result = Orientation.Landscape;
+ if (t[0] == 0f && t[1]== 1f && t[2] == -1f && t[3] == 0f)
+ {
+ result = Orientation.Portrait;
+ } else
+ if (t[0] == 0f && t[1] == -1f && t[2] == 1f && t[3] == 0f)
+ {
+ result = Orientation.PortraitFlipped;
+ } else
+ if (t[0]== 1f && t[1] == 0f && t[2] == 0f && t[3] == 1f)
+ {
+ result = Orientation.Landscape;
+ } else
+ if (t[0] == -1f && t[1] == 0f && t[2] == 0f && t[3] == -1f)
+ {
+ result = Orientation.LandscapeFlipped;
+ }
+ return result;
+ }
+
+ public static Matrix4x4 GetMatrixForOrientation(Orientation ori)
+ {
+ // TODO: cache these matrices
+ Matrix4x4 portrait = Matrix4x4.TRS(new Vector3(0f, 1f, 0f), Quaternion.Euler(0f, 0f, -90f), Vector3.one);
+ Matrix4x4 portraitFlipped = Matrix4x4.TRS(new Vector3(1f, 0f, 0f), Quaternion.Euler(0f, 0f, 90f), Vector3.one);
+ Matrix4x4 landscapeFlipped = Matrix4x4.TRS(new Vector3(1f, 1f, 0f), Quaternion.identity, new Vector3(-1f, -1f, 1f));
+
+ Matrix4x4 result = Matrix4x4.identity;
+ switch (ori)
+ {
+ case Orientation.Landscape:
+ break;
+ case Orientation.LandscapeFlipped:
+ result = landscapeFlipped;
+ break;
+ case Orientation.Portrait:
+ result = portrait;
+ break;
+ case Orientation.PortraitFlipped:
+ result = portraitFlipped;
+ break;
+ }
+ return result;
+ }
+
+ public static void SetupStereoEyeModeMaterial(Material material, StereoEye mode)
+ {
+ switch (mode)
+ {
+ case StereoEye.Both:
+ material.DisableKeyword("FORCEEYE_LEFT");
+ material.DisableKeyword("FORCEEYE_RIGHT");
+ material.EnableKeyword("FORCEEYE_NONE");
+ break;
+ case StereoEye.Left:
+ material.DisableKeyword("FORCEEYE_NONE");
+ material.DisableKeyword("FORCEEYE_RIGHT");
+ material.EnableKeyword("FORCEEYE_LEFT");
+ break;
+ case StereoEye.Right:
+ material.DisableKeyword("FORCEEYE_NONE");
+ material.DisableKeyword("FORCEEYE_LEFT");
+ material.EnableKeyword("FORCEEYE_RIGHT");
+ break;
+ }
+ }
+ public static void SetupLayoutMaterial(Material material, VideoMapping mapping)
+ {
+ material.DisableKeyword("LAYOUT_NONE");
+ material.DisableKeyword("LAYOUT_EQUIRECT180");
+
+ switch (mapping)
+ {
+ // Only EquiRectangular180 currently does anything in the shader
+ case VideoMapping.EquiRectangular180:
+ material.EnableKeyword("LAYOUT_EQUIRECT180");
+ break;
+ }
+ }
+
+ public static void SetupStereoMaterial(Material material, StereoPacking packing, bool displayDebugTinting)
+ {
+ material.DisableKeyword("STEREO_CUSTOM_UV");
+ material.DisableKeyword("STEREO_TOP_BOTTOM");
+ material.DisableKeyword("STEREO_LEFT_RIGHT");
+ material.DisableKeyword("MONOSCOPIC");
+
+ // Enable the required mode
+ switch (packing)
+ {
+ case StereoPacking.None:
+ break;
+ case StereoPacking.TopBottom:
+ material.EnableKeyword("STEREO_TOP_BOTTOM");
+ break;
+ case StereoPacking.LeftRight:
+ material.EnableKeyword("STEREO_LEFT_RIGHT");
+ break;
+ case StereoPacking.CustomUV:
+ material.EnableKeyword("STEREO_CUSTOM_UV");
+ break;
+ }
+
+ if (displayDebugTinting)
+ {
+ material.EnableKeyword("STEREO_DEBUG");
+ }
+ else
+ {
+ material.DisableKeyword("STEREO_DEBUG");
+ }
+ }
+
+ public static void SetupAlphaPackedMaterial(Material material, AlphaPacking packing)
+ {
+ material.DisableKeyword("ALPHAPACK_TOP_BOTTOM");
+ material.DisableKeyword("ALPHAPACK_LEFT_RIGHT");
+ material.DisableKeyword("ALPHAPACK_NONE");
+
+ // Enable the required mode
+ switch (packing)
+ {
+ case AlphaPacking.None:
+ break;
+ case AlphaPacking.TopBottom:
+ material.EnableKeyword("ALPHAPACK_TOP_BOTTOM");
+ break;
+ case AlphaPacking.LeftRight:
+ material.EnableKeyword("ALPHAPACK_LEFT_RIGHT");
+ break;
+ }
+ }
+
+ public static void SetupGammaMaterial(Material material, bool playerSupportsLinear)
+ {
+#if UNITY_PLATFORM_SUPPORTS_LINEAR
+ if (QualitySettings.activeColorSpace == ColorSpace.Linear && !playerSupportsLinear)
+ {
+ material.EnableKeyword("APPLY_GAMMA");
+ }
+ else
+ {
+ material.DisableKeyword("APPLY_GAMMA");
+ }
+#endif
+ }
+
+ public static int ConvertTimeSecondsToFrame(float seconds, float frameRate)
+ {
+ return Mathf.FloorToInt(frameRate * seconds);
+ }
+
+ public static float ConvertFrameToTimeSeconds(int frame, float frameRate)
+ {
+ float frameDurationSeconds = 1f / frameRate;
+ return ((float)frame * frameDurationSeconds) + (frameDurationSeconds * 0.5f); // Add half a frame we that the time lands in the middle of the frame range and not at the edges
+ }
+
+ public static float FindNextKeyFrameTimeSeconds(float seconds, float frameRate, int keyFrameInterval)
+ {
+ int currentFrame = Helper.ConvertTimeSecondsToFrame(seconds, frameRate);
+ // TODO: allow specifying a minimum number of frames so that if currentFrame is too close to nextKeyFrame, it will calculate the next-next keyframe
+ int nextKeyFrame = keyFrameInterval * Mathf.CeilToInt((float)(currentFrame + 1) / (float)keyFrameInterval);
+ return Helper.ConvertFrameToTimeSeconds(nextKeyFrame, frameRate);
+ }
+
+ public static System.DateTime ConvertSecondsSince1970ToDateTime(double secondsSince1970)
+ {
+ System.TimeSpan time = System.TimeSpan.FromSeconds(secondsSince1970);
+ return new System.DateTime(1970, 1, 1).Add(time);
+ }
+
+ public static void DrawTexture(Rect screenRect, Texture texture, ScaleMode scaleMode, AlphaPacking alphaPacking, Material material)
+ {
+ if (Event.current.type == EventType.Repaint)
+ {
+ float textureWidth = texture.width;
+ float textureHeight = texture.height;
+ switch (alphaPacking)
+ {
+ case AlphaPacking.LeftRight:
+ textureWidth *= 0.5f;
+ break;
+ case AlphaPacking.TopBottom:
+ textureHeight *= 0.5f;
+ break;
+ }
+
+ float aspectRatio = (float)textureWidth / (float)textureHeight;
+ Rect sourceRect = new Rect(0f, 0f, 1f, 1f);
+ switch (scaleMode)
+ {
+ case ScaleMode.ScaleAndCrop:
+ {
+ float screenRatio = screenRect.width / screenRect.height;
+ if (screenRatio > aspectRatio)
+ {
+ float adjust = aspectRatio / screenRatio;
+ sourceRect = new Rect(0f, (1f - adjust) * 0.5f, 1f, adjust);
+ }
+ else
+ {
+ float adjust = screenRatio / aspectRatio;
+ sourceRect = new Rect(0.5f - adjust * 0.5f, 0f, adjust, 1f);
+ }
+ }
+ break;
+ case ScaleMode.ScaleToFit:
+ {
+ float screenRatio = screenRect.width / screenRect.height;
+ if (screenRatio > aspectRatio)
+ {
+ float adjust = aspectRatio / screenRatio;
+ screenRect = new Rect(screenRect.xMin + screenRect.width * (1f - adjust) * 0.5f, screenRect.yMin, adjust * screenRect.width, screenRect.height);
+ }
+ else
+ {
+ float adjust = screenRatio / aspectRatio;
+ screenRect = new Rect(screenRect.xMin, screenRect.yMin + screenRect.height * (1f - adjust) * 0.5f, screenRect.width, adjust * screenRect.height);
+ }
+ }
+ break;
+ case ScaleMode.StretchToFill:
+ break;
+ }
+
+ Graphics.DrawTexture(screenRect, texture, sourceRect, 0, 0, 0, 0, GUI.color, material);
+ }
+ }
+
+ // Converts a non-readable texture to a readable Texture2D.
+ // "targetTexture" can be null or you can pass in an existing texture.
+ // Remember to Destroy() the returned texture after finished with it
+ public static Texture2D GetReadableTexture(Texture inputTexture, bool requiresVerticalFlip, Orientation ori, Texture2D targetTexture)
+ {
+ Texture2D resultTexture = targetTexture;
+
+ RenderTexture prevRT = RenderTexture.active;
+
+ int textureWidth = inputTexture.width;
+ int textureHeight = inputTexture.height;
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ if (ori == Orientation.Portrait || ori == Orientation.PortraitFlipped)
+ {
+ textureWidth = inputTexture.height;
+ textureHeight = inputTexture.width;
+ }
+#endif
+
+ // Blit the texture to a temporary RenderTexture
+ // This handles any format conversion that is required and allows us to use ReadPixels to copy texture from RT to readable texture
+ RenderTexture tempRT = RenderTexture.GetTemporary(textureWidth, textureHeight, 0, RenderTextureFormat.ARGB32);
+
+ if (ori == Orientation.Landscape)
+ {
+ if (!requiresVerticalFlip)
+ {
+ Graphics.Blit(inputTexture, tempRT);
+ }
+ else
+ {
+ // The above Blit can't flip unless using a material, so we use Graphics.DrawTexture instead
+ GL.PushMatrix();
+ RenderTexture.active = tempRT;
+ GL.LoadPixelMatrix(0f, tempRT.width, 0f, tempRT.height);
+ Rect sourceRect = new Rect(0f, 0f, 1f, 1f);
+ // NOTE: not sure why we need to set y to -1, without this there is a 1px gap at the bottom
+ Rect destRect = new Rect(0f, -1f, tempRT.width, tempRT.height);
+
+ Graphics.DrawTexture(destRect, inputTexture, sourceRect, 0, 0, 0, 0);
+ GL.PopMatrix();
+ GL.InvalidateState();
+ }
+ }
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ else
+ {
+ Matrix4x4 m = Matrix4x4.identity;
+ switch (ori)
+ {
+ case Orientation.Portrait:
+ m = Matrix4x4.TRS(new Vector3(0f, inputTexture.width, 0f), Quaternion.Euler(0f, 0f, -90f), Vector3.one);
+ break;
+ case Orientation.PortraitFlipped:
+ m = Matrix4x4.TRS(new Vector3(inputTexture.height, 0f, 0f), Quaternion.Euler(0f, 0f, 90f), Vector3.one);
+ break;
+ case Orientation.LandscapeFlipped:
+ m = Matrix4x4.TRS(new Vector3(inputTexture.width, inputTexture.height, 0f), Quaternion.identity, new Vector3(-1f, -1f, 1f));
+ break;
+ }
+
+ // The above Blit can't flip unless using a material, so we use Graphics.DrawTexture instead
+ GL.InvalidateState();
+ GL.PushMatrix();
+ GL.Clear(false, true, Color.red);
+ RenderTexture.active = tempRT;
+ GL.LoadPixelMatrix(0f, tempRT.width, 0f, tempRT.height);
+ Rect sourceRect = new Rect(0f, 0f, 1f, 1f);
+ // NOTE: not sure why we need to set y to -1, without this there is a 1px gap at the bottom
+ Rect destRect = new Rect(0f, -1f, inputTexture.width, inputTexture.height);
+ GL.MultMatrix(m);
+
+ Graphics.DrawTexture(destRect, inputTexture, sourceRect, 0, 0, 0, 0);
+ GL.PopMatrix();
+ GL.InvalidateState();
+ }
+#endif
+
+ if (resultTexture == null)
+ {
+ resultTexture = new Texture2D(textureWidth, textureHeight, TextureFormat.ARGB32, false);
+ }
+
+ RenderTexture.active = tempRT;
+ resultTexture.ReadPixels(new Rect(0f, 0f, textureWidth, textureHeight), 0, 0, false);
+ resultTexture.Apply(false, false);
+ RenderTexture.ReleaseTemporary(tempRT);
+
+ RenderTexture.active = prevRT;
+
+ return resultTexture;
+ }
+
+ ///
+ /// Parse time in format: 00:00:48,924 and convert to milliseconds
+ ///
+ private static int ParseTimeToMs(string text)
+ {
+ int result = 0;
+
+ string[] digits = text.Split(new char[] { ':', ',' });
+
+ if (digits.Length == 4)
+ {
+ int hours = int.Parse(digits[0]);
+ int minutes = int.Parse(digits[1]);
+ int seconds = int.Parse(digits[2]);
+ int milliseconds = int.Parse(digits[3]);
+
+ result = milliseconds + (seconds + (minutes + (hours * 60)) * 60) * 1000;
+ }
+
+ return result;
+ }
+
+ public static List LoadSubtitlesSRT(string data)
+ {
+ List result = null;
+
+ if (!string.IsNullOrEmpty(data))
+ {
+ data = data.Trim();
+ var rx = new System.Text.RegularExpressions.Regex("\n\r|\r\n|\n|\r");
+ string[] lines = rx.Split(data);
+
+ if (lines.Length >= 3)
+ {
+ result = new List(256);
+
+ int count = 0;
+ int index = 0;
+ Subtitle subtitle = null;
+ for (int i = 0; i < lines.Length; i++)
+ {
+ if (index == 0)
+ {
+ subtitle = new Subtitle();
+ subtitle.index = count;// int.Parse(lines[i]);
+ }
+ else if (index == 1)
+ {
+ string[] times = lines[i].Split(new string[] { " --> " }, System.StringSplitOptions.RemoveEmptyEntries);
+ if (times.Length == 2)
+ {
+ subtitle.timeStartMs = ParseTimeToMs(times[0]);
+ subtitle.timeEndMs = ParseTimeToMs(times[1]);
+ }
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(lines[i]))
+ {
+ if (index == 2)
+ {
+ subtitle.text = lines[i];
+ }
+ else
+ {
+ subtitle.text += "\n" + lines[i];
+ }
+ }
+ }
+
+ if (string.IsNullOrEmpty(lines[i]) && index > 1)
+ {
+ result.Add(subtitle);
+ index = 0;
+ count++;
+ subtitle = null;
+ }
+ else
+ {
+ index++;
+ }
+ }
+
+ // Handle the last one
+ if (subtitle != null)
+ {
+ result.Add(subtitle);
+ subtitle = null;
+ }
+ }
+ else
+ {
+ Debug.LogWarning("[AVProVideo] SRT format doesn't appear to be valid");
+ }
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Interfaces.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Interfaces.cs.meta
new file mode 100644
index 0000000..36ea5f1
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Interfaces.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 00407cbf3ca503142903894431082ac6
+timeCreated: 1438695622
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/NullMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/NullMediaPlayer.cs
new file mode 100644
index 0000000..4a472e8
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/NullMediaPlayer.cs
@@ -0,0 +1,318 @@
+using System;
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// This media player fakes video playback for platforms that aren't supported
+ ///
+ public sealed class NullMediaPlayer : BaseMediaPlayer
+ {
+ private bool _isPlaying = false;
+ private bool _isPaused = false;
+ private float _currentTime = 0.0f;
+// private bool _audioMuted = false;
+ private float _volume = 0.0f;
+ private float _playbackRate = 1.0f;
+ private bool _bLoop;
+
+ private int _Width = 256;
+ private int _height = 256;
+ private Texture2D _texture;
+ private Texture2D _texture_AVPro;
+ private Texture2D _texture_AVPro1;
+ private float _fakeFlipTime;
+ private int _frameCount;
+
+ private const float FrameRate = 10f;
+
+ public override string GetVersion()
+ {
+ return "0.0.0";
+ }
+
+ public override bool OpenVideoFromFile(string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0)
+ {
+ _texture_AVPro = (Texture2D)Resources.Load("AVPro");
+ _texture_AVPro1 = (Texture2D)Resources.Load("AVPro1");
+
+ if( _texture_AVPro )
+ {
+ _Width = _texture_AVPro.width;
+ _height = _texture_AVPro.height;
+ }
+
+ _texture = _texture_AVPro;
+
+ _fakeFlipTime = 0.0f;
+ _frameCount = 0;
+
+ return true;
+ }
+
+ public override void CloseVideo()
+ {
+ _frameCount = 0;
+ Resources.UnloadAsset(_texture_AVPro);
+ Resources.UnloadAsset(_texture_AVPro1);
+
+ base.CloseVideo();
+ }
+
+ public override void SetLooping( bool bLooping )
+ {
+ _bLoop = bLooping;
+ }
+
+ public override bool IsLooping()
+ {
+ return _bLoop;
+ }
+
+ public override bool HasMetaData()
+ {
+ return true;
+ }
+
+ public override bool CanPlay()
+ {
+ return true;
+ }
+
+ public override bool HasAudio()
+ {
+ return false;
+ }
+
+ public override bool HasVideo()
+ {
+ return false;
+ }
+
+ public override void Play()
+ {
+ _isPlaying = true;
+ _isPaused = false;
+ _fakeFlipTime = 0.0f;
+ }
+
+ public override void Pause()
+ {
+ _isPlaying = false;
+ _isPaused = true;
+ }
+
+ public override void Stop()
+ {
+ _isPlaying = false;
+ _isPaused = false;
+ }
+
+ public override bool IsSeeking()
+ {
+ return false;
+ }
+ public override bool IsPlaying()
+ {
+ return _isPlaying;
+ }
+ public override bool IsPaused()
+ {
+ return _isPaused;
+ }
+ public override bool IsFinished()
+ {
+ return _isPlaying && (_currentTime >= GetDurationMs());
+ }
+
+ public override bool IsBuffering()
+ {
+ return false;
+ }
+
+ public override float GetDurationMs()
+ {
+ return 10.0f * 1000.0f;
+ }
+
+ public override int GetVideoWidth()
+ {
+ return _Width;
+ }
+
+ public override int GetVideoHeight()
+ {
+ return _height;
+ }
+
+ public override float GetVideoDisplayRate()
+ {
+ return FrameRate;
+ }
+
+ public override Texture GetTexture( int index )
+ {
+// return _texture ? _texture : Texture2D.whiteTexture;
+ return _texture;
+ }
+
+ public override int GetTextureFrameCount()
+ {
+ return _frameCount;
+ }
+
+ public override bool RequiresVerticalFlip()
+ {
+ return false;
+ }
+
+ public override void Seek(float timeMs)
+ {
+ _currentTime = timeMs;
+ }
+
+ public override void SeekFast(float timeMs)
+ {
+ _currentTime = timeMs;
+ }
+
+ public override void SeekWithTolerance(float timeMs, float beforeMs, float afterMs)
+ {
+ _currentTime = timeMs;
+ }
+
+ public override float GetCurrentTimeMs()
+ {
+ return _currentTime;
+ }
+
+ public override void SetPlaybackRate(float rate)
+ {
+ _playbackRate = rate;
+ }
+
+ public override float GetPlaybackRate()
+ {
+ return _playbackRate;
+ }
+
+ public override float GetBufferingProgress()
+ {
+ return 0f;
+ }
+
+ public override void MuteAudio(bool bMuted)
+ {
+// _audioMuted = bMuted;
+ }
+
+ public override bool IsMuted()
+ {
+ return true;
+ }
+
+ public override void SetVolume(float volume)
+ {
+ _volume = volume;
+ }
+
+ public override float GetVolume()
+ {
+ return _volume;
+ }
+
+ public override int GetAudioTrackCount()
+ {
+ return 0;
+ }
+
+ public override int GetCurrentAudioTrack()
+ {
+ return 0;
+ }
+
+ public override void SetAudioTrack( int index )
+ {
+ }
+
+ public override int GetVideoTrackCount()
+ {
+ return 0;
+ }
+
+ public override int GetCurrentVideoTrack()
+ {
+ return 0;
+ }
+
+ public override string GetCurrentAudioTrackId()
+ {
+ // TODO
+ return "";
+ }
+
+ public override int GetCurrentAudioTrackBitrate()
+ {
+ // TODO
+ return 0;
+ }
+ public override void SetVideoTrack( int index )
+ {
+ }
+
+ public override string GetCurrentVideoTrackId()
+ {
+ return "";
+ }
+
+ public override int GetCurrentVideoTrackBitrate()
+ {
+ return 0;
+ }
+
+ public override float GetVideoFrameRate()
+ {
+ return 0.0f;
+ }
+
+ public override void Update()
+ {
+ UpdateSubtitles();
+
+ if (_isPlaying)
+ {
+ _currentTime += Time.deltaTime * 1000.0f;
+ if (_currentTime >= GetDurationMs())
+ {
+ _currentTime = GetDurationMs();
+ if( _bLoop )
+ {
+ Rewind();
+ }
+ }
+
+ //
+
+ _fakeFlipTime += Time.deltaTime;
+ if( _fakeFlipTime >= (1.0 / FrameRate))
+ {
+ _fakeFlipTime = 0.0f;
+ _texture = ( _texture == _texture_AVPro ) ? _texture_AVPro1 : _texture_AVPro;
+ _frameCount++;
+ }
+ }
+ }
+
+ public override void Render()
+ {
+ }
+
+ public override void Dispose()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/NullMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/NullMediaPlayer.cs.meta
new file mode 100644
index 0000000..339f4c2
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/NullMediaPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 478671181ab1c9b42be924da77d7fcbe
+timeCreated: 1438703159
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs
new file mode 100644
index 0000000..d347ce3
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs
@@ -0,0 +1,932 @@
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ #if !UNITY_5_0 && !UNITY_5_1
+ #define AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ #endif
+#endif
+
+using UnityEngine;
+using UnityEngine.Rendering;
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Text.RegularExpressions;
+using AOT;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// macOS, iOS and tvOS implementation of BaseMediaPlayer
+ ///
+ public class OSXMediaPlayer : BaseMediaPlayer
+ {
+#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
+ private const string PluginName = "AVProVideo";
+#elif UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ private const string PluginName = "__Internal";
+#endif
+
+ // Native Interface
+
+ private enum AVPPluginEventType
+ {
+ PlayerRender,
+ PlayerFreeResources,
+ }
+
+ private enum AVPPluginColorSpace
+ {
+ Uninitialized,
+ Gamma,
+ Linear
+ };
+
+ private enum AVPPlayerStatus
+ {
+ Failed = -1,
+ Unknown,
+ ReadyToPlay,
+ Playing,
+ Finished,
+ Seeking,
+ Buffering
+ }
+
+ private enum AVPLogFlag
+ {
+ Error = 1 << 0,
+ Warning = 1 << 1,
+ Info = 1 << 2,
+ Debug = 1 << 3,
+ Verbose = 1 << 4,
+ };
+
+ private enum AVPLogLevel
+ {
+ Off = 0,
+ Error = AVPLogFlag.Error,
+ Warning = AVPLogFlag.Error | AVPLogFlag.Warning,
+ Info = AVPLogFlag.Error | AVPLogFlag.Warning | AVPLogFlag.Info,
+ Debug = AVPLogFlag.Error | AVPLogFlag.Warning | AVPLogFlag.Info | AVPLogFlag.Debug,
+ Verbose = AVPLogFlag.Error | AVPLogFlag.Warning | AVPLogFlag.Info | AVPLogFlag.Debug | AVPLogFlag.Verbose,
+ All = -1
+ };
+
+ [StructLayout(LayoutKind.Sequential, Pack=4)]
+ private struct AVPPlayerTextureInfo
+ {
+ public IntPtr native;
+ public int width;
+ public int height;
+ public int format;
+ public int flipped;
+ };
+
+ [StructLayout(LayoutKind.Sequential, Pack=4)]
+ private struct AVPPlayerTimeRange
+ {
+ public double start;
+ public double duration;
+ };
+
+ [DllImport(PluginName)]
+ private static extern string AVPGetVersion();
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ [DllImport(PluginName)]
+ private static extern IntPtr AVPGetRenderEventFunc();
+#endif
+
+ [DllImport(PluginName)]
+ private static extern ErrorCode AVPPlayerGetLastError(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern double AVPPlayerGetCurrentTime(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern double AVPPlayerGetCurrentDate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern double AVPPlayerGetDuration(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetFrameCount(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern double AVPPlayerGetFrameRate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern long AVPPlayerGetFrameTimeStamp(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern float AVPPlayerGetNominalFrameRate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetHandle(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern AVPPlayerStatus AVPPlayerGetStatus(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern float AVPPlayerGetBufferingProgress(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetBufferedTimeRangeCount(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerGetBufferedTimeRange(IntPtr player, int index, out float start, out float end);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetSeekableTimeRanges(IntPtr player, [In, Out] AVPPlayerTimeRange[] ranges, ref int count);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerGetTextures(IntPtr player, [In, Out] AVPPlayerTextureInfo[] textures, ref int count);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerGetTextureTransform(IntPtr player, [In, Out] float[] transform);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerGetYpCbCrTransform(IntPtr player, ref float transform);
+
+ [DllImport(PluginName)]
+ private static extern float AVPPlayerGetVolume(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerHasAudio(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerHasVideo(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerHasMetaData(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerIsLooping(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetLooping(IntPtr player, bool looping);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerIsMuted(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetMuted(IntPtr player, bool muted);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetVolume(IntPtr player, float volume);
+
+ [DllImport(PluginName)]
+ private static extern IntPtr AVPPlayerNew(bool useYuv);
+
+ [DllImport(PluginName)]
+ private static extern IntPtr AVPPlayerRelease(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerOpenFile(IntPtr player, string path);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerOpenURL(IntPtr player, string url, string headers);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerClose(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerPlay(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerPause(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSeek(IntPtr player, double time);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSeekFast(IntPtr player, double time);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSeekWithTolerance(IntPtr player, double time, double before, double after);
+
+ [DllImport(PluginName)]
+ private static extern float AVPPlayerGetPlaybackRate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetPlaybackRate(IntPtr player, float rate);
+
+ [DllImport(PluginName)]
+ private static extern bool AVPPlayerUpdate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetAudioTrackCount(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern string AVPPlayerGetAudioTrackId(IntPtr player, int index);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetCurrentAudioTrack(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern string AVPPlayerGetCurrentAudioTrackId(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetCurrentAudioTrackBitrate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetVideoTrackCount(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern string AVPPlayerGetVideoTrackId(IntPtr player, int index);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetCurrentVideoTrack(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern string AVPPlayerGetCurrentVideoTrackId(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerGetCurrentVideoTrackBitrate(IntPtr player);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetAudioTrack(IntPtr player, int track);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetVideoTrack(IntPtr player, int track);
+
+ [DllImport(PluginName)]
+ private static extern int AVPPlayerExtractFrame(IntPtr player, [In, Out] AVPPlayerTextureInfo[] textures, ref int count, double timeout);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerAddValueDidChangeObserver(IntPtr player, IntPtr self, IntPtr callback, string key, uint flags);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetKeyServerURL(IntPtr player, string url);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetKeyServerAuthToken(IntPtr player, string token);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetDecryptionKeyBase64(IntPtr player, string key);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPlayerSetDecryptionKey(IntPtr player, byte[] key, int len);
+
+ [DllImport(PluginName)]
+ private static extern void AVPlayerSetPlayWithoutBuffering(IntPtr player, bool playWithoutBuffering);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPluginRegister();
+
+ [DllImport(PluginName)]
+ private static extern void AVPPluginInitialise(AVPPluginColorSpace colorSpace);
+
+ [DllImport(PluginName)]
+ private static extern void AVPPluginSetDebugLogFunction(IntPtr fn);
+
+ // MediaPlayer Interface
+
+ private static bool _initialised = false;
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ private static IntPtr _renderEventFunc = IntPtr.Zero;
+#endif
+ private static Regex _matchURLRegex = null;
+
+#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+#endif
+ private delegate void DebugLogCallbackDelegate(int level, int flags, string str);
+
+#if UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ [MonoPInvokeCallback(typeof(DebugLogCallbackDelegate))]
+#endif
+ private static void DebugLogCallback(int level, int flags, string str)
+ {
+ if ((flags & (int)AVPLogFlag.Error) == (int)AVPLogFlag.Error)
+ {
+ Debug.LogError(str);
+ }
+ else if ((flags & (int)AVPLogFlag.Warning) == (int)AVPLogFlag.Warning)
+ {
+ Debug.LogWarning(str);
+ }
+ else
+ {
+ Debug.Log(str);
+ }
+ }
+
+ private static void IssuePluginEvent(AVPPluginEventType type, int param)
+ {
+ // Build eventId from the type and param.
+ int eventId = 0x0FA60000 | ((int)type << 12);
+ eventId |= param & 0xfff;
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ GL.IssuePluginEvent(_renderEventFunc, eventId);
+#else
+ GL.IssuePluginEvent(eventId);
+#endif
+ }
+
+#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+#endif
+ private delegate void ValueAtKeyPathDidChangeDelegate(IntPtr self, string keyPath);
+
+#if UNITY_IPHONE || UNITY_IOS || UNITY_TVOS
+ [MonoPInvokeCallback(typeof(ValueAtKeyPathDidChangeDelegate))]
+#endif
+ private static void ValueAtKeyPathDidChangeThunk(IntPtr self, string keyPath)
+ {
+ GCHandle handle = GCHandle.FromIntPtr(self);
+ OSXMediaPlayer player = (OSXMediaPlayer)handle.Target;
+ player.ValueAtKeyPathDidChange(keyPath);
+ }
+
+ private void ValueAtKeyPathDidChange(string keyPath)
+ {
+ if (keyPath == "seekableTimeRanges")
+ {
+ AVPPlayerTimeRange[] ranges = new AVPPlayerTimeRange[4];
+ int count = ranges.Length;
+ int numRanges = AVPPlayerGetSeekableTimeRanges(_player, ranges, ref count);
+ if (numRanges > count)
+ {
+ ranges = new AVPPlayerTimeRange[numRanges];
+ count = numRanges;
+ AVPPlayerGetSeekableTimeRanges(_player, ranges, ref count);
+ }
+ if (_seekableTimeRanges.Length != count)
+ {
+ _seekableTimeRanges = new TimeRange[count];
+ }
+ for (int i = 0; i < count; ++i)
+ {
+ _seekableTimeRanges[i].startTime = (float)(ranges[i].start * 1000.0);
+ _seekableTimeRanges[i].duration = (float)(ranges[i].duration * 1000.0);
+ }
+ }
+ }
+
+ static void Initialise()
+ {
+ if (!_initialised)
+ {
+ _initialised = true;
+
+#if ((UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX) && !UNITY_5) || (UNITY_IPHONE || UNITY_IOS || UNITY_TVOS)
+ AVPPluginRegister();
+#endif
+
+ DebugLogCallbackDelegate callbackDelegate = new DebugLogCallbackDelegate(DebugLogCallback);
+ IntPtr func = Marshal.GetFunctionPointerForDelegate(callbackDelegate);
+ AVPPluginSetDebugLogFunction(func);
+
+ AVPPluginColorSpace colorSpace = QualitySettings.activeColorSpace == ColorSpace.Linear ? AVPPluginColorSpace.Linear : AVPPluginColorSpace.Gamma;
+ AVPPluginInitialise(colorSpace);
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ _renderEventFunc = AVPGetRenderEventFunc();
+#endif
+
+ _matchURLRegex = new Regex("^[a-zA-Z][a-zA-Z0-9+-.]*://.*$");
+ }
+ }
+
+ private IntPtr _player = IntPtr.Zero; // The native player instance.
+ private int _handle = 0; // Handle to the native player for use with IssuePluginEvent.
+ private AVPPlayerStatus _status = AVPPlayerStatus.Unknown;
+ private int _planeCount = 0;
+ private Texture2D[] _texture = new Texture2D[2];
+ private int _width = 0;
+ private int _height = 0;
+ private bool _flipped = false;
+ private bool _isMetaDataReady = false;
+ private GCHandle _thisHandle;
+ private bool _useYpCbCr = false;
+ private Matrix4x4 _YpCbCrTransform = Matrix4x4.identity;
+ private bool _YpCbCrTransformIsValid = false;
+
+ static OSXMediaPlayer()
+ {
+ Initialise();
+ }
+
+ public OSXMediaPlayer(bool useYpCbCr = false)
+ {
+ _useYpCbCr = useYpCbCr;
+ _player = AVPPlayerNew(useYpCbCr);
+ _handle = AVPPlayerGetHandle(_player);
+
+ _thisHandle = GCHandle.Alloc(this, GCHandleType.Normal);
+ ValueAtKeyPathDidChangeDelegate callbackDelegate = new ValueAtKeyPathDidChangeDelegate(ValueAtKeyPathDidChangeThunk);
+
+ IntPtr self = GCHandle.ToIntPtr(_thisHandle);
+ IntPtr callback = Marshal.GetFunctionPointerForDelegate(callbackDelegate);
+ AVPPlayerAddValueDidChangeObserver(_player, self, callback, "seekableTimeRanges", 0);
+ }
+
+ // Convenience method for calling OSXMediaPlayer.IssuePluginEvent.
+ //
+ private void IssuePluginEvent(AVPPluginEventType type)
+ {
+ OSXMediaPlayer.IssuePluginEvent(type, _handle);
+ }
+
+ // BaseMediaPlayer Overrides
+
+ public override string GetVersion()
+ {
+ return AVPGetVersion();
+ }
+
+ public override bool OpenVideoFromFile(string path, long offset /* ignored */, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0)
+ {
+ bool success = false;
+ if (_matchURLRegex.IsMatch(path))
+ {
+ success = AVPPlayerOpenURL(_player, path, httpHeaderJson);
+ }
+ else
+ {
+ success = AVPPlayerOpenFile(_player, path);
+ }
+ return success;
+ }
+
+ public override void CloseVideo()
+ {
+ AVPPlayerClose(_player);
+
+ if (_texture[0] != null)
+ {
+ IssuePluginEvent(AVPPluginEventType.PlayerFreeResources);
+ // Have to update with zero to release Metal textures!
+ for (int i = 0; i < _planeCount; ++i)
+ {
+ _texture[i].UpdateExternalTexture(IntPtr.Zero);
+ Texture2D.Destroy(_texture[i]);
+ _texture[i] = null;
+ }
+ }
+
+ _width = 0;
+ _height = 0;
+ _isMetaDataReady = false;
+ _planeCount = 0;
+ _YpCbCrTransformIsValid = false;
+
+ base.CloseVideo();
+ }
+
+ public override bool IsLooping()
+ {
+ return AVPPlayerIsLooping(_player);
+ }
+
+ public override void SetLooping(bool looping)
+ {
+ AVPPlayerSetLooping(_player, looping);
+ }
+
+ public override bool HasAudio()
+ {
+ return AVPPlayerHasAudio(_player);
+ }
+
+ public override bool HasVideo()
+ {
+ return AVPPlayerHasVideo(_player);
+ }
+
+ public override bool HasMetaData()
+ {
+ return _isMetaDataReady;
+ }
+
+ public override bool CanPlay()
+ {
+ return _status >= AVPPlayerStatus.ReadyToPlay;
+ }
+
+ public override void Play()
+ {
+ AVPPlayerPlay(_player);
+ }
+
+ public override void Pause()
+ {
+ AVPPlayerPause(_player);
+ }
+
+ public override void Stop()
+ {
+ AVPPlayerPause(_player);
+ }
+
+ public override void Seek(float ms)
+ {
+ AVPPlayerSeek(_player, ms / 1000.0);
+ }
+
+ public override void SeekFast(float ms)
+ {
+ AVPPlayerSeekFast(_player, ms / 1000.0);
+ }
+
+ public override void SeekWithTolerance(float timeMs, float beforeMs, float afterMs)
+ {
+ AVPPlayerSeekWithTolerance(_player, timeMs / 1000.0, beforeMs / 1000.0, afterMs / 1000.0);
+ }
+
+ public override float GetCurrentTimeMs()
+ {
+ return (float)(AVPPlayerGetCurrentTime(_player) * 1000.0f);
+ }
+
+ public override double GetCurrentDateTimeSecondsSince1970()
+ {
+ return AVPPlayerGetCurrentDate(_player);
+ }
+
+ public override void SetPlaybackRate(float rate)
+ {
+ AVPPlayerSetPlaybackRate(_player, rate);
+ }
+
+ public override float GetPlaybackRate()
+ {
+ return AVPPlayerGetPlaybackRate(_player);
+ }
+
+ public override float GetDurationMs()
+ {
+ return (float)(AVPPlayerGetDuration(_player) * 1000.0f);
+ }
+
+ public override int GetVideoWidth()
+ {
+ return _width;
+ }
+
+ public override int GetVideoHeight()
+ {
+ return _height;
+ }
+
+ public override float GetVideoDisplayRate()
+ {
+ return (float)AVPPlayerGetFrameRate(_player);
+ }
+
+ public override bool IsSeeking()
+ {
+ return _status == AVPPlayerStatus.Seeking;
+ }
+
+ public override bool IsPlaying()
+ {
+ return _status == AVPPlayerStatus.Playing;
+ }
+
+ public override bool IsPaused()
+ {
+ return _status == AVPPlayerStatus.ReadyToPlay;
+ }
+
+ public override bool IsFinished()
+ {
+ return _status == AVPPlayerStatus.Finished;
+ }
+
+ public override bool IsBuffering()
+ {
+ return _status == AVPPlayerStatus.Buffering;
+ }
+
+ public override float GetBufferingProgress()
+ {
+ return AVPPlayerGetBufferingProgress(_player);
+ }
+
+ public override int GetBufferedTimeRangeCount()
+ {
+ return AVPPlayerGetBufferedTimeRangeCount(_player);
+ }
+
+ public override bool GetBufferedTimeRange(int index, ref float startTimeMs, ref float endTimeMs)
+ {
+ return AVPPlayerGetBufferedTimeRange(_player, index, out startTimeMs, out endTimeMs);
+ }
+
+ public override bool WaitForNextFrame(Camera camera, int previousFrameCount)
+ {
+ int count = 2;
+ AVPPlayerTextureInfo[] textures = new AVPPlayerTextureInfo[count];
+ int ret = AVPPlayerExtractFrame(_player, textures, ref count, 0.0);
+ if (ret == 0)
+ {
+ _planeCount = count;
+ for (int i = 0; i < count; ++i)
+ {
+ if (_texture[i] == null || _texture[i].width != textures[i].width || _texture[i].height != textures[i].height || _texture[i].format != (TextureFormat)textures[i].format)
+ {
+ _texture[i] = Texture2D.CreateExternalTexture(textures[i].width, textures[i].height, (TextureFormat)textures[i].format, /*mipmap*/ false, /*linear*/ false, textures[i].native);
+ if (i == 0)
+ {
+ _width = textures[i].width;
+ _height = textures[i].height;
+ _flipped = textures[i].flipped != 0;
+ }
+ }
+ else
+ {
+ _texture[i].UpdateExternalTexture(textures[i].native);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public override void SetPlayWithoutBuffering(bool playWithoutBuffering)
+ {
+ AVPlayerSetPlayWithoutBuffering(_player, playWithoutBuffering);
+ }
+
+ public override void SetKeyServerURL(string url)
+ {
+ AVPPlayerSetKeyServerURL(_player, url);
+ }
+
+ public override void SetKeyServerAuthToken(string token)
+ {
+ AVPPlayerSetKeyServerAuthToken(_player, token);
+ }
+
+ public override void SetDecryptionKeyBase64(string key)
+ {
+ AVPPlayerSetDecryptionKeyBase64(_player, key);
+ }
+
+ public override void SetDecryptionKey(byte[] key)
+ {
+ AVPPlayerSetDecryptionKey(_player, key, key.Length);
+ }
+
+ // IMediaProducer
+
+ public override int GetTextureCount()
+ {
+ return _planeCount;
+ }
+
+ public override Texture GetTexture(int index)
+ {
+ return _texture[index];
+ }
+
+ public override int GetTextureFrameCount()
+ {
+ return AVPPlayerGetFrameCount(_player);
+ }
+
+ public override long GetTextureTimeStamp()
+ {
+ return AVPPlayerGetFrameTimeStamp(_player);
+ }
+
+ public override bool RequiresVerticalFlip()
+ {
+ return _flipped;
+ }
+
+ public override bool IsPlaybackStalled()
+ {
+ return false;
+ }
+
+ public override bool PlayerSupportsLinearColorSpace()
+ {
+#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
+ return true;
+#else // iOS or tvOS
+ // Linear colour space is supported when using the Metal renderer, however
+ // Y'CbCr requires gamma correction so we pretend we don't support linear
+ // in this case.
+ return (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) && (!_useYpCbCr);
+#endif
+ }
+
+ public override float[] GetTextureTransform()
+ {
+ float[] transform = new float[6];
+ AVPPlayerGetTextureTransform(_player, transform);
+ return transform;
+ }
+
+ public override Matrix4x4 GetYpCbCrTransform()
+ {
+ return _YpCbCrTransform;
+ }
+
+ //
+
+ public override bool IsMuted()
+ {
+ return AVPPlayerIsMuted(_player);
+ }
+
+ public override void MuteAudio( bool bMute )
+ {
+ AVPPlayerSetMuted(_player, bMute);
+ }
+
+ public override void SetVolume(float volume)
+ {
+ AVPPlayerSetVolume(_player, volume);
+ }
+
+ public override float GetVolume()
+ {
+ return AVPPlayerGetVolume(_player);
+ }
+
+ public override int GetAudioTrackCount()
+ {
+ return AVPPlayerGetAudioTrackCount(_player);
+ }
+
+ public override string GetAudioTrackId(int index)
+ {
+ string identifier = AVPPlayerGetAudioTrackId(_player, index);
+ if (identifier == null)
+ identifier = base.GetAudioTrackId(index);
+ return identifier;
+ }
+
+ public override int GetCurrentAudioTrack()
+ {
+ return AVPPlayerGetCurrentAudioTrack(_player);
+ }
+
+ public override void SetAudioTrack(int track)
+ {
+ AVPPlayerSetAudioTrack(_player, track);
+ }
+
+ public override string GetCurrentAudioTrackId()
+ {
+ return AVPPlayerGetCurrentAudioTrackId(_player);
+ }
+
+ public override int GetCurrentAudioTrackBitrate()
+ {
+ return AVPPlayerGetCurrentAudioTrackBitrate(_player);
+ }
+
+ public override int GetVideoTrackCount()
+ {
+ return AVPPlayerGetVideoTrackCount(_player);
+ }
+
+ public override int GetCurrentVideoTrack()
+ {
+ return AVPPlayerGetCurrentVideoTrack(_player);
+ }
+
+ public override void SetVideoTrack(int index)
+ {
+ AVPPlayerSetVideoTrack(_player, index);
+ }
+
+ public override string GetVideoTrackId(int index)
+ {
+ string identifier = AVPPlayerGetVideoTrackId(_player, index);
+ if (identifier == null)
+ identifier = base.GetVideoTrackId(index);
+ return identifier;
+ }
+
+ public override string GetCurrentVideoTrackId()
+ {
+ return AVPPlayerGetCurrentVideoTrackId(_player);
+ }
+
+ public override int GetCurrentVideoTrackBitrate()
+ {
+ return AVPPlayerGetCurrentVideoTrackBitrate(_player);
+ }
+
+ public override float GetVideoFrameRate()
+ {
+ return AVPPlayerGetNominalFrameRate(_player);
+ }
+
+ public override void Render()
+ {
+
+ }
+
+ public void UpdateTextures()
+ {
+ AVPPlayerTextureInfo[] textures = new AVPPlayerTextureInfo[2];
+ int count = textures.Length;
+ if (AVPPlayerGetTextures(_player, textures, ref count))
+ {
+ _planeCount = count;
+ for (int i = 0; i < count; ++i)
+ {
+ if (_texture[i] == null || _texture[i].width != textures[i].width || _texture[i].height != textures[i].height || _texture[i].format != (TextureFormat)textures[i].format)
+ {
+ _texture[i] = Texture2D.CreateExternalTexture(textures[i].width, textures[i].height, (TextureFormat)textures[i].format, /*mipmap*/ false, /*linear*/ false, textures[i].native);
+ if (i == 0)
+ {
+ _width = textures[i].width;
+ _height = textures[i].height;
+ _flipped = textures[i].flipped != 0;
+ }
+ if (_texture[i] != null)
+ {
+ ApplyTextureProperties(_texture[i]);
+ }
+ }
+ else
+ {
+ _texture[i].UpdateExternalTexture(textures[i].native);
+ }
+ }
+
+ // If Y'CbCr grab the transform
+ if (_useYpCbCr && !_YpCbCrTransformIsValid)
+ {
+
+ float[] transform = new float[16];
+ _YpCbCrTransformIsValid = AVPPlayerGetYpCbCrTransform(_player, ref transform[0]);
+ for (int i = 0; i < 16; ++i)
+ _YpCbCrTransform[i] = transform[i];
+
+ // _YpCbCrMatrix.SetRow(0, new Vector4(1.164384f, 0.000000f, 1.596027f, 0.000000f));
+ // _YpCbCrMatrix.SetRow(1, new Vector4(1.164384f, -0.391762f, -0.812968f, 0.000000f));
+ // _YpCbCrMatrix.SetRow(2, new Vector4(1.164384f, 2.017232f, 0.000000f, 0.000000f));
+
+ // Debug.Log("YpCbCrMatrix: " + _YpCbCrTransform.ToString());
+ }
+ }
+ }
+
+ public override void Update()
+ {
+ _status = AVPPlayerGetStatus(_player);
+
+ if (AVPPlayerUpdate(_player))
+ {
+ IssuePluginEvent(AVPPluginEventType.PlayerRender);
+ }
+
+ _lastError = AVPPlayerGetLastError(_player);
+ UpdateTextures();
+
+ UpdateSubtitles();
+
+ // Check for meta data to become available
+ if (!_isMetaDataReady)
+ {
+ if (AVPPlayerHasMetaData(_player) || CanPlay())
+ {
+ // MOZ - had to move this outside of HasVideo check
+ _isMetaDataReady = true;
+
+ if (HasVideo())
+ {
+ if (_width > 0 && _height > 0)
+ {
+ if (Mathf.Max(_width, _height) > SystemInfo.maxTextureSize)
+ {
+ Debug.LogError("[AVProVideo] Video dimensions larger than maxTextureSize");
+ }
+ }
+ _playerDescription = "AVFoundation";
+ Helper.LogInfo("Using playback path: " + _playerDescription + " (" + _width + "x" + _height + "@" + GetVideoFrameRate().ToString("F2") + ")");
+ }
+ else if (HasAudio())
+ {
+
+ }
+ }
+ }
+ }
+
+ public override void Dispose()
+ {
+ CloseVideo();
+ AVPPlayerRelease(_player);
+ _player = IntPtr.Zero;
+ _thisHandle.Free();
+ }
+
+ }
+}
+
+#endif
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs.meta
new file mode 100644
index 0000000..4c1da65
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c9ce5c323422b4989a79a9c9fc9b67c1
+timeCreated: 1451922104
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Resampler.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Resampler.cs
new file mode 100644
index 0000000..1b3aaf7
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Resampler.cs
@@ -0,0 +1,589 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Utility class to resample MediaPlayer video frames to allow for smoother playback
+ /// Keeps a buffer of frames with timestamps and presents them using its own clock
+ ///
+ public class Resampler
+ {
+ private class TimestampedRenderTexture
+ {
+ public RenderTexture texture = null;
+ public long timestamp = 0;
+ public bool used = false;
+ }
+
+ public enum ResampleMode
+ {
+ POINT, LINEAR
+ }
+
+ private List _buffer = new List();
+ private MediaPlayer _mediaPlayer;
+ private RenderTexture[] _outputTexture = null;
+
+ private int _start = 0;
+ private int _end = 0;
+ private int _bufferSize = 0;
+
+ private long _baseTimestamp = 0;
+ private float _elapsedTimeSinceBase = 0f;
+
+ private Material _blendMat;
+
+ private ResampleMode _resampleMode;
+ private string _name = "";
+
+ private long _lastTimeStamp = -1;
+
+ private int _droppedFrames = 0;
+
+ private long _lastDisplayedTimestamp = 0;
+ private int _frameDisplayedTimer = 0;
+ private long _currentDisplayedTimestamp = 0;
+
+ public int DroppedFrames
+ {
+ get { return _droppedFrames; }
+ }
+
+ public int FrameDisplayedTimer
+ {
+ get { return _frameDisplayedTimer; }
+ }
+
+ public long BaseTimestamp
+ {
+ get { return _baseTimestamp; }
+ set { _baseTimestamp = value; }
+ }
+
+ public float ElapsedTimeSinceBase
+ {
+ get { return _elapsedTimeSinceBase; }
+ set { _elapsedTimeSinceBase = value; }
+ }
+
+ public float LastT
+ {
+ get; private set;
+ }
+
+ public long TextureTimeStamp
+ {
+ get; private set;
+ }
+
+ private const string ShaderPropT = "_t";
+ private const string ShaderPropAftertex = "_AfterTex";
+ private int _propAfterTex;
+ private int _propT;
+ private float _videoFrameRate;
+
+ public void OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
+ {
+ switch (et)
+ {
+ case MediaPlayerEvent.EventType.MetaDataReady:
+ _videoFrameRate = mp.Info.GetVideoFrameRate();
+ _elapsedTimeSinceBase = 0f;
+ if (_videoFrameRate > 0f)
+ {
+ _elapsedTimeSinceBase = _bufferSize / _videoFrameRate;
+ }
+ break;
+ case MediaPlayerEvent.EventType.Closing:
+ Reset();
+ break;
+ default:
+ break;
+ }
+ }
+
+ public Resampler(MediaPlayer player, string name, int bufferSize = 2, ResampleMode resampleMode = ResampleMode.LINEAR)
+ {
+ _bufferSize = Mathf.Max(2, bufferSize);
+
+ player.Events.AddListener(OnVideoEvent);
+
+ _mediaPlayer = player;
+
+ Shader blendShader = Shader.Find("AVProVideo/BlendFrames");
+ if (blendShader != null)
+ {
+ _blendMat = new Material(blendShader);
+ _propT = Shader.PropertyToID(ShaderPropT);
+ _propAfterTex = Shader.PropertyToID(ShaderPropAftertex);
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] Failed to find BlendFrames shader");
+ }
+
+ _resampleMode = resampleMode;
+ _name = name;
+
+ Debug.Log("[AVProVideo] Resampler " + _name + " started");
+ }
+
+ public Texture[] OutputTexture
+ {
+ get { return _outputTexture; }
+ }
+
+ public void Reset()
+ {
+ _lastTimeStamp = -1;
+ _baseTimestamp = 0;
+ InvalidateBuffer();
+ }
+
+ public void Release()
+ {
+ ReleaseRenderTextures();
+ if (_blendMat != null)
+ {
+ Material.Destroy(_blendMat);
+ }
+ }
+
+ private void ReleaseRenderTextures()
+ {
+ for (int i = 0; i < _buffer.Count; ++i)
+ {
+ for (int j = 0; j < _buffer[i].Length; ++j)
+ {
+ if (_buffer[i][j].texture != null)
+ {
+ RenderTexture.ReleaseTemporary(_buffer[i][j].texture);
+ _buffer[i][j].texture = null;
+ }
+ }
+
+ if (_outputTexture != null && _outputTexture[i] != null)
+ {
+ RenderTexture.ReleaseTemporary(_outputTexture[i]);
+ }
+ }
+
+ _outputTexture = null;
+ }
+
+ private void ConstructRenderTextures()
+ {
+ ReleaseRenderTextures();
+ _buffer.Clear();
+
+ _outputTexture = new RenderTexture[_mediaPlayer.TextureProducer.GetTextureCount()];
+
+ for (int i = 0; i < _mediaPlayer.TextureProducer.GetTextureCount(); ++i)
+ {
+ Texture tex = _mediaPlayer.TextureProducer.GetTexture(i);
+ _buffer.Add(new TimestampedRenderTexture[_bufferSize]);
+ for (int j = 0; j < _bufferSize; ++j)
+ {
+ _buffer[i][j] = new TimestampedRenderTexture();
+ }
+
+ for (int j = 0; j < _buffer[i].Length; ++j)
+ {
+ _buffer[i][j].texture = RenderTexture.GetTemporary(tex.width, tex.height, 0);
+ _buffer[i][j].timestamp = 0;
+ _buffer[i][j].used = false;
+ }
+
+ _outputTexture[i] = RenderTexture.GetTemporary(tex.width, tex.height, 0);
+ _outputTexture[i].filterMode = tex.filterMode;
+ _outputTexture[i].wrapMode = tex.wrapMode;
+ _outputTexture[i].anisoLevel = tex.anisoLevel;
+ // TODO: set up the mips level too?
+ }
+ }
+
+ private bool CheckRenderTexturesValid()
+ {
+ for (int i = 0; i < _mediaPlayer.TextureProducer.GetTextureCount(); ++i)
+ {
+ Texture tex = _mediaPlayer.TextureProducer.GetTexture(i);
+ for (int j = 0; j < _buffer.Count; ++j)
+ {
+ if (_buffer[i][j].texture == null || _buffer[i][j].texture.width != tex.width || _buffer[i][j].texture.height != tex.height)
+ {
+ return false;
+ }
+ }
+
+ if (_outputTexture == null || _outputTexture[i] == null || _outputTexture[i].width != tex.width || _outputTexture[i].height != tex.height)
+ {
+ return false;
+ }
+
+ }
+
+ return true;
+ }
+
+ //finds closest frame that occurs before given index
+ private int FindBeforeFrameIndex(int frameIdx)
+ {
+ if (frameIdx >= _buffer.Count)
+ {
+ return -1;
+ }
+
+ int foundFrame = -1;
+ float smallestDif = float.MaxValue;
+ int closest = -1;
+ float smallestElapsed = float.MaxValue;
+
+ for (int i = 0; i < _buffer[frameIdx].Length; ++i)
+ {
+ if (_buffer[frameIdx][i].used)
+ {
+ float elapsed = (_buffer[frameIdx][i].timestamp - _baseTimestamp) / 10000000f;
+
+ //keep track of closest after frame, just in case no before frame was found
+ if (elapsed < smallestElapsed)
+ {
+ closest = i;
+ smallestElapsed = elapsed;
+ }
+
+ float dif = _elapsedTimeSinceBase - elapsed;
+
+ if (dif >= 0 && dif < smallestDif)
+ {
+ smallestDif = dif;
+ foundFrame = i;
+ }
+ }
+ }
+
+ if (foundFrame < 0)
+ {
+ if (closest < 0)
+ {
+ return -1;
+ }
+
+ return closest;
+ }
+
+ return foundFrame;
+ }
+
+ private int FindClosestFrame(int frameIdx)
+ {
+ if (frameIdx >= _buffer.Count)
+ {
+ return -1;
+ }
+
+ int foundPos = -1;
+ float smallestDif = float.MaxValue;
+
+ for (int i = 0; i < _buffer[frameIdx].Length; ++i)
+ {
+ if (_buffer[frameIdx][i].used)
+ {
+ float elapsed = (_buffer[frameIdx][i].timestamp - _baseTimestamp) / 10000000f;
+ float dif = Mathf.Abs(_elapsedTimeSinceBase - elapsed);
+ if (dif < smallestDif)
+ {
+ foundPos = i;
+ smallestDif = dif;
+ }
+ }
+ }
+
+ return foundPos;
+ }
+
+ //point update selects closest frame and uses that as output
+ private void PointUpdate()
+ {
+ for (int i = 0; i < _buffer.Count; ++i)
+ {
+ int frameIndex = FindClosestFrame(i);
+
+ if (frameIndex < 0)
+ {
+ continue;
+ }
+
+ _outputTexture[i].DiscardContents();
+ Graphics.Blit(_buffer[i][frameIndex].texture, _outputTexture[i]);
+ _currentDisplayedTimestamp = _buffer[i][frameIndex].timestamp;
+ }
+
+ }
+
+ //Updates currently displayed frame
+ private void SampleFrame(int frameIdx, int bufferIdx)
+ {
+ _outputTexture[bufferIdx].DiscardContents();
+ Graphics.Blit(_buffer[bufferIdx][frameIdx].texture, _outputTexture[bufferIdx]);
+ TextureTimeStamp = _buffer[bufferIdx][frameIdx].timestamp;
+ _currentDisplayedTimestamp = _buffer[bufferIdx][frameIdx].timestamp;
+ }
+
+ //Same as sample frame, but does a lerp of the two given frames and outputs that image instead
+ private void SampleFrames(int bufferIdx, int frameIdx1, int frameIdx2, float t)
+ {
+ _blendMat.SetFloat(_propT, t);
+ _blendMat.SetTexture(_propAfterTex, _buffer[bufferIdx][frameIdx2].texture);
+ _outputTexture[bufferIdx].DiscardContents();
+ Graphics.Blit(_buffer[bufferIdx][frameIdx1].texture, _outputTexture[bufferIdx], _blendMat);
+ TextureTimeStamp = (long)Mathf.Lerp(_buffer[bufferIdx][frameIdx1].timestamp, _buffer[bufferIdx][frameIdx2].timestamp, t);
+ _currentDisplayedTimestamp = _buffer[bufferIdx][frameIdx1].timestamp;
+ }
+
+ private void LinearUpdate()
+ {
+ for (int i = 0; i < _buffer.Count; ++i)
+ {
+ //find closest frame
+ int frameIndex = FindBeforeFrameIndex(i);
+
+ //no valid frame, this should never ever happen actually...
+ if (frameIndex < 0)
+ {
+ continue;
+ }
+
+ //resample or just use last frame and set current elapsed time to that frame
+ float frameElapsed = (_buffer[i][frameIndex].timestamp - _baseTimestamp) / 10000000f;
+ if (frameElapsed > _elapsedTimeSinceBase)
+ {
+ SampleFrame(frameIndex, i);
+ LastT = -1f;
+ }
+ else
+ {
+ int next = (frameIndex + 1) % _buffer[i].Length;
+ float nextElapsed = (_buffer[i][next].timestamp - _baseTimestamp) / 10000000f;
+
+ //no larger frame, move elapsed time back a bit since we cant predict the future
+ if (nextElapsed < frameElapsed)
+ {
+ SampleFrame(frameIndex, i);
+ LastT = 2f;
+ }
+ //have a before and after frame, interpolate
+ else
+ {
+
+ float range = nextElapsed - frameElapsed;
+ float t = (_elapsedTimeSinceBase - frameElapsed) / range;
+ SampleFrames(i, frameIndex, next, t);
+ LastT = t;
+ }
+ }
+ }
+ }
+
+ private void InvalidateBuffer()
+ {
+ _elapsedTimeSinceBase = (_bufferSize / 2) / _videoFrameRate;
+
+ for (int i = 0; i < _buffer.Count; ++i)
+ {
+ for (int j = 0; j < _buffer[i].Length; ++j)
+ {
+ _buffer[i][j].used = false;
+ }
+ }
+
+ _start = _end = 0;
+ }
+
+ private float GuessFrameRate()
+ {
+ int fpsCount = 0;
+ long fps = 0;
+
+ for (int k = 0; k < _buffer[0].Length; k++)
+ {
+ if (_buffer[0][k].used)
+ {
+ // Find the pair with the smallest difference
+ long smallestDiff = long.MaxValue;
+ for (int j = k + 1; j < _buffer[0].Length; j++)
+ {
+ if (_buffer[0][j].used)
+ {
+ long diff = System.Math.Abs(_buffer[0][k].timestamp - _buffer[0][j].timestamp);
+ if (diff < smallestDiff)
+ {
+ smallestDiff = diff;
+ }
+ }
+ }
+
+ if (smallestDiff != long.MaxValue)
+ {
+ fps += smallestDiff;
+ fpsCount++;
+ }
+ }
+ }
+ if (fpsCount > 1)
+ {
+ fps /= fpsCount;
+ }
+ return 10000000f / (float)fps;
+ }
+
+ public void Update()
+ {
+ if (_mediaPlayer.TextureProducer == null)
+ {
+ return;
+ }
+
+ //recreate textures if invalid
+ if (_mediaPlayer.TextureProducer == null || _mediaPlayer.TextureProducer.GetTexture() == null)
+ {
+ return;
+ }
+
+ if (!CheckRenderTexturesValid())
+ {
+ ConstructRenderTextures();
+ }
+
+ long currentTimestamp = _mediaPlayer.TextureProducer.GetTextureTimeStamp();
+
+ //if frame has been updated, do a calculation to estimate dropped frames
+ if (currentTimestamp != _lastTimeStamp)
+ {
+ float dif = Mathf.Abs(currentTimestamp - _lastTimeStamp);
+ float frameLength = (10000000f / _videoFrameRate);
+ if (dif > frameLength * 1.1f && dif < frameLength * 3.1f)
+ {
+ _droppedFrames += (int)((dif - frameLength) / frameLength + 0.5);
+ }
+ _lastTimeStamp = currentTimestamp;
+ }
+
+ //Adding texture to buffer logic
+ long timestamp = _mediaPlayer.TextureProducer.GetTextureTimeStamp();
+ bool insertNewFrame = !_mediaPlayer.Control.IsSeeking();
+ //if buffer is not empty, we need to check if we need to reject the new frame
+ if (_start != _end || _buffer[0][_end].used)
+ {
+ int lastFrame = (_end + _buffer[0].Length - 1) % _buffer[0].Length;
+ //frame is not new and thus we do not need to store it
+ if (timestamp == _buffer[0][lastFrame].timestamp)
+ {
+ insertNewFrame = false;
+ }
+ }
+
+ bool bufferWasNotFull = (_start != _end) || (!_buffer[0][_end].used);
+
+ if (insertNewFrame)
+ {
+ //buffer empty, reset base timestamp to current
+ if (_start == _end && !_buffer[0][_end].used)
+ {
+ _baseTimestamp = timestamp;
+ }
+
+ //update buffer counters, if buffer is full, we get rid of the earliest frame by incrementing the start counter
+ if (_end == _start && _buffer[0][_end].used)
+ {
+ _start = (_start + 1) % _buffer[0].Length;
+ }
+
+ for (int i = 0; i < _mediaPlayer.TextureProducer.GetTextureCount(); ++i)
+ {
+ Texture currentTexture = _mediaPlayer.TextureProducer.GetTexture(i);
+
+ //store frame info
+ _buffer[i][_end].texture.DiscardContents();
+ Graphics.Blit(currentTexture, _buffer[i][_end].texture);
+ _buffer[i][_end].timestamp = timestamp;
+ _buffer[i][_end].used = true;
+ }
+
+ _end = (_end + 1) % _buffer[0].Length;
+ }
+
+ bool bufferNotFull = (_start != _end) || (!_buffer[0][_end].used);
+
+ if (bufferNotFull)
+ {
+ for (int i = 0; i < _buffer.Count; ++i)
+ {
+ _outputTexture[i].DiscardContents();
+ Graphics.Blit(_buffer[i][_start].texture, _outputTexture[i]);
+ _currentDisplayedTimestamp = _buffer[i][_start].timestamp;
+ }
+ }
+ else
+ {
+ // If we don't have a valid frame rate and the buffer is now full, guess the frame rate by looking at the buffered timestamps
+ if (bufferWasNotFull && _videoFrameRate <= 0f)
+ {
+ _videoFrameRate = GuessFrameRate();
+ _elapsedTimeSinceBase = (_bufferSize / 2) / _videoFrameRate;
+ }
+ }
+
+ if (_mediaPlayer.Control.IsPaused())
+ {
+ InvalidateBuffer();
+ }
+
+ //we always wait until buffer is full before display things, just assign first frame in buffer to output so that the user can see something
+ if (bufferNotFull)
+ {
+ return;
+ }
+
+ if (_mediaPlayer.Control.IsPlaying() && !_mediaPlayer.Control.IsFinished())
+ {
+ //correct elapsed time if too far out
+ long ts = _buffer[0][(_start + _bufferSize / 2) % _bufferSize].timestamp - _baseTimestamp;
+ double dif = Mathf.Abs(((float)((double)_elapsedTimeSinceBase * 10000000) - ts));
+ double threshold = (_buffer[0].Length / 2) / _videoFrameRate * 10000000;
+
+ if (dif > threshold)
+ {
+ _elapsedTimeSinceBase = ts / 10000000f;
+ }
+
+ if (_resampleMode == ResampleMode.POINT)
+ {
+ PointUpdate();
+ }
+ else if (_resampleMode == ResampleMode.LINEAR)
+ {
+ LinearUpdate();
+ }
+
+ _elapsedTimeSinceBase += Time.unscaledDeltaTime;
+ }
+ }
+
+ public void UpdateTimestamp()
+ {
+ if (_lastDisplayedTimestamp != _currentDisplayedTimestamp)
+ {
+ _lastDisplayedTimestamp = _currentDisplayedTimestamp;
+ _frameDisplayedTimer = 0;
+ }
+ _frameDisplayedTimer++;
+ }
+ }
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Resampler.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Resampler.cs.meta
new file mode 100644
index 0000000..e88c7fd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Resampler.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 8ac8dc09faa6b1d48bf6f490c9888550
+timeCreated: 1497356591
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Stream.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Stream.cs
new file mode 100644
index 0000000..8baa022
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Stream.cs
@@ -0,0 +1,37 @@
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+using System.Collections.Generic;
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Abstract class used to retreiving data from an adaptive Stream
+ /// generated by StreamParser. Currently implemented by HLSStream.
+ ///
+ public abstract class Stream
+ {
+ public struct Chunk
+ {
+ public string name;
+ }
+
+ public abstract int Width { get; }
+
+ public abstract int Height { get; }
+
+ public abstract int Bandwidth { get; }
+
+ public abstract string URL { get; }
+
+ public abstract List GetAllChunks();
+
+ public abstract List GetChunks();
+
+ public abstract List GetAllStreams();
+
+ public abstract List GetStreams();
+ }
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Stream.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Stream.cs.meta
new file mode 100644
index 0000000..fe07496
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/Stream.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 48133a6996376df4a924eeb8d53bce27
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WebGLMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WebGLMediaPlayer.cs
new file mode 100644
index 0000000..6b7930a
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WebGLMediaPlayer.cs
@@ -0,0 +1,799 @@
+#if UNITY_WEBGL
+using UnityEngine;
+using System.Runtime.InteropServices;
+using System;
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// WebGL implementation of BaseMediaPlayer
+ ///
+ public sealed class WebGLMediaPlayer : BaseMediaPlayer
+ {
+ //private enum AVPPlayerStatus
+ //{
+ // Unknown,
+ // ReadyToPlay,
+ // Playing,
+ // Finished,
+ // Seeking,
+ // Failed
+ //}
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerInsertVideoElement(string path, int[] idValues, int externalLibrary);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerWidth(int player);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerHeight(int player);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerGetLastError(int player);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerAudioTrackCount(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerSetAudioTrack(int player, int index);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerClose(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerReady(int player);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerSetLooping(int player, bool loop);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsLooping(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsSeeking(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsPlaying(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsPaused(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsFinished(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsBuffering(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsPlaybackStalled(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerPlay(int player);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerPause(int player);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerSeekToTime(int player, float timeMS, bool fast);
+
+ [DllImport("__Internal")]
+ private static extern float AVPPlayerGetCurrentTime(int player);
+
+ [DllImport("__Internal")]
+ private static extern float AVPPlayerGetPlaybackRate(int player);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerSetPlaybackRate(int player, float rate);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerSetMuted(int player, bool muted);
+
+ [DllImport("__Internal")]
+ private static extern float AVPPlayerGetDuration(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerIsMuted(int player);
+
+ [DllImport("__Internal")]
+ private static extern float AVPPlayerGetVolume(int player);
+
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerSetVolume(int player, float volume);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerHasVideo(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerHasAudio(int player);
+
+ // Need jslib
+ [DllImport("__Internal")]
+ private static extern void AVPPlayerFetchVideoTexture(int player, IntPtr texture, bool init);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerGetDecodedFrameCount(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerSupportedDecodedFrameCount(int player);
+
+ [DllImport("__Internal")]
+ private static extern bool AVPPlayerHasMetadata(int player);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerUpdatePlayerIndex(int id);
+
+ [DllImport("__Internal")]
+ private static extern int AVPPlayerGetNumBufferedTimeRanges(int id);
+
+ [DllImport("__Internal")]
+ private static extern float AVPPlayerGetTimeRangeStart(int id, int timeRangeIndex);
+ [DllImport("__Internal")]
+ private static extern float AVPPlayerGetTimeRangeEnd(int id, int timeRangeIndex);
+
+ private WebGL.ExternalLibrary _externalLibrary = WebGL.ExternalLibrary.None;
+ private int _playerIndex = -1;
+ private int _playerID = -1;
+ private RenderTexture _texture = null;
+ private int _width = 0;
+ private int _height = 0;
+ private int _audioTrackCount = 0;
+ private int _audioTrackIndex = 0;
+ private bool _useTextureMips = false;
+ private System.IntPtr _cachedTextureNativePtr = System.IntPtr.Zero;
+
+ private int _lastFrameCount = 0;
+ private float _displayRateTimer = 0f;
+ private float _displayRate = 0f;
+
+ private static bool _isWebGL1 = false;
+
+ public static void InitialisePlatform()
+ {
+ _isWebGL1 = (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.OpenGLES2);
+ }
+
+ public WebGLMediaPlayer(WebGL.ExternalLibrary externalLibrary, bool useTextureMips)
+ {
+ SetOptions(externalLibrary, useTextureMips);
+ }
+
+ public void SetOptions(WebGL.ExternalLibrary externalLibrary, bool useTextureMips)
+ {
+ _externalLibrary = externalLibrary;
+ _useTextureMips = useTextureMips;
+ }
+
+ public override string GetVersion()
+ {
+ return "1.9.3";
+ }
+
+ public override bool OpenVideoFromFile(string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0)
+ {
+ bool result = false;
+
+ if (path.StartsWith("http://") ||
+ path.StartsWith("https://") ||
+ path.StartsWith("file://") ||
+ path.StartsWith("blob:") ||
+ path.StartsWith("chrome-extension://"))
+ {
+ int[] idValues = new int[2];
+ idValues[0] = -1;
+ AVPPlayerInsertVideoElement(path, idValues, (int)_externalLibrary);
+ {
+ int playerIndex = idValues[0];
+ _playerID = idValues[1];
+
+ if (playerIndex > -1)
+ {
+ _playerIndex = playerIndex;
+ result = true;
+ }
+ }
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] Unknown URL protocol");
+ }
+
+ return result;
+ }
+
+ public override void CloseVideo()
+ {
+ if (_playerIndex != -1)
+ {
+ Pause();
+
+ _width = 0;
+ _height = 0;
+ _audioTrackCount = 0;
+ _audioTrackIndex = 0;
+
+ AVPPlayerClose(_playerIndex);
+
+ if (_texture != null)
+ {
+ // Have to update with zero to release Metal textures!
+ //_texture.UpdateExternalTexture(0);
+ _cachedTextureNativePtr = System.IntPtr.Zero;
+ RenderTexture.Destroy(_texture);
+ _texture = null;
+ }
+
+ _playerIndex = -1;
+ _playerID = -1;
+
+ base.CloseVideo();
+ }
+ }
+
+ public override bool IsLooping()
+ {
+ //Debug.Assert(_player != -1, "no player IsLooping");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsLooping(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override void SetLooping(bool looping)
+ {
+ Debug.Assert(_playerIndex != -1, "no player SetLooping");
+
+ AVPPlayerSetLooping(_playerIndex, looping);
+ }
+
+ public override bool HasAudio()
+ {
+ //Debug.Assert(_player != -1, "no player HasAudio");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerHasAudio(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool HasVideo()
+ {
+ //Debug.Assert(_player != -1, "no player HasVideo");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerHasVideo(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool HasMetaData()
+ {
+ //Debug.Assert(_player != -1, "no player HasMetaData");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerHasMetadata(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool CanPlay()
+ {
+ //Debug.Assert(_player != -1, "no player CanPlay");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerReady(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override void Play()
+ {
+ Debug.Assert(_playerIndex != -1, "no player Play");
+
+ if (!AVPPlayerPlay(_playerIndex))
+ {
+ Debug.LogWarning("[AVProVideo] Browser permission prevented video playback");
+ }
+ }
+
+ public override void Pause()
+ {
+ Debug.Assert(_playerIndex != -1, "no player Pause");
+
+ AVPPlayerPause(_playerIndex);
+ }
+
+ public override void Stop()
+ {
+ Debug.Assert(_playerIndex != -1, "no player Stop");
+
+ AVPPlayerPause(_playerIndex);
+ }
+
+ public override void Seek(float ms)
+ {
+ Debug.Assert(_playerIndex != -1, "no player Seek");
+ AVPPlayerSeekToTime(_playerIndex, ms * 0.001f, false);
+ }
+
+ public override void SeekFast(float ms)
+ {
+ Debug.Assert(_playerIndex != -1, "no player SeekFast");
+
+ AVPPlayerSeekToTime(_playerIndex, ms * 0.001f, true);
+ }
+
+ public override float GetCurrentTimeMs()
+ {
+ //Debug.Assert(_player != -1, "no player GetCurrentTimeMs");
+ float result = 0.0f;
+
+ if (_playerIndex != -1)
+ {
+ result = (AVPPlayerGetCurrentTime(_playerIndex) * 1000.0f);
+ //Debug.Log("CurrentTime C#: " + result);
+ }
+
+ return result;
+ }
+
+ public override void SetPlaybackRate(float rate)
+ {
+ Debug.Assert(_playerIndex != -1, "no player SetPlaybackRate");
+
+ // No HTML implementations allow negative rate yet
+ rate = Mathf.Clamp(rate, 0.25f, 8f);
+
+ AVPPlayerSetPlaybackRate(_playerIndex, rate);
+ }
+
+ public override float GetPlaybackRate()
+ {
+ //Debug.Assert(_player != -1, "no player GetPlaybackRate");
+ float result = 0.0f;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerGetPlaybackRate(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override float GetDurationMs()
+ {
+ //Debug.Assert(_player != -1, "no player GetDurationMs");
+ float result = 0.0f;
+
+ if (_playerIndex != -1)
+ {
+ result = (AVPPlayerGetDuration(_playerIndex) * 1000.0f);
+ }
+
+ return result;
+ }
+
+ public override int GetVideoWidth()
+ {
+ if (_width == 0)
+ {
+ _width = AVPPlayerWidth(_playerIndex);
+ }
+ return _width;
+ }
+
+ public override int GetVideoHeight()
+ {
+ if (_height == 0)
+ {
+ _height = AVPPlayerHeight(_playerIndex);
+ }
+ return _height;
+ }
+
+ public override float GetVideoFrameRate()
+ {
+ // There is no way in HTML5 yet to get the frame rate of the video
+ return 0f;
+ }
+
+ public override float GetVideoDisplayRate()
+ {
+ return _displayRate;
+ }
+
+ public override bool IsSeeking()
+ {
+ //Debug.Assert(_player != -1, "no player IsSeeking");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsSeeking(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool IsPlaying()
+ {
+ //Debug.Assert(_player != -1, "no player IsPlaying");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsPlaying(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool IsPaused()
+ {
+ //Debug.Assert(_player != -1, "no player IsPaused");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsPaused(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool IsFinished()
+ {
+ //Debug.Assert(_player != -1, "no player IsFinished");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsFinished(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool IsBuffering()
+ {
+ //Debug.Assert(_player != -1, "no player IsBuffering");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsBuffering(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override Texture GetTexture( int index )
+ {
+ return _texture;
+ }
+
+ public override int GetTextureFrameCount()
+ {
+ //Debug.Assert(_player != -1, "no player GetTextureFrameCount");
+ int result = 0;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerGetDecodedFrameCount(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool SupportsTextureFrameCount()
+ {
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerSupportedDecodedFrameCount(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override bool RequiresVerticalFlip()
+ {
+ return true;
+ }
+
+ public override bool IsMuted()
+ {
+ //Debug.Assert(_player != -1, "no player IsMuted");
+ bool result = false;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerIsMuted(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override void MuteAudio(bool bMute)
+ {
+ Debug.Assert(_playerIndex != -1, "no player MuteAudio");
+
+ AVPPlayerSetMuted(_playerIndex, bMute);
+ }
+
+ public override void SetVolume(float volume)
+ {
+ Debug.Assert(_playerIndex != -1, "no player SetVolume");
+
+ AVPPlayerSetVolume(_playerIndex, volume);
+ }
+
+ public override float GetVolume()
+ {
+ //Debug.Assert(_player != -1, "no player GetVolume");
+ float result = 0.0f;
+
+ if (_playerIndex != -1)
+ {
+ result = AVPPlayerGetVolume(_playerIndex);
+ }
+
+ return result;
+ }
+
+ public override void Render()
+ {
+
+ }
+
+ private void UpdateLastErrorCode()
+ {
+ var code = AVPPlayerGetLastError(_playerIndex);
+
+ switch(code){
+ case 0:
+ _lastError = ErrorCode.None;
+ break;
+ case 1:
+ _lastError = ErrorCode.LoadFailed;
+ break;
+ case 2:
+ _lastError = ErrorCode.LoadFailed;
+ break;
+ case 3:
+ _lastError = ErrorCode.DecodeFailed;
+ break;
+ case 4:
+ _lastError = ErrorCode.LoadFailed;
+ break;
+ default:
+ break;
+ }
+ }
+
+ public override void Update()
+ {
+ if(_playerID > -1) // CheckPlayer's index and update it
+ {
+ _playerIndex = AVPPlayerUpdatePlayerIndex(_playerID);
+ }
+
+ if(_playerIndex > -1)
+ {
+ UpdateSubtitles();
+
+ UpdateLastErrorCode();
+
+ if (AVPPlayerReady(_playerIndex))
+ {
+ if (AVPPlayerHasVideo(_playerIndex))
+ {
+ _width = AVPPlayerWidth(_playerIndex);
+ _height = AVPPlayerHeight(_playerIndex);
+
+ if (_texture == null && _width > 0 && _height > 0)
+ {
+ _texture = new RenderTexture(_width, _height, 0, RenderTextureFormat.Default);
+ _texture.autoGenerateMips = false;
+ _texture.useMipMap = false;
+ if (_useTextureMips && (!_isWebGL1 || (Mathf.IsPowerOfTwo(_width) && Mathf.IsPowerOfTwo(_height))))
+ {
+ // Mip generation only supported in WebGL 2.0, or WebGL 1.0 when using power-of-two textures
+ _texture.useMipMap = true;
+ }
+ _texture.Create();
+ _cachedTextureNativePtr = _texture.GetNativeTexturePtr();
+ ApplyTextureProperties(_texture);
+
+ // Textures in WebGL 2.0 don't require texImage2D as they are already recreated with texStorage2D
+ AVPPlayerFetchVideoTexture(_playerIndex, _cachedTextureNativePtr, _isWebGL1?true:false);
+ }
+
+ if (_texture != null && (_texture.width != _width || _texture.height != _height))
+ {
+ RenderTexture.Destroy(_texture);
+ _texture = new RenderTexture(_width, _height, 0, RenderTextureFormat.Default);
+ _texture.autoGenerateMips = false;
+ _texture.useMipMap = false;
+ if (_useTextureMips && (!_isWebGL1 || (Mathf.IsPowerOfTwo(_width) && Mathf.IsPowerOfTwo(_height))))
+ {
+ // Mip generation only supported in WebGL 2.0, or WebGL 1.0 when using power-of-two textures
+ _texture.useMipMap = true;
+ }
+ _texture.Create();
+ _cachedTextureNativePtr = _texture.GetNativeTexturePtr();
+ ApplyTextureProperties(_texture);
+
+ // Textures in WebGL 2.0 don't require texImage2D as they are already recreated with texStorage2D
+ AVPPlayerFetchVideoTexture(_playerIndex, _cachedTextureNativePtr, _isWebGL1?true:false);
+ if (_texture.useMipMap)
+ {
+ _texture.GenerateMips();
+ }
+ }
+
+ if (_cachedTextureNativePtr != System.IntPtr.Zero)
+ {
+ // TODO: only update the texture when the frame count changes
+ // (actually this will break the update for certain browsers such as edge and possibly safari - Sunrise)
+ AVPPlayerFetchVideoTexture(_playerIndex, _cachedTextureNativePtr, false);
+ if (_texture.useMipMap)
+ {
+ _texture.GenerateMips();
+ }
+ }
+
+ UpdateDisplayFrameRate();
+ }
+
+ if (AVPPlayerHasAudio(_playerIndex))
+ {
+ _audioTrackCount = Mathf.Max(1, AVPPlayerAudioTrackCount(_playerIndex));
+ }
+ }
+ }
+ }
+
+ private void UpdateDisplayFrameRate()
+ {
+ _displayRateTimer += Time.deltaTime;
+ if (_displayRateTimer >= 0.5f)
+ {
+ int frameCount = AVPPlayerGetDecodedFrameCount(_playerIndex);
+ int frames = (frameCount - _lastFrameCount);
+ if (frames > 0)
+ {
+ _displayRate = (float)frames / _displayRateTimer;
+ }
+ else
+ {
+ _displayRate = 0f;
+ }
+ _displayRateTimer = 0f;
+ _lastFrameCount = frameCount;
+ }
+ }
+
+ public override void Dispose()
+ {
+ CloseVideo();
+ }
+
+ public override int GetAudioTrackCount()
+ {
+ return _audioTrackCount;
+ }
+
+ public override int GetCurrentAudioTrack()
+ {
+ return _audioTrackIndex;
+ }
+
+ public override void SetAudioTrack(int index)
+ {
+ if (_playerIndex > -1)
+ {
+ if (index >= 0 && index < _audioTrackCount)
+ {
+ if (index != _audioTrackIndex)
+ {
+ AVPPlayerSetAudioTrack(_playerIndex, index);
+ _audioTrackIndex = index;
+ }
+ }
+ }
+ }
+
+ public override bool IsPlaybackStalled()
+ {
+ bool result = false;
+ if (_playerIndex > -1)
+ {
+ result = AVPPlayerIsPlaybackStalled(_playerIndex);
+ }
+ return result;
+ }
+
+ public override string GetCurrentAudioTrackId()
+ {
+ // TODO
+ return "";
+ }
+
+ public override int GetCurrentAudioTrackBitrate()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override int GetVideoTrackCount()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override int GetCurrentVideoTrack()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override void SetVideoTrack( int index )
+ {
+ // TODO
+ }
+
+ public override string GetCurrentVideoTrackId()
+ {
+ // TODO
+ return "";
+ }
+
+ public override int GetCurrentVideoTrackBitrate()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override float GetBufferingProgress()
+ {
+ //TODO
+ return 0f;
+ }
+
+ public override int GetBufferedTimeRangeCount()
+ {
+ return AVPPlayerGetNumBufferedTimeRanges(_playerIndex);
+ }
+
+ public override bool GetBufferedTimeRange(int index, ref float startTimeMs, ref float endTimeMs)
+ {
+ startTimeMs = AVPPlayerGetTimeRangeStart(_playerIndex, index) * 1000.0f;
+ endTimeMs = AVPPlayerGetTimeRangeEnd(_playerIndex, index) * 1000.0f;
+
+ return true;
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WebGLMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WebGLMediaPlayer.cs.meta
new file mode 100644
index 0000000..92cbed4
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WebGLMediaPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c044ff13d5570e64a8156bc718b3cfec
+timeCreated: 1468230219
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WindowsMediaPlayer.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WindowsMediaPlayer.cs
new file mode 100644
index 0000000..14c4eae
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WindowsMediaPlayer.cs
@@ -0,0 +1,1249 @@
+#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN || UNITY_WSA_10_0 || UNITY_WINRT_8_1 || UNITY_WSA
+
+#if UNITY_5 || UNITY_5_4_OR_NEWER
+ #if !UNITY_5_0 && !UNITY_5_1
+ #define AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ #endif
+ #if !UNITY_5_0 && !UNITY_5_1 && !UNITY_5_2 && !UNITY_5_3 && !UNITY_5_4_0 && !UNITY_5_4_1
+ #define AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ #endif
+#endif
+#if UNITY_WP_8_1 || UNITY_WSA || UNITY_WSA_8_1 || UNITY_WSA_10
+ #define AVPROVIDEO_MARSHAL_RETURN_BOOL
+#endif
+
+using UnityEngine;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using System;
+
+#if NETFX_CORE
+using Windows.Storage.Streams;
+#endif
+
+//-----------------------------------------------------------------------------
+// Copyright 2015-2018 RenderHeads Ltd. All rights reserverd.
+//-----------------------------------------------------------------------------
+
+namespace RenderHeads.Media.AVProVideo
+{
+ ///
+ /// Windows desktop, Windows phone and UWP implementation of BaseMediaPlayer
+ ///
+ public /*sealed*/ partial class WindowsMediaPlayer : BaseMediaPlayer
+ {
+ private bool _forceAudioResample = true;
+ private bool _useUnityAudio = false;
+ private string _audioDeviceOutputName = string.Empty;
+ private List _preferredFilters = new List();
+ private Audio360ChannelMode _audioChannelMode = Audio360ChannelMode.TBE_8_2;
+
+ private bool _isPlaying = false;
+ private bool _isPaused = false;
+ private bool _audioMuted = false;
+ private float _volume = 1.0f;
+ private float _balance = 0.0f;
+ private bool _bLoop = false;
+ private bool _canPlay = false;
+ private bool _hasMetaData = false;
+ private int _width = 0;
+ private int _height = 0;
+ private float _frameRate = 0f;
+ private bool _hasAudio = false;
+ private bool _hasVideo = false;
+ private bool _isTextureTopDown = true;
+ private System.IntPtr _nativeTexture = System.IntPtr.Zero;
+ private Texture2D _texture;
+ private System.IntPtr _instance = System.IntPtr.Zero;
+ private float _displayRateTimer;
+ private int _lastFrameCount;
+ private float _displayRate = 1f;
+ private Windows.VideoApi _videoApi = Windows.VideoApi.MediaFoundation;
+ private bool _useHardwareDecoding = true;
+ private bool _useTextureMips = false;
+ private bool _hintAlphaChannel = false;
+ private bool _useLowLatency = false;
+ private int _queueSetAudioTrackIndex = -1;
+ private bool _supportsLinearColorSpace = true;
+
+ private int _bufferedTimeRangeCount = 0;
+ private float[] _bufferedTimeRanges = new float[0];
+
+ private static bool _isInitialised = false;
+ private static string _version = "Plug-in not yet initialised";
+
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ private static System.IntPtr _nativeFunction_UpdateAllTextures;
+ private static System.IntPtr _nativeFunction_FreeTextures;
+ private static System.IntPtr _nativeFunction_ExtractFrame;
+#endif
+#if AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ private int _textureQuality = QualitySettings.masterTextureLimit;
+#endif
+
+ public static bool InitialisePlatform()
+ {
+ if (!_isInitialised)
+ {
+ try
+ {
+ if (!Native.Init(QualitySettings.activeColorSpace == ColorSpace.Linear, true))
+ {
+ Debug.LogError("[AVProVideo] Failing to initialise platform");
+ }
+ else
+ {
+ _isInitialised = true;
+ _version = GetPluginVersion();
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ _nativeFunction_UpdateAllTextures = Native.GetRenderEventFunc_UpdateAllTextures();
+ _nativeFunction_FreeTextures = Native.GetRenderEventFunc_FreeTextures();
+ _nativeFunction_ExtractFrame = Native.GetRenderEventFunc_WaitForNewFrame();
+#endif
+ }
+ }
+ catch (System.DllNotFoundException e)
+ {
+ Debug.LogError("[AVProVideo] Failed to load DLL. " + e.Message);
+#if (UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN)
+#if !UNITY_5 && !UNITY_5_4_OR_NEWER
+ Debug.LogError("[AVProVideo] You may need to copy the Audio360 DLL into the root folder of your project (the folder above Assets)");
+#endif
+#endif
+ }
+ }
+
+ return _isInitialised;
+ }
+
+ public static void DeinitPlatform()
+ {
+ Native.Deinit();
+ _isInitialised = false;
+ }
+
+ public override int GetNumAudioChannels()
+ {
+ return Native.GetAudioChannelCount(_instance);
+ }
+
+ public WindowsMediaPlayer(Windows.VideoApi videoApi, bool useHardwareDecoding, bool useTextureMips, bool hintAlphaChannel, bool useLowLatency, string audioDeviceOutputName, bool useUnityAudio, bool forceResample, List preferredFilters)
+ {
+ SetOptions(videoApi, useHardwareDecoding:useHardwareDecoding, useTextureMips:useTextureMips, hintAlphaChannel:hintAlphaChannel, useLowLatency:useLowLatency, audioDeviceOutputName:audioDeviceOutputName, useUnityAudio:useUnityAudio, forceResample:forceResample, preferredFilters:preferredFilters);
+ }
+
+ public void SetOptions(Windows.VideoApi videoApi, bool useHardwareDecoding, bool useTextureMips, bool hintAlphaChannel, bool useLowLatency, string audioDeviceOutputName, bool useUnityAudio, bool forceResample, List preferredFilters)
+ {
+ _videoApi = videoApi;
+ _useHardwareDecoding = useHardwareDecoding;
+ _useTextureMips = useTextureMips;
+ _hintAlphaChannel = hintAlphaChannel;
+ _useLowLatency = useLowLatency;
+ _audioDeviceOutputName = audioDeviceOutputName;
+ if (!string.IsNullOrEmpty(_audioDeviceOutputName))
+ {
+ _audioDeviceOutputName = _audioDeviceOutputName.Trim();
+ }
+ _useUnityAudio = useUnityAudio;
+ _forceAudioResample = forceResample;
+ _preferredFilters = preferredFilters;
+ if (_preferredFilters != null)
+ {
+ for (int i = 0; i < _preferredFilters.Count; ++i)
+ {
+ if (!string.IsNullOrEmpty(_preferredFilters[i]))
+ {
+ _preferredFilters[i] = _preferredFilters[i].Trim();
+ }
+ }
+ }
+ }
+
+ public override string GetVersion()
+ {
+ return _version;
+ }
+
+ private static int GetUnityAudioSampleRate()
+ {
+ int result = 0;
+
+ // For standalone builds (not in the editor):
+ // In Unity 4.6, 5.0, 5.1 when audio is disabled there is no indication from the API.
+ // But in 5.2.0 and above, it logs an error when trying to call
+ // AudioSettings.GetDSPBufferSize() or AudioSettings.outputSampleRate
+ // So to prevent the error, check if AudioSettings.GetConfiguration().sampleRate == 0
+
+#if UNITY_5_4_OR_NEWER || UNITY_5_2 || UNITY_5_3
+ result = (AudioSettings.GetConfiguration().sampleRate == 0) ? 0 : AudioSettings.outputSampleRate;
+#else
+ result = AudioSettings.outputSampleRate;
+#endif
+ return result;
+ }
+
+ public override bool OpenVideoFromFile(string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0, int forceFileFormat = 0)
+ {
+ CloseVideo();
+
+ uint filterCount = 0U;
+ IntPtr[] filters = null;
+
+ if (_preferredFilters != null && _preferredFilters.Count > 0)
+ {
+ filterCount = (uint)_preferredFilters.Count;
+ filters = new IntPtr[_preferredFilters.Count];
+
+ for (int i = 0; i < filters.Length; ++i)
+ {
+ filters[i] = Marshal.StringToHGlobalUni(_preferredFilters[i]);
+ }
+ }
+
+ _instance = Native.OpenSource(_instance, path, (int)_videoApi, _useHardwareDecoding, _useTextureMips, _hintAlphaChannel, _useLowLatency, _audioDeviceOutputName, _useUnityAudio, _forceAudioResample, GetUnityAudioSampleRate(), filters, filterCount, (int)_audioChannelMode, sourceSamplerate, sourceChannels);
+
+ if (filters != null)
+ {
+ for (int i = 0; i < filters.Length; ++i)
+ {
+ Marshal.FreeHGlobal(filters[i]);
+ }
+ }
+
+ if (_instance == System.IntPtr.Zero)
+ {
+ DisplayLoadFailureSuggestion(path);
+ return false;
+ }
+
+ Native.SetUnityAudioEnabled(_instance, _useUnityAudio);
+
+ return true;
+ }
+
+ public override bool OpenVideoFromBuffer(byte[] buffer)
+ {
+ CloseVideo();
+
+ IntPtr[] filters;
+ if (_preferredFilters.Count == 0)
+ {
+ filters = null;
+ }
+ else
+ {
+ filters = new IntPtr[_preferredFilters.Count];
+
+ for (int i = 0; i < filters.Length; ++i)
+ {
+ filters[i] = Marshal.StringToHGlobalUni(_preferredFilters[i]);
+ }
+ }
+
+ _instance = Native.OpenSourceFromBuffer(_instance, buffer, (ulong)buffer.Length, (int)_videoApi, _useHardwareDecoding, _useTextureMips, _hintAlphaChannel, _useLowLatency, _audioDeviceOutputName, _useUnityAudio, filters, (uint)_preferredFilters.Count);
+
+ if (filters != null)
+ {
+ for (int i = 0; i < filters.Length; ++i)
+ {
+ Marshal.FreeHGlobal(filters[i]);
+ }
+ }
+
+ if (_instance == System.IntPtr.Zero)
+ {
+ return false;
+ }
+
+ Native.SetUnityAudioEnabled(_instance, _useUnityAudio);
+
+ return true;
+ }
+
+ public override bool StartOpenVideoFromBuffer(ulong length)
+ {
+ CloseVideo();
+
+ _instance = Native.StartOpenSourceFromBuffer(_instance, (int)_videoApi, length);
+
+ return _instance != IntPtr.Zero;
+ }
+
+ public override bool AddChunkToVideoBuffer(byte[] chunk, ulong offset, ulong length)
+ {
+ return Native.AddChunkToSourceBuffer(_instance, chunk, offset, length);
+ }
+
+ public override bool EndOpenVideoFromBuffer()
+ {
+ IntPtr[] filters;
+ if (_preferredFilters.Count == 0)
+ {
+ filters = null;
+ }
+ else
+ {
+ filters = new IntPtr[_preferredFilters.Count];
+
+ for (int i = 0; i < filters.Length; ++i)
+ {
+ filters[i] = Marshal.StringToHGlobalUni(_preferredFilters[i]);
+ }
+ }
+
+ _instance = Native.EndOpenSourceFromBuffer(_instance, _useHardwareDecoding, _useTextureMips, _hintAlphaChannel, _useLowLatency, _audioDeviceOutputName, _useUnityAudio, filters, (uint)_preferredFilters.Count);
+
+ if (filters != null)
+ {
+ for (int i = 0; i < filters.Length; ++i)
+ {
+ Marshal.FreeHGlobal(filters[i]);
+ }
+ }
+
+ if (_instance == System.IntPtr.Zero)
+ {
+ return false;
+ }
+
+ Native.SetUnityAudioEnabled(_instance, _useUnityAudio);
+
+ return true;
+ }
+
+#if NETFX_CORE
+ public override bool OpenVideoFromFile(IRandomAccessStream ras, string path, long offset, string httpHeaderJson, uint sourceSamplerate = 0, uint sourceChannels = 0)
+ {
+ CloseVideo();
+
+ _instance = Native.OpenSourceFromStream(_instance, ras, path, (int)_videoApi, _useHardwareDecoding, _useTextureMips, _hintAlphaChannel, _useLowLatency, _audioDeviceOutputName, _useUnityAudio, _forceAudioResample, GetUnityAudioSampleRate(), sourceSamplerate, sourceChannels);
+
+ if (_instance == System.IntPtr.Zero)
+ {
+ DisplayLoadFailureSuggestion(path);
+ return false;
+ }
+
+ Native.SetUnityAudioEnabled(_instance, _useUnityAudio);
+
+ return true;
+ }
+#endif
+
+ private void DisplayLoadFailureSuggestion(string path)
+ {
+ bool usingDirectShow = (_videoApi == Windows.VideoApi.DirectShow) || SystemInfo.operatingSystem.Contains("Windows 7") || SystemInfo.operatingSystem.Contains("Windows Vista") || SystemInfo.operatingSystem.Contains("Windows XP");
+ if (usingDirectShow && path.Contains(".mp4"))
+ {
+ Debug.LogWarning("[AVProVideo] The native Windows DirectShow H.264 decoder doesn't support videos with resolution above 1920x1080. You may need to reduce your video resolution, switch to another codec (such as DivX or Hap), or install 3rd party DirectShow codec (eg LAV Filters). This shouldn't be a problem for Windows 8 and above as it has a native limitation of 3840x2160.");
+ }
+ }
+
+ public override void CloseVideo()
+ {
+ _width = 0;
+ _height = 0;
+ _frameRate = 0f;
+ _hasAudio = _hasVideo = false;
+ _hasMetaData = false;
+ _canPlay = false;
+ _isPaused = false;
+ _isPlaying = false;
+ _bLoop = false;
+ _audioMuted = false;
+ _volume = 1f;
+ _balance = 0f;
+ _lastFrameCount = 0;
+ _displayRate = 0f;
+ _displayRateTimer = 0f;
+ _queueSetAudioTrackIndex = -1;
+ _supportsLinearColorSpace = true;
+ _nativeTexture = System.IntPtr.Zero;
+
+ if (_texture != null)
+ {
+ Texture2D.Destroy(_texture);
+ _texture = null;
+ }
+ if (_instance != System.IntPtr.Zero)
+ {
+ Native.CloseSource(_instance);
+ _instance = System.IntPtr.Zero;
+ }
+
+ // Issue thread event to free the texture on the GPU
+ IssueRenderThreadEvent(Native.RenderThreadEvent.FreeTextures);
+
+ base.CloseVideo();
+ }
+
+ public override void SetLooping(bool looping)
+ {
+ _bLoop = looping;
+ Native.SetLooping(_instance, looping);
+ }
+
+ public override bool IsLooping()
+ {
+ return _bLoop;
+ }
+
+ public override bool HasMetaData()
+ {
+ return _hasMetaData;
+ }
+
+ public override bool HasAudio()
+ {
+ return _hasAudio;
+ }
+
+ public override bool HasVideo()
+ {
+ return _hasVideo;
+ }
+
+ public override bool CanPlay()
+ {
+ return _canPlay;
+ }
+
+ public override void Play()
+ {
+ _isPlaying = true;
+ _isPaused = false;
+ Native.Play(_instance);
+ }
+
+ public override void Pause()
+ {
+ _isPlaying = false;
+ _isPaused = true;
+ Native.Pause(_instance);
+ }
+
+ public override void Stop()
+ {
+ _isPlaying = false;
+ _isPaused = false;
+ Native.Pause(_instance);
+ }
+
+ public override bool IsSeeking()
+ {
+ return Native.IsSeeking(_instance);
+ }
+ public override bool IsPlaying()
+ {
+ return _isPlaying;
+ }
+ public override bool IsPaused()
+ {
+ return _isPaused;
+ }
+ public override bool IsFinished()
+ {
+ return Native.IsFinished(_instance);
+ }
+
+ public override bool IsBuffering()
+ {
+ return Native.IsBuffering(_instance);
+ }
+
+ public override float GetDurationMs()
+ {
+ return Native.GetDuration(_instance) * 1000f;
+ }
+
+ public override int GetVideoWidth()
+ {
+ return _width;
+ }
+
+ public override int GetVideoHeight()
+ {
+ return _height;
+ }
+
+ public override float GetVideoFrameRate()
+ {
+ return _frameRate;
+ }
+
+ public override float GetVideoDisplayRate()
+ {
+ return _displayRate;
+ }
+
+ public override Texture GetTexture( int index )
+ {
+ Texture result = null;
+ if (Native.GetTextureFrameCount(_instance) > 0)
+ {
+ result = _texture;
+ }
+ return result;
+ }
+
+ public override int GetTextureFrameCount()
+ {
+ return Native.GetTextureFrameCount(_instance);
+ }
+
+ public override long GetTextureTimeStamp()
+ {
+ return Native.GetTextureTimeStamp(_instance);
+ }
+
+ public override bool RequiresVerticalFlip()
+ {
+ return _isTextureTopDown;
+ }
+
+ public override void Seek(float timeMs)
+ {
+ Native.SetCurrentTime(_instance, timeMs / 1000f, false);
+ }
+
+ public override void SeekFast(float timeMs)
+ {
+ Native.SetCurrentTime(_instance, timeMs / 1000f, true);
+ }
+
+ public override float GetCurrentTimeMs()
+ {
+ return Native.GetCurrentTime(_instance) * 1000f;
+ }
+
+ public override void SetPlaybackRate(float rate)
+ {
+ Native.SetPlaybackRate(_instance, rate);
+ }
+
+ public override float GetPlaybackRate()
+ {
+ return Native.GetPlaybackRate(_instance);
+ }
+
+ public override float GetBufferingProgress()
+ {
+ return Native.GetBufferingProgress(_instance);
+ }
+
+ public override int GetBufferedTimeRangeCount()
+ {
+ return _bufferedTimeRangeCount;
+ }
+
+ public override bool GetBufferedTimeRange(int index, ref float startTimeMs, ref float endTimeMs)
+ {
+ bool result = false;
+ if (index >= 0 && index < _bufferedTimeRangeCount)
+ {
+ //Debug.Assert(_bufferedTimeRanges.Length > (index * 2 + 1));
+ result = true;
+ startTimeMs = 1000f * _bufferedTimeRanges[index * 2 + 0];
+ endTimeMs = 1000f * _bufferedTimeRanges[index * 2 + 1];
+ }
+ return result;
+ }
+
+ public override void MuteAudio(bool bMuted)
+ {
+ _audioMuted = bMuted;
+ Native.SetMuted(_instance, _audioMuted);
+ }
+
+ public override bool IsMuted()
+ {
+ return _audioMuted;
+ }
+
+ public override void SetVolume(float volume)
+ {
+ _volume = volume;
+ Native.SetVolume(_instance, volume);
+ }
+
+ public override float GetVolume()
+ {
+ return _volume;
+ }
+
+ public override void SetBalance(float balance)
+ {
+ _balance = balance;
+ Native.SetBalance(_instance, balance);
+ }
+
+ public override float GetBalance()
+ {
+ return _balance;
+ }
+
+ public override int GetAudioTrackCount()
+ {
+ return Native.GetAudioTrackCount(_instance);
+ }
+
+ public override int GetCurrentAudioTrack()
+ {
+ return Native.GetAudioTrack(_instance);
+ }
+
+ public override void SetAudioTrack( int index )
+ {
+ _queueSetAudioTrackIndex = index;
+ }
+
+ public override int GetVideoTrackCount()
+ {
+ int result = 0;
+ if (HasVideo())
+ {
+ result = 1;
+ }
+ return result;
+ }
+
+ public override bool IsPlaybackStalled()
+ {
+ return Native.IsPlaybackStalled(_instance);
+ }
+
+ public override string GetCurrentAudioTrackId()
+ {
+ // TODO
+ return string.Empty;
+ }
+
+ public override int GetCurrentAudioTrackBitrate()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override int GetCurrentVideoTrack()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override void SetVideoTrack( int index )
+ {
+ // TODO
+ }
+
+ public override string GetCurrentVideoTrackId()
+ {
+ // TODO
+ return string.Empty;
+ }
+
+ public override int GetCurrentVideoTrackBitrate()
+ {
+ // TODO
+ return 0;
+ }
+
+ public override bool WaitForNextFrame(Camera dummyCamera, int previousFrameCount)
+ {
+ // Mark as extracting
+ Native.StartExtractFrame(_instance);
+
+ // Queue up render thread event to wait for the new frame
+ IssueRenderThreadEvent(Native.RenderThreadEvent.WaitForNewFrame);
+
+ // Force render thread to run
+ dummyCamera.Render();
+
+ // Wait for the frame to change
+ Native.WaitForExtract(_instance);
+
+ // Return whether the frame changed
+ return (previousFrameCount != Native.GetTextureFrameCount(_instance));
+ }
+
+ public override void SetAudioChannelMode(Audio360ChannelMode channelMode)
+ {
+ _audioChannelMode = channelMode;
+ Native.SetAudioChannelMode(_instance, (int)channelMode);
+ }
+
+ public override void SetAudioHeadRotation(Quaternion q)
+ {
+ Native.SetHeadOrientation(_instance, q.x, q.y, q.z, q.w);
+ }
+
+ public override void ResetAudioHeadRotation()
+ {
+ Native.SetHeadOrientation(_instance, Quaternion.identity.x, Quaternion.identity.y, Quaternion.identity.z, Quaternion.identity.w);
+ }
+
+ public override void SetAudioFocusEnabled(bool enabled)
+ {
+ Native.SetAudioFocusEnabled(_instance, enabled);
+ }
+
+ public override void SetAudioFocusProperties(float offFocusLevel, float widthDegrees)
+ {
+ Native.SetAudioFocusProps(_instance, offFocusLevel, widthDegrees);
+ }
+
+ public override void SetAudioFocusRotation(Quaternion q)
+ {
+ Native.SetAudioFocusRotation(_instance, q.x, q.y, q.z, q.w);
+ }
+
+ public override void ResetAudioFocus()
+ {
+ Native.SetAudioFocusEnabled(_instance, false);
+ Native.SetAudioFocusProps(_instance, 0f, 90f);
+ Native.SetAudioFocusRotation(_instance, 0f, 0f, 0f, 1f);
+ }
+
+ //public override void SetAudioDeviceName(string name)
+ //{
+ //}
+
+ public override void Update()
+ {
+ Native.Update(_instance);
+ _lastError = (ErrorCode)Native.GetLastErrorCode(_instance);
+
+ if (_queueSetAudioTrackIndex >= 0 && _hasAudio)
+ {
+ // We have to queue the setting of the audio track, as doing it from the UI can result in a crash (for some unknown reason)
+ Native.SetAudioTrack(_instance, _queueSetAudioTrackIndex);
+ _queueSetAudioTrackIndex = -1;
+ }
+
+ // Update network buffering
+ {
+ _bufferedTimeRangeCount = Native.GetBufferedRanges(_instance, _bufferedTimeRanges, _bufferedTimeRanges.Length / 2);
+ if (_bufferedTimeRangeCount > (_bufferedTimeRanges.Length / 2))
+ {
+ _bufferedTimeRanges = new float[_bufferedTimeRangeCount * 2];
+ _bufferedTimeRangeCount = Native.GetBufferedRanges(_instance, _bufferedTimeRanges, _bufferedTimeRanges.Length / 2);
+ }
+ }
+
+ UpdateSubtitles();
+
+ if (!_canPlay)
+ {
+ if (!_hasMetaData)
+ {
+ if (Native.HasMetaData(_instance))
+ {
+ if (Native.HasVideo(_instance))
+ {
+ _width = Native.GetWidth(_instance);
+ _height = Native.GetHeight(_instance);
+ _frameRate = Native.GetFrameRate(_instance);
+
+ // Sometimes the dimensions aren't available yet, in which case fail and poll them again next loop
+ if (_width > 0 && _height > 0)
+ {
+ _hasVideo = true;
+
+ // Note: If the Unity editor Build platform isn't set to Windows then maxTextureSize will not be correct
+ if (Mathf.Max(_width, _height) > SystemInfo.maxTextureSize
+
+ // If we're running in the editor it may be emulating another platform
+ // in which case maxTextureSize won't be correct, so ignore it.
+ #if UNITY_EDITOR
+ && !SystemInfo.graphicsDeviceName.ToLower().Contains("emulated")
+ #endif
+ )
+ {
+ Debug.LogError(string.Format("[AVProVideo] Video dimensions ({0}x{1}) larger than maxTextureSize ({2} for current build target)", _width, _height, SystemInfo.maxTextureSize));
+ _width = _height = 0;
+ _hasVideo = false;
+ }
+ }
+
+ if (_hasVideo)
+ {
+ if (Native.HasAudio(_instance))
+ {
+ _hasAudio = true;
+ }
+ }
+ }
+ else
+ {
+ if (Native.HasAudio(_instance))
+ {
+ _hasAudio = true;
+ }
+ }
+
+ if (_hasVideo || _hasAudio)
+ {
+ _hasMetaData = true;
+ }
+
+ _playerDescription = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(Native.GetPlayerDescription(_instance));
+ _supportsLinearColorSpace = !_playerDescription.Contains("MF-MediaEngine-Hardware");
+ Helper.LogInfo("Using playback path: " + _playerDescription + " (" + _width + "x" + _height + "@" + GetVideoFrameRate().ToString("F2") + ")");
+ if (_hasVideo)
+ {
+ OnTextureSizeChanged();
+ }
+ }
+ }
+ if (_hasMetaData)
+ {
+ _canPlay = Native.CanPlay(_instance);
+ }
+ }
+
+#if UNITY_WSA
+ // NOTE: I think this issue has been resolved now as of version 1.5.24.
+ // The issue was caused by functions returning booleans incorrectly (4 bytes vs 1)
+ // and as been resolved by specificying the return type during marshalling..
+ // Still we'll keep this code here until after more testing.
+
+ // WSA has an issue where it can load the audio track first and the video track later
+ // Here we try to handle this case and get the video track information when it arrives
+ if (_hasAudio && !_hasVideo)
+ {
+ _width = Native.GetWidth(_instance);
+ _height = Native.GetHeight(_instance);
+ _frameRate = Native.GetFrameRate(_instance);
+
+ if (_width > 0 && _height > 0)
+ {
+ _hasVideo = true;
+ OnTextureSizeChanged();
+ }
+ }
+#endif
+
+ if (_hasVideo)
+ {
+ System.IntPtr newPtr = Native.GetTexturePointer(_instance);
+
+ // Check for texture recreation (due to device loss or change in texture size)
+ if (_texture != null && _nativeTexture != System.IntPtr.Zero && _nativeTexture != newPtr)
+ {
+ _width = Native.GetWidth(_instance);
+ _height = Native.GetHeight(_instance);
+
+ if (newPtr == System.IntPtr.Zero || (_width != _texture.width || _height != _texture.height))
+ {
+ if (_width != _texture.width || _height != _texture.height)
+ {
+ Helper.LogInfo("Texture size changed: " + _width + " X " + _height);
+ OnTextureSizeChanged();
+ }
+
+ _nativeTexture = System.IntPtr.Zero;
+ Texture2D.Destroy(_texture);
+ _texture = null;
+ }
+ else if (_nativeTexture != newPtr)
+ {
+ _texture.UpdateExternalTexture(newPtr);
+ _nativeTexture = newPtr;
+ }
+ }
+
+#if AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ // In Unity 5.4.2 and above the video texture turns black when changing the TextureQuality in the Quality Settings
+ // The code below gets around this issue. A bug report has been sent to Unity. So far we have tested and replicated the
+ // "bug" in Windows only, but a user has reported it in Android too.
+ // Texture.GetNativeTexturePtr() must sync with the rendering thread, so this is a large performance hit!
+ if(_textureQuality != QualitySettings.masterTextureLimit)
+ {
+ if (_texture != null && _nativeTexture != System.IntPtr.Zero && _texture.GetNativeTexturePtr() == System.IntPtr.Zero)
+ {
+ //Debug.Log("RECREATING");
+ _texture.UpdateExternalTexture(_nativeTexture);
+ }
+
+ _textureQuality = QualitySettings.masterTextureLimit;
+ }
+
+#endif
+
+ // Check if a new texture has to be created
+ if (_texture == null && _width > 0 && _height > 0 && newPtr != System.IntPtr.Zero)
+ {
+ _isTextureTopDown = Native.IsTextureTopDown(_instance);
+ _texture = Texture2D.CreateExternalTexture(_width, _height, TextureFormat.RGBA32, _useTextureMips, false, newPtr);
+ if (_texture != null)
+ {
+ _texture.name = "AVProVideo";
+ _nativeTexture = newPtr;
+ ApplyTextureProperties(_texture);
+ }
+ else
+ {
+ Debug.LogError("[AVProVideo] Failed to create texture");
+ }
+ }
+ }
+ }
+
+ public override long GetLastExtendedErrorCode()
+ {
+ return Native.GetLastExtendedErrorCode(_instance);
+ }
+
+ private void OnTextureSizeChanged()
+ {
+ // Warning for DirectShow Microsoft H.264 decoder which has a limit of 1920x1080 and can fail silently and return video dimensions clamped at 720x480
+ if ((_width == 720 || _height == 480) && _playerDescription.Contains("DirectShow"))
+ {
+ Debug.LogWarning("[AVProVideo] If video fails to play then it may be due to the resolution being higher than 1920x1080 which is the limitation of the Microsoft DirectShow H.264 decoder.\nTo resolve this you can either use Windows 8 or above (and disable 'Force DirectShow' option), resize your video, use a different codec (such as Hap or DivX), or install a 3rd party H.264 decoder such as LAV Filters.");
+ }
+ // Warning when using software decoder with high resolution videos
+ else if ((_width > 1920 || _height > 1080) && _playerDescription.Contains("MF-MediaEngine-Software"))
+ {
+ //Debug.LogWarning("[AVProVideo] Using software video decoder. For best performance consider adding the -force-d3d11-no-singlethreaded command-line switch to enable GPU decoding.");
+ }
+ }
+
+ private void UpdateDisplayFrameRate()
+ {
+ _displayRateTimer += Time.deltaTime;
+ if (_displayRateTimer >= 0.5f)
+ {
+ int frameCount = Native.GetTextureFrameCount(_instance);
+ _displayRate = (float)(frameCount - _lastFrameCount) / _displayRateTimer;
+ _displayRateTimer -= 0.5f;
+ if (_displayRateTimer >= 0.5f)
+ _displayRateTimer = 0f;
+ _lastFrameCount = frameCount;
+ }
+ }
+
+ public override void Render()
+ {
+ UpdateDisplayFrameRate();
+
+ IssueRenderThreadEvent(Native.RenderThreadEvent.UpdateAllTextures);
+ }
+
+ public override void Dispose()
+ {
+ CloseVideo();
+ }
+
+ public override void GrabAudio(float[] buffer, int floatCount, int channelCount)
+ {
+ Native.GrabAudio(_instance, buffer, floatCount, channelCount);
+ }
+
+ public override bool PlayerSupportsLinearColorSpace()
+ {
+ return _supportsLinearColorSpace;
+ }
+
+ //private static int _lastUpdateAllTexturesFrame = -1;
+
+ private static void IssueRenderThreadEvent(Native.RenderThreadEvent renderEvent)
+ {
+ /*if (renderEvent == Native.RenderThreadEvent.UpdateAllTextures)
+ {
+ // We only want to update all textures once per frame
+ if (_lastUpdateAllTexturesFrame == Time.frameCount)
+ return;
+
+ _lastUpdateAllTexturesFrame = Time.frameCount;
+ }*/
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ if (renderEvent == Native.RenderThreadEvent.UpdateAllTextures)
+ {
+ GL.IssuePluginEvent(_nativeFunction_UpdateAllTextures, 0);
+ }
+ else if (renderEvent == Native.RenderThreadEvent.FreeTextures)
+ {
+ GL.IssuePluginEvent(_nativeFunction_FreeTextures, 0);
+ }
+ else if (renderEvent == Native.RenderThreadEvent.WaitForNewFrame)
+ {
+ GL.IssuePluginEvent(_nativeFunction_ExtractFrame, 0);
+ }
+#else
+ GL.IssuePluginEvent(Native.PluginID | (int)renderEvent);
+#endif
+ }
+
+ private static string GetPluginVersion()
+ {
+ return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(Native.GetPluginVersion());
+ }
+
+#if AVPROVIDEO_FIXREGRESSION_TEXTUREQUALITY_UNITY542
+ public override void OnEnable()
+ {
+ base.OnEnable();
+
+ if (_texture != null && _nativeTexture != System.IntPtr.Zero && _texture.GetNativeTexturePtr() == System.IntPtr.Zero)
+ {
+ _texture.UpdateExternalTexture(_nativeTexture);
+ }
+ _textureQuality = QualitySettings.masterTextureLimit;
+ }
+#endif
+
+ private struct Native
+ {
+ public const int PluginID = 0xFA60000;
+
+ public enum RenderThreadEvent
+ {
+ UpdateAllTextures,
+ FreeTextures,
+ WaitForNewFrame,
+ }
+
+ // Global
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool Init(bool linearColorSpace, bool isD3D11NoSingleThreaded);
+
+ [DllImport("AVProVideo")]
+ public static extern void Deinit();
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr GetPluginVersion();
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool IsTrialVersion();
+
+ // Open and Close
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr OpenSource(System.IntPtr instance, [MarshalAs(UnmanagedType.LPWStr)]string path, int videoApiIndex, bool useHardwareDecoding,
+ bool generateTextureMips, bool hintAlphaChannel, bool useLowLatency, [MarshalAs(UnmanagedType.LPWStr)]string forceAudioOutputDeviceName,
+ bool useUnityAudio, bool forceResample, int sampleRate, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]IntPtr[] preferredFilter, uint numFilters,
+ int audioChannelMode, uint sourceSampleRate, uint sourceChannels);
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr OpenSourceFromBuffer(System.IntPtr instance, byte[] buffer, ulong bufferLength, int videoApiIndex, bool useHardwareDecoding,
+ bool generateTextureMips, bool hintAlphaChannel, bool useLowLatency, [MarshalAs(UnmanagedType.LPWStr)]string forceAudioOutputDeviceName,
+ bool useUnityAudio, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]IntPtr[] preferredFilter, uint numFilters);
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr StartOpenSourceFromBuffer(System.IntPtr instance, int videoApiIndex, ulong bufferLength);
+
+ [DllImport("AVProVideo")]
+ public static extern bool AddChunkToSourceBuffer(System.IntPtr instance, byte[] buffer, ulong offset, ulong chunkLength);
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr EndOpenSourceFromBuffer(System.IntPtr instance, bool useHardwareDecoding, bool generateTextureMips, bool hintAlphaChannel,
+ bool useLowLatency, [MarshalAs(UnmanagedType.LPWStr)]string forceAudioOutputDeviceName, bool useUnityAudio,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]IntPtr[] preferredFilter, uint numFilters);
+
+#if NETFX_CORE
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr OpenSourceFromStream(System.IntPtr instance, IRandomAccessStream ras,
+ [MarshalAs(UnmanagedType.LPWStr)]string path, int videoApiIndex, bool useHardwareDecoding, bool generateTextureMips,
+ bool hintAlphaChannel, bool useLowLatency, [MarshalAs(UnmanagedType.LPWStr)]string forceAudioOutputDeviceName, bool useUnityAudio, bool forceResample,
+ int sampleRate, uint sourceSampleRate, uint sourceChannels);
+#endif
+
+ [DllImport("AVProVideo")]
+ public static extern void CloseSource(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr GetPlayerDescription(System.IntPtr instance);
+
+ // Errors
+
+ [DllImport("AVProVideo")]
+ public static extern int GetLastErrorCode(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern long GetLastExtendedErrorCode(System.IntPtr instance);
+
+ // Controls
+
+ [DllImport("AVProVideo")]
+ public static extern void Play(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern void Pause(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetMuted(System.IntPtr instance, bool muted);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetVolume(System.IntPtr instance, float volume);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetBalance(System.IntPtr instance, float volume);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetLooping(System.IntPtr instance, bool looping);
+
+ // Properties
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool HasVideo(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool HasAudio(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetWidth(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetHeight(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern float GetFrameRate(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern float GetDuration(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetAudioTrackCount(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool IsPlaybackStalled(System.IntPtr instance);
+
+ // State
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool HasMetaData(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool CanPlay(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool IsSeeking(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool IsFinished(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool IsBuffering(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern float GetCurrentTime(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetCurrentTime(System.IntPtr instance, float time, bool fast);
+
+ [DllImport("AVProVideo")]
+ public static extern float GetPlaybackRate(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetPlaybackRate(System.IntPtr instance, float rate);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetAudioTrack(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetAudioTrack(System.IntPtr instance, int index);
+
+ [DllImport("AVProVideo")]
+ public static extern float GetBufferingProgress(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetBufferedRanges(System.IntPtr instance, float[] timeArray, int arrayCount);
+
+ [DllImport("AVProVideo")]
+ public static extern void StartExtractFrame(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern void WaitForExtract(System.IntPtr instance);
+
+ // Update and Rendering
+
+ [DllImport("AVProVideo")]
+ public static extern void Update(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr GetTexturePointer(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+#if AVPROVIDEO_MARSHAL_RETURN_BOOL
+ [return: MarshalAs(UnmanagedType.I1)]
+#endif
+ public static extern bool IsTextureTopDown(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetTextureFrameCount(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern long GetTextureTimeStamp(System.IntPtr instance);
+
+#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr GetRenderEventFunc_UpdateAllTextures();
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr GetRenderEventFunc_FreeTextures();
+
+ [DllImport("AVProVideo")]
+ public static extern System.IntPtr GetRenderEventFunc_WaitForNewFrame();
+#endif
+
+ // Audio
+
+ [DllImport("AVProVideo")]
+ public static extern void SetUnityAudioEnabled(System.IntPtr instance, bool enabled);
+
+ [DllImport("AVProVideo")]
+ public static extern void GrabAudio(System.IntPtr instance, float[] buffer, int floatCount, int channelCount);
+
+ [DllImport("AVProVideo")]
+ public static extern int GetAudioChannelCount(System.IntPtr instance);
+
+ [DllImport("AVProVideo")]
+ public static extern int SetAudioChannelMode(System.IntPtr instance, int channelMode);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetHeadOrientation(System.IntPtr instance, float x, float y, float z, float w);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetAudioFocusEnabled(System.IntPtr instance, bool enabled);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetAudioFocusProps(System.IntPtr instance, float offFocusLevel, float widthDegrees);
+
+ [DllImport("AVProVideo")]
+ public static extern void SetAudioFocusRotation(System.IntPtr instance, float x, float y, float z, float w);
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WindowsMediaPlayer.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WindowsMediaPlayer.cs.meta
new file mode 100644
index 0000000..07f1f07
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/AVProVideo/Scripts/Internal/WindowsMediaPlayer.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6f3c954eb61392a4193295a8376bd8db
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes.meta
new file mode 100644
index 0000000..f3e355c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d30849730a64027478071af65ad77821
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset.meta
new file mode 100644
index 0000000..665009e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3df25eaaca05750439b1daaecf9125a2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font.meta
new file mode 100644
index 0000000..9f50ecf
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 300f22ad3664e5949a7c9b82928b1e5f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold.meta
new file mode 100644
index 0000000..8c597da
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6e143be8f9bfa4240a8c9326ddf97d73
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold/Compacta Std Bold.otf b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold/Compacta Std Bold.otf
new file mode 100644
index 0000000..2d9291e
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold/Compacta Std Bold.otf differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold/Compacta Std Bold.otf.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold/Compacta Std Bold.otf.meta
new file mode 100644
index 0000000..02b21d6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Compacta Std Bold/Compacta Std Bold.otf.meta
@@ -0,0 +1,22 @@
+fileFormatVersion: 2
+guid: f0281d839f7ff4d409dddfddf2f77aee
+TrueTypeFontImporter:
+ externalObjects: {}
+ serializedVersion: 4
+ fontSize: 16
+ forceTextureCase: -2
+ characterSpacing: 0
+ characterPadding: 1
+ includeFontData: 1
+ fontName: Compacta Std
+ fontNames:
+ - Compacta Std
+ fallbackFontReferences: []
+ customCharacters:
+ fontRenderingMode: 0
+ ascentCalculationMode: 1
+ useLegacyBoundsCalculation: 0
+ shouldRoundAdvanceValue: 1
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std.meta
new file mode 100644
index 0000000..de4877e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6c7f74bfd0139e14192a52edc3f41b11
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std/Eurostile-LT-Std-Demi_16310.ttf b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std/Eurostile-LT-Std-Demi_16310.ttf
new file mode 100644
index 0000000..4d230c3
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std/Eurostile-LT-Std-Demi_16310.ttf differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std/Eurostile-LT-Std-Demi_16310.ttf.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std/Eurostile-LT-Std-Demi_16310.ttf.meta
new file mode 100644
index 0000000..c3d01f1
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/Eurostile-LT-Std/Eurostile-LT-Std-Demi_16310.ttf.meta
@@ -0,0 +1,22 @@
+fileFormatVersion: 2
+guid: 1d742de74eda8b04c8b4f7c3e68941ed
+TrueTypeFontImporter:
+ externalObjects: {}
+ serializedVersion: 4
+ fontSize: 67
+ forceTextureCase: -2
+ characterSpacing: 0
+ characterPadding: 1
+ includeFontData: 1
+ fontName: Eurostile LT Std
+ fontNames:
+ - Eurostile LT Std
+ fallbackFontReferences: []
+ customCharacters:
+ fontRenderingMode: 0
+ ascentCalculationMode: 1
+ useLegacyBoundsCalculation: 0
+ shouldRoundAdvanceValue: 1
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted.meta
new file mode 100644
index 0000000..e2fffcc
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 44ed9cc8ff8e07240b518c52f892ffbe
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Black.otf b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Black.otf
new file mode 100644
index 0000000..e3e0c24
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Black.otf differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Black.otf.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Black.otf.meta
new file mode 100644
index 0000000..8aaef4b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Black.otf.meta
@@ -0,0 +1,22 @@
+fileFormatVersion: 2
+guid: 1f940ec663706444798b9201d8ddedec
+TrueTypeFontImporter:
+ externalObjects: {}
+ serializedVersion: 4
+ fontSize: 16
+ forceTextureCase: -2
+ characterSpacing: 0
+ characterPadding: 1
+ includeFontData: 1
+ fontName: Noto Sans CJK SC
+ fontNames:
+ - Noto Sans CJK SC
+ fallbackFontReferences: []
+ customCharacters:
+ fontRenderingMode: 0
+ ascentCalculationMode: 1
+ useLegacyBoundsCalculation: 0
+ shouldRoundAdvanceValue: 1
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Bold.otf b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Bold.otf
new file mode 100644
index 0000000..13314c9
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Bold.otf differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Bold.otf.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Bold.otf.meta
new file mode 100644
index 0000000..a713de0
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/NotoSansCJKsc-hinted/NotoSansCJKsc-Bold.otf.meta
@@ -0,0 +1,23 @@
+fileFormatVersion: 2
+guid: b9a3cf7d754c5ff448c41816cc1e6c0a
+TrueTypeFontImporter:
+ externalObjects: {}
+ serializedVersion: 4
+ fontSize: 16
+ forceTextureCase: -2
+ characterSpacing: 0
+ characterPadding: 1
+ includeFontData: 1
+ fontName: Noto Sans CJK SC
+ fontNames:
+ - Noto Sans CJK SC
+ fallbackFontReferences:
+ - {fileID: 12800000, guid: 1f940ec663706444798b9201d8ddedec, type: 3}
+ customCharacters:
+ fontRenderingMode: 0
+ ascentCalculationMode: 1
+ useLegacyBoundsCalculation: 0
+ shouldRoundAdvanceValue: 1
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic.meta
new file mode 100644
index 0000000..8984ce7
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 69b3f1deebad1a94a977dd819302394b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic/TradeMarker Bold Italic.ttf b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic/TradeMarker Bold Italic.ttf
new file mode 100644
index 0000000..7bbdcfb
Binary files /dev/null and b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic/TradeMarker Bold Italic.ttf differ
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic/TradeMarker Bold Italic.ttf.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic/TradeMarker Bold Italic.ttf.meta
new file mode 100644
index 0000000..758b904
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Font/TradeMarker Bold Italic/TradeMarker Bold Italic.ttf.meta
@@ -0,0 +1,22 @@
+fileFormatVersion: 2
+guid: b6f3e9c99a2aacd418c384e8a28d1877
+TrueTypeFontImporter:
+ externalObjects: {}
+ serializedVersion: 4
+ fontSize: 16
+ forceTextureCase: -2
+ characterSpacing: 0
+ characterPadding: 1
+ includeFontData: 1
+ fontName: TradeMarker
+ fontNames:
+ - TradeMarker
+ fallbackFontReferences: []
+ customCharacters:
+ fontRenderingMode: 0
+ ascentCalculationMode: 1
+ useLegacyBoundsCalculation: 0
+ shouldRoundAdvanceValue: 1
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Highlight.mat b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Highlight.mat
new file mode 100644
index 0000000..8eaf491
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Highlight.mat
@@ -0,0 +1,91 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: Highlight
+ m_Shader: {fileID: 4800000, guid: f32079bbb2560394abb63e40e1d53da7, type: 3}
+ m_ShaderKeywords: ALPHAPACK_LEFT_RIGHT
+ m_LightmapFlags: 4
+ m_EnableInstancingVariants: 0
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs:
+ - _BumpMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _ChromaTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailAlbedoMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailMask:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailNormalMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _EmissionMap:
+ 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}
+ - _MetallicGlossMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _OcclusionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _ParallaxMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats:
+ - AlphaPack: 2
+ - _ApplyGamma: 0
+ - _BumpScale: 1
+ - _ColorMask: 15
+ - _Cutoff: 0.5
+ - _DetailNormalMapScale: 1
+ - _DstBlend: 0
+ - _GlossMapScale: 1
+ - _Glossiness: 0.5
+ - _GlossyReflections: 1
+ - _Metallic: 0
+ - _Mode: 0
+ - _OcclusionStrength: 1
+ - _Parallax: 0.02
+ - _SmoothnessTextureChannel: 0
+ - _SpecularHighlights: 1
+ - _SrcBlend: 1
+ - _Stencil: 0
+ - _StencilComp: 8
+ - _StencilOp: 0
+ - _StencilReadMask: 255
+ - _StencilWriteMask: 255
+ - _UVSec: 0
+ - _UseYpCbCr: 0
+ - _VertScale: 1
+ - _ZWrite: 1
+ m_Colors:
+ - _Color: {r: 1, g: 1, b: 1, a: 1}
+ - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Highlight.mat.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Highlight.mat.meta
new file mode 100644
index 0000000..c8e0502
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Highlight.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: afc00ed57d4e1c744abc1e85aadd7628
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 2100000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Multilingual Core.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Multilingual Core.prefab
new file mode 100644
index 0000000..d23c55e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Multilingual Core.prefab
@@ -0,0 +1,47 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &1189168522907383257
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1189168522907383259}
+ - component: {fileID: 1189168522907383256}
+ m_Layer: 0
+ m_Name: Multilingual Core
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &1189168522907383259
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1189168522907383257}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &1189168522907383256
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1189168522907383257}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 284722400c506cf41a5be114091d56f2, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ language: 10
+ availableLanguages: 0a00000028000000
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Multilingual Core.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Multilingual Core.prefab.meta
new file mode 100644
index 0000000..e1ad066
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Multilingual Core.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: da961c31106ff5949974f5e38c4761f7
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Page Manager.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Page Manager.prefab
new file mode 100644
index 0000000..51fcd74
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Page Manager.prefab
@@ -0,0 +1,78 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &4352828657788332676
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 4352828657788332678}
+ - component: {fileID: 4352828657788332677}
+ m_Layer: 0
+ m_Name: Page Manager
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!4 &4352828657788332678
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4352828657788332676}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &4352828657788332677
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4352828657788332676}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: a6458bcce7ab91d4d955627578bf68be, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ names:
+ - 07
+ - 10
+ - 18
+ - 21
+ - 23
+ - 31
+ - 46
+ - an
+ - bw
+ - ca
+ - fn
+ - he
+ - hk
+ - in
+ - tr
+ - we
+ onSelected:
+ m_PersistentCalls:
+ m_Calls:
+ - m_Target: {fileID: 0}
+ m_MethodName: LoadScene
+ m_Mode: 1
+ m_Arguments:
+ m_ObjectArgument: {fileID: 0}
+ m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+ m_IntArgument: 0
+ m_FloatArgument: 0
+ m_StringArgument:
+ m_BoolArgument: 0
+ m_CallState: 2
+ m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
+ Culture=neutral, PublicKeyToken=null
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Page Manager.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Page Manager.prefab.meta
new file mode 100644
index 0000000..9cdf4cd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Page Manager.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d6764018e72489a4fa2bb9dd376cf95a
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft.meta
new file mode 100644
index 0000000..ce603f1
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 63810d5c37aa78149ba84b7d87350c85
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Brush Tool.asset b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Brush Tool.asset
new file mode 100644
index 0000000..22d9a28
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Brush Tool.asset
@@ -0,0 +1,243 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 91e0788c54f764fd6b9f11121c941076, type: 3}
+ m_Name: Brush Tool
+ m_EditorClassIdentifier:
+ Filters:
+ - {fileID: 11489040}
+ - {fileID: 11425390}
+ - {fileID: 11432428}
+ - {fileID: 11474562}
+ - {fileID: 11431106}
+ - {fileID: 11478692}
+ - {fileID: 11474894}
+ StartFilter: {fileID: 11489040}
+ MinSize: {x: 2, y: 2}
+ BaseSize: {x: 100, y: 100}
+--- !u!114 &11425390
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: a8b53e6aef74248dd8ed15ea3bd83f39, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 301
+ y: 12
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11478692}
+--- !u!114 &11426612
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5a2f8cfa5980ffb46877b7519e071d3d, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 527
+ y: 323
+ width: 245
+ height: 41
+ NextFilter: {fileID: 11431106}
+ PointType: 3
+--- !u!114 &11431106
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: ca49eaec1fe6843b38bf6aaa3b916d8f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 279
+ y: 201
+ width: 245
+ height: 92
+ NextFilter: {fileID: 0}
+ NormalMaterial: {fileID: 2100000, guid: 6bb96d1cf404fa741b7877b830ab10dc, type: 2}
+ RegionMaterial: {fileID: 2100000, guid: f928287c90518c34091e6730c896c352, type: 2}
+--- !u!114 &11431320
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d10ea70fa82d3435da1e77ec87f1bf2e, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ x: 527
+ y: 20
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11432428}
+--- !u!114 &11432428
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 2bffc343d21534863bedecd721ea2154, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 29
+ y: 94
+ width: 245
+ height: 110
+ NextFilter: {fileID: 11474894}
+ Spacing:
+ PropertyType: 0
+ Value: 3
+--- !u!114 &11453454
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1c3a10253828ca4469ee5e16d176a1f1, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 54
+ y: 248
+ width: 245
+ height: 41
+ NextFilter: {fileID: 11431106}
+ PointType: 3
+--- !u!114 &11474562
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 85be29966423c49aa8bfc750b85c9cfb, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 563
+ y: 99
+ width: 245
+ height: 77
+ NextFilter: {fileID: 11431106}
+ PointType: -1
+ Alpha: 0.05
+--- !u!114 &11474894
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1c6e80c3f83644dc3b1a8b36f8c48a58, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 287
+ y: 99
+ width: 245
+ height: 59
+ NextFilter: {fileID: 11474562}
+ PointType: -1
+--- !u!114 &11478692
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 2e69471ea07534d2cad6f82a366c928f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 567
+ y: 10
+ width: 245
+ height: 59
+ NextFilter: {fileID: 11432428}
+ PointType: -1
+--- !u!114 &11489040
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 43188b9bad52c44ebba5417cb13ff27b, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 10
+ y: 12
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11425390}
+--- !u!114 &11494368
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: cd1915d6ef8f942f09e9148f53bbdc5c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ x: 297
+ y: 115
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11474562}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Brush Tool.asset.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Brush Tool.asset.meta
new file mode 100644
index 0000000..51ff284
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Brush Tool.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6494f2b9ecacc9448abb9b2daac9ce4c
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/BrushNormalRegionMaterial.mat b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/BrushNormalRegionMaterial.mat
new file mode 100644
index 0000000..5f8e2c0
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/BrushNormalRegionMaterial.mat
@@ -0,0 +1,35 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: BrushNormalRegionMaterial
+ m_Shader: {fileID: 4800000, guid: f095c451794067b4da37bc4454b41574, type: 3}
+ m_ShaderKeywords:
+ m_LightmapFlags: 5
+ m_EnableInstancingVariants: 0
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs:
+ - _MainTex:
+ m_Texture: {fileID: 2800000, guid: cf6d131078d6d7346862464452eb74e5, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _PatternTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _RegionTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats: []
+ m_Colors: []
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/BrushNormalRegionMaterial.mat.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/BrushNormalRegionMaterial.mat.meta
new file mode 100644
index 0000000..f657150
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/BrushNormalRegionMaterial.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f928287c90518c34091e6730c896c352
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Crayon Tool.asset b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Crayon Tool.asset
new file mode 100644
index 0000000..df4b16a
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Crayon Tool.asset
@@ -0,0 +1,347 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 91e0788c54f764fd6b9f11121c941076, type: 3}
+ m_Name: Crayon Tool
+ m_EditorClassIdentifier:
+ Filters:
+ - {fileID: 11470664}
+ - {fileID: 11468304}
+ - {fileID: 11411010}
+ - {fileID: 11480426}
+ - {fileID: 11447514}
+ - {fileID: 11470602}
+ - {fileID: 11425410}
+ - {fileID: 11441662}
+ - {fileID: 11458396}
+ - {fileID: 11429310}
+ StartFilter: {fileID: 11470664}
+ MinSize: {x: 2, y: 2}
+ BaseSize: {x: 100, y: 100}
+--- !u!114 &11411010
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: a8b53e6aef74248dd8ed15ea3bd83f39, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 554
+ y: 32
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11480426}
+--- !u!114 &11425410
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5e918c6351cf7420f8b47a7fe8c5188b, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 290
+ y: 324
+ width: 245
+ height: 95
+ NextFilter: {fileID: 11441662}
+ PointType: 2
+ ScaleMax: 1
+ ScaleMin: 0.95
+--- !u!114 &11429310
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1c6e80c3f83644dc3b1a8b36f8c48a58, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 260
+ y: 118
+ width: 245
+ height: 59
+ NextFilter: {fileID: 11458396}
+ PointType: 2
+--- !u!114 &11436630
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 250ee5cb9a8dc4670bee2827d61b6c54, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 239
+ y: 188
+ width: 245
+ height: 77
+ NextFilter: {fileID: 11470602}
+ PointType: -1
+ Offset: 2
+--- !u!114 &11441662
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: ca49eaec1fe6843b38bf6aaa3b916d8f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 576
+ y: 313
+ width: 245
+ height: 92
+ NextFilter: {fileID: 0}
+ NormalMaterial: {fileID: 2100000, guid: 3c8b87d7a6252114c9d41aa2b987e356, type: 2}
+ RegionMaterial: {fileID: 2100000, guid: a7163f6ab2f9897499599a56943543ce, type: 2}
+--- !u!114 &11441774
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d10ea70fa82d3435da1e77ec87f1bf2e, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ x: 586
+ y: 145
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11447514}
+--- !u!114 &11447514
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: a02165a4a343fa242af9ec50c74eed6f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 372
+ y: 196
+ width: 245
+ height: 95
+ NextFilter: {fileID: 11470602}
+ PointType: 2
+ Radius: 15
+ MultiplyToBrushSize: 1
+--- !u!114 &11458396
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 2e69471ea07534d2cad6f82a366c928f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 514
+ y: 113
+ width: 245
+ height: 59
+ NextFilter: {fileID: 11447514}
+ PointType: 2
+--- !u!114 &11459424
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 0}
+ m_Name:
+ m_EditorClassIdentifier: Assembly-CSharp:PaintCraft.Tools.Filters.PropertyBinders:BindColorToCanvas
+ EditorWindowRect:
+ x: 10
+ y: 10
+ width: 0
+ height: 0
+ NextFilter: {fileID: 0}
+--- !u!114 &11468304
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: acfc26114bbf74bf3a570df721ba02e7, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 291
+ y: 32
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11411010}
+--- !u!114 &11468312
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d10ea70fa82d3435da1e77ec87f1bf2e, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ x: 567
+ y: 33
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11411010}
+--- !u!114 &11470602
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: b84dff2bc9cad074e8c07832543d40e9, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 30
+ y: 299
+ width: 245
+ height: 95
+ NextFilter: {fileID: 11425410}
+ PointType: 2
+ MinAngle: 0
+ MaxAngle: 360
+--- !u!114 &11470664
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 43188b9bad52c44ebba5417cb13ff27b, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 23
+ y: 14
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11468304}
+--- !u!114 &11474086
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: cd1915d6ef8f942f09e9148f53bbdc5c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ x: 287
+ y: 136
+ width: 245
+ height: 56
+ NextFilter: {fileID: 11458396}
+--- !u!114 &11479418
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: f1fa3add17cbe46269fde33087aa7337, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 10
+ y: 78
+ width: 245
+ height: 59
+ NextFilter: {fileID: 11470664}
+ FilePath: Assets/Crayon.txt
+--- !u!114 &11480426
+MonoBehaviour:
+ m_ObjectHideFlags: 1
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 2bffc343d21534863bedecd721ea2154, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ EditorWindowRect:
+ serializedVersion: 2
+ x: 14
+ y: 131
+ width: 245
+ height: 110
+ NextFilter: {fileID: 11429310}
+ Spacing:
+ PropertyType: 0
+ Value: 3
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Crayon Tool.asset.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Crayon Tool.asset.meta
new file mode 100644
index 0000000..09c36b4
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/Crayon Tool.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b68cc20131b70b548a798f53dcddb8c2
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/CrayonNormalRegionMaterial.mat b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/CrayonNormalRegionMaterial.mat
new file mode 100644
index 0000000..af482a5
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/CrayonNormalRegionMaterial.mat
@@ -0,0 +1,35 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 6
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: CrayonNormalRegionMaterial
+ m_Shader: {fileID: 4800000, guid: f095c451794067b4da37bc4454b41574, type: 3}
+ m_ShaderKeywords:
+ m_LightmapFlags: 5
+ m_EnableInstancingVariants: 0
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs:
+ - _MainTex:
+ m_Texture: {fileID: 2800000, guid: 64d535b7b91939c438b6c545553e34f7, type: 3}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _PatternTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _RegionTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Floats: []
+ m_Colors: []
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/CrayonNormalRegionMaterial.mat.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/CrayonNormalRegionMaterial.mat.meta
new file mode 100644
index 0000000..f5e8dc6
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/CrayonNormalRegionMaterial.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a7163f6ab2f9897499599a56943543ce
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/signature.asset b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/signature.asset
new file mode 100644
index 0000000..093a75e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/signature.asset
@@ -0,0 +1,18 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInternal: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 8820b1d2e7c56fa4f8625365d4108cc5, type: 3}
+ m_Name: signature
+ m_EditorClassIdentifier:
+ UniqueId: 00
+ startImagePath: Marvel/empty
+ outlinePath: Marvel/signature_outline
+ RegionPath: Marvel/signature_regions
+ IconPath: Marvel/icon
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/signature.asset.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/signature.asset.meta
new file mode 100644
index 0000000..15fd7cd
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/signature.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a93987c511ac1404f8afaef1197ce4db
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/temp.asset b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/temp.asset
new file mode 100644
index 0000000..871c16b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/temp.asset
@@ -0,0 +1,19 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 8820b1d2e7c56fa4f8625365d4108cc5, type: 3}
+ m_Name: temp
+ m_EditorClassIdentifier:
+ UniqueId: ca
+ startImagePath: Marvel/start_ca
+ outlinePath: Marvel/outline_ca
+ RegionPath: Marvel/regions_ca
+ IconPath: Marvel/icon
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/temp.asset.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/temp.asset.meta
new file mode 100644
index 0000000..2c96875
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/PaintCraft/temp.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d88cf84a0076ae046a59765223ff9c70
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Pivot.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Pivot.prefab
new file mode 100644
index 0000000..2349926
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Pivot.prefab
@@ -0,0 +1,102 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &3886692351726213916
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 3886692351726213917}
+ - component: {fileID: 3886692351726213905}
+ - component: {fileID: 3886692351726213904}
+ - component: {fileID: 3886692351726213919}
+ - component: {fileID: 3886692351726213918}
+ m_Layer: 5
+ m_Name: Pivot
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &3886692351726213917
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 3886692351726213916}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_AnchorMin: {x: 0.5, y: 0.5}
+ m_AnchorMax: {x: 0.5, y: 0.5}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 1024, y: 1024}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &3886692351726213905
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 3886692351726213916}
+ m_CullTransparentMesh: 0
+--- !u!114 &3886692351726213904
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 3886692351726213916}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0.9056604, g: 0.21081325, b: 0, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 21300000, guid: 4b056f4b95985cb47bc5d8b0d7a029c6, type: 3}
+ m_Type: 0
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 1
+ m_FillOrigin: 0
+ m_UseSpriteMesh: 0
+--- !u!225 &3886692351726213919
+CanvasGroup:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 3886692351726213916}
+ m_Enabled: 1
+ m_Alpha: 1
+ m_Interactable: 0
+ m_BlocksRaycasts: 0
+ m_IgnoreParentGroups: 0
+--- !u!114 &3886692351726213918
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 3886692351726213916}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: e1863de8d04562d40b3a9e6be058ed93, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Pivot.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Pivot.prefab.meta
new file mode 100644
index 0000000..8f945b3
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/Pivot.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4cd8a09ef60382849a213d8d8d9edbc8
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/RadialClock.prefab b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/RadialClock.prefab
new file mode 100644
index 0000000..428891f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/RadialClock.prefab
@@ -0,0 +1,362 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &2000318231216149527
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1792381460007772463}
+ - component: {fileID: 3627595796981133178}
+ - component: {fileID: 1792524374366686521}
+ - component: {fileID: 6884847666010517644}
+ - component: {fileID: 1897392084050188185}
+ m_Layer: 5
+ m_Name: RadialClock
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &1792381460007772463
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000318231216149527}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children:
+ - {fileID: 1792240707152731105}
+ - {fileID: 1792187184970575513}
+ - {fileID: 8757555787750090136}
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_AnchorMin: {x: 0, y: 1}
+ m_AnchorMax: {x: 0, y: 1}
+ m_AnchoredPosition: {x: 180, y: -235}
+ m_SizeDelta: {x: 100, y: 100}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &3627595796981133178
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000318231216149527}
+ m_CullTransparentMesh: 0
+--- !u!225 &1792524374366686521
+CanvasGroup:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000318231216149527}
+ m_Enabled: 1
+ m_Alpha: 1
+ m_Interactable: 1
+ m_BlocksRaycasts: 1
+ m_IgnoreParentGroups: 0
+--- !u!114 &6884847666010517644
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000318231216149527}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0.16862746, g: 0.23921569, b: 0.32156864, a: 0}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Texture: {fileID: 2800000, guid: 4b056f4b95985cb47bc5d8b0d7a029c6, type: 3}
+ m_UVRect:
+ serializedVersion: 2
+ x: 0
+ y: 0
+ width: 1
+ height: 1
+--- !u!114 &1897392084050188185
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000318231216149527}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1195da39bc4cdf245b318af94919381a, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+--- !u!1 &2000896897870920853
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1792187184970575513}
+ - component: {fileID: 1789710596541470879}
+ - component: {fileID: 1898629275916592579}
+ m_Layer: 5
+ m_Name: Text
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &1792187184970575513
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000896897870920853}
+ m_LocalRotation: {x: 0, y: 0, z: 0.06975647, w: 0.9975641}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 1792381460007772463}
+ m_RootOrder: 1
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 8}
+ m_AnchorMin: {x: 0.5, y: 0.5}
+ m_AnchorMax: {x: 0.5, y: 0.5}
+ m_AnchoredPosition: {x: 0.4, y: 20.5}
+ m_SizeDelta: {x: 300, y: 300}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &1789710596541470879
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000896897870920853}
+ m_CullTransparentMesh: 0
+--- !u!114 &1898629275916592579
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2000896897870920853}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0.16078432, g: 0.2784314, b: 0.70980394, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 12800000, guid: b6f3e9c99a2aacd418c384e8a28d1877, type: 3}
+ m_FontSize: 100
+ m_FontStyle: 0
+ m_BestFit: 0
+ m_MinSize: 1
+ m_MaxSize: 165
+ m_Alignment: 4
+ m_AlignByGeometry: 0
+ m_RichText: 1
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 1
+ m_Text: 180
+--- !u!1 &2001780478511426867
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1792240707152731105}
+ - component: {fileID: 1789121063144140005}
+ - component: {fileID: 1897278982536747537}
+ m_Layer: 5
+ m_Name: Image
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &1792240707152731105
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2001780478511426867}
+ m_LocalRotation: {x: 0, y: 0, z: 1, w: 0}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 1792381460007772463}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180}
+ m_AnchorMin: {x: 0, y: 0}
+ m_AnchorMax: {x: 1, y: 1}
+ m_AnchoredPosition: {x: 0, y: 0}
+ m_SizeDelta: {x: 0, y: 0}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &1789121063144140005
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2001780478511426867}
+ m_CullTransparentMesh: 0
+--- !u!114 &1897278982536747537
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2001780478511426867}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0.09411765, g: 0.4745098, b: 0.7411765, a: 0}
+ m_RaycastTarget: 0
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_Sprite: {fileID: 21300000, guid: 4b056f4b95985cb47bc5d8b0d7a029c6, type: 3}
+ m_Type: 3
+ m_PreserveAspect: 0
+ m_FillCenter: 1
+ m_FillMethod: 4
+ m_FillAmount: 1
+ m_FillClockwise: 0
+ m_FillOrigin: 0
+ m_UseSpriteMesh: 0
+--- !u!1 &4059456127422672775
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 8757555787750090136}
+ - component: {fileID: 7886625736964199916}
+ - component: {fileID: 2970367884123308800}
+ - component: {fileID: 2525503451231538874}
+ m_Layer: 5
+ m_Name: Text Desc
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!224 &8757555787750090136
+RectTransform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4059456127422672775}
+ m_LocalRotation: {x: 0, y: 0, z: 0.06975647, w: 0.9975641}
+ m_LocalPosition: {x: 0, y: 0, z: 0}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 1792381460007772463}
+ m_RootOrder: 2
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 8}
+ m_AnchorMin: {x: 0.5, y: 0.5}
+ m_AnchorMax: {x: 0.5, y: 0.5}
+ m_AnchoredPosition: {x: -49.4, y: 100}
+ m_SizeDelta: {x: 300, y: 300}
+ m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &7886625736964199916
+CanvasRenderer:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4059456127422672775}
+ m_CullTransparentMesh: 0
+--- !u!114 &2970367884123308800
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4059456127422672775}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ m_Material: {fileID: 0}
+ m_Color: {r: 0.16078432, g: 0.2784314, b: 0.70980394, a: 1}
+ m_RaycastTarget: 1
+ m_OnCullStateChanged:
+ m_PersistentCalls:
+ m_Calls: []
+ m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
+ Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+ m_FontData:
+ m_Font: {fileID: 12800000, guid: b6f3e9c99a2aacd418c384e8a28d1877, type: 3}
+ m_FontSize: 42
+ m_FontStyle: 2
+ m_BestFit: 0
+ m_MinSize: 1
+ m_MaxSize: 165
+ m_Alignment: 4
+ m_AlignByGeometry: 0
+ m_RichText: 1
+ m_HorizontalOverflow: 0
+ m_VerticalOverflow: 0
+ m_LineSpacing: 2
+ m_Text: Time Left
+--- !u!114 &2525503451231538874
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 4059456127422672775}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5d4111d72b538b544860d085f76e5ad8, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ language: 10
+ contexts:
+ - language: 10
+ text: Time Left
+ font: {fileID: 12800000, guid: b6f3e9c99a2aacd418c384e8a28d1877, type: 3}
+ fontSize: 42
+ lineSpacing: 2
+ baseline: 100
+ - language: 40
+ text: "\u64CD\u4F5C\u65F6\u95F4"
+ font: {fileID: 12800000, guid: b9a3cf7d754c5ff448c41816cc1e6c0a, type: 3}
+ fontSize: 39
+ lineSpacing: 0.9
+ baseline: 100.4
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/RadialClock.prefab.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/RadialClock.prefab.meta
new file mode 100644
index 0000000..9f5d382
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Asset/RadialClock.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 8fd553587c443f141825bdcd07858522
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script.meta
new file mode 100644
index 0000000..dccd2e2
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a6240af4f5ff6ec45881b5f61a6cebe1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/AppData.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/AppData.cs
new file mode 100644
index 0000000..8c8435e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/AppData.cs
@@ -0,0 +1,20 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using PaintCraft.Canvas.Configs;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class AppData : Singleton
+ {
+ public bool dev = false;
+ public int deviceId;
+ public string roleId;
+ public string serial = "0123456789";
+ public Texture2D lastPainting = null;
+ public Texture2D lastThumbnail = null;
+ public Texture2D lastSignature = null;
+ public Dictionary pages = new Dictionary();
+
+ }
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/AppData.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/AppData.cs.meta
new file mode 100644
index 0000000..b3c89b4
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/AppData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a3beb6db6e6980a4586c6845126088bc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/BrushManager.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/BrushManager.cs
new file mode 100644
index 0000000..797969b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/BrushManager.cs
@@ -0,0 +1,49 @@
+using PaintCraft.Tools;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace UltraCombos.Coloring
+{
+ public class BrushManager : MonoBehaviour
+ {
+ public LineConfig lineConfig;
+ public LineScaleManager lineScale;
+ public List brushes = new List();
+
+ List options;
+
+ private void Start()
+ {
+ options = new List(GetComponentsInChildren());
+ foreach (var opt in options)
+ {
+ opt.onValueChanged.AddListener(OnOptionChanged);
+ }
+ SetBrush(brushes.Count - 1);
+ }
+
+ private void Update()
+ {
+ var is_brush = !lineConfig.Brush.name.Equals("Bucket Tool");
+ lineScale.SetActive(is_brush);
+ }
+
+ public void OnOptionChanged(bool v)
+ {
+ var index = options.FindIndex(x => x.isOn);
+ if (index >= 0)
+ {
+ SetBrush(index);
+ }
+ }
+
+ public void SetBrush(int i)
+ {
+ lineConfig.Brush = brushes[Mathf.Clamp(i, 0, brushes.Count - 1)];
+ }
+ }
+
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/BrushManager.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/BrushManager.cs.meta
new file mode 100644
index 0000000..84d3d47
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/BrushManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 56e7611f8ac11184b92417cf14b7f210
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/CycleLanguage.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/CycleLanguage.cs
new file mode 100644
index 0000000..93df6eb
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/CycleLanguage.cs
@@ -0,0 +1,15 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class CycleLanguage : MonoBehaviour
+ {
+ public void Cycle()
+ {
+ Multilingual.Core.Instance.CycleLangauge();
+ }
+ }
+
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/CycleLanguage.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/CycleLanguage.cs.meta
new file mode 100644
index 0000000..952766e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/CycleLanguage.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c05979c47dbe7ed46aedcf5a3416ef4c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/DevelopMode.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/DevelopMode.cs
new file mode 100644
index 0000000..cc5ea8e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/DevelopMode.cs
@@ -0,0 +1,62 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+using UnityEngine.EventSystems;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class DevelopMode : MonoBehaviour, IDragHandler
+ {
+ float time_step = 0.5f;
+ float timestamp;
+ float trigger_stamp;
+
+ bool is_triggered = false;
+
+ public UnityEvent onTriggered = new UnityEvent();
+
+ private void Start()
+ {
+ AppData.Instance.dev = false;
+ }
+
+ private void Update()
+ {
+ if (is_triggered)
+ return;
+
+ float dt = Time.time - timestamp;
+ if (dt > time_step)
+ {
+ trigger_stamp = Time.time;
+ }
+
+ if (Time.time - trigger_stamp > 3.0f)
+ {
+ is_triggered = true;
+ OnTrigger();
+ onTriggered.Invoke();
+ }
+ }
+
+ public void OnDrag(PointerEventData eventData)
+ {
+ timestamp = Time.time;
+ }
+
+ private void OnTrigger()
+ {
+ var pages = AppData.Instance.pages;
+ var names = new string[pages.Count];
+ pages.Keys.CopyTo(names, 0);
+ var index = Random.Range(0, names.Length);
+ global::PaintCraft.Canvas.AppData.SelectedPageConfig = pages[names[index]];
+
+ AppData.Instance.dev = true;
+ AppData.Instance.roleId = names[index];
+ }
+ }
+}
+
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/DevelopMode.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/DevelopMode.cs.meta
new file mode 100644
index 0000000..f95eb47
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/DevelopMode.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 977cb9dd5b2262e44bffa8b2b5f480ba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor.meta
new file mode 100644
index 0000000..08ab5f5
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 763a6e4809b5d3d4ca7ed380a792b32d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor/SceneLoaderEditor.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor/SceneLoaderEditor.cs
new file mode 100644
index 0000000..b690171
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor/SceneLoaderEditor.cs
@@ -0,0 +1,73 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ [CustomEditor(typeof(SceneLoader))]
+ public class SceneLoaderEditor : Editor
+ {
+ //SerializedProperty fadingProperty;
+ SerializedProperty durationProperty;
+ SerializedProperty sceneNameProperty;
+ SerializedProperty onCountdownProperty;
+ SerializedProperty onLoadSceneProperty;
+
+ SceneLoader loader;
+
+ private void OnEnable()
+ {
+ if (target == null)
+ return;
+
+ loader = target as SceneLoader;
+
+ //fadingProperty = serializedObject.FindProperty("fading");
+ durationProperty = serializedObject.FindProperty("duration");
+ sceneNameProperty = serializedObject.FindProperty("scenePath");
+ onCountdownProperty = serializedObject.FindProperty("onCountdown");
+ onLoadSceneProperty = serializedObject.FindProperty("onLoadScene");
+ }
+
+ public override void OnInspectorGUI()
+ {
+ serializedObject.Update();
+
+ using (var check = new EditorGUI.ChangeCheckScope())
+ {
+ EditorGUILayout.Space();
+ DrawInspectorGUI();
+ EditorGUILayout.Space();
+
+ if (check.changed)
+ {
+ serializedObject.ApplyModifiedProperties();
+ }
+ }
+ }
+
+ protected override void DrawInspectorGUI()
+ {
+ //EditorGUILayout.PropertyField(fadingProperty, true);
+ EditorGUILayout.PropertyField(durationProperty, true);
+ //EditorGUILayout.PropertyField(sceneNameProperty, true);
+
+ var scenes = new List(EditorBuildSettings.scenes);
+ var index = scenes.FindIndex(x => { return x.path.Equals(loader.scenePath); });
+ //var index = scenes.FindIndex(x => { return x.path.Equals($"Assets/{loader.sceneName}.unity"); });
+ index = Mathf.Max(index, 0);
+ var options = new List();
+ foreach (var sc in scenes)
+ options.Add(sc.path);
+ var v = EditorGUILayout.Popup("Scene Path", index, options.ToArray());
+ loader.scenePath = options[v];
+ //loader.sceneName = loader.sceneName.TrimStart(new char[] { 'A', 's', 'e', 't', '/' }).TrimEnd(new char[] { '.', 'u', 'n', 'i', 't', 'y' });
+
+ EditorGUILayout.PropertyField(onCountdownProperty, true);
+ EditorGUILayout.PropertyField(onLoadSceneProperty, true);
+ }
+ }
+
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor/SceneLoaderEditor.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor/SceneLoaderEditor.cs.meta
new file mode 100644
index 0000000..1a981ce
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Editor/SceneLoaderEditor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 057a5566f2e74764f99d8d476fcf2d0d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc.meta
new file mode 100644
index 0000000..4f59ef4
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6c033ec1a947143458a6e2354c200a35
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/Ultracombos.Marvel.DrawHeroesGrpc.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/Ultracombos.Marvel.DrawHeroesGrpc.cs
new file mode 100644
index 0000000..564c952
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/Ultracombos.Marvel.DrawHeroesGrpc.cs
@@ -0,0 +1,128 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: Ultracombos.Marvel.DrawHeroes.proto
+//
+#pragma warning disable 0414, 1591
+#region Designer generated code
+
+using grpc = global::Grpc.Core;
+
+namespace UltraCombos.Marvel.DrawHeroes {
+ public static partial class Resource
+ {
+ static readonly string __ServiceName = "UltraCombos.Marvel.DrawHeroes.Resource";
+
+ static readonly grpc::Marshaller __Marshaller_UltraCombos_Marvel_DrawHeroes_Device = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Marvel.DrawHeroes.Device.Parser.ParseFrom);
+ static readonly grpc::Marshaller __Marshaller_UltraCombos_Marvel_DrawHeroes_Page = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Marvel.DrawHeroes.Page.Parser.ParseFrom);
+ static readonly grpc::Marshaller __Marshaller_UltraCombos_Marvel_DrawHeroes_DataRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Marvel.DrawHeroes.DataRequest.Parser.ParseFrom);
+ static readonly grpc::Marshaller __Marshaller_UltraCombos_Marvel_DrawHeroes_DataReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Marvel.DrawHeroes.DataReply.Parser.ParseFrom);
+
+ static readonly grpc::Method __Method_GetPage = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "GetPage",
+ __Marshaller_UltraCombos_Marvel_DrawHeroes_Device,
+ __Marshaller_UltraCombos_Marvel_DrawHeroes_Page);
+
+ static readonly grpc::Method __Method_SendData = new grpc::Method(
+ grpc::MethodType.Unary,
+ __ServiceName,
+ "SendData",
+ __Marshaller_UltraCombos_Marvel_DrawHeroes_DataRequest,
+ __Marshaller_UltraCombos_Marvel_DrawHeroes_DataReply);
+
+ /// Service descriptor
+ public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
+ {
+ get { return global::UltraCombos.Marvel.DrawHeroes.UltracombosMarvelDrawHeroesReflection.Descriptor.Services[0]; }
+ }
+
+ /// Base class for server-side implementations of Resource
+ public abstract partial class ResourceBase
+ {
+ public virtual global::System.Threading.Tasks.Task GetPage(global::UltraCombos.Marvel.DrawHeroes.Device request, grpc::ServerCallContext context)
+ {
+ throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
+ }
+
+ public virtual global::System.Threading.Tasks.Task SendData(global::UltraCombos.Marvel.DrawHeroes.DataRequest request, grpc::ServerCallContext context)
+ {
+ throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
+ }
+
+ }
+
+ /// Client for Resource
+ public partial class ResourceClient : grpc::ClientBase
+ {
+ /// Creates a new client for Resource
+ /// The channel to use to make remote calls.
+ public ResourceClient(grpc::Channel channel) : base(channel)
+ {
+ }
+ /// Creates a new client for Resource that uses a custom CallInvoker.
+ /// The callInvoker to use to make remote calls.
+ public ResourceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
+ {
+ }
+ /// Protected parameterless constructor to allow creation of test doubles.
+ protected ResourceClient() : base()
+ {
+ }
+ /// Protected constructor to allow creation of configured clients.
+ /// The client configuration.
+ protected ResourceClient(ClientBaseConfiguration configuration) : base(configuration)
+ {
+ }
+
+ public virtual global::UltraCombos.Marvel.DrawHeroes.Page GetPage(global::UltraCombos.Marvel.DrawHeroes.Device request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return GetPage(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ public virtual global::UltraCombos.Marvel.DrawHeroes.Page GetPage(global::UltraCombos.Marvel.DrawHeroes.Device request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_GetPage, null, options, request);
+ }
+ public virtual grpc::AsyncUnaryCall GetPageAsync(global::UltraCombos.Marvel.DrawHeroes.Device request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return GetPageAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ public virtual grpc::AsyncUnaryCall GetPageAsync(global::UltraCombos.Marvel.DrawHeroes.Device request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_GetPage, null, options, request);
+ }
+ public virtual global::UltraCombos.Marvel.DrawHeroes.DataReply SendData(global::UltraCombos.Marvel.DrawHeroes.DataRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return SendData(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ public virtual global::UltraCombos.Marvel.DrawHeroes.DataReply SendData(global::UltraCombos.Marvel.DrawHeroes.DataRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.BlockingUnaryCall(__Method_SendData, null, options, request);
+ }
+ public virtual grpc::AsyncUnaryCall SendDataAsync(global::UltraCombos.Marvel.DrawHeroes.DataRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
+ {
+ return SendDataAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
+ }
+ public virtual grpc::AsyncUnaryCall SendDataAsync(global::UltraCombos.Marvel.DrawHeroes.DataRequest request, grpc::CallOptions options)
+ {
+ return CallInvoker.AsyncUnaryCall(__Method_SendData, null, options, request);
+ }
+ /// Creates a new instance of client from given ClientBaseConfiguration.
+ protected override ResourceClient NewInstance(ClientBaseConfiguration configuration)
+ {
+ return new ResourceClient(configuration);
+ }
+ }
+
+ /// Creates service definition that can be registered with a server
+ /// An object implementing the server-side handling logic.
+ public static grpc::ServerServiceDefinition BindService(ResourceBase serviceImpl)
+ {
+ return grpc::ServerServiceDefinition.CreateBuilder()
+ .AddMethod(__Method_GetPage, serviceImpl.GetPage)
+ .AddMethod(__Method_SendData, serviceImpl.SendData).Build();
+ }
+
+ }
+}
+#endregion
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/Ultracombos.Marvel.DrawHeroesGrpc.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/Ultracombos.Marvel.DrawHeroesGrpc.cs.meta
new file mode 100644
index 0000000..5f989cb
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/Ultracombos.Marvel.DrawHeroesGrpc.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0f8b6ebf6fdfc674482ee96abfbe077a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/UltracombosMarvelDrawHeroes.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/UltracombosMarvelDrawHeroes.cs
new file mode 100644
index 0000000..59717be
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/UltracombosMarvelDrawHeroes.cs
@@ -0,0 +1,813 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: Ultracombos.Marvel.DrawHeroes.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace UltraCombos.Marvel.DrawHeroes {
+
+ /// Holder for reflection information generated from Ultracombos.Marvel.DrawHeroes.proto
+ public static partial class UltracombosMarvelDrawHeroesReflection {
+
+ #region Descriptor
+ /// File descriptor for Ultracombos.Marvel.DrawHeroes.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static UltracombosMarvelDrawHeroesReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CiNVbHRyYWNvbWJvcy5NYXJ2ZWwuRHJhd0hlcm9lcy5wcm90bxIdVWx0cmFD",
+ "b21ib3MuTWFydmVsLkRyYXdIZXJvZXMiBwoFRW1wdHkiFAoGRGV2aWNlEgoK",
+ "AmlkGAEgASgFIiIKBFBhZ2USCgoCaWQYASABKAkSDgoGc2VyaWFsGAIgASgJ",
+ "ImAKC0RhdGFSZXF1ZXN0EgoKAmlkGAEgASgJEg4KBnNlcmlhbBgCIAEoCRIP",
+ "Cgdjb250ZW50GAMgASgMEhEKCXNpZ25hdHVyZRgEIAEoDBIRCgl0aHVtYm5h",
+ "aWwYBSABKAwiGwoJRGF0YVJlcGx5Eg4KBnJlc3VsdBgBIAEoCTLHAQoIUmVz",
+ "b3VyY2USVwoHR2V0UGFnZRIlLlVsdHJhQ29tYm9zLk1hcnZlbC5EcmF3SGVy",
+ "b2VzLkRldmljZRojLlVsdHJhQ29tYm9zLk1hcnZlbC5EcmF3SGVyb2VzLlBh",
+ "Z2UiABJiCghTZW5kRGF0YRIqLlVsdHJhQ29tYm9zLk1hcnZlbC5EcmF3SGVy",
+ "b2VzLkRhdGFSZXF1ZXN0GiguVWx0cmFDb21ib3MuTWFydmVsLkRyYXdIZXJv",
+ "ZXMuRGF0YVJlcGx5IgBiBnByb3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Marvel.DrawHeroes.Empty), global::UltraCombos.Marvel.DrawHeroes.Empty.Parser, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Marvel.DrawHeroes.Device), global::UltraCombos.Marvel.DrawHeroes.Device.Parser, new[]{ "Id" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Marvel.DrawHeroes.Page), global::UltraCombos.Marvel.DrawHeroes.Page.Parser, new[]{ "Id", "Serial" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Marvel.DrawHeroes.DataRequest), global::UltraCombos.Marvel.DrawHeroes.DataRequest.Parser, new[]{ "Id", "Serial", "Content", "Signature", "Thumbnail" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Marvel.DrawHeroes.DataReply), global::UltraCombos.Marvel.DrawHeroes.DataReply.Parser, new[]{ "Result" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ public sealed partial class Empty : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::UltraCombos.Marvel.DrawHeroes.UltracombosMarvelDrawHeroesReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Empty() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Empty(Empty other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Empty Clone() {
+ return new Empty(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Empty);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Empty other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Empty other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class Device : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Device());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::UltraCombos.Marvel.DrawHeroes.UltracombosMarvelDrawHeroesReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Device() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Device(Device other) : this() {
+ id_ = other.id_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Device Clone() {
+ return new Device(this);
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 1;
+ private int id_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Id {
+ get { return id_; }
+ set {
+ id_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Device);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Device other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Id != other.Id) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Id != 0) hash ^= Id.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Id != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Id);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Id != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Device other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Id != 0) {
+ Id = other.Id;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Id = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class Page : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Page());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::UltraCombos.Marvel.DrawHeroes.UltracombosMarvelDrawHeroesReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Page() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Page(Page other) : this() {
+ id_ = other.id_;
+ serial_ = other.serial_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Page Clone() {
+ return new Page(this);
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 1;
+ private string id_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Id {
+ get { return id_; }
+ set {
+ id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "serial" field.
+ public const int SerialFieldNumber = 2;
+ private string serial_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Serial {
+ get { return serial_; }
+ set {
+ serial_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Page);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Page other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Id != other.Id) return false;
+ if (Serial != other.Serial) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Id.Length != 0) hash ^= Id.GetHashCode();
+ if (Serial.Length != 0) hash ^= Serial.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Id.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Id);
+ }
+ if (Serial.Length != 0) {
+ output.WriteRawTag(18);
+ output.WriteString(Serial);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Id.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
+ }
+ if (Serial.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Serial);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Page other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Id.Length != 0) {
+ Id = other.Id;
+ }
+ if (other.Serial.Length != 0) {
+ Serial = other.Serial;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ Id = input.ReadString();
+ break;
+ }
+ case 18: {
+ Serial = input.ReadString();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class DataRequest : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DataRequest());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::UltraCombos.Marvel.DrawHeroes.UltracombosMarvelDrawHeroesReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public DataRequest() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public DataRequest(DataRequest other) : this() {
+ id_ = other.id_;
+ serial_ = other.serial_;
+ content_ = other.content_;
+ signature_ = other.signature_;
+ thumbnail_ = other.thumbnail_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public DataRequest Clone() {
+ return new DataRequest(this);
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 1;
+ private string id_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Id {
+ get { return id_; }
+ set {
+ id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "serial" field.
+ public const int SerialFieldNumber = 2;
+ private string serial_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Serial {
+ get { return serial_; }
+ set {
+ serial_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "content" field.
+ public const int ContentFieldNumber = 3;
+ private pb::ByteString content_ = pb::ByteString.Empty;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pb::ByteString Content {
+ get { return content_; }
+ set {
+ content_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "signature" field.
+ public const int SignatureFieldNumber = 4;
+ private pb::ByteString signature_ = pb::ByteString.Empty;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pb::ByteString Signature {
+ get { return signature_; }
+ set {
+ signature_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "thumbnail" field.
+ public const int ThumbnailFieldNumber = 5;
+ private pb::ByteString thumbnail_ = pb::ByteString.Empty;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pb::ByteString Thumbnail {
+ get { return thumbnail_; }
+ set {
+ thumbnail_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as DataRequest);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(DataRequest other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Id != other.Id) return false;
+ if (Serial != other.Serial) return false;
+ if (Content != other.Content) return false;
+ if (Signature != other.Signature) return false;
+ if (Thumbnail != other.Thumbnail) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Id.Length != 0) hash ^= Id.GetHashCode();
+ if (Serial.Length != 0) hash ^= Serial.GetHashCode();
+ if (Content.Length != 0) hash ^= Content.GetHashCode();
+ if (Signature.Length != 0) hash ^= Signature.GetHashCode();
+ if (Thumbnail.Length != 0) hash ^= Thumbnail.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Id.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Id);
+ }
+ if (Serial.Length != 0) {
+ output.WriteRawTag(18);
+ output.WriteString(Serial);
+ }
+ if (Content.Length != 0) {
+ output.WriteRawTag(26);
+ output.WriteBytes(Content);
+ }
+ if (Signature.Length != 0) {
+ output.WriteRawTag(34);
+ output.WriteBytes(Signature);
+ }
+ if (Thumbnail.Length != 0) {
+ output.WriteRawTag(42);
+ output.WriteBytes(Thumbnail);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Id.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
+ }
+ if (Serial.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Serial);
+ }
+ if (Content.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeBytesSize(Content);
+ }
+ if (Signature.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeBytesSize(Signature);
+ }
+ if (Thumbnail.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeBytesSize(Thumbnail);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(DataRequest other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Id.Length != 0) {
+ Id = other.Id;
+ }
+ if (other.Serial.Length != 0) {
+ Serial = other.Serial;
+ }
+ if (other.Content.Length != 0) {
+ Content = other.Content;
+ }
+ if (other.Signature.Length != 0) {
+ Signature = other.Signature;
+ }
+ if (other.Thumbnail.Length != 0) {
+ Thumbnail = other.Thumbnail;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ Id = input.ReadString();
+ break;
+ }
+ case 18: {
+ Serial = input.ReadString();
+ break;
+ }
+ case 26: {
+ Content = input.ReadBytes();
+ break;
+ }
+ case 34: {
+ Signature = input.ReadBytes();
+ break;
+ }
+ case 42: {
+ Thumbnail = input.ReadBytes();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class DataReply : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DataReply());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::UltraCombos.Marvel.DrawHeroes.UltracombosMarvelDrawHeroesReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public DataReply() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public DataReply(DataReply other) : this() {
+ result_ = other.result_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public DataReply Clone() {
+ return new DataReply(this);
+ }
+
+ /// Field number for the "result" field.
+ public const int ResultFieldNumber = 1;
+ private string result_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Result {
+ get { return result_; }
+ set {
+ result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as DataReply);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(DataReply other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Result != other.Result) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Result.Length != 0) hash ^= Result.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Result.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Result);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Result.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Result);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(DataReply other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Result.Length != 0) {
+ Result = other.Result;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ Result = input.ReadString();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/UltracombosMarvelDrawHeroes.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/UltracombosMarvelDrawHeroes.cs.meta
new file mode 100644
index 0000000..86b65a3
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Grpc/UltracombosMarvelDrawHeroes.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d91f02c2d4a19654fbed3a7abe9380a7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ImageFader.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ImageFader.cs
new file mode 100644
index 0000000..7e0c256
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ImageFader.cs
@@ -0,0 +1,55 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace UltraCombos
+{
+ public class ImageFader : MonoBehaviour
+ {
+ CanvasGroup canvas_group;
+ float fade_stamp;
+ AnimationCurve curve;
+
+ bool is_active = true;
+ const float fading = 0.3f;
+
+ const float eps = 0.5f / 255.0f;
+
+ private void Start()
+ {
+ canvas_group = GetComponent();
+ if (canvas_group == null)
+ canvas_group = gameObject.AddComponent();
+ canvas_group.alpha = 1.0f;
+
+ curve = AnimationCurve.EaseInOut(0, 0, 1, 1);
+
+ SetActive(false);
+ }
+
+ private void FixedUpdate()
+ {
+ float a = canvas_group.alpha;
+ float b = is_active ? 1 : 0;
+
+ if (Mathf.Abs(a - b) < eps)
+ {
+ canvas_group.alpha = b;
+ }
+ else
+ {
+ float t = Time.fixedDeltaTime * 8.0f;
+ canvas_group.alpha = Mathf.Lerp(a, b, t);
+ }
+ }
+
+ public void SetActive(bool value)
+ {
+ fade_stamp = Time.time;
+ is_active = canvas_group.blocksRaycasts = canvas_group.interactable = value;
+
+ }
+ }
+
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ImageFader.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ImageFader.cs.meta
new file mode 100644
index 0000000..d14ea44
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ImageFader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9ace21b5923f6d946b893dcd51b83f20
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LastPaintingImage.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LastPaintingImage.cs
new file mode 100644
index 0000000..b2c74a3
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LastPaintingImage.cs
@@ -0,0 +1,26 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ [RequireComponent(typeof(RawImage))]
+ public class LastPaintingImage : MonoBehaviour
+ {
+ RawImage image;
+
+ private void Start()
+ {
+ image = GetComponent();
+ }
+
+ private void Update()
+ {
+ if (image.texture == null)
+ {
+ image.texture = AppData.Instance.lastPainting;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LastPaintingImage.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LastPaintingImage.cs.meta
new file mode 100644
index 0000000..ec02c7c
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LastPaintingImage.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 47b15dbef5eb46140a92fffa0f17cfcb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LineScaleManager.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LineScaleManager.cs
new file mode 100644
index 0000000..5940328
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LineScaleManager.cs
@@ -0,0 +1,55 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace UltraCombos.Coloring
+{
+ [RequireComponent(typeof(CanvasGroup))]
+ public class LineScaleManager : MonoBehaviour
+ {
+ public float maxSize = 1.0f;
+ public float minSize = 0.5f;
+ public Image colorImage;
+ public Button pointer;
+ public global::PaintCraft.Tools.LineConfig lineConfig;
+
+ CanvasGroup group;
+ bool is_active = true;
+
+ private void Start()
+ {
+ var slider = GetComponentInChildren();
+ slider.value = 1;
+ slider.minValue = minSize;
+ slider.maxValue = maxSize;
+ slider.onValueChanged.AddListener(OnValueChanged);
+
+ group = GetComponent();
+ }
+
+ private void Update()
+ {
+ colorImage.color = pointer.colors.normalColor;
+ }
+
+ private void FixedUpdate()
+ {
+ group.interactable = group.blocksRaycasts = is_active;
+ group.alpha = Mathf.Lerp(group.alpha, is_active ? 1.0f : 0.0f, Time.fixedDeltaTime * 8.0f);
+ }
+
+ public void OnValueChanged(float value)
+ {
+ colorImage.transform.localScale = Vector3.one * value;
+ lineConfig.Scale = value;
+ }
+
+ public void SetActive(bool v)
+ {
+ is_active = v;
+ }
+ }
+
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LineScaleManager.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LineScaleManager.cs.meta
new file mode 100644
index 0000000..e91af46
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/LineScaleManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d59c368af446605458d6c225c1625f8a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PageManager.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PageManager.cs
new file mode 100644
index 0000000..eea2478
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PageManager.cs
@@ -0,0 +1,52 @@
+using PaintCraft.Canvas.Configs;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class PageManager : MonoBehaviour
+ {
+ public List names = new List();
+
+ [Space(10)]
+ public UnityEvent onSelected = new UnityEvent();
+
+ private void Start()
+ {
+ var pages = AppData.Instance.pages;
+ foreach (var n in names)
+ {
+ if (pages.ContainsKey(n))
+ continue;
+ string id = $"{n}";
+ var config = ScriptableObject.CreateInstance();
+ config.name = $"Page-{id}";
+ config.UniqueId = $"{id}";
+ config.startImagePath = $"Marvel/start_{id}";
+ config.outlinePath = $"Marvel/outline_{id}";
+ config.RegionPath = $"Marvel/regions_{id}";
+ config.IconPath = $"Marvel/icon";
+ pages.Add(id, config);
+ }
+ Debug.Log($"[Page Manager] Add {pages.Count} pages.");
+ }
+
+ public void SetSelectedPage(string page)
+ {
+ var pages = AppData.Instance.pages;
+ if (pages.ContainsKey(page))
+ {
+ global::PaintCraft.Canvas.AppData.SelectedPageConfig = pages[page];
+ onSelected.Invoke();
+ }
+ else
+ {
+ Debug.Log($"[Page Manager] Page-{page} is not found.");
+ }
+
+ }
+ }
+
+}
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PageManager.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PageManager.cs.meta
new file mode 100644
index 0000000..36c67c2
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PageManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a6458bcce7ab91d4d955627578bf68be
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PaintSender.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PaintSender.cs
new file mode 100644
index 0000000..9b95f8e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PaintSender.cs
@@ -0,0 +1,167 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class PaintSender : MonoBehaviour
+ {
+ [SerializeField]
+ float interval = 1.0f;
+
+ public PaintCraft.CanvasController canvas;
+
+ ResourceClient client;
+
+ Coroutine coroutine = null;
+
+ public global::PaintCraft.Canvas.Configs.PageConfig signaturePage;
+
+ [Space(10)]
+ public UnityEvent onPaintingSaved = new UnityEvent();
+
+ private void Start()
+ {
+
+ }
+
+ public void SavePainting()
+ {
+ if (coroutine == null)
+ {
+ coroutine = StartCoroutine(DoSavePainting());
+ }
+ }
+
+ public void SavePaintingAndSignature()
+ {
+ if (coroutine == null)
+ {
+ coroutine = StartCoroutine(DoSavePaintingAndSignature());
+ }
+ }
+
+ IEnumerator DoSavePainting()
+ {
+ yield return canvas.MakeColoringTexture();
+
+ var data = AppData.Instance;
+
+ if (data.lastPainting == null)
+ {
+ data.lastPainting = new Texture2D(canvas.ColoringTexture.width, canvas.ColoringTexture.height, canvas.ColoringTexture.format, false);
+ }
+
+ Graphics.CopyTexture(canvas.ColoringTexture, data.lastPainting);
+ data.lastPainting.Apply();
+ data.lastPainting.name = $"painting - {data.serial}";
+
+ if (data.lastThumbnail == null)
+ {
+ data.lastThumbnail = new Texture2D(canvas.ThumbnailTexture.width, canvas.ThumbnailTexture.height, canvas.ThumbnailTexture.format, false);
+ }
+
+ Graphics.CopyTexture(canvas.ThumbnailTexture, data.lastThumbnail);
+ data.lastThumbnail.Apply();
+ data.lastThumbnail.name = $"thumbnail - {data.serial}";
+
+ global::PaintCraft.Canvas.AppData.SelectedPageConfig = signaturePage;
+
+ onPaintingSaved.Invoke();
+
+ yield return new WaitForSeconds(interval);
+
+ coroutine = null;
+ }
+
+ IEnumerator DoSavePaintingAndSignature()
+ {
+ //Debug.Log("DoSavePaintingAndSignature");
+ yield return canvas.MakeColoringTexture();
+
+ var data = AppData.Instance;
+
+ if (data.lastPainting == null)
+ {
+ data.lastPainting = new Texture2D(canvas.ColoringTexture.width, canvas.ColoringTexture.height, canvas.ColoringTexture.format, false);
+ }
+
+ Graphics.CopyTexture(canvas.ColoringTexture, data.lastPainting);
+ data.lastPainting.Apply();
+ data.lastPainting.name = $"painting - {data.serial}";
+
+ yield return null;
+
+ if (data.lastThumbnail == null)
+ {
+ data.lastThumbnail = new Texture2D(canvas.ThumbnailTexture.width, canvas.ThumbnailTexture.height, canvas.ThumbnailTexture.format, false);
+ }
+
+ Graphics.CopyTexture(canvas.ThumbnailTexture, data.lastThumbnail);
+ data.lastThumbnail.Apply();
+ data.lastThumbnail.name = $"thumbnail - {data.serial}";
+
+ yield return null;
+
+ if (data.lastSignature == null)
+ {
+ data.lastSignature = new Texture2D(64, 64, TextureFormat.RGBA32, false);
+ data.lastSignature.name = $"signature - empty";
+ }
+
+ yield return new WaitForSeconds(interval);
+
+ onPaintingSaved.Invoke();
+
+ coroutine = null;
+ //Debug.Log("DoSavePaintingAndSignature is done.");
+ }
+
+ public void Send()
+ {
+ if (coroutine == null)
+ {
+ if (client == null)
+ {
+ client = GetComponent();
+ }
+
+ coroutine = StartCoroutine(DoSend());
+ }
+ }
+
+ IEnumerator DoSaveSignature()
+ {
+ yield return canvas.MakeColoringTexture();
+
+ var data = AppData.Instance;
+
+ if (data.lastSignature == null)
+ {
+ data.lastSignature = new Texture2D(canvas.ColoringTexture.width, canvas.ColoringTexture.height, canvas.ColoringTexture.format, false);
+ }
+ Graphics.CopyTexture(canvas.ColoringTexture, data.lastSignature);
+ data.lastSignature.Apply();
+ data.lastSignature.name = $"signature - {data.serial}";
+
+ coroutine = null;
+ }
+
+ IEnumerator DoSend()
+ {
+ //yield return DoSaveSignature();
+
+ var data = AppData.Instance;
+
+ if (AppData.Instance.dev == false)
+ client.SendData(data.lastThumbnail, data.lastSignature, data.lastThumbnail);
+
+ yield return new WaitForSeconds(interval);
+
+ coroutine = null;
+ }
+ }
+}
+
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PaintSender.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PaintSender.cs.meta
new file mode 100644
index 0000000..7061f4f
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/PaintSender.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c3d755f139f20dc4bb877ead0f967023
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Pivot.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Pivot.cs
new file mode 100644
index 0000000..119769e
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Pivot.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ [RequireComponent(typeof(CanvasGroup))]
+ public class Pivot : MonoBehaviour
+ {
+ CanvasGroup group;
+
+ public Vector3 Position { get { return transform.position; } }
+
+ private void Start()
+ {
+ group = GetComponent();
+ group.interactable = group.blocksRaycasts = false;
+ group.alpha = 0;
+ }
+ }
+
+}
+
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Pivot.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Pivot.cs.meta
new file mode 100644
index 0000000..c20faea
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/Pivot.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e1863de8d04562d40b3a9e6be058ed93
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ResourceClient.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ResourceClient.cs
new file mode 100644
index 0000000..b8832c7
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ResourceClient.cs
@@ -0,0 +1,123 @@
+//#define TEXTURE_RAW_DATA
+
+using Grpc.Core;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Events;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class ResourceClient : GrpcClientBase
+ {
+
+ [Configuration.Config]
+ public string overrideHost = "127.0.0.1";
+
+ [System.Serializable]
+ public class PageEvent : UnityEvent { }
+
+ [Space(10)]
+ [Header("Draw Your Own Heroes")]
+ public PageEvent onPageReceived = new PageEvent();
+ public UnityEvent onTextureSent = new UnityEvent();
+
+ private void Start()
+ {
+ DebugInformation.Instance.UpdateProperty("Local IP", $"{Utility.Network.GetLocalIPAddress()}");
+ }
+
+ private void Update()
+ {
+ if (channel == null || host.Equals(overrideHost) == false)
+ {
+ Init();
+ }
+
+ DebugInformation.Instance.UpdateProperty(name, $"{host}:{port}");
+ }
+
+ private void Init()
+ {
+ host = overrideHost;
+ var options = new List { new ChannelOption(ChannelOptions.MaxSendMessageLength, int.MaxValue) };
+ Connect(options);
+ }
+
+ bool is_index_got = false;
+
+ public void GetPage()
+ {
+ if (State != ChannelState.Ready || is_index_got)
+ return;
+
+ GetPageAsync();
+ }
+
+ private async void GetPageAsync()
+ {
+ try
+ {
+ var data = AppData.Instance;
+ is_index_got = true;
+ var client = new Resource.ResourceClient(channel);
+ var reply = await client.GetPageAsync(new Device() { Id = data.deviceId });
+ Log($"OnPageReceived: {reply.Id}");
+ data.roleId = reply.Id;
+ data.serial = reply.Serial;
+ onPageReceived.Invoke(reply.Id);
+ }
+ catch (System.Exception e)
+ {
+ Log(e.Message, LogType.Error);
+ is_index_got = false;
+ }
+ }
+
+ bool is_data_sent = false;
+
+ public void SendData(Texture2D painting, Texture2D signature, Texture2D thumbnail)
+ {
+ if (State != ChannelState.Ready || is_data_sent)
+ return;
+#if false
+ var content = tex.GetRawTextureData();
+#else
+ //var content = tex.EncodeToJPG();
+ var painting_content = painting.EncodeToPNG();
+ var signature_content = signature.EncodeToPNG();
+ var thumbnail_content = thumbnail.EncodeToPNG();
+#endif
+
+ var data = AppData.Instance;
+
+ SendDataAsync(new DataRequest()
+ {
+ Id = data.roleId,
+ Serial = data.serial,
+ Content = Google.Protobuf.ByteString.CopyFrom(painting_content),
+ Signature = Google.Protobuf.ByteString.CopyFrom(signature_content),
+ Thumbnail = Google.Protobuf.ByteString.CopyFrom(thumbnail_content),
+ });
+ }
+
+ private async void SendDataAsync(DataRequest request)
+ {
+ try
+ {
+ is_data_sent = true;
+ var client = new Resource.ResourceClient(channel);
+ var reply = await client.SendDataAsync(request);
+
+ Log(reply.Result);
+
+ onTextureSent.Invoke();
+ }
+ catch (System.Exception e)
+ {
+ is_data_sent = false;
+ Log(e.Message, LogType.Error);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ResourceClient.cs.meta b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ResourceClient.cs.meta
new file mode 100644
index 0000000..30f4d0b
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/ResourceClient.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ad52d55475487ce47b859154b5f46eea
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/RoleLocationManager.cs b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/RoleLocationManager.cs
new file mode 100644
index 0000000..f5d1b79
--- /dev/null
+++ b/Unity-19050-03_RoyalGallery_iPad/Assets/DrawYourOwnHeroes/Script/RoleLocationManager.cs
@@ -0,0 +1,119 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace UltraCombos.Marvel.DrawHeroes
+{
+ public class RoleLocationManager : MonoBehaviour
+ {
+ public RectTransform highlight;
+ public RectTransform magnify;
+ public Vector4 magnifyScale;
+
+ [Header("Debug")]
+ public bool mode = false;
+ [Range(0, 20)]
+ public int index = 0;
+
+ Dictionary roles;
+ RectTransform target_role;
+ List target_positions;
+
+ private void Start()
+ {
+ var role_images = GetComponentsInChildren();
+
+ roles = new Dictionary();
+ for (int i = 0; i < role_images.Length; i++)
+ {
+ if (i == 0)
+ continue;
+ var img = role_images[i];
+ roles.Add(img.name, img);
+ img.gameObject.SetActive(false);
+ }
+
+#if UNITY_EDITOR
+ if (string.IsNullOrEmpty(AppData.Instance.roleId))
+ {
+ AppData.Instance.roleId = "ca";
+ }
+#endif
+
+ string id = $"Role-{AppData.Instance.roleId}";
+ if (roles.ContainsKey(id))
+ {
+ var role = roles[id];
+ role.texture = AppData.Instance.lastPainting;
+ role.gameObject.SetActive(true);
+ //highlight.position = roles[id].transform.position;
+ target_role = roles[id].rectTransform;
+ }
+
+ var canvas = GetComponentInParent