void Awake() { m_Camera = m_Camera != null ? m_Camera : Camera.main; m_CanvasTexture = new Texture2D(m_CanvasSize, m_CanvasSize, TextureFormat.ARGB32, false, true); m_CanvasTexture.filterMode = FilterMode.Point; m_CanvasMaterial.SetTexture("_MainTex", m_CanvasTexture); m_CanvasMaterial.SetColorArray("_MainColors", m_MainColors); _Canvas = new Tex2DCanvas(m_CanvasTexture); _Canvas.Flush(); }
private void DrawTextureAtPos(Vector2Int pos) { //Debug.Log("DrawTextureAtPos! pos = " + pos); CanvasCell cell = _Canvas.GetCellByPos(pos.x, pos.y); cell.data0 = 0b_1010_1010; cell.data1 = 0b_0010_0001; cell.data2 = 0b_0100_0011; cell.data3 = 0b_0000_0000; cell.dirty = true; _Canvas.Flush(); }