示例#1
0
    public static void UpdateRosterHullDamageIndicators(Ship.GenericShip thisShip)
    {
        thisShip.InfoPanel.transform.Find("ShipInfo/ShipHullText").GetComponent <Text>().text = thisShip.Hull.ToString();
        foreach (Transform damageIndicator in thisShip.InfoPanel.transform.Find("ShipInfo/DamageBarPanel").transform)
        {
            string[] damageIndicatorData = damageIndicator.name.Split('.');
            string   type  = damageIndicatorData[1];
            int      value = int.Parse(damageIndicatorData[2]);
            if (type == "Hull")
            {
                damageIndicator.gameObject.SetActive(value <= thisShip.Hull);
            }
        }

        //Todo: move
        thisShip.ToggleDamaged(thisShip.Hull == 1);
    }