示例#1
0
    private void DecidEspião()
    {
        float  c    = Random.Range(0, 100);
        string a    = "";
        int    font = 0;

        if (c < 30)
        {
            font = 50;
            a    = "NADA";
        }
        else if (c >= 30 && c <= 60)
        {
            font = 50;
            a    = "ESPIÃO";
            telaInterrogatorio.transform.GetChild(7).GetComponent <Image>().color = new Color(1, 1, 1, 0.5f);
        }
        else
        {
            font = 33;
            Conquist con = dadosGO.GetComponent <Conquist>();
            a = "ESPIÃO DE " + con.county[Random.Range(0, con.county.Count)].Name;
            telaInterrogatorio.transform.GetChild(7).GetComponent <Image>().color = new Color(1, 1, 1, 0.5f);
        }
        telaInterrogatorio.transform.GetChild(6).GetComponent <Text>().text     = a;
        telaInterrogatorio.transform.GetChild(6).GetComponent <Text>().fontSize = font;
    }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     sit           = gameObject.GetComponent <Situation>();
     trabalhadores = trabalhadoresTela.GetComponent <Trabalhadores>();
     conquist      = dados.GetComponent <Conquist>();
     ItiateVar();
     current = this;
     StartPopulation();
 }