11using UnityEngine ;
22using System . Collections ;
3+ using DG . Tweening ;
34public class CutsceneDirector : MonoBehaviour
45{
56 [ SerializeField ] private AnimationDirector MUnity ;
7+ [ SerializeField ] private DarkDirector Dark ;
8+ [ SerializeField ] private GameObject UICanvas ;
9+ [ SerializeField ] private GameObject MenuCamera ;
10+ [ SerializeField ] private GameObject CutCamera1 ;
11+ [ SerializeField ] private GameObject CutCamera2 ;
12+ [ SerializeField ] private GameObject Lights ;
13+ [ SerializeField ] private GameObject Chair ;
14+ [ SerializeField ] private ChangeMaterials LaptopScreen ;
15+ [ SerializeField ] private ChangeMaterials MUnityHead ;
16+ [ SerializeField ] private Material [ ] WakeMaterial ;
17+ [ SerializeField ] private Material [ ] HappyMaterial ;
618 [ SerializeField ] private GameObject RunningCactus ;
719 private void Awake ( )
820 {
@@ -15,21 +27,52 @@ public void CutSceneStart()
1527 private IEnumerator CutScene ( )
1628 {
1729 yield return new WaitForSeconds ( 1 ) ;
30+ MenuCamera . SetActive ( false ) ;
31+ yield return new WaitForSeconds ( 1 ) ;
32+ Destroy ( UICanvas ) ;
33+ yield return new WaitForSeconds ( 2 ) ;
34+ Dark . UnDark ( ) ;
35+ yield return new WaitForSeconds ( 2 ) ;
36+ Lights . SetActive ( true ) ;
37+ LaptopScreen . Change ( ) ;
38+ yield return new WaitForSeconds ( 2 ) ;
39+ CutCamera1 . SetActive ( false ) ;
40+ MUnity . RotatePart ( AnimationDirector . BodyPart . Head , new Vector3 ( 35 , 0 , 0 ) , 4 , Ease . Linear ) ;
41+ yield return new WaitForSeconds ( 4 ) ;
42+ MUnityHead . Change ( WakeMaterial ) ;
43+ MUnity . RotatePart ( AnimationDirector . BodyPart . Head , new Vector3 ( 0 , 0 , 0 ) , 0.5f , Ease . OutBounce ) ;
44+ yield return new WaitForSeconds ( 2 ) ;
45+ MUnity . RotatePart ( AnimationDirector . BodyPart . Head , new Vector3 ( 5 , - 60 , 0 ) , 2 , Ease . InOutElastic ) ;
46+ yield return new WaitForSeconds ( 2 ) ;
47+ MUnity . RotatePart ( AnimationDirector . BodyPart . ArmRight , new Vector3 ( - 170 , 0 , - 15 ) , 1 , Ease . InOutCubic ) ;
48+ yield return new WaitForSeconds ( 2 ) ;
49+ MUnity . RotatePart ( AnimationDirector . BodyPart . ArmRight , new Vector3 ( - 20 , 0 , 0 ) , 2 , Ease . InOutElastic ) ;
50+ yield return new WaitForSeconds ( 2 ) ;
51+ MUnityHead . Change ( HappyMaterial ) ;
52+ yield return new WaitForSeconds ( 2 ) ;
53+ Chair . transform . DORotate ( new Vector3 ( 90 , 270 , 0 ) , 1 ) . SetEase ( Ease . InOutCubic ) ;
54+ CutCamera2 . SetActive ( false ) ;
55+ yield return new WaitForSeconds ( 1 ) ;
56+ Chair . transform . DOMoveZ ( - 2.8f , 1 ) . SetEase ( Ease . InCubic ) ;
57+ Chair . transform . DORotate ( new Vector3 ( 90 , 0 , 0 ) , 1 ) . SetEase ( Ease . InOutCubic ) ;
58+ yield return new WaitForSeconds ( 1 ) ;
59+ Chair . transform . DOMoveX ( - 0.2f , 1 ) . SetEase ( Ease . InCubic ) ;
60+ MUnity . RotatePart ( AnimationDirector . BodyPart . Head , new Vector3 ( 0 , 0 , 0 ) , 1 , Ease . InOutCubic ) ;
1861
1962 }
2063 private IEnumerator Walking ( AnimationDirector Player , float Speed )
2164 {
2265 while ( true )
2366 {
24- Player . RotatePart ( AnimationDirector . BodyPart . LegRight , new Vector3 ( - 20 , 0 , 0 ) , Speed ) ;
25- Player . RotatePart ( AnimationDirector . BodyPart . LegLeft , new Vector3 ( 20 , 0 , 0 ) , Speed ) ;
26- Player . RotatePart ( AnimationDirector . BodyPart . ArmRight , new Vector3 ( 20 , 0 , 0 ) , Speed ) ;
27- Player . RotatePart ( AnimationDirector . BodyPart . ArmLeft , new Vector3 ( - 20 , 0 , 0 ) , Speed ) ;
67+ Player . RotatePart ( AnimationDirector . BodyPart . LegRight , new Vector3 ( - 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
68+ Player . RotatePart ( AnimationDirector . BodyPart . LegLeft , new Vector3 ( 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
69+ Player . RotatePart ( AnimationDirector . BodyPart . ArmRight , new Vector3 ( 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
70+ Player . RotatePart ( AnimationDirector . BodyPart . ArmLeft , new Vector3 ( - 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
2871 yield return new WaitForSeconds ( Speed ) ;
29- Player . RotatePart ( AnimationDirector . BodyPart . LegRight , new Vector3 ( 20 , 0 , 0 ) , Speed ) ;
30- Player . RotatePart ( AnimationDirector . BodyPart . LegLeft , new Vector3 ( - 20 , 0 , 0 ) , Speed ) ;
31- Player . RotatePart ( AnimationDirector . BodyPart . ArmRight , new Vector3 ( - 20 , 0 , 0 ) , Speed ) ;
32- Player . RotatePart ( AnimationDirector . BodyPart . ArmLeft , new Vector3 ( 20 , 0 , 0 ) , Speed ) ;
72+ Player . RotatePart ( AnimationDirector . BodyPart . LegRight , new Vector3 ( 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
73+ Player . RotatePart ( AnimationDirector . BodyPart . LegLeft , new Vector3 ( - 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
74+ Player . RotatePart ( AnimationDirector . BodyPart . ArmRight , new Vector3 ( - 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
75+ Player . RotatePart ( AnimationDirector . BodyPart . ArmLeft , new Vector3 ( 20 , 0 , 0 ) , Speed , Ease . InFlash ) ;
3376 yield return new WaitForSeconds ( Speed ) ;
3477 }
3578 }
0 commit comments