Skip to content

Commit 9eaba96

Browse files
committed
Animation!!
1 parent 54e8751 commit 9eaba96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+8785
-3008
lines changed

Source Code/M-Unity's Weird Website/Assembly-CSharp.csproj

Lines changed: 468 additions & 479 deletions
Large diffs are not rendered by default.

Source Code/M-Unity's Weird Website/Assets/AnimationDirector.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,16 @@ public enum BodyPart
2121
public GameObject LegRight;
2222
public GameObject Head;
2323
private GameObject CurrentPart;
24-
public void MovePart(BodyPart Part, Vector3 MovePosition, float MoveDuration)
24+
public void MovePart(BodyPart Part, Vector3 MovePosition, float MoveDuration, Ease AnimationEase)
2525
{
2626
if (Part.Equals(BodyPart.Whole)) CurrentPart = gameObject;
2727
else CurrentPart = GetType().GetField(Part.ToString()).GetValue(this) as GameObject;
28-
CurrentPart.transform.DOLocalMove(MovePosition,MoveDuration);
28+
CurrentPart.transform.DOLocalMove(MovePosition,MoveDuration).SetEase(AnimationEase);
2929
}
30-
public void RotatePart(BodyPart Part, Vector3 RotatePosition, float RotateDuration)
30+
public void RotatePart(BodyPart Part, Vector3 RotatePosition, float RotateDuration, Ease AnimationEase)
3131
{
3232
if (Part.Equals(BodyPart.Whole)) CurrentPart = gameObject;
3333
else CurrentPart = GetType().GetField(Part.ToString()).GetValue(this) as GameObject;
34-
CurrentPart.transform.DOLocalRotate(RotatePosition,RotateDuration);
35-
}
36-
public void DefaultMove()
37-
{
38-
MovePart(BodyPart.Whole, new Vector3 (2,0,0), 1);
39-
RotatePart(BodyPart.Whole, new Vector3 (0,-90,0), 2);
40-
RotatePart(BodyPart.ArmLeft, new Vector3 (-125,0,0), 2);
34+
CurrentPart.transform.DOLocalRotate(RotatePosition,RotateDuration).SetEase(AnimationEase);
4135
}
4236
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEngine;
2+
3+
public class ChangeMaterials : MonoBehaviour
4+
{
5+
private MeshRenderer Mesh;
6+
[SerializeField] private Material[] NewMaterials;
7+
private void Awake()
8+
{
9+
Mesh = GetComponent<MeshRenderer>();
10+
}
11+
12+
public void Change() => Mesh.materials = NewMaterials;
13+
public void Change(Material[] mats) => Mesh.materials = mats;
14+
}

Source Code/M-Unity's Weird Website/Assets/ChangeMaterials.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source Code/M-Unity's Weird Website/Assets/CutsceneDirector.cs

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
using UnityEngine;
22
using System.Collections;
3+
using DG.Tweening;
34
public 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
}
4.42 KB
Loading

Source Code/M-Unity's Weird Website/Assets/M-Unity 1.png.meta

Lines changed: 143 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
4.65 KB
Loading

0 commit comments

Comments
 (0)