Exemplo n.º 1
0
        private void button6_Click(object sender, RoutedEventArgs e)
        {
            DroneAnimation animation   = ARDrone.Control.Commands.DroneAnimation.WAVE;
            int            miliseconds = Convert.ToInt16(animationDurationBox.Text.ToString()) * 1000;

            switch (DroneAnimationComboBox.SelectedIndex)
            {
            case 0: animation = ARDrone.Control.Commands.DroneAnimation.FLIP_FRONT; break;

            case 1: animation = ARDrone.Control.Commands.DroneAnimation.FLIP_BACK; break;

            case 2: animation = ARDrone.Control.Commands.DroneAnimation.FLIP_LEFT; break;

            case 3: animation = ARDrone.Control.Commands.DroneAnimation.FLIP_RIGHT; break;

            case 4: animation = ARDrone.Control.Commands.DroneAnimation.PHI_M30_DEG; break;

            case 5: animation = ARDrone.Control.Commands.DroneAnimation.PHI_30_DEG; break;

            case 6: animation = ARDrone.Control.Commands.DroneAnimation.THETA_M30_DEG; break;

            case 7: animation = ARDrone.Control.Commands.DroneAnimation.THETA_30_DEG; break;

            case 8: animation = ARDrone.Control.Commands.DroneAnimation.THETA_20DEG_YAW_200DEG; break;

            case 9: animation = ARDrone.Control.Commands.DroneAnimation.THETA_20DEG_YAW_M200DEG; break;

            case 10: animation = ARDrone.Control.Commands.DroneAnimation.TURNAROUND; break;

            case 11: animation = ARDrone.Control.Commands.DroneAnimation.TURNAROUND_GODOWN; break;

            case 12: animation = ARDrone.Control.Commands.DroneAnimation.YAW_DANCE; break;

            case 13: animation = ARDrone.Control.Commands.DroneAnimation.PHI_DANCE; break;

            case 14: animation = ARDrone.Control.Commands.DroneAnimation.THETA_DANCE; break;

            case 15: animation = ARDrone.Control.Commands.DroneAnimation.VZ_DANCE; break;

            case 16: animation = ARDrone.Control.Commands.DroneAnimation.WAVE; break;

            case 17: animation = ARDrone.Control.Commands.DroneAnimation.PHI_THETA_MIXED; break;

            case 18: animation = ARDrone.Control.Commands.DroneAnimation.DOUBLE_PHI_THETA_MIXED; break;

            case 19: animation = ARDrone.Control.Commands.DroneAnimation.MAYDAY; break;
            }

            Command DroneAnimationCommand = new PlayDroneAnimationCommand(animation, miliseconds);

            droneControl.SendCommand(DroneAnimationCommand);
        }
Exemplo n.º 2
0
    void Start()
    {
        _GM_   = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
        player = _GM_.player;
        rb     = GetComponent <Rigidbody2D>();
        if (droneType == 1)
        {
            attackScript = GetComponent <DroneAttack>();
        }
        else
        {
            attackScript2 = GetComponent <Drone2Attack>();
        }

        anim = GetComponent <DroneAnimation>();
    }
Exemplo n.º 3
0
 public PlayDroneAnimationCommand(DroneAnimation droneAnimation, int duration)
 {
     this.droneAnimation = droneAnimation;
     this.duration       = duration;
 }
 public PlayDroneAnimationCommand(DroneAnimation droneAnimation, int duration)
 {
     this.droneAnimation = droneAnimation;
     this.duration = duration;
 }