Пример #1
0
 void change_cam_click()
 {
     Debug.Log("cam clicked.............");
     if (View)
     {
         View.SwitchCameras();
     }
 }
Пример #2
0
    void DesktopController()
    {
        // Desktop controller
        flight.SimpleControl = SimpleControl;

        // lock mouse position to the center.
        if (this.gameObject.GetComponent <FlightOnWin>().isWin == false)
        {
            Screen.lockCursor = true;

            flight.AxisControl(new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")));
            if (SimpleControl)
            {
                flight.DirectVelocity = false;
                flight.TurnControl(Input.GetAxis("Mouse X"));
            }
            else
            {
                flight.DirectVelocity = directVelBack;
            }

            flight.TurnControl(Input.GetAxis("Horizontal"));
            flight.SpeedUp(Input.GetAxis("Vertical"));


            if (Input.GetButton("Fire1"))
            {
                flight.WeaponControl.LaunchWeapon();
            }

            if (Input.GetButtonDown("Fire2"))
            {
                flight.WeaponControl.SwitchWeapon();
            }

            if (Input.GetKeyDown(KeyCode.C))
            {
                if (View)
                {
                    View.SwitchCameras();
                }
            }

            if (Input.GetKeyDown(KeyCode.N))
            {
                //Test Win...
                this.gameObject.GetComponent <FlightOnWin>().OnWin();
            }
        }
        else
        {
            Screen.lockCursor = false;
        }
    }
Пример #3
0
    void DesktopController()
    {
        // Desktop controller
        flight.SimpleControl = SimpleControl;

        // lock mouse position to the center.
        MouseLock.MouseLocked = true;

        flight.AxisControl(new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y")));
        if (SimpleControl)
        {
            flight.DirectVelocity = false;
            flight.TurnControl(Input.GetAxis("Mouse X"));
        }
        else
        {
            flight.DirectVelocity = directVelBack;
        }

        flight.TurnControl(Input.GetAxis("Horizontal"));
        flight.SpeedUp(Input.GetAxis("Vertical"));


        if (Input.GetButton("Fire1"))
        {
            flight.WeaponControl.LaunchWeapon();
        }

        if (Input.GetButtonDown("Fire2"))
        {
            flight.WeaponControl.SwitchWeapon();
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            if (View)
            {
                View.SwitchCameras();
            }
        }
    }
    void Start()
    {
        flight = this.GetComponent <FlightSystem> ();
        View   = (FlightView)GameObject.FindObjectOfType(typeof(FlightView));

        // setting all Touch screen controller in the position
        controllerTouch = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, Screen.height - 100));
        fireTouch       = new TouchScreenVal(new Rect(Screen.width / 2, 0, Screen.width / 2, Screen.height));
        switchTouch     = new TouchScreenVal(new Rect(0, Screen.height - 100, Screen.width / 2, 100));
        sliceTouch      = new TouchScreenVal(new Rect(0, 0, Screen.width / 2, 50));

        View.SwitchCameras();
        if (flight)
        {
            directVelBack = flight.DirectVelocity;
        }
    }