Skip to content

Commit

Permalink
Letterbox intro video
Browse files Browse the repository at this point in the history
  • Loading branch information
toberge committed Jun 8, 2024
1 parent da32d84 commit 81ca5bc
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 14 deletions.
11 changes: 5 additions & 6 deletions Assets/Prefabs/UI/MenuCanvas.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -2095,10 +2095,10 @@ RectTransform:
m_Father: {fileID: 712943427912787205}
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_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1920, y: 1080}
m_SizeDelta: {x: -12, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3696208728217252567
CanvasRenderer:
Expand Down Expand Up @@ -2130,7 +2130,7 @@ MonoBehaviour:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: ab99f21b79632a44e8ee090d4975f8e3, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_PreserveAspect: 1
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
Expand Down Expand Up @@ -3767,7 +3767,7 @@ VideoPlayer:
m_TargetMaterialRenderer: {fileID: 0}
m_TargetMaterialProperty: <noninit>
m_RenderMode: 1
m_AspectRatio: 2
m_AspectRatio: 3
m_DataSource: 0
m_TimeUpdateMode: 2
m_PlaybackSpeed: 1
Expand Down Expand Up @@ -4028,7 +4028,6 @@ MonoBehaviour:
- {fileID: 8300000, guid: 2fc59430bcd0be5418d8e7a5c9273c9d, type: 3}
- {fileID: 8300000, guid: 998e63f1e44797246a2dc7e0887d770e, type: 3}
uiChooseSounds: {fileID: 11400000, guid: 90b0dc5583765d64f81545c255b0fa3a, type: 2}
loadingScreen: {fileID: 0}
mainMenuCamera: {fileID: 0}
--- !u!82 &5626306360106808345
AudioSource:
Expand Down
191 changes: 188 additions & 3 deletions Assets/Scenes/Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 785370674}
m_IndirectSpecularColor: {r: 0.0583656, g: 0.21644169, b: 0.49412873, a: 1}
m_IndirectSpecularColor: {r: 0.062373787, g: 0.21931762, b: 0.49501657, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -158,6 +158,7 @@ Transform:
m_Children:
- {fileID: 378774848}
- {fileID: 1383999238}
- {fileID: 284847887}
- {fileID: 2052637887}
- {fileID: 1664839715}
m_Father: {fileID: 0}
Expand Down Expand Up @@ -474,6 +475,142 @@ Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e82874ba34dffc64f840e8d7656aac9b, type: 3}
m_PrefabInstance: {fileID: 1427635014}
m_PrefabAsset: {fileID: 0}
--- !u!1 &284847886
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 284847887}
- component: {fileID: 284847890}
- component: {fileID: 284847889}
- component: {fileID: 284847888}
m_Layer: 0
m_Name: VideoPlayerCam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &284847887
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 284847886}
m_LocalRotation: {x: -0, y: 0.86602545, z: -0, w: 0.49999994}
m_LocalPosition: {x: -1, y: -18.6, z: 254.3}
m_LocalScale: {x: 0.18, y: 0.18, z: 0.18}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 88555959}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 9, y: 0, z: 0}
--- !u!114 &284847888
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 284847886}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
quality: 3
frameInfluence: 0.1
jitterScale: 1
mipBias: 0
varianceClampScale: 0.9
contrastAdaptiveSharpening: 0
--- !u!81 &284847889
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 284847886}
m_Enabled: 1
--- !u!20 &284847890
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 284847886}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 65
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 32
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1001 &298487808
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -609,7 +746,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!20 &378774845
Camera:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3634,10 +3771,26 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 884901864513283218, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 884901864513283218, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 884901864513283218, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_TargetCamera
value:
objectReference: {fileID: 378774845}
- target: {fileID: 884901864513283218, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 884901864513283218, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 943789032350396941, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchorMax.y
value: 1
Expand Down Expand Up @@ -3846,6 +3999,10 @@ PrefabInstance:
propertyPath: playerSelectModel
value:
objectReference: {fileID: 1372750351}
- target: {fileID: 1098348358083011975, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: videoPlayerCamera
value:
objectReference: {fileID: 284847886}
- target: {fileID: 1098348358083011975, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: levelSelectManager
value:
Expand Down Expand Up @@ -5138,6 +5295,30 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3477710770181042025, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3477710770181042025, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3477710770181042025, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3477710770181042025, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3477710770181042025, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3477710770181042025, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3497602124488804537, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
Expand Down Expand Up @@ -5397,7 +5578,11 @@ PrefabInstance:
- target: {fileID: 4018858951849858731, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_TargetCamera
value:
objectReference: {fileID: 378774845}
objectReference: {fileID: 284847890}
- target: {fileID: 4018858951849858731, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_TargetTexture
value:
objectReference: {fileID: 8400000, guid: 76d69d5ae834ced459a9853f89954188, type: 2}
- target: {fileID: 4071540528866138580, guid: cbf30f348674af6ecb2ba42ec2aacaf6, type: 3}
propertyPath: m_Navigation.m_SelectOnUp
value:
Expand Down
10 changes: 8 additions & 2 deletions Assets/Scripts/UI/MainMenu/MainMenuController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ public class MainMenuController : MonoBehaviour
private PlayerInputManagerController playerInputManagerController;
private List<InputManager> playerInputs = new List<InputManager>();

private int loadingDuration = 6;

private Coroutine introRoutine;

[SerializeField]
private GameObject mainMenuCamera;

[SerializeField]
private GameObject videoPlayerCamera;

private void Awake()
{
if (!FindAnyObjectByType<PlayerInputManagerController>())
Expand All @@ -91,6 +92,7 @@ private void Start()
playerInputManagerController.onPlayerInputJoined += AddPlayer;
if (SceneManager.GetActiveScene().name == "Menu")
((Peer2PeerTransport)NetworkManager.singleton).OnPlayerReceived += UpdateStartButton;

if (playerInputManagerController.LocalPlayerInputs.Count > 0)
{
// Already played, just show the menu.
Expand All @@ -99,6 +101,8 @@ private void Start()
introVideo.Stop();
introVideo.gameObject.SetActive(false);
introVideoFirstFrame.SetActive(false);
videoPlayerCamera.SetActive(false);
mainMenuCamera.SetActive(true);
// Reset loading screen
LoadingScreen.ResetCounter();
}
Expand Down Expand Up @@ -165,6 +169,8 @@ private void EndIntro()
playerInputManagerController.onPlayerInputJoined -= ShowSkipText;
skipIntroText.gameObject.SetActive(false);
introVideo.gameObject.SetActive(false);
videoPlayerCamera.SetActive(false);
mainMenuCamera.SetActive(true);
defaultMenu.SetActive(true);
SelectControl(defaultButton);
}
Expand Down
4 changes: 1 addition & 3 deletions Assets/Scripts/UI/MainMenu/MainMenuMoveCamera.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MainMenuMoveCamera : MonoBehaviour
Expand Down Expand Up @@ -41,7 +39,7 @@ public void MoveToPlayerSelect()
playerSelectCamera.gameObject.SetActive(true);
mainMenuCamera.gameObject.SetActive(false);
directionalLight.SetActive(false);

if (inLevelSelect)
{
inLevelSelect = false;
Expand Down

0 comments on commit 81ca5bc

Please sign in to comment.