Esempio n. 1
0
    void DoAction()
    {
        BirdController bird = birds[Random.Range(0, birds.Count)].GetComponent <BirdController>();

        BirdController._birdMovement birdMovement = (BirdController._birdMovement)Random.Range(0, (int)BirdController._birdMovement.Count);
        switch (birdMovement)
        {
        case BirdController._birdMovement.Soar: bird.Soar(); break;

        case BirdController._birdMovement.Flapping: bird.PlayFlap(); break;

        case BirdController._birdMovement.Forward: bird.MoveForward(Random.Range(minLateralTime, maxLateralTime), Random.Range(minLateralSpeed, maxLateralSpeed)); break;

        case BirdController._birdMovement.Backward: bird.MoveBackward(Random.Range(minLateralTime, maxLateralTime), Random.Range(minLateralSpeed, maxLateralSpeed)); break;

        case BirdController._birdMovement.Ascend: bird.Ascend(Random.Range(minElevationChange, maxElevationChange), Random.Range(minPitchAngle, maxPitchAngle)); break;

        case BirdController._birdMovement.Descend: bird.Descend(Random.Range(minElevationChange, maxElevationChange), Random.Range(minPitchAngle, maxPitchAngle)); break;

        case BirdController._birdMovement.BarrelRollDown: bird.BarrelRollLeft(Random.Range(minRollTime, maxRollTime)); break;

        case BirdController._birdMovement.BarrelRollUp: bird.BarrelRollRight(Random.Range(minRollTime, maxRollTime)); break;

        case BirdController._birdMovement.LoopDown: bird.LoopDLoopDown(Random.Range(minLoopTime, maxLoopTime)); break;

        case BirdController._birdMovement.LoopUp: bird.LoopDLoopUp(Random.Range(minLoopTime, maxLoopTime)); break;

        default: bird.Soar(); break;
        }
    }