public InRangeCellInfo InstantiateCell(CELLRecord CELL) { Debug.Assert(CELL != null); string cellObjName = null; LANDRecord LAND = null; if (!CELL.isInterior) { cellObjName = "cell " + CELL.gridCoords.ToString(); LAND = dataReader.FindLANDRecord(CELL.gridCoords); } else { cellObjName = CELL.NAME.value; } var cellObj = new GameObject(cellObjName); cellObj.tag = "Cell"; var cellObjectsContainer = new GameObject("objects"); cellObjectsContainer.transform.parent = cellObj.transform; var cellCreationCoroutine = InstantiateCellObjectsCoroutine(CELL, LAND, cellObj, cellObjectsContainer); temporalLoadBalancer.AddTask(cellCreationCoroutine); return(new InRangeCellInfo(cellObj, cellObjectsContainer, cellCreationCoroutine)); }
public InRangeCellInfo StartInstantiatingCell(CELLRecord cell) { Debug.Assert(cell != null); string cellObjName = null; LANDRecord land = null; if (!cell.IsInterior) { cellObjName = string.Format("cell-{0:00}x{1:00}", cell.GridId.x, cell.GridId.y); land = _data.FindLANDRecord(cell.GridId); } else { cellObjName = cell.Name; } var cellObj = new GameObject(cellObjName) { tag = "Cell" }; var cellObjectsContainer = new GameObject("objects"); cellObjectsContainer.transform.parent = cellObj.transform; var cellObjectsCreationCoroutine = InstantiateCellObjectsCoroutine(cell, land, cellObj, cellObjectsContainer); _loadBalancer.AddTask(cellObjectsCreationCoroutine); return(new InRangeCellInfo(cellObj, cellObjectsContainer, cell, cellObjectsCreationCoroutine)); }
public InRangeCellInfo StartInstantiatingCell(CELLRecord cell) { Assert(cell != null); var cellObjName = "cell " + cell.GridId.ToString(); var land = _dataPack.FindLANDRecord(cell.GridId); var cellObj = new GameObject(cellObjName) { tag = "Cell" }; var cellObjectsContainer = new GameObject("objects"); cellObjectsContainer.transform.parent = cellObj.transform; var cellObjectsCreationCoroutine = InstantiateCellObjectsCoroutine(cell, land, cellObj, cellObjectsContainer); _loadBalancer.AddTask(cellObjectsCreationCoroutine); return(new InRangeCellInfo(cellObj, cellObjectsContainer, cell, cellObjectsCreationCoroutine)); }