Ejemplo n.º 1
0
    void SetUiValues(so_DataSet _dataSet)
    {
        if (_dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Stone) != null)
        {
            TextStone.text = _dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Stone).Value.ToString();
        }
        else
        {
            TextStone.text = "0";
        }
        if (_dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Coal) != null)
        {
            TextCoal.text = _dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Coal).Value.ToString();
        }
        else
        {
            TextCoal.text = "0";
        }
        if (_dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Iron) != null)
        {
            TextIron.text = _dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Iron).Value.ToString();
        }
        else
        {
            TextIron.text = "0";
        }
        if (_dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Dida) != null)
        {
            TextDida.text = _dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Dida).Value.ToString();
        }
        else
        {
            TextDida.text = "0";
        }
        if (_dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Gale) != null)
        {
            TextGale.text = _dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Gale).Value.ToString();
        }
        else
        {
            TextGale.text = "0";
        }
        if (_dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Energy) != null)
        {
            TextEnergy.text = _dataSet.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Cost_Energy).Value.ToString();
        }
        else
        {
            TextEnergy.text = "0";
        }

        Icon.sprite = DataSet.MainIcon;
    }
Ejemplo n.º 2
0
 public void BtnClick_SetDataSet(so_DataSet _dataSet)
 {
     DataSet = _dataSet;
     BuildInfoBox.SetActive(true);
     SetUiValues(DataSet);
 }