Exemplo n.º 1
0
 private void Move()
 {
     if (rising)
     {
         if (transform.position.y < MAXIMUM_HEIGHT)
         {
             Vector3 rise_position = transform.position;
             rise_position.y    = MAXIMUM_HEIGHT;
             transform.position = Vector3.MoveTowards(transform.position, rise_position, movement_speed *
                                                      EngineStrategy.GetDeltaTime());
         }
         else
         {
             rising = false;
             Vector3 target_position = coordinate;
             target_position.y  = MAXIMUM_HEIGHT;
             transform.position = target_position;
         }
     }
     else
     {
         UpdatePosition();
         UpdateCoordinates();
         UpdateShadow();
         if ((transform.position - coordinate).magnitude > COLLISION_DISTANCE)
         {
             transform.position = Vector3.MoveTowards(transform.position, coordinate, movement_speed *
                                                      EngineStrategy.GetDeltaTime());
         }
         else
         {
             projectile_explosion.Explode(gameObject, explosion, transform.position, transform.rotation);
         }
     }
 }
Exemplo n.º 2
0
 public void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.tag == "Player")
     {
         projectile_explosion.Explode(gameObject, explosion, transform.position, transform.rotation);
     }
 }
Exemplo n.º 3
0
 private void Move()
 {
     if ((transform.position - coordinate).magnitude > COLLISION_DISTANCE)
     {
         transform.position = Vector3.MoveTowards(transform.position, coordinate, movement_speed *
                                                  EngineStrategy.GetDeltaTime());
     }
     else
     {
         projectile_explosion.Explode(gameObject, explosion, transform.position, transform.rotation);
     }
 }