diff --git a/Assets/Scenes/CreditsScene.shade b/Assets/Scenes/CreditsScene.shade new file mode 100644 index 00000000..dd77ac62 --- /dev/null +++ b/Assets/Scenes/CreditsScene.shade @@ -0,0 +1,174 @@ +- NavData: 0 +- EID: 0 + Name: Camera + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Camera Component: + Position: {x: 0, y: 0, z: 0} + Pitch: 0 + Yaw: 0 + Roll: 0 + Width: 1920 + Near: 0.00999999978 + Far: 10000 + Perspective: true + FOV: 90 + IsActive: true + Scripts: ~ +- EID: 46 + Name: Credits Canvas + IsActive: true + NumberOfChildren: 3 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: ~ +- EID: 47 + Name: Scrolling Credits + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -3800, z: 1.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1920, y: 8026, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 120332672 + IsActive: true + UI Component: + Canvas ID: 46 + Hovered: false + Clicked: false + IsActive: true + Scripts: + - Type: SHADE_Scripting.UI.ScrollingCredits + Enabled: true + endY: 4300 + duration: 27 + levelTransition: 619 + - Type: SHADE_Scripting.UI.TransitToMainMenu + Enabled: true + timeToTransit: 27 + sceneToChange: 97158628 +- EID: 49 + Name: Credits Title Text + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: -150, y: 400, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 100, y: 100, z: 1} + IsActive: false + Text Renderer Component: + Text: Credits + Font: 174412429 + Color: {x: 0, y: 0, z: 0, w: 1} + Text Size: {x: 1, y: 1, z: 1} + IsActive: false + UI Component: + Canvas ID: 46 + Hovered: false + Clicked: false + IsActive: false + Scripts: ~ +- EID: 55 + Name: BackGround + IsActive: false + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 1.5} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1920, y: 1080, z: 1} + IsActive: false + Renderable Component: + Mesh: 141771688 + Material: 121834459 + IsActive: false + UI Component: + Canvas ID: 46 + Hovered: false + Clicked: false + IsActive: false + Scripts: ~ +- EID: 54 + Name: TweenManager + IsActive: true + NumberOfChildren: 0 + Components: ~ + Scripts: + - Type: TweenManager + Enabled: true +- EID: 619 + Name: LevelTransistionCanvas + IsActive: true + NumberOfChildren: 2 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: + - Type: LevelTransistion + Enabled: true + logo: 618 + bg: 617 + duration: 0.5 + bgEndPositionX: 3000 + logoEndPositionX: 3000 + rotAndScale: false + rotationAmt: 360 + scaleAmt: 631 +- EID: 618 + Name: LevelTransistionLogo + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 631, y: 631, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 126117259 + IsActive: true + UI Component: + Canvas ID: 619 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 617 + Name: LevelTransistionBG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.200000003} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 4000, y: 4000, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 132131066 + IsActive: true + UI Component: + Canvas ID: 619 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ \ No newline at end of file diff --git a/Assets/Scenes/CreditsScene.shade.shmeta b/Assets/Scenes/CreditsScene.shade.shmeta new file mode 100644 index 00000000..5122ac26 --- /dev/null +++ b/Assets/Scenes/CreditsScene.shade.shmeta @@ -0,0 +1,3 @@ +Name: CreditsScene +ID: 97376761 +Type: 5 diff --git a/Assets/Scenes/CutSceneEnd.shade b/Assets/Scenes/CutSceneEnd.shade index 62c7389f..cdbaeac7 100644 --- a/Assets/Scenes/CutSceneEnd.shade +++ b/Assets/Scenes/CutSceneEnd.shade @@ -1,3 +1,4 @@ +- NavData: 0 - EID: 1 Name: Canvas4 IsActive: true @@ -152,7 +153,7 @@ Scripts: - Type: CutsceneEnd Enabled: true - nextScene: 92009475 + nextScene: 97376761 duration: 1 skipDuration: 0.100000001 cutscene4Points: 4 @@ -161,6 +162,7 @@ cutscene5Pics: 15 canvas4: 1 canvas5: 14 + levelTransition: 619 - EID: 4 Name: CutScene4Points IsActive: true @@ -288,7 +290,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 250, y: -500, z: 0.100000001} + Translate: {x: 250, y: -500, z: 0.300000012} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 50, y: 50, z: 50} IsActive: true @@ -331,4 +333,73 @@ Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true - Scripts: ~ \ No newline at end of file + Scripts: ~ +- EID: 619 + Name: LevelTransistionCanvas + IsActive: true + NumberOfChildren: 2 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: + - Type: LevelTransistion + Enabled: true + logo: 618 + bg: 617 + duration: 0.5 + bgEndPositionX: 3000 + logoEndPositionX: 3000 + rotAndScale: false + rotationAmt: 360 + scaleAmt: 631 +- EID: 618 + Name: LevelTransistionLogo + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 631, y: 631, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 126117259 + IsActive: true + UI Component: + Canvas ID: 619 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 617 + Name: LevelTransistionBG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.200000003} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 4000, y: 4000, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 132131066 + IsActive: true + UI Component: + Canvas ID: 619 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 616 + Name: TweenManager + IsActive: true + NumberOfChildren: 0 + Components: ~ + Scripts: + - Type: TweenManager + Enabled: true \ No newline at end of file diff --git a/Assets/Scenes/CutSceneIntro.shade b/Assets/Scenes/CutSceneIntro.shade index abb83046..2bffdb44 100644 --- a/Assets/Scenes/CutSceneIntro.shade +++ b/Assets/Scenes/CutSceneIntro.shade @@ -1,3 +1,4 @@ +- NavData: 0 - EID: 1 Name: Canvas1 IsActive: true @@ -164,6 +165,7 @@ canvas1: 1 canvas2: 13 canvas3: 24 + levelTransition: 619 - EID: 4 Name: CutScene1Points IsActive: true @@ -177,7 +179,7 @@ Components: Transform Component: Translate: {x: -550, y: 0, z: 0.5} - Rotate: {x: 0, y: 0, z: 0} + Rotate: {x: 500.5, y: -274.5, z: 0.600000024} Scale: {x: 1, y: 1, z: 1} IsActive: true Scripts: ~ @@ -394,7 +396,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -1375, y: 250, z: 0.5} + Translate: {x: -1375, y: 250, z: 0.899999976} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 982, y: 527, z: 1} IsActive: true @@ -414,7 +416,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 200, y: 1200, z: 0.400000006} + Translate: {x: 200, y: 1200, z: 0.800000012} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 625, y: 579, z: 1} IsActive: true @@ -434,7 +436,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 1700, y: 200, z: 0.300000012} + Translate: {x: 1700, y: 200, z: 0.699999988} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 529, y: 670, z: 1} IsActive: true @@ -454,7 +456,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -1600, y: -200, z: 0.5} + Translate: {x: -1600, y: -200, z: 0.899999976} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1299, y: 575, z: 1} IsActive: true @@ -474,7 +476,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 500, y: -1275, z: 0.5} + Translate: {x: 500, y: -1275, z: 0.899999976} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 866, y: 483, z: 1} IsActive: true @@ -494,7 +496,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 0, z: 0.699999988} + Translate: {x: 0, y: 0, z: 0.99000001} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1920, y: 1080, z: 1} IsActive: true @@ -514,7 +516,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 250, y: -500, z: 0.100000001} + Translate: {x: 250, y: -500, z: 0.400000006} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 50, y: 50, z: 50} IsActive: true @@ -542,7 +544,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -375, y: 250, z: 0.5} + Translate: {x: -375, y: 250, z: 0.899999976} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -553,7 +555,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 200, y: 200, z: 0.400000006} + Translate: {x: 200, y: 200, z: 0.800000012} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -564,7 +566,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 700, y: 200, z: 0.300000012} + Translate: {x: 700, y: 200, z: 0.699999988} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -575,7 +577,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: -225, y: -200, z: 0.200000003} + Translate: {x: -225, y: -200, z: 0.600000024} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true @@ -586,8 +588,77 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 500, y: -275, z: 0.100000001} + Translate: {x: 500, y: -275, z: 0.5} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1, y: 1, z: 1} IsActive: true - Scripts: ~ \ No newline at end of file + Scripts: ~ +- EID: 619 + Name: LevelTransistionCanvas + IsActive: true + NumberOfChildren: 2 + Components: + Canvas Component: + Canvas Width: 1920 + Canvas Height: 1080 + Scale by canvas width: false + IsActive: true + Scripts: + - Type: LevelTransistion + Enabled: true + logo: 618 + bg: 617 + duration: 0.5 + bgEndPositionX: 3000 + logoEndPositionX: 3000 + rotAndScale: false + rotationAmt: 360 + scaleAmt: 631 +- EID: 618 + Name: LevelTransistionLogo + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.100000001} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 631, y: 631, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 126117259 + IsActive: true + UI Component: + Canvas ID: 619 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 617 + Name: LevelTransistionBG + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: 0, z: 0.200000003} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 4000, y: 4000, z: 1} + IsActive: true + Renderable Component: + Mesh: 141771688 + Material: 132131066 + IsActive: true + UI Component: + Canvas ID: 619 + Hovered: false + Clicked: false + IsActive: true + Scripts: ~ +- EID: 616 + Name: TweenManager + IsActive: true + NumberOfChildren: 0 + Components: ~ + Scripts: + - Type: TweenManager + Enabled: true \ No newline at end of file diff --git a/Assets/Scenes/Level1.shade b/Assets/Scenes/Level1.shade index 9a02fa83..2ca595a5 100644 --- a/Assets/Scenes/Level1.shade +++ b/Assets/Scenes/Level1.shade @@ -9544,6 +9544,7 @@ maxCombo: 621 finalScore: 620 contiuneBtn: 624 + levelTransition: 619 nextScene: 86098106 scoreTweenDur: 2 - EID: 624 diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index 05da3e46..e897fc49 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -17510,6 +17510,7 @@ maxCombo: 612 finalScore: 610 contiuneBtn: 623 + levelTransition: 608 nextScene: 88928066 scoreTweenDur: 2 - EID: 623 diff --git a/Assets/Scenes/Level3.shade b/Assets/Scenes/Level3.shade index f1e2a19f..8d745d8f 100644 --- a/Assets/Scenes/Level3.shade +++ b/Assets/Scenes/Level3.shade @@ -15884,6 +15884,7 @@ maxCombo: 484 finalScore: 274 contiuneBtn: 488 + levelTransition: 229 nextScene: 84606951 scoreTweenDur: 2 - EID: 488 diff --git a/Assets/Scenes/MainMenu.shade b/Assets/Scenes/MainMenu.shade index 57ea52f2..3292cecc 100644 --- a/Assets/Scenes/MainMenu.shade +++ b/Assets/Scenes/MainMenu.shade @@ -1558,7 +1558,7 @@ Scripts: - Type: ChangeSceneButton Enabled: true - sceneID: 96668835 + sceneID: 91947920 levelTransistion: 433 - Type: SHADE_Scripting.UI.ButtonFX Enabled: true diff --git a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAI.cs b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAI.cs index c72f4d09..c2c0ea1a 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAI.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAI.cs @@ -83,6 +83,9 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework AudioHandler.audioClipHandlers["HO_bark"] = SHADE.Audio.CreateAudioClip("event:/Homeowner/homeowner_bark"); SHADE.Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["HO_bark"], GameObject.EntityId); + AudioHandler.audioClipHandlers["HO_humming"] = SHADE.Audio.CreateAudioClip("event:/Homeowner/homeowner_humming"); + SHADE.Audio.AttachAudioClipToObject(AudioHandler.audioClipHandlers["HO_humming"], GameObject.EntityId); + patrolPointPool = patrolPointParent.GetComponentsInChildren(); pppList = patrolPointPool.ToList(); transform = GetComponent(); diff --git a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/PatrolState.cs b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/PatrolState.cs index 22f233d1..2848e1d9 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/PatrolState.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/States/PatrolState.cs @@ -50,6 +50,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States animator.Play(ai.walkingAnim); AudioHandler.audioClipHandlers["HO_footsteps"].Play(); + AudioHandler.audioClipHandlers["HO_humming"].Play(); footStepTimer = footStepInterval; @@ -64,7 +65,8 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States public override void OnExit() { animator.Stop(); - } + AudioHandler.audioClipHandlers["HO_humming"].Stop(false); + } public override void update() { diff --git a/Assets/Scripts/UI/EasingHelper.cs b/Assets/Scripts/UI/EasingHelper.cs index 10f3ecb9..d59b513e 100644 --- a/Assets/Scripts/UI/EasingHelper.cs +++ b/Assets/Scripts/UI/EasingHelper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/Assets/Scripts/UI/SC_CutSceneEnd.cs b/Assets/Scripts/UI/SC_CutSceneEnd.cs index 7aa65b1f..61cd292a 100644 --- a/Assets/Scripts/UI/SC_CutSceneEnd.cs +++ b/Assets/Scripts/UI/SC_CutSceneEnd.cs @@ -54,6 +54,9 @@ public class CutsceneEnd : Script private bool cutscene4Done = false; private bool cutscene5Done = false; + public GameObject levelTransition; + private bool waiting = false; + protected override void awake() { initCutscene4(); @@ -73,6 +76,9 @@ public class CutsceneEnd : Script protected override void update() { + if (!levelTransition.GetScript().complete) + return; + Canvas4(); Canvas5(); @@ -98,8 +104,12 @@ public class CutsceneEnd : Script if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene5Done && canvas5.IsActiveSelf) { - SceneManager.ChangeScene(nextScene); + levelTransition.GetScript().resetToLeft(); + waiting = true; } + + if (levelTransition.GetScript().complete && waiting) + SceneManager.ChangeScene(nextScene); } private void Canvas4() diff --git a/Assets/Scripts/UI/SC_CutsceneIntro.cs b/Assets/Scripts/UI/SC_CutsceneIntro.cs index 89f7061d..56df791a 100644 --- a/Assets/Scripts/UI/SC_CutsceneIntro.cs +++ b/Assets/Scripts/UI/SC_CutsceneIntro.cs @@ -82,6 +82,9 @@ public class CutsceneIntro : Script private bool cutscene2Done = false; private bool cutscene3Done = false; + public GameObject levelTransition; + private bool waiting = false; + protected override void awake() { initCutscene1(); @@ -109,6 +112,9 @@ public class CutsceneIntro : Script protected override void update() { + if (!levelTransition.GetScript().complete) + return; + Canvas1(); Canvas2(); Canvas3(); @@ -148,8 +154,12 @@ public class CutsceneIntro : Script if (Input.GetKeyUp(Input.KeyCode.Space) && cutscene3Done && canvas3.IsActiveSelf) { - SceneManager.ChangeScene(nextScene); + levelTransition.GetScript().resetToLeft(); + waiting = true; } + + if (levelTransition.GetScript().complete && waiting) + SceneManager.ChangeScene(nextScene); } private void Canvas1() diff --git a/Assets/Scripts/UI/SC_LevelTransistion.cs b/Assets/Scripts/UI/SC_LevelTransistion.cs index 7883e92e..eb7382b4 100644 --- a/Assets/Scripts/UI/SC_LevelTransistion.cs +++ b/Assets/Scripts/UI/SC_LevelTransistion.cs @@ -69,6 +69,22 @@ public class LevelTransistion : Script complete = true; } + public void resetToLeft() + { + logoTran.LocalEulerAngles = Vector3.Zero; + logoTran.LocalPosition = Vector3.Zero; + logoTran.LocalScale = Vector3.Zero; + bgTween.duration = 0.8f; + bgTween.Reset(-3000.0f,0.0f); + logoTween.duration = 0.8f; + logoTween.Reset(); + rot.duration = 0.8f; + rot.Reset(); + scale.duration = 0.8f; + scale.Reset(); + complete = false; + rotAndScale = true; + } } diff --git a/Assets/Scripts/UI/SC_Results.cs b/Assets/Scripts/UI/SC_Results.cs index b61c1c44..df3775ac 100644 --- a/Assets/Scripts/UI/SC_Results.cs +++ b/Assets/Scripts/UI/SC_Results.cs @@ -14,6 +14,7 @@ public class Results : Script public GameObject maxCombo; public GameObject finalScore; public GameObject contiuneBtn; + public GameObject levelTransition; public uint nextScene; public float scoreTweenDur = 2.0f; @@ -73,9 +74,7 @@ public class Results : Script { contiune.OnRelease.RegisterAction(() => { - if (SceneFadeInOut.Instance != null) - SceneFadeInOut.Instance.CallFadeIn(); - + levelTransition.GetScript().resetToLeft(); waitForTransition = true; GameManager.Instance.GamePause = false; @@ -93,7 +92,7 @@ public class Results : Script protected override void update() { - if (SceneFadeInOut.Instance && SceneFadeInOut.Instance.FadeInFinished() && waitForTransition) + if (levelTransition.GetScript().complete && waitForTransition) { Audio.StopAllSounds(); SceneManager.ChangeScene(nextScene); diff --git a/Assets/Scripts/UI/SC_ScaleBounce.cs b/Assets/Scripts/UI/SC_ScaleBounce.cs index fabf504d..0f264e9c 100644 --- a/Assets/Scripts/UI/SC_ScaleBounce.cs +++ b/Assets/Scripts/UI/SC_ScaleBounce.cs @@ -1,4 +1,4 @@ -using SHADE; +using SHADE; using System; using System.Collections.Generic; using System.Linq; diff --git a/Assets/Scripts/UI/SC_ScrollingCredits.cs b/Assets/Scripts/UI/SC_ScrollingCredits.cs index 1e58d6bd..7a98a005 100644 --- a/Assets/Scripts/UI/SC_ScrollingCredits.cs +++ b/Assets/Scripts/UI/SC_ScrollingCredits.cs @@ -7,44 +7,43 @@ using System.Threading.Tasks; namespace SHADE_Scripting.UI { - public class ScrollingCredits: Script + public class ScrollingCredits : Script + { + + public float endY = 4000.0f; + public float duration = 30.0f; + public GameObject levelTransition; + + + [NonSerialized] + TweenThread thread; + + protected override void awake() + { + base.awake(); + + } + + protected override void start() { - public float endY = 4000.0f; - public float duration = 30.0f; - - - [NonSerialized] - TweenThread thread; - - protected override void awake() - { - base.awake(); - - } - - protected override void start() - { - base.start(); - - Transform transform = GetComponent(); - if(transform != null) - { - thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR); - thread.SetResetOnInactive(GameObject); - } - } - - protected override void update() - { - base.update(); - - Transform transform = GetComponent(); - - if(thread != null && transform != null) - { - transform.LocalPosition = new Vector3( transform.LocalPosition.x ,thread.GetValue() , transform.LocalPosition.z); - } - } + Transform transform = GetComponent(); + if (transform != null) + { + thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR); + thread.SetResetOnInactive(GameObject); + } } + + protected override void update() + { + + Transform transform = GetComponent(); + + if (thread != null && transform != null) + { + transform.LocalPosition = new Vector3(transform.LocalPosition.x, thread.GetValue(), transform.LocalPosition.z); + } + } + } } diff --git a/Assets/Scripts/UI/TransitToMainMenu.cs b/Assets/Scripts/UI/TransitToMainMenu.cs new file mode 100644 index 00000000..7d4d5d79 --- /dev/null +++ b/Assets/Scripts/UI/TransitToMainMenu.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SHADE; + +namespace SHADE_Scripting.UI +{ + public class TransitToMainMenu: Script + { + public float timeToTransit = 0.0f; + public uint sceneToChange = 0; + private float timer = 0.0f; + private bool sceneChanged = false; + + protected override void start() + { + timer = timeToTransit; + sceneChanged = false; + } + + + protected override void update() + { + timer -= Time.DeltaTimeF; + if(timer <= 0.0f && sceneChanged == false) + { + SceneManager.ChangeScene(sceneToChange); + sceneChanged = true; + } + if(Input.GetKeyDown(Input.KeyCode.Space)) + { + timer = 0.0f; + } + + + } + + + + + } +} diff --git a/Assets/Scripts/UI/TransitToMainMenu.cs.shmeta b/Assets/Scripts/UI/TransitToMainMenu.cs.shmeta new file mode 100644 index 00000000..a5bea7ec --- /dev/null +++ b/Assets/Scripts/UI/TransitToMainMenu.cs.shmeta @@ -0,0 +1,3 @@ +Name: TransitToMainMenu +ID: 159865134 +Type: 9