コード例 #1
0
    //public bool forTesting = false;

    private void Awake()
    {
        colorHandler = FindObjectOfType <ColorHandler>();
        pauseBlocker = FindObjectOfType <PauseBlocker>();
        gameLoop     = FindObjectOfType <GameLoop>();
        grid         = GetComponent <CellsGrid>();
    }
コード例 #2
0
ファイル: CellsPatch.cs プロジェクト: wlastas/Nav
        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);
            }
        }
コード例 #3
0
 private void Start()
 {
     grid = FindObjectOfType <CellsGrid>();
     cell = GetComponent <Cell>();
 }
コード例 #4
0
ファイル: Cell.cs プロジェクト: EgorVAntonov/CubeAllocator
 private void Start()
 {
     grid = FindObjectOfType <CellsGrid>();
 }