Ejemplo n.º 1
0
        private void Awake()
        {
            grids        = FindObjectsOfType <MyGrid>();
            myProperties = FindObjectOfType <MapDesignerProperties>();
            gridUtil     = GetComponent <GridUtil>();

            sV = FindObjectOfType <SharedVariables>();
        }
Ejemplo n.º 2
0
        // Start is called before the first frame update
        void Awake()
        {
            sV            = FindObjectOfType <SharedVariables>();
            gM            = FindObjectOfType <GridManager>();
            mapProperties = FindObjectOfType <MapDesignerProperties>();
            grids         = gM.grids.ToArray();

            int ColorCount = mapProperties.colorCount;

            Color[] mapColors = mapProperties.colors;

            foreach (MyGrid item in grids)
            {
                int randColor = Random.Range(0, ColorCount);
                item.assignedCell.color = mapColors[randColor];
                item.assignedCell.GetComponent <SpriteRenderer>().color = mapColors[randColor];
            }
        }
Ejemplo n.º 3
0
        private MyGrid GetBelowGrid()
        {
            if (mapProperties == null)
            {
                mapProperties = GetComponent <MapDesignerProperties>();
            }

            int amountOfHorizontalCells = mapProperties.horizontalAmount;

            if (grids.Count < amountOfHorizontalCells)
            {
                return(null);
            }


            int belowRowStartingPoint = grids.Count - amountOfHorizontalCells;



            return(grids[belowRowStartingPoint]);
        }
Ejemplo n.º 4
0
 public void Awake()
 {
     mapProperties = GetComponent <MapDesignerProperties>();
 }