Commit 293601b8 authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

added paralax to the background

parent 8a119a2a
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Parllax : MonoBehaviour {
public Transform[] ParalaxLayers;
public float[] distances;
private float lastX;
// Use this for initialization
void Start () {
lastX = transform.position.x;
}
private void FixedUpdate() {
float moveAmmount = transform.position.x - lastX;
for (int i = 0; i < ParalaxLayers.Length; i++) {
Vector3 newPos = ParalaxLayers[i].transform.position;
newPos.x = moveAmmount * distances[i];
ParalaxLayers[i].transform.position = newPos;
}
}
}
fileFormatVersion: 2
guid: 947429982cf1b8b4082feba6c3b455b0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4912bb1b0bc6d2146898d2cfb55c153f
TextureImporter:
fileIDToRecycleName: {}
fileIDToRecycleName:
21300000: Fence_0
21300002: Fence_1
21300004: Fence_2
21300006: Fence_3
externalObjects: {}
serializedVersion: 7
mipmaps:
......@@ -40,7 +44,7 @@ TextureImporter:
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
......@@ -69,9 +73,100 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
sprites:
- serializedVersion: 2
name: Fence_0
rect:
serializedVersion: 2
x: 0
y: 67
width: 49
height: 45
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 09f68cf50721d1441b697711a9b8fd1d
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Fence_1
rect:
serializedVersion: 2
x: 379
y: 67
width: 621
height: 44
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 0b312166d2d5c09489dae956ef5f20c5
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Fence_2
rect:
serializedVersion: 2
x: 0
y: 67
width: 1000
height: 47
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 04c3aeb0e5a521e4b97ff0e61f100a5a
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Fence_3
rect:
serializedVersion: 2
x: 821
y: 135
width: 172
height: 48
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: a50999f1e02a7e0409f32b1bfae68168
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
......
fileFormatVersion: 2
guid: 1c47972b737a9714aad98a707f95b1f6
TextureImporter:
fileIDToRecycleName: {}
fileIDToRecycleName:
21300000: Staff Only Sign_0
externalObjects: {}
serializedVersion: 7
mipmaps:
......@@ -40,7 +41,7 @@ TextureImporter:
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
......@@ -50,7 +51,7 @@ TextureImporter:
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
spriteTessellationDetail: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
......@@ -69,10 +70,48 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
sprites:
- serializedVersion: 2
name: Staff Only Sign_0
rect:
serializedVersion: 2
x: 225
y: 44
width: 75
height: 63
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 06e181abdbbf9f24dbd6fea08e17050d
vertices: []
indices:
edges: []
weights: []
outline:
- - {x: -277, y: -208}
- {x: -218, y: -208}
- {x: -198, y: -199}
- {x: -198, y: -146}
- {x: -200, y: -141}
- {x: -265, y: -141}
- {x: -277, y: -183}
physicsShape: []
bones: []
spriteID: 5b355a65f1e555045a58300a3ab6237e
......
fileFormatVersion: 2
guid: 1cc46b7545212554fa063393705ae076
TextureImporter:
fileIDToRecycleName: {}
fileIDToRecycleName:
21300000: Tent Door_0
externalObjects: {}
serializedVersion: 7
mipmaps:
......@@ -40,7 +41,7 @@ TextureImporter:
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
......@@ -69,9 +70,40 @@ TextureImporter:
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
sprites:
- serializedVersion: 2
name: Tent Door_0
rect:
serializedVersion: 2
x: 110
y: 49
width: 173
height: 143
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 3027d14b843e8704bbdb599f83f0c358
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment