Skip to content

Commit

Permalink
Intro Scene Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
doingitraith committed Jan 22, 2017
1 parent acbe836 commit 27fbb25
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 6 deletions.
Binary file modified GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab
Binary file not shown.
4 changes: 2 additions & 2 deletions GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab
Binary file not shown.
2 changes: 1 addition & 1 deletion GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified GGJ17/Assets/Prefab/Dialog/Dialog.prefab
Binary file not shown.
2 changes: 1 addition & 1 deletion GGJ17/Assets/Prefab/Dialog/Dialog.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified GGJ17/Assets/Scene/IntroScene.unity
Binary file not shown.
15 changes: 14 additions & 1 deletion GGJ17/Assets/Script/Dialog/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public IEnumerator Talk()

yield return StartCoroutine(MoveDialogBox(rect,
new Vector3(rect.anchoredPosition.x,
-rect.rect.height / 2 - (i * rect.rect.height) - 14)));
-rect.rect.height / 2 - (i * rect.rect.height) - 30)));

rect.anchoredPosition = new Vector3(rect.rect.width / 2 + 17,
-rect.rect.height / 2 - (i * rect.rect.height) - 30 - 15*i);

DialogBox d = box.GetComponent<DialogBox>();
d.text = speeches[i].text;
Expand All @@ -64,6 +67,16 @@ public IEnumerator MoveDialogBox(RectTransform rect, Vector3 target)
}
}

public void Reset()
{
foreach(DialogBox d in FindObjectsOfType<DialogBox>())
{
Destroy(d.gameObject);
}

speeches.Clear();
}

internal void Clear()
{
speeches.Clear();
Expand Down
34 changes: 33 additions & 1 deletion GGJ17/Assets/Script/IntroSequence.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using UnityEngine.SceneManagement;

public class IntroSequence : MonoBehaviour
{

Expand Down Expand Up @@ -50,5 +51,36 @@ public IEnumerator PlayIntro()
d.speeches.Add(e);

yield return StartCoroutine(d.Talk());

d.Reset();

e = new Dialog.DialogElement();
e.dialogBox = d.dialogBoxes[1];
e.text = "Mission control, we are now entering Psion's orbit.";
d.speeches.Add(e);

e = new Dialog.DialogElement();
e.dialogBox = d.dialogBoxes[1];
e.text = "Mission control, please come in! We are just above Psion..... Do you copy?";
d.speeches.Add(e);

e = new Dialog.DialogElement();
e.dialogBox = d.dialogBoxes[1];
e.text = "They are not answering!";
d.speeches.Add(e);

e = new Dialog.DialogElement();
e.dialogBox = d.dialogBoxes[1];
e.text = "Check the main systems!";
d.speeches.Add(e);

e = new Dialog.DialogElement();
e.dialogBox = d.dialogBoxes[1];
e.text = "Whate the ...? Something has fried our computer! We are coming down hard. Brace for impact.";
d.speeches.Add(e);

yield return StartCoroutine(d.Talk());

SceneManager.LoadScene(2, LoadSceneMode.Single);
}
}
Binary file modified GGJ17/ProjectSettings/EditorBuildSettings.asset
Binary file not shown.

0 comments on commit 27fbb25

Please sign in to comment.