From 8aa8e4c77aa71c90f5b29cb62bd9890e9652de21 Mon Sep 17 00:00:00 2001 From: kimura Date: Wed, 20 Oct 2021 19:03:05 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A6=96=E8=81=B4=E5=A4=B1=E6=95=97=E3=83=80?= =?UTF-8?q?=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/Main/WatchMovieFailure.unity | 29 ++++++++++++++----- .../MyGame/Scripts/VideoFailToLoadDialog.cs | 29 +++++++++++++++++++ .../Scripts/VideoFailToLoadDialog.cs.meta | 3 ++ 3 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs create mode 100644 popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs.meta diff --git a/popcorn/Assets/MyGame/Scenes/Main/WatchMovieFailure.unity b/popcorn/Assets/MyGame/Scenes/Main/WatchMovieFailure.unity index 902fcbc9..34b83481 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/WatchMovieFailure.unity +++ b/popcorn/Assets/MyGame/Scenes/Main/WatchMovieFailure.unity @@ -153,7 +153,7 @@ RectTransform: - {fileID: 1944724933} - {fileID: 385302319} m_Father: {fileID: 699828831} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -415,6 +415,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: + - {fileID: 1335450095} - {fileID: 699828831} m_Father: {fileID: 0} m_RootOrder: 0 @@ -433,6 +434,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 699828831} + - component: {fileID: 699828832} m_Layer: 5 m_Name: Window m_TagString: Untagged @@ -451,17 +453,30 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 1335450095} - {fileID: 1919735135} - {fileID: 4677966} m_Father: {fileID: 688506544} - m_RootOrder: 0 + m_RootOrder: 1 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: 57} m_SizeDelta: {x: 705, y: 550} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &699828832 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 699828830} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9f6d1b5b8f3a49e4a93060301fc842db, type: 3} + m_Name: + m_EditorClassIdentifier: + backgroundAnimator: {fileID: 1335450096} + closeButton: {fileID: 1544360571} --- !u!1 &1115168610 GameObject: m_ObjectHideFlags: 0 @@ -640,12 +655,12 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] - m_Father: {fileID: 699828831} + m_Father: {fileID: 688506544} 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: -56.999996} + m_AnchoredPosition: {x: 0, y: 0.00004196167} m_SizeDelta: {x: 2048, y: 2732} m_Pivot: {x: 0.5, y: 0.5} --- !u!95 &1335450096 @@ -681,7 +696,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 0.9372549, a: 0.19607843} - m_RaycastTarget: 0 + m_RaycastTarget: 1 m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -870,7 +885,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 699828831} - m_RootOrder: 1 + 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} diff --git a/popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs b/popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs new file mode 100644 index 00000000..17bed5dc --- /dev/null +++ b/popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs @@ -0,0 +1,29 @@ +using System; +using UniRx; +using UnityEngine; +using UnityEngine.UI; + +namespace MyGame.Scripts +{ + public class VideoFailToLoadDialog : MonoBehaviour + { + private static readonly int OpenTrigger = Animator.StringToHash("OpenTrigger"); + private static readonly int CloseTrigger = Animator.StringToHash("CloseTrigger"); + + [SerializeField] private Animator backgroundAnimator; + [SerializeField] private Button closeButton; + + private void Start() + { + closeButton.OnClickAsObservable().Subscribe(_ => + { + transform.parent.SetLocalScale(0); + backgroundAnimator.SetTrigger(CloseTrigger); + this.CallWaitForSeconds(.25f, () => + { + TransitionManager.Instance.UnloadScene(GameScenes.WatchMovieFailure); + }); + }).AddTo(this); + } + } +} \ No newline at end of file diff --git a/popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs.meta b/popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs.meta new file mode 100644 index 00000000..26212eb9 --- /dev/null +++ b/popcorn/Assets/MyGame/Scripts/VideoFailToLoadDialog.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9f6d1b5b8f3a49e4a93060301fc842db +timeCreated: 1634695717 \ No newline at end of file