Commit 063ce07c authored by Michael But's avatar Michael But

Merge branch 'master' of gitlab.fsi.hochschule-trier.de:GameDevWeek/ws-18_19/unity/suck-it

parents 8274b11d 8f1d1b56
......@@ -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]));
......
......@@ -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;
}
}
}
......
......@@ -172,32 +172,36 @@ public class PlayerAnimation : MonoBehaviour
transform.localScale = s;
}
private IEnumerator ScaleUp(int from, int to)
private IEnumerator ScaleUp(float from, float 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()
{
......
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