Skip to content

Instantly share code, notes, and snippets.

@carlows
Created April 24, 2015 02:16
Show Gist options
  • Save carlows/2288eb0d947c7d9602a4 to your computer and use it in GitHub Desktop.
Save carlows/2288eb0d947c7d9602a4 to your computer and use it in GitHub Desktop.
if(distancia > 20.0f && distancia < 25.0f)
{
mover(2.0f);
}
else if(distancia < 20.0f && distancia > 5.0f)
{
mover(4.0f);
}
else
{
// no puede ver al enemigo
// o está demasiado cerca, asi que no tiene que seguir avanzando
}
void mover(float velocidad)
{
banshee.position += banshee.forward * velocidad * Time.deltaTime;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment