public void Imposta(Colonizzato blocco,int x,int y)
 {
     posx = x;
     posy = y;
     bloccoAttuale = blocco;
     SetInformazioni();
 }
示例#2
0
 public Blocco(Naturale natural)
 {
     naturale = natural;
     gameObject = natural.gameObject;
     risorse = natural.risorse;
     colonizzato = null;
 }
示例#3
0
 public Blocco(Naturale natural,Colonizzato colon)
 {
     naturale = natural;
     colonizzato = colon;
     gameObject = colon.gameObject;
     risorse = risorseCompatibili(natural.risorse,colon.risorseProdotte);
 }
 public void setCosto(Colonizzato col)
 {
     PannelloCosti.SetActive(true);
     PannelloCosti.transform.FindChild("CostoLegno").GetComponent<Text>().text = "";
     PannelloCosti.transform.FindChild("CostoRoccia").GetComponent<Text>().text = "";
     PannelloCosti.transform.FindChild("CostoFerro").GetComponent<Text>().text = "";
     PannelloCosti.transform.FindChild("CostoOro").GetComponent<Text>().text = "";
     foreach(ReN ren in col.costoRisorse){
         Risorsa ris = ren.risorsa;
         float costo = ren.numero;
         Text testo;
         switch(ris){
         case Risorsa.Legno:
             testo = PannelloCosti.transform.FindChild("CostoLegno").GetComponent<Text>();
             testo.text = costo.ToString();
             break;
         case Risorsa.Roccia:
             testo = PannelloCosti.transform.FindChild("CostoRoccia").GetComponent<Text>();
             testo.text = costo.ToString();
             break;
         case Risorsa.Ferro:
             testo = PannelloCosti.transform.FindChild("CostoFerro").GetComponent<Text>();
             testo.text = costo.ToString();
             break;
         case Risorsa.Oro:
             testo = PannelloCosti.transform.FindChild("CostoOro").GetComponent<Text>();
             testo.text = costo.ToString();
             break;
         }
     }
 }
示例#5
0
 public void setColonizzato(Colonizzato colonia)
 {
     gameObject = colonia.gameObject;
     colonizzato = colonia;
     risorse = risorseCompatibili(risorse,colonia.risorseProdotte);
 }