private void Awake() { m_health = m_ship.GetComponent <ABR_ShipHealth>(); m_health.m_healthBar = this; m_healthbar.maxValue = m_health.GetMaxHealth(); m_ship.m_weaponPickupEvent = UpdateWeapon; UpdateHealth(); }
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); } }
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); } } }