From 4da804c2c17b99e9257289c54aaa45ee127862e3 Mon Sep 17 00:00:00 2001 From: tigerchen Date: Tue, 3 Dec 2019 14:33:50 +0800 Subject: [PATCH] add movie player --- .../Assets/Scenes/DarkSea.unity | 42 ++++++++++++++++++- .../Assets/Scripts/movieController.cs | 14 ++++++- .../Assets/Scripts/tuio_event.cs | 2 +- .../Videos/New UltraCombos.DShowClip.asset | 2 +- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity index 333ec4e..1fe51e4 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity @@ -413,6 +413,11 @@ PrefabInstance: propertyPath: m_Pivot.y value: 0.5 objectReference: {fileID: 0} + - target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8, + type: 3} + propertyPath: m_LocalScale.y + value: -1 + objectReference: {fileID: 0} - target: {fileID: 2829506254029656376, guid: 8bbc036a3be21954681613cbe4f0e9a8, type: 3} propertyPath: tuio_event @@ -461,7 +466,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 600} - m_SizeDelta: {x: 2585, y: 1200} + m_SizeDelta: {x: 2527, y: 1200} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &503604497 MonoBehaviour: @@ -786,7 +791,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: -600} - m_SizeDelta: {x: 2585, y: 1200} + m_SizeDelta: {x: 2527, y: 1200} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &797223805 MonoBehaviour: @@ -1147,6 +1152,39 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 490275147} m_PrefabAsset: {fileID: 0} +--- !u!114 &1996081109 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1996081105} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 03dae28dfe6734f4eb76c922ac72dd34, type: 3} + m_Name: + m_EditorClassIdentifier: + target: 0 + materials: [] + attributeName: + targetObject: {fileID: 1996081105} +--- !u!114 &1996081110 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1996081105} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 10f07b3f9fb96524db93eb42d89c229c, type: 3} + m_Name: + m_EditorClassIdentifier: + VideoAsset: {fileID: 11400000, guid: 232980c200b699741a54e99e165d86a2, type: 2} + LoadOnAwake: 1 + PlayOnStart: 1 + Looping: 1 + AudioVolume: 0 --- !u!1 &2044104306 GameObject: m_ObjectHideFlags: 0 diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs index dd3e725..a7008e6 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs @@ -1,10 +1,14 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.Events; using UnityEngine.UI; +using UltraCombos; public class movieController : MonoBehaviour { + //[RequireComponent(typeof(DShowMoviePlayer))] + DShowMoviePlayer player; public float totalTime = 0.5f; public int id; public tuio_event tuio_event; @@ -12,9 +16,15 @@ public class movieController : MonoBehaviour public int stat; float c; Vector2 pos, pre_pos; - + + void Awake() + { + player = GetComponent(); + } + void Start() { + //player = GetComponent(); GetComponent().color = Color.clear; pos = Vector2.zero; } @@ -61,10 +71,12 @@ public class movieController : MonoBehaviour stat = 1; c = 0f; Debug.Log("Hi"); + player.Frame = (uint)Random.Range(0, player.TotalNumFrames); } private void OnDestroy() { Debug.Log("Bye"); + player.Stop(); } } diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs index b6d1fce..6e7637b 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs @@ -70,7 +70,7 @@ public class tuio_event : MonoBehaviour void reset_id() { GameObject[] objs = GameObject.FindGameObjectsWithTag("onFoot"); - Debug.Log(objs.Length); + //Debug.Log(objs.Length); for (int i = 0; i < objs.Length; i++) { objs[i].GetComponent().id = i - 1; diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset index 00b3727..8ac65e0 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset @@ -13,5 +13,5 @@ MonoBehaviour: m_Name: New UltraCombos.DShowClip m_EditorClassIdentifier: m_VideoLocation: 1 - m_VideoPath: ..\..\_Deploy_PC\08_DarkSea\Material\Video_buttombracket.avi + m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Material\Video_buttombracket.avi animationClip: {fileID: 0}