コード例 #1
0
    public override void OnInspectorGUI()
    {
        EditorGUI.BeginChangeCheck();
        maskMaker.resolutionMultiplier = EditorGUILayout.IntField("Resolution Multiplier", maskMaker.resolutionMultiplier);
        EditorGUILayout.LabelField("Resolution: " + maskMaker.maskTex.width + " x " + maskMaker.maskTex.height);
        if (EditorGUI.EndChangeCheck())
        {
            maskMaker.UpdateTextureSize();
        }
        if (!maskMaker.isPainting)
        {
            if (GUILayout.Button("Paint"))
            {
                maskMaker.isPainting = true;

                AlphaBrushWizard.CreateWizard(maskMaker);
            }
        }
        EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
        EditorGUILayout.LabelField("RGB", GUILayout.Width(40));
        GUI.DrawTexture(GUILayoutUtility.GetRect(100f, 100f), maskMaker.maskTex, ScaleMode.ScaleToFit, false);
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
        EditorGUILayout.LabelField("Alpha", GUILayout.Width(40));
        GUI.DrawTexture(GUILayoutUtility.GetRect(100f, 100f), maskMaker.maskTex, ScaleMode.ScaleToFit, true);
        EditorGUILayout.EndHorizontal();
        brushProjector.enabled = maskMaker.isPainting;
    }
コード例 #2
0
    public static void CreateWizard(PaintedMask mask)
    {
        AlphaBrushWizard wizard = DisplayWizard <AlphaBrushWizard>("AlphaBrush", "Apply");

        wizard.mask = mask;
    }