From 93525182bbb6a55025c16c0621592abefe0f72f6 Mon Sep 17 00:00:00 2001 From: LH Date: Tue, 10 Dec 2019 21:12:58 +0800 Subject: [PATCH] [03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC] Added spout feature. --- .../Assets/RoyalGalleryPortrait.unity | 60 +++++++++++++++++++ .../Script/SpoutSenderController.cs | 58 ++++++++++++++++++ .../Script/SpoutSenderController.cs.meta | 11 ++++ .../Packages/manifest.json | 3 +- 4 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs create mode 100644 03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs.meta diff --git a/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait.unity b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait.unity index 5b38eda..8e53a1c 100644 --- a/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait.unity +++ b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait.unity @@ -2070,6 +2070,7 @@ GameObject: - component: {fileID: 841726154} - component: {fileID: 841726153} - component: {fileID: 841726156} + - component: {fileID: 841726157} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -2189,6 +2190,20 @@ MonoBehaviour: CanvasTint: {r: 1, g: 1, b: 1, a: 1} flipY: 0 geomFlipY: 1 +--- !u!114 &841726157 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 841726152} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e7ebb928551598b458017c1d9ba3863f, type: 3} + m_Name: + m_EditorClassIdentifier: + isEnableSpout: 0 + sender: {fileID: 1215315276} --- !u!1 &891482387 GameObject: m_ObjectHideFlags: 0 @@ -3139,6 +3154,51 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1182070069} m_CullTransparentMesh: 0 +--- !u!1 &1215315275 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1215315278} + - component: {fileID: 1215315276} + m_Layer: 0 + m_Name: SpoutSenderRG + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1215315276 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1215315275} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45099d624c1e6c14e9514f4e5ea1ed9c, type: 3} + m_Name: + m_EditorClassIdentifier: + _sourceTexture: {fileID: 8400000, guid: 426d5362c4e5d0942af76fa4789d70e2, type: 2} + _alphaSupport: 0 +--- !u!4 &1215315278 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1215315275} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 18.269424, y: 207.27754, z: 99.554535} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1259440794 GameObject: m_ObjectHideFlags: 0 diff --git a/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs new file mode 100644 index 0000000..cfc0931 --- /dev/null +++ b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs @@ -0,0 +1,58 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace UltraCombos.Frozen +{ + [RequireComponent(typeof(Camera))] + public class SpoutSenderController : MonoBehaviour + { + [Configuration.Config] + public bool isEnableSpout; + public Klak.Spout.SpoutSender sender; + + Camera camera; + private bool m_isEnable; + bool isEnable + { + get + { + return m_isEnable; + } + + set + { + if (value == m_isEnable) + { + return; + } + + + if (value) + { + sender.enabled = true; + camera.targetTexture = sender.sourceTexture; + } + else + { + sender.enabled = false; + camera.targetTexture = null; + } + + m_isEnable = value; + } + } + + // Start is called before the first frame update + void Start() + { + camera = GetComponent(); + } + + // Update is called once per frame + void Update() + { + isEnable = isEnableSpout; + } + } +} diff --git a/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs.meta b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs.meta new file mode 100644 index 0000000..e67bcc7 --- /dev/null +++ b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Assets/RoyalGalleryPortrait/Script/SpoutSenderController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e7ebb928551598b458017c1d9ba3863f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Packages/manifest.json b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Packages/manifest.json index aace9b2..490aa8f 100644 --- a/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Packages/manifest.json +++ b/03_RoyalGallery/Unity-19050-03_RoyalGallery_Portrait_PC/19050-03_RoyalGallery_Portrait_PC/Packages/manifest.json @@ -6,7 +6,8 @@ "com.ultracombos.movie-player": "file:/../../../../../_Package/com.ultracombos.movie-player", "com.ultracombos.utility-native-plugin": "file:/../../../../../_Package/com.ultracombos.utility-native-plugin", "com.ultracombos.frozen.royal-gallery-asset": "file:/../../../../../_Package/com.ultracombos.frozen.royal-gallery-asset", - "com.ultracombos.flockaroo": "file:/../../../../../_Package/com.ultracombos.flockaroo", + "com.ultracombos.flockaroo": "file:/../../../../../_Package/com.ultracombos.flockaroo", + "jp.keijiro.klak.spout": "file:/../../../../../_Package/KlakSpout", "com.unity.2d.animation": "1.0.16-preview.1", "com.unity.collab-proxy": "1.2.15", "com.unity.package-manager-ui": "2.0.8",