Ejemplo n.º 1
0
    private void Update()
    {
        if (Input.GetAxis("Horizontal") > 0)
        {
            m_ship.TurnClockwise();
            horizontal = true;
        }
        else if (Input.GetAxis("Horizontal") < 0)
        {
            m_ship.TurnCounterClockWise();
            horizontal = true;
        }
        else if (horizontal)
        {
            horizontal = false;
            m_ship.StopTurn();
        }

        if (Input.GetAxis("Vertical") > 0)
        {
            m_ship.Thrust(1);
            vertical = true;
        }
        else if (vertical)
        {
            vertical = false;
            m_ship.StopThrust();
        }

        if (Input.GetButtonDown("Fire"))
        {
            m_ship.GetComponentInChildren <ABR_Turret>().FireBullet();
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        ABR_Ship ship = other.GetComponent <ABR_Ship>();

        if (ship != null)
        {
            runaways.Remove(ship);

            NotificationReciever notificationReciever = ship.GetComponent <NotificationReciever>();
            if (notificationReciever != null)
            {
                notificationReciever.Notify("Lost Control", false);
            }

            ship.StopThrust(true);
            ship.StopTurnTo(true);
        }
    }
Ejemplo n.º 3
0
 private void EndTouch()
 {
     m_ship.StopThrust();
     ToggleTouchVisual(false);
     started = false;
 }