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 OnCollisionEnter2D(Collision2D collision) { ABR_ShipHealth ship = collision.gameObject.GetComponent <ABR_ShipHealth>(); if (ship) { ship.TakeDamage(isInstantKill ? ship.GetMaxHealth() : m_damage); } }
public void JoinGame(int playerIndex) { if (playerIndex > m_players.Length) { Debug.Log("Player Doesn't Exist"); return; } Transform spawnPoint = GetBestSpawnPoint(playerIndex); m_players[playerIndex].ResetTo(spawnPoint); ABR_ShipHealth health = m_players[playerIndex].ship.GetComponent <ABR_ShipHealth>(); if (health) { health.Respawn(); } }