コード例 #1
0
        void IGraphViewCallback.Initialize()
        {
            m_ExportTextureNode = new ExportTextureNode();
            AddElement(m_ExportTextureNode);
            var pos = Rect.zero;

            pos.center = layout.center;
            m_ExportTextureNode.SetPosition(pos);
        }
コード例 #2
0
        Texture2D ProcessAll()
        {
            if (m_ExportTextureNode == null)
            {
                m_ExportTextureNode = this.Q <ExportTextureNode>();
            }
            m_ExportTextureNode.StartProcess(new TextureGraphData(width, height));
            var texture = new Texture2D(width, height, TextureFormat.RGBA32, false)
            {
                hideFlags = HideFlags.DontSave
            };

            texture.SetPixels(m_ExportTextureNode.colors);
            texture.Apply();
            return(texture);
        }