diff --git a/Assets/MainScene.unity b/Assets/MainScene.unity index 7a21816..53bea80 100644 --- a/Assets/MainScene.unity +++ b/Assets/MainScene.unity @@ -155,6 +155,7 @@ RectTransform: - {fileID: 829833583} - {fileID: 1208856122} - {fileID: 1611173891} + - {fileID: 1056662978} m_Father: {fileID: 1407544729} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -307,7 +308,7 @@ VideoPlayer: m_EnabledAudioTracks: 01 m_DirectAudioMutes: 00 m_ControlledAudioTrackCount: 1 - m_PlayOnAwake: 1 + m_PlayOnAwake: 0 m_SkipOnDrop: 1 m_Looping: 0 m_WaitForFirstFrame: 1 @@ -331,6 +332,85 @@ Transform: - {fileID: 1139932278} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &497138741 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 497138742} + - component: {fileID: 497138744} + - component: {fileID: 497138743} + m_Layer: 5 + m_Name: Text (Legacy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &497138742 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 497138741} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1056662978} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &497138743 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 497138741} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 22 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: 3 +--- !u!222 &497138744 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 497138741} + m_CullTransparentMesh: 1 --- !u!1 &519420028 GameObject: m_ObjectHideFlags: 0 @@ -367,7 +447,7 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -493,7 +573,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Button + m_Text: 2 --- !u!222 &673983701 CanvasRenderer: m_ObjectHideFlags: 0 @@ -572,7 +652,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Button + m_Text: "\u5F00\u59CB" --- !u!222 &819521447 CanvasRenderer: m_ObjectHideFlags: 0 @@ -760,9 +840,156 @@ MonoBehaviour: m_EditorClassIdentifier: player: {fileID: 357243465} clips: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} + - {fileID: 32900000, guid: 9a44e1349eeb6e04bbe3097d266a7164, type: 3} + - {fileID: 32900000, guid: 22db7d270a401d242a713a2799e94fdb, type: 3} + - {fileID: 32900000, guid: c78f5fb90e9eddd45b17488b0c02d2eb, type: 3} + buttons: + - {fileID: 829833582} + - {fileID: 1208856121} + - {fileID: 1611173890} + - {fileID: 1056662977} + endButtons_0: 0100000002000000 + endButtons_1: 03000000 + endButtons_2: + endButtons_3: + endButtons_4: + endButtons_5: + endButtons_6: + endButtons_7: + endButtons_8: +--- !u!1 &1056662977 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1056662978} + - component: {fileID: 1056662981} + - component: {fileID: 1056662980} + - component: {fileID: 1056662979} + m_Layer: 5 + m_Name: Button (Legacy) (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1056662978 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1056662977} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 497138742} + m_Father: {fileID: 17715543} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 200, y: 80} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1056662979 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1056662977} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1056662980} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 901215817} + m_TargetAssemblyTypeName: + m_MethodName: + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &1056662980 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1056662977} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1056662981 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1056662977} + m_CullTransparentMesh: 1 --- !u!1 &1139932275 GameObject: m_ObjectHideFlags: 0 @@ -914,14 +1141,14 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 901215817} - m_TargetAssemblyTypeName: - m_MethodName: - m_Mode: 1 + - m_Target: {fileID: 901215819} + m_TargetAssemblyTypeName: Coltroller, Assembly-CSharp + m_MethodName: PlayVideo + m_Mode: 3 m_Arguments: m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: - m_IntArgument: 0 + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 1 m_FloatArgument: 0 m_StringArgument: m_BoolArgument: 0 @@ -1270,7 +1497,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: Button + m_Text: 1 --- !u!222 &1994506420 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Controller.cs b/Assets/Scripts/Controller.cs index dabb066..df596b4 100644 --- a/Assets/Scripts/Controller.cs +++ b/Assets/Scripts/Controller.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using Unity.VisualScripting; using UnityEngine; using UnityEngine.Video; @@ -7,8 +8,10 @@ public class Coltroller : MonoBehaviour { public VideoPlayer player; public List clips = new List(); + public List buttons = new List(); int currentIndex = 0; + List[] jumpList = new List[9]; public List endButtons_0 = new List(); public List endButtons_1 = new List(); @@ -17,23 +20,72 @@ public class Coltroller : MonoBehaviour public List endButtons_4 = new List(); public List endButtons_5 = new List(); public List endButtons_6 = new List(); + public List endButtons_7 = new List(); + public List endButtons_8 = new List(); - // Start is called before the first frame update - void Start() + private void Awake() { - + jumpList[0] = endButtons_0; + jumpList[1] = endButtons_1; + jumpList[2] = endButtons_2; + jumpList[3] = endButtons_3; + jumpList[4] = endButtons_4; + jumpList[5] = endButtons_5; + jumpList[6] = endButtons_6; + jumpList[7] = endButtons_7; + jumpList[8] = endButtons_8; + } + + private void Start() + { + foreach (GameObject g in buttons) + { + if (g != null) + { + g.SetActive(false); + } + } + + buttons[0].SetActive(true); } - // Update is called once per frame void Update() { - + if (player.isPlaying) + { + double timeLeft = player.clip.length - player.time; + if (timeLeft < 0.3) + { + player.Pause(); + + foreach (int i in jumpList[currentIndex]) + { + if (buttons[i] != null) + { + buttons[i].SetActive(true); + } + } + + } + } } public void PlayVideo(int _index) { - + currentIndex = _index; + + player.clip = clips[_index]; + player.Play(); + + foreach (GameObject g in buttons) + { + g.SetActive(false); + } } + public void Close() + { + Application.Quit(); + } } diff --git a/Assets/Videos/00.mp4 b/Assets/Videos/00.mp4 new file mode 100644 index 0000000..e6563f0 Binary files /dev/null and b/Assets/Videos/00.mp4 differ diff --git a/Assets/Videos/录制_2024_01_29_21_03_41_459.mp4.meta b/Assets/Videos/00.mp4.meta similarity index 54% rename from Assets/Videos/录制_2024_01_29_21_03_41_459.mp4.meta rename to Assets/Videos/00.mp4.meta index a6d18a9..289cb73 100644 --- a/Assets/Videos/录制_2024_01_29_21_03_41_459.mp4.meta +++ b/Assets/Videos/00.mp4.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e03b55270e380ab4491b11d000f0dd54 +guid: 9a44e1349eeb6e04bbe3097d266a7164 VideoClipImporter: externalObjects: {} serializedVersion: 2 @@ -12,16 +12,7 @@ VideoClipImporter: flipVertical: 0 flipHorizontal: 0 importAudio: 1 - targetSettings: - 0: - enableTranscoding: 1 - codec: 0 - resizeFormat: 0 - aspectRatio: 0 - customWidth: 1064 - customHeight: 596 - bitrateMode: 2 - spatialQuality: 2 + targetSettings: {} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Videos/01.mp4 b/Assets/Videos/01.mp4 new file mode 100644 index 0000000..4344ea3 Binary files /dev/null and b/Assets/Videos/01.mp4 differ diff --git a/Assets/Videos/01.mp4.meta b/Assets/Videos/01.mp4.meta new file mode 100644 index 0000000..50e6066 --- /dev/null +++ b/Assets/Videos/01.mp4.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 22db7d270a401d242a713a2799e94fdb +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Videos/02.mp4 b/Assets/Videos/02.mp4 new file mode 100644 index 0000000..5b9d815 Binary files /dev/null and b/Assets/Videos/02.mp4 differ diff --git a/Assets/Videos/02.mp4.meta b/Assets/Videos/02.mp4.meta new file mode 100644 index 0000000..014c068 --- /dev/null +++ b/Assets/Videos/02.mp4.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c78f5fb90e9eddd45b17488b0c02d2eb +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Videos/录制_2024_01_29_21_03_41_459.mp4 b/Assets/Videos/录制_2024_01_29_21_03_41_459.mp4 deleted file mode 100644 index 4b1454d..0000000 Binary files a/Assets/Videos/录制_2024_01_29_21_03_41_459.mp4 and /dev/null differ