// Start is called before the first frame update void Start() { startpos = 0f; points = 0.01f; Reel.value = startpos; Fish.value = startpos; CurrentFishDirection = FishDirection.MovingUp; }
//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; } }
// 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(); }
//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; } } }