aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Bybjerg <mikkel.bybjerg@hotmail.com>2019-04-27 09:09:57 +0200
committerMikkel Bybjerg <mikkel.bybjerg@hotmail.com>2019-04-27 09:09:57 +0200
commit8a17cd03497a4037067f9c1714d69a8975090189 (patch)
tree19cc0fa832028f83da27e842b8dffc263b028117 /nGJ2019/Assets/Scripts/DragonMovement.cs
parent8db39efb58e68f57404ec204f9dbe15e6157f1b0 (diff)
optimize dragon transformations
Diffstat (limited to 'nGJ2019/Assets/Scripts/DragonMovement.cs')
-rw-r--r--nGJ2019/Assets/Scripts/DragonMovement.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/nGJ2019/Assets/Scripts/DragonMovement.cs b/nGJ2019/Assets/Scripts/DragonMovement.cs
index 64d7f21..04f1c3a 100644
--- a/nGJ2019/Assets/Scripts/DragonMovement.cs
+++ b/nGJ2019/Assets/Scripts/DragonMovement.cs
@@ -55,9 +55,9 @@ public class DragonMovement : MonoBehaviour
private IEnumerator transformSlim()
{
- while(state == State.slim && transform.localScale.y > 0.2f)
+ while(state == State.slim && swarm.Collapse < 0.8f)
{
- transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y-0.03f, transform.localScale.z-0.03f);
+ swarm.Collapse += 0.05f;
yield return new WaitForSeconds(0.01f);
}
}
@@ -73,9 +73,9 @@ public class DragonMovement : MonoBehaviour
private IEnumerator transformAntiSlim()
{
- while(state == State.normal && transform.localScale.y < 1)
+ while(state == State.normal && swarm.Collapse > 0)
{
- transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y+0.05f, transform.localScale.z+0.05f);
+ swarm.Collapse -= 0.07f;
yield return new WaitForSeconds(0.01f);
}
if(state == State.normal)
@@ -155,7 +155,7 @@ public class DragonMovement : MonoBehaviour
private void resetTurn()
{
- transform.localScale = Vector3.one;
+ swarm.Collapse = 0;
swarm.Noise = 0;
}