Exemplo n.º 1
0
        void AcquireTarget()
        {
            // if there is no target selected
            if (targetSystem.currentTargets.Count < 0)
            {
                // is there any target out there
                if (targetSystem.potentialTargets.Count > 0)
                {
                    targetSystem.cycleUpTargets();
                }
                else
                {
                    status = Status.FREE_ROAM;
                    return;
                }
            }

            status = Status.ENGAGE_MODE;
        }
Exemplo n.º 2
0
        // Update is called once per frame
        void Update()
        {
            flightControl.isBraking = false;

            // thrust and brake are mutually exclusive
            if (Input.GetButton("Brake"))
            {
                flightControl.Brake();
            }

            if (!flightControl.isBraking)
            {
                inputAxis = Input.GetAxis("Thrust");
                flightControl.Thrust(inputAxis);
            }

            // roll, pitch and yaw are not mutually exclusive
            inputAxis = Input.GetAxis("Roll");
            flightControl.Roll(inputAxis);

            inputAxis = Input.GetAxis("Pitch");
            flightControl.Pitch(inputAxis);

            inputAxis = Input.GetAxis("Yaw");
            flightControl.Yaw(inputAxis);



            /*********** WEAPON SYSTEM ***************/

            if (Input.GetButtonUp("Fire Weapon"))
            {
                weaponSystem.FireWeapon();
            }

            inputAxis = Input.GetAxis("Cycle Weapon");
            if (inputAxis > 0f)
            {
                weaponSystem.CycleUpWeapon();
            }
            else if (inputAxis < 0f)
            {
                weaponSystem.CycleDownWeapon();
            }


            /************* TARGET SYSTEM ***************/

            inputAxis = Input.GetAxis("Cycle Target");
            if (inputAxis > 0f)
            {
                targetSystem.cycleUpTargets();
            }
            else if (inputAxis < 0f)
            {
                targetSystem.cycleDownTargets();
            }


            /********* COUNTER-MEASURE SYSTEM **********/

            if (Input.GetButtonUp("Deploy Flare"))
            {
                cmSystem.DeployFlare();
            }
        }