Update EnemyReturn Script Optimizations

This commit is contained in:
Philip W 2021-11-02 16:21:52 +00:00
parent 54446d676b
commit 1d0a89a9ef

View File

@ -29,14 +29,7 @@ public class EnemyReturn : Physics2DObject
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (isReturning) movement = (isReturning) ? new Vector2(0f, returnSpeed) : new Vector2(0f, -normalSpeed);
{
movement = new Vector2(0f, returnSpeed);
}
else
{
movement = new Vector2(0f, -normalSpeed);
}
} }
//FixedUpdate is called every frame when the physics are calculated //FixedUpdate is called every frame when the physics are calculated