Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Wintersemester 2018-2019
Unity
Suck It
Commits
aa2c9f87
Commit
aa2c9f87
authored
Mar 30, 2019
by
Sebastian
Browse files
Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/ws-18_19/unity/suck-it
merge for pull
parents
ed57dd11
8f1d1b56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Assets/_Game/Scripts/Level Hazards/MovingPlattform.cs
View file @
aa2c9f87
...
...
@@ -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/Player/PlayerAnimation.cs
View file @
aa2c9f87
...
...
@@ -172,32 +172,36 @@ public class PlayerAnimation : MonoBehaviour
transform
.
localScale
=
s
;
}
private
IEnumerator
ScaleUp
(
in
t
from
,
in
t
to
)
private
IEnumerator
ScaleUp
(
floa
t
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