private DeveloperPlayerHUD InitPlayerHUD(GameObject player, Transform playerHUDHolder)
    {
        if (player == null)
        {
            return(null);
        }
        DeveloperPlayerHUD hud = new DeveloperPlayerHUD();

        hud.player = player.GetComponent <PlayerBehaviour>();
        hud.health = playerHUDHolder.Find("Health").GetComponent <Text>();
        hud.armor  = playerHUDHolder.Find("Armor").GetComponent <Text>();
        return(hud);
    }
 private void UpdateHealth(DeveloperPlayerHUD hud)
 {
     hud.health.text = hud != null?hud.player.hp.ToString() : "0";
 }
    private void UpdateArmor(DeveloperPlayerHUD hud)
    {
        bool hasArmor = hud != null && hud.player.armor != null;

        hud.armor.text = hasArmor ? hud.player.armor.Value.ToString() : "0";
    }
 void Start()
 {
     //timerText = transform.Find("Timer").GetComponent<Text>();
     hudP1 = InitPlayerHUD(GameObject.FindGameObjectWithTag("Player"), transform.Find("Player1"));
     hudP2 = InitPlayerHUD(GameObject.FindGameObjectWithTag("Player"), transform.Find("Player1"));
 }