Exemplo n.º 1
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);
        }
    }
Exemplo n.º 2
0
    private void OnTriggerExit2D(Collider2D other)
    {
        ABR_Ship ship = other.GetComponent <ABR_Ship>();

        if (ship != null)
        {
            runaways.Add(ship);
            NotificationReciever notificationReciever = ship.GetComponent <NotificationReciever>();
            if (notificationReciever != null)
            {
                notificationReciever.Notify("Lost Control");
            }
        }
        else
        {
            ABR_Asteroid asteroid = other.GetComponent <ABR_Asteroid>();

            if (asteroid)
            {
                other.gameObject.SetActive(false);
            }
        }
    }
Exemplo n.º 3
0
 private void Awake()
 {
     m_ship = GetComponent <ABR_Ship>();
 }
Exemplo n.º 4
0
 private void Awake()
 {
     m_target = GetComponent <ABR_Ship>();
 }