コード例 #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"))
        {
            targetTest.CreateBlur();
        }

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

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

        if (GUILayout.Button("Create effect using the given Circuit"))
        {
            targetTest.ApplyGates();
        }


        if (GUILayout.Button("Create combination effect using the given Circuit"))
        {
            targetTest.FastCustomTeleport();
        }


        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 file using file browser"))
        {
            targetTest.SaveFile();
        }
    }
コード例 #2
0
    public void ApplyGates()
    {
        ImageCreator.InputTexture1 = InputTexture;
        List <Gate> gateList = new List <Gate>();

        for (int i = 0; i < operations.Length; i++)
        {
            if (operations[i].CircuitType != CircuitType.M)
            {
                gateList.Add(operations[i]);
            }
        }
        ImageCreator.BlurCircuit = gateList;
        ImageCreator.ApplyGates();
        Visualisation.texture = ImageCreator.OutputTexture;


        if (Generator != null && Generator.gameObject.activeSelf)
        {
            Debug.Log("Applied Gates " + Generator.gameObject.activeSelf);
            GenerateTerrain();
        }
    }