diff --git a/Project Undercover/Assets/Scenes/Splash.unity b/Project Undercover/Assets/Scenes/Splash.unity index 51b4288..7d97b67 100644 --- a/Project Undercover/Assets/Scenes/Splash.unity +++ b/Project Undercover/Assets/Scenes/Splash.unity @@ -264,8 +264,9 @@ GameObject: - component: {fileID: 854366558} - component: {fileID: 854366560} - component: {fileID: 854366559} + - component: {fileID: 854366561} m_Layer: 5 - m_Name: Image (1) + m_Name: SplashText m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -322,6 +323,17 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 854366557} +--- !u!114 &854366561 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 854366557} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 96b46a3ec497e3640a9ecf1b5067a5a2, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1108133782 GameObject: m_ObjectHideFlags: 0 @@ -404,7 +416,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1108133782} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 485, y: 267.5, z: 0} + m_LocalPosition: {x: 512, y: 384, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1531749743} @@ -493,7 +505,7 @@ GameObject: - component: {fileID: 1531749745} - component: {fileID: 1531749744} m_Layer: 5 - m_Name: Image + m_Name: SplashBackground m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Project Undercover/Assets/Scripts/Lobby/LobbyManager.cs b/Project Undercover/Assets/Scripts/Lobby/LobbyManager.cs index faefbc2..f1a2e9e 100644 --- a/Project Undercover/Assets/Scripts/Lobby/LobbyManager.cs +++ b/Project Undercover/Assets/Scripts/Lobby/LobbyManager.cs @@ -61,7 +61,7 @@ public class LobbyManager : Photon.PunBehaviour { public override void OnLeftRoom() { - SceneManager.LoadScene(0); + SceneManager.LoadScene("MainMenu"); } public void LeaveRoom() diff --git a/Project Undercover/Assets/Scripts/UI/SplashController.cs b/Project Undercover/Assets/Scripts/UI/SplashController.cs new file mode 100644 index 0000000..2e88aae --- /dev/null +++ b/Project Undercover/Assets/Scripts/UI/SplashController.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine.UI; +using UnityEngine; +using UnityEngine.SceneManagement; + +public class SplashController : MonoBehaviour { + private Image splashText; + private float timer; + + void Start () { + splashText = GetComponent (); + Color tempcolor = Color.white; + tempcolor.a = 0; + splashText.color = tempcolor; + timer = 4; + } + + void Update () { + Color setalpha = Color.white; + timer -= Time.deltaTime; + + if(timer >= 2.5 && timer < 3.5) { + setalpha.a = 1 - (timer - 2.5f); + splashText.color = setalpha; + } + if(timer >= 0.5 && timer < 1.5) { + setalpha.a = (timer - 0.5f); + splashText.color = setalpha; + } + if(timer <= 0) { + SceneManager.LoadScene ("MainMenu"); + } + } +} \ No newline at end of file diff --git a/Project Undercover/Assets/Scripts/UI/SplashController.cs.meta b/Project Undercover/Assets/Scripts/UI/SplashController.cs.meta new file mode 100644 index 0000000..48254b2 --- /dev/null +++ b/Project Undercover/Assets/Scripts/UI/SplashController.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 96b46a3ec497e3640a9ecf1b5067a5a2 +timeCreated: 1512026200 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: