Credits and Transition done #454

Merged
glencelow merged 6 commits from PlayerController into main 2023-04-01 18:09:04 +08:00
19 changed files with 472 additions and 64 deletions
Showing only changes of commit 51f426868e - Show all commits

View File

@ -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: ~

View File

@ -0,0 +1,3 @@
Name: CreditsScene
ID: 97376761
Type: 5

View File

@ -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
@ -332,3 +334,72 @@
Scale: {x: 1, y: 1, z: 1}
IsActive: true
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

View File

@ -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: ~
- 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

View File

@ -9544,6 +9544,7 @@
maxCombo: 621
finalScore: 620
contiuneBtn: 624
levelTransition: 619
nextScene: 86098106
scoreTweenDur: 2
- EID: 624

View File

@ -17510,6 +17510,7 @@
maxCombo: 612
finalScore: 610
contiuneBtn: 623
levelTransition: 608
nextScene: 88928066
scoreTweenDur: 2
- EID: 623

View File

@ -15884,6 +15884,7 @@
maxCombo: 484
finalScore: 274
contiuneBtn: 488
levelTransition: 229
nextScene: 84606951
scoreTweenDur: 2
- EID: 488

View File

@ -1558,7 +1558,7 @@
Scripts:
- Type: ChangeSceneButton
Enabled: true
sceneID: 96668835
sceneID: 91947920
levelTransistion: 433
- Type: SHADE_Scripting.UI.ButtonFX
Enabled: true

View File

@ -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<Transform>();
pppList = patrolPointPool.ToList<Transform>();
transform = GetComponent<Transform>();

View File

@ -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,6 +65,7 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework.States
public override void OnExit()
{
animator.Stop();
AudioHandler.audioClipHandlers["HO_humming"].Stop(false);
}
public override void update()

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

View File

@ -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<LevelTransistion>().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<LevelTransistion>().resetToLeft();
waiting = true;
}
if (levelTransition.GetScript<LevelTransistion>().complete && waiting)
SceneManager.ChangeScene(nextScene);
}
private void Canvas4()

View File

@ -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<LevelTransistion>().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<LevelTransistion>().resetToLeft();
waiting = true;
}
if (levelTransition.GetScript<LevelTransistion>().complete && waiting)
SceneManager.ChangeScene(nextScene);
}
private void Canvas1()

View File

@ -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;
}
}

View File

@ -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<LevelTransistion>().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<LevelTransistion>().complete && waitForTransition)
{
Audio.StopAllSounds();
SceneManager.ChangeScene(nextScene);

View File

@ -1,4 +1,4 @@
using SHADE;
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -7,11 +7,12 @@ 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]
@ -25,10 +26,9 @@ namespace SHADE_Scripting.UI
protected override void start()
{
base.start();
Transform transform = GetComponent<Transform>();
if(transform != null)
if (transform != null)
{
thread = TweenManager.CreateTweenThread(duration, transform.LocalPosition.y, endY, EASING_METHOD.LINEAR);
thread.SetResetOnInactive(GameObject);
@ -37,13 +37,12 @@ namespace SHADE_Scripting.UI
protected override void update()
{
base.update();
Transform transform = GetComponent<Transform>();
if(thread != null && transform != null)
if (thread != null && transform != null)
{
transform.LocalPosition = new Vector3( transform.LocalPosition.x ,thread.GetValue() , transform.LocalPosition.z);
transform.LocalPosition = new Vector3(transform.LocalPosition.x, thread.GetValue(), transform.LocalPosition.z);
}
}
}

View File

@ -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;
}
}
}
}

View File

@ -0,0 +1,3 @@
Name: TransitToMainMenu
ID: 159865134
Type: 9