Пример #1
0
    //selects biome
    public void SelectBiome(MultiplayerBiome biome)
    {
        if (selected != null)
        {
            DeselectBiome();
        }

        selected = biome;
        selected.BuildingSpaces.SetActive(true);

        Debug.Log("Selecting: " + selected.transform.parent.name);
    }
Пример #2
0
    void SyncTiles()
    {
        //set biomeType if exists already
        if (biomeType != null)
        {
            o.GetComponentInChildren <MultiplayerBiome>().type = biomeType;
            o.GetComponent <SpriteRenderer>().color            = biomeType.typeColor;
        }
        //sets sprite if exists already
        if (spr != null && spr != "")
        {
            Debug.Log("trying to set spriiiite");

            foreach (Building b in buildings)
            {
                if (b.ToString().Contains(spr))
                {
                    bu = b;
                }
            }

            //syncVar of this

            bi = go.GetComponent <MultiplayerBiome>();
            sr = go.GetComponent <SpriteRenderer>();


            bi.square = bu.buildingIcon;
            sr.sprite = bu.buildingIcon;
            sr.color  = new Color(1f, 1f, 1f);
        }

        //sets if it is starting or not
        if (starting != false)
        {
            o.GetComponentInChildren <MultiplayerBiome>().startingTile = starting;
        }
    }
Пример #3
0
 //deselects biome
 public void DeselectBiome()
 {
     selected.BuildingSpaces.SetActive(false);
     selected = null;
 }