public void Spawn(ByteArray2D layout) { m_MaxLoops = (byte)m_LoopPools.Length; Vector3 offScreen = new Vector3(0f, 0f, m_SpawnDepthMin); foreach (LoopPool pool in m_LoopPools) { pool.Initialize(offScreen); } SetCells(layout); UpdateSpawning(); }
private void SetCells(ByteArray2D layout) { m_NumColumns = layout.width; m_NumRows = layout.height; int numCells = layout.bytes.Length; m_Cells = new Cell[numCells]; m_Thresholds = SortThresholds(m_LoopPools); for (int index = 0; index < numCells; ++index) { byte loopIndex = ByteToLoopIndex(layout.bytes[index], m_Thresholds); m_Cells[index] = new Cell(loopIndex, false); } }
public ByteArray2D GetRedChannel() { if (m_RedChannel != null) { return(m_RedChannel); } Color32[] colors = m_Texture.GetPixels32(); int area = m_Texture.width * m_Texture.height; byte[] bytes = new byte[area]; for (int index = 0; index < area; ++index) { bytes[index] = colors[index].r; } m_RedChannel = new ByteArray2D(bytes, m_Texture.width, m_Texture.height); return(m_RedChannel); }