Example #1
0
    public void Init(Map map, Map.Coord pos, Faction faction)
    {
        this.map     = map;
        this.pos     = pos;
        this.faction = faction;

        pos.x = (int)transform.position.x;
        pos.y = (int)transform.position.z;

        // Set our color to our faction color
        rend = gameObject.GetComponent <Renderer>();
        //Material tempMaterial = new Material(rend.sharedMaterial);
        //tempMaterial.color = faction.color;
        rend.material.color = faction.color;

        Debug.Log("inited");

        map.tiles[pos.x, pos.y].SetOccupationStatus(true);
        faction.AddUnit(this);
    }