コード例 #1
0
    public override void OnInspectorGUI()
    {
        // Let the default inspecter draw all the values
        DrawDefaultInspector();

        // Spawn buttons


        if (GUILayout.Button("Create blurred image using quantum blur"))
        {
            if (targetScript.OutputTexture != null && !AssetDatabase.Contains(targetScript.OutputTexture))
            {
                Texture2D.DestroyImmediate(targetScript.OutputTexture);
                Resources.UnloadUnusedAssets();
            }
            targetScript.CreateBlur();
        }

        if (GUILayout.Button("Mix the 2 images using teleportation"))
        {
            if (targetScript.OutputTexture != null && !AssetDatabase.Contains(targetScript.OutputTexture))
            {
                Texture2D.DestroyImmediate(targetScript.OutputTexture);
                Resources.UnloadUnusedAssets();
            }
            targetScript.Teleport();
        }

        if (GUILayout.Button("Load File as InputTexture"))
        {
            targetScript.LoadPNG();
        }


        if (GUILayout.Button("Load File as InputTexture2"))
        {
            targetScript.LoadPNG2();
        }

        if (GUILayout.Button("Save Output Texture to specific file directly"))
        {
            targetScript.SaveFileDirect();
            AssetDatabase.Refresh();
        }


        if (GUILayout.Button("Save Output Texture to file using file browser"))
        {
            targetScript.SaveFile();
        }
    }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        // Let the default inspecter draw all the values
        DrawDefaultInspector();

        // Spawn buttons


        if (GUILayout.Button("Create blurred image using quantum blur"))
        {
            targetTest.CreateBlur();
        }

        if (GUILayout.Button("Mix the 2 images using teleportation"))
        {
            targetTest.Teleport();
        }

        if (GUILayout.Button("Load File as InputTexture"))
        {
            targetTest.LoadPNG();
        }


        if (GUILayout.Button("Load File as InputTexture2"))
        {
            targetTest.LoadPNG2();
        }

        if (GUILayout.Button("Save Output Texture to specific file directly"))
        {
            targetTest.SaveFileDirect();
            AssetDatabase.Refresh();
        }


        if (GUILayout.Button("Save Output Texture to file using file browser"))
        {
            targetTest.SaveFile();
        }
    }