diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index d5b574a..00eff5d 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -93,7 +93,7 @@ VideoPlayer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1791320227682299352} m_Enabled: 1 - m_VideoClip: {fileID: 32900000, guid: 1e1f7c5ecdf0b224bac09727d97cd45a, type: 3} + m_VideoClip: {fileID: 0} m_TargetCameraAlpha: 1 m_TargetCamera3DLayout: 0 m_TargetCamera: {fileID: 3591939341705465154} diff --git a/Assets/Scripts/PlayerScript.cs b/Assets/Scripts/PlayerScript.cs index 58ae73f..acef861 100644 --- a/Assets/Scripts/PlayerScript.cs +++ b/Assets/Scripts/PlayerScript.cs @@ -120,21 +120,24 @@ public void HandleCharacterControllerUpdate() void HandleConfigInitialization() { - // TODO: Colocar na classe + GameManagerScript.instance.DisableMenu(); + + if (!LocalPrefs.GetGamepadEnabled()) + { + GameManagerScript.instance.DisableGamepad(); + } + + // TODO: Colocar como atributo da classe var videoPlayer = Camera.main.gameObject.GetComponent(); + videoPlayer.source = VideoSource.Url; + videoPlayer.url = AssetLoader.GetPath("Video/black-hole.mp4"); + videoPlayer.Prepare(); videoPlayer.prepareCompleted += (source) => { videoPlayer.Play(); }; - - GameManagerScript.instance.DisableMenu(); - - if (!LocalPrefs.GetGamepadEnabled()) - { - GameManagerScript.instance.DisableGamepad(); - } } void HandleModelAnimation(GameObject model) diff --git a/Assets/Scripts/Utils/AssetLoader.cs b/Assets/Scripts/Utils/AssetLoader.cs new file mode 100644 index 0000000..7e3e44c --- /dev/null +++ b/Assets/Scripts/Utils/AssetLoader.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +public static class AssetLoader +{ + public static string GetPath(string file) + { + return System.IO.Path.Combine(Application.streamingAssetsPath, file); + } +} diff --git a/Assets/Scripts/Utils/AssetLoader.cs.meta b/Assets/Scripts/Utils/AssetLoader.cs.meta new file mode 100644 index 0000000..f68f3ac --- /dev/null +++ b/Assets/Scripts/Utils/AssetLoader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d87696c066fb284e8c3645d25dbf143 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Video.meta b/Assets/StreamingAssets/Video.meta similarity index 100% rename from Assets/Video.meta rename to Assets/StreamingAssets/Video.meta diff --git a/Assets/Video/black-hole.mp4 b/Assets/StreamingAssets/Video/black-hole.mp4 similarity index 100% rename from Assets/Video/black-hole.mp4 rename to Assets/StreamingAssets/Video/black-hole.mp4 diff --git a/Assets/Video/black-hole.mp4.meta b/Assets/StreamingAssets/Video/black-hole.mp4.meta similarity index 100% rename from Assets/Video/black-hole.mp4.meta rename to Assets/StreamingAssets/Video/black-hole.mp4.meta