Ejemplo n.º 1
0
        public static CanvasCell Create(Tex2DCanvas owner, int x, int y)
        {
            CanvasCell cell = new CanvasCell();

            cell.owner = owner;
            cell.x     = x;
            cell.y     = y;
            cell.dirty = true;
            return(cell);
        }
        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();
        }
Ejemplo n.º 3
0
        //============================================================================================================
        // static factory
        //============================================================================================================

        public static CanvasCell Create(Tex2DCanvas owner, Vector2Int pos)
        {
            return(Create(owner, pos.x, pos.y));
        }