// Start is called before the first frame update
 void Start()
 {
     startpos             = 0f;
     points               = 0.01f;
     Reel.value           = startpos;
     Fish.value           = startpos;
     CurrentFishDirection = FishDirection.MovingUp;
 }
예제 #2
0
 //what to do if the fish should be moving down
 private void MoveDown()
 {
     RealCurrHeight -= CalcMov();
     Fish.value     -= CalcMov();
     if (Fish.value == 0.0f)
     {
         CurrentFishDirection = FishDirection.MovingUp;
     }
 }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     MaxHeight            = 10;
     MinHeight            = 0;
     CurrHeight           = 0.01f;
     RealCurrHeight       = 0.0f;
     CurrentFishDirection = FishDirection.MovingUp;
     Fish.value           = CalcMov();
 }
예제 #4
0
 //what to do if the fish should be moving up
 private void MoveUp(float increment)
 {
     CurrHeight     += increment;
     RealCurrHeight += CalcMov();
     Fish.value     += CalcMov();
     if (Fish.value == 1.0f)
     {
         CurrentFishDirection = FishDirection.MovingDown;
     }
 }
 private void MoveFish()
 {
     if (CurrentFishDirection == FishDirection.MovingUp)
     {
         Fish.value += 0.01f;
         if (Fish.value == 1.0f)
         {
             CurrentFishDirection = FishDirection.MovingDown;
         }
     }
     else if (CurrentFishDirection == FishDirection.MovingDown)
     {
         Fish.value -= 0.01f;
         if (Fish.value == 0.0f)
         {
             CurrentFishDirection = FishDirection.MovingUp;
         }
     }
 }