public static void Init(TextureNode _src)
    {
        PreviewTextureWindow window = null;

        foreach (var x in m_List)
        {
            if (x != null && !x.m_Locked)
            {
                window = x;
                break;
            }
        }
        if (window == null)
        {
            window = CreateInstance <PreviewTextureWindow>();
            m_List.Add(window);
        }
        else
        {
            if (window.m_Source != null)
            {
                window.m_Source.RemoveRefreshWindow(window);
            }
        }
        //GetWindow<PreviewTextureWindow>();//ScriptableObject.CreateInstance<PreviewTextureWindow>();
        _src.AddRefreshWindow(window);
        window.m_Source = _src;


//            window.m_Preview = new RenderTexture(width, height, 24, RenderTextureFormat.ARGB32);
        //window.position = new Rect(_inst.canvasWindowRect.x+ _inst.canvasWindowRect.width*0.5f, _inst.canvasWindowRect.y + _inst.canvasWindowRect.height * 0.5f, 350, 250);
        window.titleContent = new GUIContent("Preview");
        window.Show();
        window.Repaint();
    }
Exemplo n.º 2
0
 public void OpenPreview()
 {
     PreviewTextureWindow.Init(this);
 }