Set background in story
This commit is contained in:
parent
3b9a6f361d
commit
43406a8c13
5 changed files with 103 additions and 2 deletions
BIN
Assets/Resources/BGBattle/BGNightSky.jpg
Normal file
BIN
Assets/Resources/BGBattle/BGNightSky.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 492 KiB |
92
Assets/Resources/BGBattle/BGNightSky.jpg.meta
Normal file
92
Assets/Resources/BGBattle/BGNightSky.jpg.meta
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 98f8a87bb8782a44987ed71e181edd57
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 11
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -100
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 1
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 8
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID: 5e97eb03825dee720800000000000000
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
spritePackingTag:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
pSDShowRemoveMatteOption: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -5,6 +5,8 @@ using UnityEngine;
|
||||||
public class Scene_Chapter1_Cave: StoryScene
|
public class Scene_Chapter1_Cave: StoryScene
|
||||||
{
|
{
|
||||||
public override IEnumerator Play(StoryDisplay storyDisplay) {
|
public override IEnumerator Play(StoryDisplay storyDisplay) {
|
||||||
|
storyDisplay.SetBackground("BGCave");
|
||||||
|
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
yield return storyDisplay.DisplayText("OMG monsters!", DialogPosition.Right);
|
yield return storyDisplay.DisplayText("OMG monsters!", DialogPosition.Right);
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ using UnityEngine;
|
||||||
|
|
||||||
public class Scene_Prologue_First: StoryScene {
|
public class Scene_Prologue_First: StoryScene {
|
||||||
public override IEnumerator Play(StoryDisplay storyDisplay) {
|
public override IEnumerator Play(StoryDisplay storyDisplay) {
|
||||||
|
storyDisplay.SetBackground("BGNightSky");
|
||||||
|
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
yield return storyDisplay.DisplayText("Are you going out again?", DialogPosition.Left);
|
yield return storyDisplay.DisplayText("Are you going out again?", DialogPosition.Left);
|
||||||
yield return new WaitForSeconds(1f);
|
yield return new WaitForSeconds(1f);
|
||||||
|
|
@ -21,7 +23,7 @@ public class Scene_Prologue_First: StoryScene {
|
||||||
DialogPosition.Left);
|
DialogPosition.Left);
|
||||||
yield return new WaitForSeconds(2f);
|
yield return new WaitForSeconds(2f);
|
||||||
yield return storyDisplay.DisplayText(
|
yield return storyDisplay.DisplayText(
|
||||||
"Finite in time, yes. But infinite in possibilities.",
|
"Finite in time, yes. But infinite in possibilities...",
|
||||||
DialogPosition.Right);
|
DialogPosition.Right);
|
||||||
yield return new WaitForSeconds(2f);
|
yield return new WaitForSeconds(2f);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
|
||||||
public enum DialogPosition {
|
public enum DialogPosition {
|
||||||
Left,
|
Left,
|
||||||
Right,
|
Right,
|
||||||
|
|
@ -13,6 +12,7 @@ public class StoryDisplay : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Canvas uiCanvas;
|
public Canvas uiCanvas;
|
||||||
public StoryBox storyBox;
|
public StoryBox storyBox;
|
||||||
|
public Image background;
|
||||||
private StoryBox storyBoxLeft;
|
private StoryBox storyBoxLeft;
|
||||||
|
|
||||||
void Awake() {
|
void Awake() {
|
||||||
|
|
@ -35,4 +35,9 @@ public class StoryDisplay : MonoBehaviour
|
||||||
yield return this.storyBox.Display(message);
|
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