Beispiel #1
0
 protected virtual void MoveAlongConveyor()
 {
     if (MoveWithConveyor && !isLaunching)
     {
         rb.velocity = new Vector2(ConveyorSpeed.GetSpeed(), rb.velocity.y);
     }
 }
Beispiel #2
0
 private void SpawnPotatoIfNeeded()
 {
     if (potatoesLeft > 0 && TimeKeeper.GetTime() > nextPotato)
     {
         animator.SetTrigger("Spawn");
         SoundEvents.Play("ItemDrop");
         var newPotato = Instantiate(potatoes[3 - potatoesLeft], GetSpawnPosition(), spawnTransform.rotation);
         newPotato.velocity        = new Vector2(ConveyorSpeed.GetSpeed(), 0);
         newPotato.angularVelocity = UnityEngine.Random.Range(40, 180);
         potatoesLeft--;
         nextPotato = TimeKeeper.GetTime() + timeBetweenPotatoes;
     }
 }
Beispiel #3
0
 private void FixedUpdate()
 {
     rb.velocity = new Vector2(ConveyorSpeed.GetSpeed(), 0);
 }