Set background in story
This commit is contained in:
parent
3b9a6f361d
commit
43406a8c13
5 changed files with 103 additions and 2 deletions
|
|
@ -5,6 +5,8 @@ using UnityEngine;
|
|||
public class Scene_Chapter1_Cave: StoryScene
|
||||
{
|
||||
public override IEnumerator Play(StoryDisplay storyDisplay) {
|
||||
storyDisplay.SetBackground("BGCave");
|
||||
|
||||
yield return new WaitForSeconds(1f);
|
||||
yield return storyDisplay.DisplayText("OMG monsters!", DialogPosition.Right);
|
||||
yield return new WaitForSeconds(1f);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ using UnityEngine;
|
|||
|
||||
public class Scene_Prologue_First: StoryScene {
|
||||
public override IEnumerator Play(StoryDisplay storyDisplay) {
|
||||
storyDisplay.SetBackground("BGNightSky");
|
||||
|
||||
yield return new WaitForSeconds(1f);
|
||||
yield return storyDisplay.DisplayText("Are you going out again?", DialogPosition.Left);
|
||||
yield return new WaitForSeconds(1f);
|
||||
|
|
@ -21,7 +23,7 @@ public class Scene_Prologue_First: StoryScene {
|
|||
DialogPosition.Left);
|
||||
yield return new WaitForSeconds(2f);
|
||||
yield return storyDisplay.DisplayText(
|
||||
"Finite in time, yes. But infinite in possibilities.",
|
||||
"Finite in time, yes. But infinite in possibilities...",
|
||||
DialogPosition.Right);
|
||||
yield return new WaitForSeconds(2f);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public enum DialogPosition {
|
||||
Left,
|
||||
Right,
|
||||
|
|
@ -13,6 +12,7 @@ public class StoryDisplay : MonoBehaviour
|
|||
{
|
||||
public Canvas uiCanvas;
|
||||
public StoryBox storyBox;
|
||||
public Image background;
|
||||
private StoryBox storyBoxLeft;
|
||||
|
||||
void Awake() {
|
||||
|
|
@ -35,4 +35,9 @@ public class StoryDisplay : MonoBehaviour
|
|||
yield return this.storyBox.Display(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBackground(string fileName) {
|
||||
Sprite sprite = Resources.Load<Sprite>("BGBattle/" + fileName);
|
||||
this.background.sprite = sprite;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue