public void SetType(CitizenTypes type)
    {
        if (type == CitizenTypes.Worker)
        {
            GetComponent<AIAttackScript>().hp = 3;
            GetComponent<MeshRenderer>().material = (Material) Instantiate(Resources.Load("materials/citizen"));
        }
        else if (type == CitizenTypes.Blonde)
        {
            GetComponent<AIAttackScript>().hp = 10;
            GetComponent<MeshRenderer>().material = (Material) Instantiate(Resources.Load("materials/citizen2"));
        }
        else if (type == CitizenTypes.Sailor)
        {
            GetComponent<AIAttackScript>().hp = 20;
            GetComponent<MeshRenderer>().material = (Material) Instantiate(Resources.Load("materials/citizen3"));
        }

        m_type = type;
    }
Exemple #2
0
    public void SetType(CitizenTypes type)
    {
        if (type == CitizenTypes.Worker)
        {
            GetComponent <AIAttackScript>().hp     = 3;
            GetComponent <MeshRenderer>().material = (Material)Instantiate(Resources.Load("materials/citizen"));
        }
        else if (type == CitizenTypes.Blonde)
        {
            GetComponent <AIAttackScript>().hp     = 10;
            GetComponent <MeshRenderer>().material = (Material)Instantiate(Resources.Load("materials/citizen2"));
        }
        else if (type == CitizenTypes.Sailor)
        {
            GetComponent <AIAttackScript>().hp     = 20;
            GetComponent <MeshRenderer>().material = (Material)Instantiate(Resources.Load("materials/citizen3"));
        }

        m_type = type;
    }