Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Suck It
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GameDevWeek
W
Wintersemester 2018-2019
Unity
Suck It
Commits
063ce07c
Commit
063ce07c
authored
Mar 30, 2019
by
Michael But
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/ws-18_19/unity/suck-it
parents
8274b11d
8f1d1b56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
50 deletions
+31
-50
Assets/_Game/Scripts/Level Hazards/MovingPlattform.cs
Assets/_Game/Scripts/Level Hazards/MovingPlattform.cs
+0
-1
Assets/_Game/Scripts/Level Hazards/SliderObject.cs
Assets/_Game/Scripts/Level Hazards/SliderObject.cs
+2
-2
Assets/_Game/Scripts/Player/PlayerAnimation.cs
Assets/_Game/Scripts/Player/PlayerAnimation.cs
+29
-47
No files found.
Assets/_Game/Scripts/Level Hazards/MovingPlattform.cs
View file @
063ce07c
...
...
@@ -55,7 +55,6 @@ public class MovingPlattform : MonoBehaviour {
}
private
void
MoveForward
()
{
Debug
.
Log
(
gameObject
.
name
+
" form: "
+
isAt
+
" to "
+
(
isAt
+
1
)
+
" isFacing: "
+
isFacingForward
);
if
((
isAt
+
1
)
<
m_Points
.
Count
)
{
//normale vor und zurück bewegung
StartCoroutine
(
Move
(
origin
+
m_Points
[
isAt
],
origin
+
m_Points
[
isAt
+
1
]));
...
...
Assets/_Game/Scripts/Level Hazards/SliderObject.cs
View file @
063ce07c
...
...
@@ -17,7 +17,7 @@ namespace _Game.Scripts.Level_Hazards
if
(
other
.
gameObject
.
layer
==
LayerMask
.
NameToLayer
(
"Player"
)
||
other
.
gameObject
.
layer
==
LayerMask
.
NameToLayer
(
"Enemy"
)
||
other
.
gameObject
.
CompareTag
(
"Fire"
))
{
_rigidbody2D
.
velocity
=
Vector2
.
zero
;
//
_rigidbody2D.velocity = Vector2.zero;
_rigidbody2D
.
bodyType
=
RigidbodyType2D
.
Static
;
}
}
...
...
@@ -28,7 +28,7 @@ namespace _Game.Scripts.Level_Hazards
other
.
gameObject
.
CompareTag
(
"Fire"
))
{
_rigidbody2D
.
bodyType
=
RigidbodyType2D
.
Dynamic
;
_rigidbody2D
.
velocity
=
Vector2
.
zero
;
//
_rigidbody2D.velocity = Vector2.zero;
}
}
}
...
...
Assets/_Game/Scripts/Player/PlayerAnimation.cs
View file @
063ce07c
...
...
@@ -172,32 +172,36 @@ public class PlayerAnimation : MonoBehaviour
transform
.
localScale
=
s
;
}
private
IEnumerator
ScaleUp
(
int
from
,
in
t
to
)
private
IEnumerator
ScaleUp
(
float
from
,
floa
t
to
)
{
/*m_isAnimating = true;
Vector3 s = transform.localScale;
float step = 1 / m_Time;
float timer = 0.0f;
float x = 0f;
float diff = to - from;
while (timer <= m_Time)
{
x = m_SizePerCharge * Mathf.Abs(diff);
transform.localScale = Vector3.Lerp(s, s + new Vector3(x * Mathf.Sign(transform.localScale.x), x, x),
m_AirScale.Evaluate(timer / m_Time));
timer += Time.deltaTime;
yield return null;
}
m_isAnimating
=
true
;
float
newSize
=
m_SizePerCharge
*
Mathf
.
Abs
((
to
-
from
));
transform
.
localScale
+=
new
Vector3
(
newSize
*
Mathf
.
Sign
(
transform
.
localScale
.
x
),
newSize
,
newSize
);
yield
return
null
;
m_isAnimating
=
false
;
}
transform.localScale = s + new Vector3(x * Mathf.Sign(transform.localScale.x), x, x);
m_isAnimating = false;*/
private
IEnumerator
ScaleDown
(
float
from
,
float
to
)
{
m_isAnimating
=
true
;
float
newSize
=
m_SizePerCharge
*
Mathf
.
Abs
((
to
-
from
));
transform
.
localScale
-=
new
Vector3
(
newSize
*
Mathf
.
Sign
(
transform
.
localScale
.
x
),
newSize
,
newSize
);
yield
return
null
;
m_isAnimating
=
false
;
}
/*private IEnumerator ScaleUp(float from, float to)
{
m_isAnimating = true;
float step = 1 / m_Time;
float timer = 0.0f;
Vector3 scale = transform.localScale;
while (timer <= m_Time)
{
float newSize = m_SizePerCharge * Mathf.Abs((to - from));
scale.x *= Mathf.Sign(transform.localScale.x);
transform.localScale = Vector3.Lerp(transform.localScale, transform.localScale + new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize),
m_AirScale.Evaluate(timer / m_Time));
timer += Time.deltaTime;
...
...
@@ -205,42 +209,20 @@ public class PlayerAnimation : MonoBehaviour
}
m_isAnimating = false;
}
}
*/
private
IEnumerator
ScaleDown
(
int
from
,
int
to
)
{
/*m_isAnimating = true;
Vector3 s = transform.localScale;
float step = 1 / m_Time;
float timer = 0.0f;
float x = 0;
float diff = to - from;
while (timer <= m_Time)
{
x = m_SizePerCharge * Mathf.Abs(diff);
transform.localScale = Vector3.Lerp(s, s - new Vector3(x * Mathf.Sign(transform.localScale.x), x, x),
m_AirScale.Evaluate(timer / m_Time));
timer += Time.deltaTime;
yield return null;
}
if (r_State.GetCharges() > 0)
{
transform.localScale = s - new Vector3(x * Mathf.Sign(transform.localScale.x), x, x);
}
else
{
ScaleReset();
}
m_isAnimating = false;*/
/*private IEnumerator ScaleDown(float from, float to)
{
m_isAnimating = true;
float step = 1 / m_Time;
float timer = 0.0f;
Vector3 scale = transform.localScale;
while (timer <= m_Time)
{
float newSize = m_SizePerCharge * Mathf.Abs((to - from));
scale.x *= Math.Sign(transform.localScale.x);
transform.localScale = Vector3.Lerp(transform.localScale, transform.localScale - new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize),
m_AirScale.Evaluate(timer / m_Time));
timer += Time.deltaTime;
...
...
@@ -249,8 +231,8 @@ public class PlayerAnimation : MonoBehaviour
if (r_State.GetCharges() > 0)
{
float
newSize
=
m_SizePerCharge
*
Mathf
.
Abs
((
to
-
from
));
transform
.
localScale
=
transform
.
localScale
-
new
Vector3
(
newSize
*
Mathf
.
Sign
(
transform
.
localScale
.
x
),
newSize
,
newSize
);
//
float newSize = m_SizePerCharge * Mathf.Abs((to - from));
//
transform.localScale = transform.localScale - new Vector3(newSize * Mathf.Sign(transform.localScale.x), newSize, newSize);
}
else
{
...
...
@@ -258,7 +240,7 @@ public class PlayerAnimation : MonoBehaviour
}
m_isAnimating = false;
}
}
*/
private
IEnumerator
RotatingElements
()
{
...
...
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