Commit a5bee86e authored by mthiele2's avatar mthiele2
parents 5030df32 901617de
This diff is collapsed.
This diff is collapsed.
...@@ -10,7 +10,7 @@ public class PlayerAnimation : MonoBehaviour ...@@ -10,7 +10,7 @@ public class PlayerAnimation : MonoBehaviour
[Header("Scaling")] public AnimationCurve m_AirScale; [Header("Scaling")] public AnimationCurve m_AirScale;
public bool m_ScalingActive = true; public bool m_ScalingActive = true;
public float m_Time = 10f; public float m_Time = 10f;
public float m_SizePerCharge = 0.2f; public float m_maxScale = 2.0f;
private Vector3 m_OriginScale; private Vector3 m_OriginScale;
private int m_PreviousAirCharges = 0; private int m_PreviousAirCharges = 0;
private int m_CurrentAirCharges = 0; private int m_CurrentAirCharges = 0;
...@@ -153,7 +153,7 @@ public class PlayerAnimation : MonoBehaviour ...@@ -153,7 +153,7 @@ public class PlayerAnimation : MonoBehaviour
public void ScalePlayer() public void ScalePlayer()
{ {
m_CurrentAirCharges = r_State.GetCharges(); m_CurrentAirCharges = r_State.GetCharges();
var scaleFactor = 1.0f + m_CurrentAirCharges * 0.2f; var scaleFactor = 1.0f + m_CurrentAirCharges * (m_maxScale - 1.0f) / 5.0f;
var direction = Mathf.Sign(this.gameObject.transform.localScale.x); var direction = Mathf.Sign(this.gameObject.transform.localScale.x);
var newScale = new Vector3(direction * scaleFactor * m_OriginScale.x, scaleFactor * m_OriginScale.x, 0.0f); var newScale = new Vector3(direction * scaleFactor * m_OriginScale.x, scaleFactor * m_OriginScale.x, 0.0f);
this.gameObject.transform.localScale = newScale; this.gameObject.transform.localScale = newScale;
......
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