Ejemplo n.º 1
0
    //public bool forTesting = false;

    private void Awake()
    {
        colorHandler = FindObjectOfType <ColorHandler>();
        pauseBlocker = FindObjectOfType <PauseBlocker>();
        gameLoop     = FindObjectOfType <GameLoop>();
        grid         = GetComponent <CellsGrid>();
    }
Ejemplo n.º 2
0
        internal void Deserialize(HashSet <Cell> all_cells, Dictionary <int, Cell> id_to_cell, BinaryReader r)
        {
            base.Deserialize(all_cells, null, r);

            int cells_count = r.ReadInt32();

            for (int i = 0; i < cells_count; ++i)
            {
                int cell_global_id = r.ReadInt32();
                Cells.Add(id_to_cell != null ? id_to_cell[cell_global_id] : all_cells.First(x => x.GlobalId == cell_global_id));
            }

            int cells_grid_count = r.ReadInt32();

            for (int i = 0; i < cells_grid_count; ++i)
            {
                var key = new AABB(r);
                int cells_list_count = r.ReadInt32();
                var cells            = new List <Cell>();
                for (int j = 0; j < cells_list_count; ++j)
                {
                    int cell_global_id = r.ReadInt32();
                    cells.Add(id_to_cell != null ? id_to_cell[cell_global_id] : all_cells.First(x => x.GlobalId == cell_global_id));
                }
                CellsGrid.Add(key, cells);
            }
        }
Ejemplo n.º 3
0
 private void Start()
 {
     grid = FindObjectOfType <CellsGrid>();
     cell = GetComponent <Cell>();
 }
Ejemplo n.º 4
0
 private void Start()
 {
     grid = FindObjectOfType <CellsGrid>();
 }