Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gstuitje
RingMaster
Commits
6d2d8b7e
Commit
6d2d8b7e
authored
Feb 10, 2019
by
Mitchie Maluschnig
Browse files
added parallax to the tent
parent
9c96eef6
Changes
2
Hide whitespace changes
Inline
Side-by-side
RingMaster/RingMaster/Assets/Scenes/Daytime.unity
View file @
6d2d8b7e
...
...
@@ -281,11 +281,11 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 102930288}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -8.
1
2, y:
-
0.0
20
00000
1
, z:
0
}
m_LocalScale: {x:
1
, y:
1
, z: 1}
m_LocalPosition: {x: -
1
8.
55800
2, y: 0.0
8
00000
4
, z:
-2
}
m_LocalScale: {x:
4
, y:
3.7
, z: 1}
m_Children: []
m_Father: {fileID: 1
146273524
}
m_RootOrder:
1
m_Father: {fileID: 1
230210401
}
m_RootOrder:
3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &102930290
SpriteRenderer:
...
...
@@ -561,7 +561,7 @@ Transform:
- {fileID: 2080760845}
- {fileID: 764569484}
m_Father: {fileID: 491873958}
m_RootOrder:
3
m_RootOrder:
4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &134449645
GameObject:
...
...
@@ -882,7 +882,7 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 231697272}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x:
8.04, y: -0.02
, z: 0}
m_LocalPosition: {x:
6.156, y: 0
, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1146273524}
...
...
@@ -1478,10 +1478,10 @@ Transform:
- {fileID: 1281771175}
- {fileID: 2052297032}
- {fileID: 239513157}
- {fileID: 1175208678}
- {fileID: 124138637}
- {fileID: 628651730}
- {fileID: 1091683637}
- {fileID: 1
146273524
}
- {fileID: 1
230210401
}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
...
...
@@ -1546,14 +1546,14 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 503603550}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x:
-2.98, y: -1.4810811, z: 0.14648438
}
m_LocalScale: {x:
0.25
, y:
0.2702703
, z: 1}
m_LocalPosition: {x:
0.049999595, y: 0.5700002, z: -1.8535156
}
m_LocalScale: {x:
1
, y:
1
, z: 1}
m_Children:
- {fileID: 1397976877}
- {fileID: 258363427}
- {fileID: 2138223315}
m_Father: {fileID:
628651730
}
m_RootOrder:
1
m_Father: {fileID:
1230210401
}
m_RootOrder:
2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &511771227
GameObject:
...
...
@@ -1735,10 +1735,16 @@ MonoBehaviour:
- {fileID: 1281771175}
- {fileID: 2052297032}
- {fileID: 239513157}
- {fileID: 1175208678}
distances:
- 1
- 0.95
- 0.6
- -0.009
tent: {fileID: 1230210400}
door: {fileID: 1402622834}
maxSquish: 1
maxDistance: 250
--- !u!1 &601223109
GameObject:
m_ObjectHideFlags: 0
...
...
@@ -1793,13 +1799,11 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 628651729}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1
0.4
, y:
4.11
, z: -2}
m_LocalPosition: {x: 1
1.969999
, y:
6.05
, z: -2}
m_LocalScale: {x: 4, y: 3.7, z: 1}
m_Children:
- {fileID: 1402622834}
- {fileID: 503603553}
m_Father: {fileID: 491873958}
m_RootOrder: 4
m_Children: []
m_Father: {fileID: 1230210401}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &628651731
SpriteRenderer:
...
...
@@ -12169,13 +12173,12 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1146273523}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1
0.39
, y: -1.
79
, z: -2}
m_LocalPosition: {x: 1
7.96
, y: -1.
86
, z: -2}
m_LocalScale: {x: 4, y: 3.7, z: 1}
m_Children:
- {fileID: 231697273}
- {fileID: 102930289}
m_Father: {fileID: 491873958}
m_RootOrder: 6
m_Father: {fileID: 1175208678}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1146273525
SpriteRenderer:
...
...
@@ -12212,7 +12215,7 @@ SpriteRenderer:
m_SortingLayerID: -1966733235
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 2130000
4
, guid: 4912bb1b0bc6d2146898d2cfb55c153f, type: 3}
m_Sprite: {fileID: 2130000
2
, guid: 4912bb1b0bc6d2146898d2cfb55c153f, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
...
...
@@ -12223,6 +12226,35 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1175208677
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1175208678}
m_Layer: 0
m_Name: layer3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1175208678
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1175208677}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1146273524}
m_Father: {fileID: 491873958}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1193059960
GameObject:
m_ObjectHideFlags: 0
...
...
@@ -12663,6 +12695,38 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1230210400
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1230210401}
m_Layer: 0
m_Name: Tent
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1230210401
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1230210400}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.57, y: -1.94, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 628651730}
- {fileID: 1402622834}
- {fileID: 503603553}
- {fileID: 102930289}
m_Father: {fileID: 491873958}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1231582143
GameObject:
m_ObjectHideFlags: 0
...
...
@@ -17720,11 +17784,11 @@ Transform:
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1402622833}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -
3.03
3, y:
-
1.29
2
, z:
0
}
m_LocalScale: {x:
1
, y:
1
, z: 1}
m_LocalPosition: {x: -
0.162000
3, y: 1.2
69599
9, z:
-2
}
m_LocalScale: {x:
4
, y:
3.7
, z: 1}
m_Children: []
m_Father: {fileID:
628651730
}
m_RootOrder:
0
m_Father: {fileID:
1230210401
}
m_RootOrder:
1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1402622835
SpriteRenderer:
...
...
RingMaster/RingMaster/Assets/Scripts/DaytimeScripts/Parllax.cs
View file @
6d2d8b7e
...
...
@@ -6,6 +6,11 @@ public class Parllax : MonoBehaviour {
public
Transform
[]
ParalaxLayers
;
public
float
[]
distances
;
public
GameObject
tent
;
public
Transform
door
;
public
float
maxSquish
;
public
float
maxDistance
;
private
float
lastX
;
...
...
@@ -15,12 +20,21 @@ public class Parllax : MonoBehaviour {
lastX
=
transform
.
position
.
x
;
}
private
void
Fixed
Update
()
{
private
void
Update
()
{
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
;
}
float
distanceFromDoor
=
transform
.
position
.
x
-
door
.
position
.
x
;
if
(
distanceFromDoor
>=
0
)
{
float
scale
=
1
-
(
distanceFromDoor
/
maxDistance
);
Vector3
newScale
=
tent
.
transform
.
localScale
;
newScale
.
x
=
scale
*
maxSquish
;
tent
.
transform
.
localScale
=
newScale
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment