void Update() { if (linearMovementPipe01.isOnDestination()) { canBeActivated = true; } if (suEGiu) { setLinearVariables(); } handleSound(); }
void setLinearVariables() { linearMovement.setDestinationPosition(firstDest.transform.position); linearMovement.canReturnBack = true; linearMovement.pauseToSwitch = 0.0f; //if (actualTurningNum < turningNum) //{ linearMovement.active = true; linearMovement.speed = uberSpeed; if (linearMovement.isOnDestination() || linearMovement.isOnOrigin()) { actualTurningNum++; } //} if (actualTurningNum > turningNum && linearMovement.isOnOrigin()) { //Debug.Log ("entrato"); actualTurningNum = 0; linearMovement.active = false; suEGiu = false; } }