Пример #1
0
        public void Show(bool reload)
        {
            GUILayout.BeginVertical();
            try {
                GUILayout.BeginHorizontal();
                try {
                    var texIcon = expand ? MinusIcon : PlusIcon;
                    if (GUILayout.Button(texIcon, bStyleLeft, optUnitHeight, optIconWidth))
                    {
                        expand = !expand;
                    }

                    if (GUILayout.Button(edited.name, bStyleLeft, optUnitHeight))
                    {
                        expand = !expand;
                    }
                    if (!expand)
                    {
                        return;
                    }
                } finally {
                    GUILayout.EndHorizontal();
                }

                if (edited.type == ShaderType.UNKNOWN)
                {
                    GUILayout.Label("shader: " + edited.material.shader.name);
                    return;
                }

                GUILayout.BeginHorizontal();
                try {
                    // コピー
                    if (GUILayout.Button(CopyIcon, optUnitHeight, optButonWidthS))
                    {
                        clipHandler.SetClipboard(MateHandler.Instance.ToText(edited));
                        if (tipsCall != null)
                        {
                            tipsCall("マテリアル情報をクリップボードに\nコピーしました");
                        }
                    }

                    GUI.enabled &= clipHandler.isMateText;
                    var icons = PasteIcons;
                    if (GUILayout.Button(icons[0], optUnitHeight, optButonWidthS))
                    {
                        try {
                            MateHandler.Instance.Write(edited, clipHandler.mateText);
                            if (tipsCall != null)
                            {
                                tipsCall("マテリアル情報を貼付けました");
                            }
                        } catch (Exception e) {
                            LogUtil.Error("failed to import mateText", e);
                        }
                    }

                    includeOthers = GUILayout.Toggle(includeOthers, "CF", uiParams.tStyleSS);
                    includeShader = GUILayout.Toggle(includeShader, "S", uiParams.tStyleSS);
                    includeTex    = GUILayout.Toggle(includeTex, "T", uiParams.tStyleSS);
                    GUI.enabled  &= (includeTex | includeShader | includeOthers);
                    if (GUILayout.Button(icons[1], optUnitHeight, optButonWidth))
                    {
                        try {
                            var pasteFlag = 0;
                            if (includeTex)
                            {
                                pasteFlag |= MateHandler.MATE_TEX;
                            }
                            if (includeShader)
                            {
                                pasteFlag |= MateHandler.MATE_SHADER;
                            }
                            if (includeOthers)
                            {
                                pasteFlag |= MateHandler.MATE_COLOR | MateHandler.MATE_FLOAT;
                            }
                            LogUtil.DebugF("material pasting from cp... tex={0}, shader={1}, others={2}",
                                           includeTex, includeShader, includeOthers);
                            MateHandler.Instance.Write(edited, clipHandler.mateText, pasteFlag);
                        } catch (Exception e) {
                            LogUtil.Error("failed to import mateText", e);
                        }

                        if (tipsCall != null)
                        {
                            tipsCall("マテリアル情報を貼付けました");
                        }
                    }
                } finally {
                    GUI.enabled = true;
                    GUILayout.EndHorizontal();
                }

                var material = edited.material;
                var idx      = edited.type.idx;

                if (shaderCombo == null)
                {
                    var selected = (idx >= 0 && idx < ShaderNames.Length) ? ShaderNames[idx] : GUIContent.none;
                    shaderCombo = new ComboBoxLO(selected, ShaderNames, uiParams.bStyleSC, uiParams.boxStyle, uiParams.listStyle, false);
                }
                else
                {
                    shaderCombo.SelectedItemIndex = idx;
                }
                shaderCombo.Show(GUILayout.ExpandWidth(true)); //uiParams.optInsideWidth);

                var selectedIdx = shaderCombo.SelectedItemIndex;
                if (idx != selectedIdx && selectedIdx != -1)
                {
                    LogUtil.Debug("shader changed", idx, "=>", selectedIdx);

                    // シェーダ変更
                    var shaderName0 = ShaderNames[selectedIdx].text;
                    edited.ChangeShader(shaderName0, selectedIdx);
                }

                if (reload)
                {
                    edited.renderQueue.Set(material.renderQueue);
                }

                sliderHelper.SetupFloatSlider("RQ", edited.renderQueue,
                                              edited.renderQueue.range.editMin, edited.renderQueue.range.editMax,
                                              (rq) => {
                    material.SetFloat(ShaderPropType.RenderQueue.propId, rq);
                    material.renderQueue = (int)rq;
                },
                                              ShaderPropType.RenderQueue.opts,
                                              ShaderPropType.RenderQueue.presetVals,
                                              rqResolver.Resolve(slotIdx));


                var sdType = edited.type;
                for (var i = 0; i < sdType.colProps.Length; i++)
                {
                    var colProp   = sdType.colProps[i];
                    var editColor = edited.editColors[i];
                    var picker    = edited.pickers[i];
                    if (reload)
                    {
                        editColor.Set(material.GetColor(colProp.propId));
//                    } else {
//                        if (!editColor.val.HasValue) {
//                            editColor.Set(colProp.defaultVal);
//                            LogUtil.DebugF("value is empty. set white. color={0}, vals={1}, syncs={2}",
//                                editColor.val, editColor.editVals, editColor.isSyncs);
//                        }
                    }

                    if (sliderHelper.DrawColorSlider(colProp, ref editColor, picker))
                    {
                        material.SetColor(colProp.propId, editColor.val);
                    }
                }

                for (var i = 0; i < sdType.fProps.Length; i++)
                {
                    var prop = sdType.fProps[i];
                    if (reload)
                    {
                        edited.editVals[i].Set(material.GetFloat(prop.propId));
                    }

                    switch (prop.valType)
                    {
                    case ValType.Float:
                        // slider
                        var fprop = prop;
                        // fprop.SetValue(mat, val);
                        sliderHelper.SetupFloatSlider(fprop, edited.editVals[i], (val) => fprop.SetValue(material, val));
                        break;

                    case ValType.Bool:
                        cbHelper.ShowCheckBox(prop.name, edited.editVals[i],
                                              (val) => prop.SetValue(material, val));
                        break;

                    case ValType.Enum:
                        cbHelper.ShowComboBox(prop.name, edited.editVals[i],
                                              (val) => prop.SetValue(material, val));
                        break;
                    }
                }
            } finally {
                GUILayout.EndVertical();
            }
        }
Пример #2
0
 // Token: 0x06000371 RID: 881 RVA: 0x0001E8C0 File Offset: 0x0001CAC0
 public void Show()
 {
     GUILayout.BeginVertical(ACCTexturesView.inboxStyle, new GUILayoutOption[0]);
     try
     {
         string text = (this.expand ? "- " : "+ ") + this.material.name;
         if (GUILayout.Button(text, ACCTexturesView.uiParams.lStyleC, new GUILayoutOption[0]))
         {
             this.expand = !this.expand;
         }
         if (this.expand)
         {
             foreach (ACCTexture acctexture in this.edited)
             {
                 bool flag = this.matNo == ACCTexturesView.editTarget.matNo && acctexture.propKey == ACCTexturesView.editTarget.propKey;
                 if (acctexture.prop.Keyword == Keyword.NONE || this.material.IsKeywordEnabled(acctexture.prop.KeywordString))
                 {
                     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                     try
                     {
                         if (!ACCTexturesView.textureModifier.IsValidTarget(ACCTexturesView.holder.CurrentMaid, ACCTexturesView.holder.CurrentSlot.Name, this.material, acctexture.propName))
                         {
                             bool enabled = GUI.enabled;
                             GUI.enabled = false;
                             GUILayout.Button("+変更", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                             {
                                 ACCTexturesView.buttonLWidth
                             });
                             GUI.enabled = enabled;
                         }
                         else if (flag)
                         {
                             if (GUILayout.Button("-変更", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                             {
                                 ACCTexturesView.buttonLWidth
                             }))
                             {
                                 ACCTexturesView.editTarget.Clear();
                             }
                         }
                         else if (GUILayout.Button("+変更", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.buttonLWidth
                         }))
                         {
                             ACCTexturesView.editTarget.slotName = ACCTexturesView.holder.CurrentSlot.Name;
                             ACCTexturesView.editTarget.matNo    = this.matNo;
                             ACCTexturesView.editTarget.propName = acctexture.propName;
                             ACCTexturesView.editTarget.propKey  = acctexture.propKey;
                         }
                         GUILayout.Label(acctexture.propName, ACCTexturesView.uiParams.lStyle, new GUILayoutOption[0]);
                         if (flag && acctexture.type.hasShadow && acctexture.propKey == ShaderPropType.MainTex.key && GUILayout.Button("_ShadowTexに反映", ACCTexturesView.uiParams.bStyleSC, new GUILayoutOption[0]))
                         {
                             ACCTexturesView.textureModifier.DuplicateFilter(ACCTexturesView.holder.CurrentMaid, ACCTexturesView.holder.CurrentSlot.Name, this.material, acctexture.propName, "_ShadowTex");
                         }
                         if (GUILayout.Button("opt", ACCTexturesView.uiParams.bStyleSC, new GUILayoutOption[]
                         {
                             ACCTexturesView.restWidth
                         }))
                         {
                             acctexture.expand = !acctexture.expand;
                         }
                     }
                     finally
                     {
                         GUILayout.EndHorizontal();
                     }
                     if (flag)
                     {
                         ACCTexturesView.textureModifier.ProcGUI(ACCTexturesView.holder.CurrentMaid, ACCTexturesView.holder.CurrentSlot.Name, this.material, acctexture.propName);
                     }
                     float      height     = (float)ACCTexturesView.uiParams.itemHeight;
                     ComboBoxLO comboBoxLO = null;
                     bool       flag2      = false;
                     if (acctexture.toonType != 0)
                     {
                         if (this.combos.TryGetValue(acctexture.propName, out comboBoxLO))
                         {
                             if (comboBoxLO.IsClickedComboButton)
                             {
                                 height = (float)(comboBoxLO.ItemCount * ACCTexturesView.uiParams.itemHeight) * 0.8f;
                             }
                         }
                         else
                         {
                             comboBoxLO = new ComboBoxLO(new GUIContent("選"), ACCTexturesView.ItemNames, ACCTexturesView.uiParams.bStyle, ACCTexturesView.uiParams.boxStyle, ACCTexturesView.uiParams.listStyle, true);
                             comboBoxLO.SetItemWidth(ACCTexturesView.comboWidth);
                             this.combos[acctexture.propName] = comboBoxLO;
                             comboBoxLO.SelectItem(acctexture.editname);
                         }
                     }
                     GUILayout.BeginHorizontal(new GUILayoutOption[]
                     {
                         GUILayout.Height(height)
                     });
                     try
                     {
                         bool   flag3 = false;
                         string text2 = acctexture.editname;
                         if (acctexture.toonType != 0)
                         {
                             int selectedItemIndex = comboBoxLO.SelectedItemIndex;
                             int num = comboBoxLO.Show(ACCTexturesView.uiParams.optBtnWidth);
                             if (num != selectedItemIndex)
                             {
                                 text2 = ACCTexturesView.ItemNames[num].text;
                                 flag2 = true;
                             }
                             flag3 = comboBoxLO.IsClickedComboButton;
                         }
                         else
                         {
                             GUILayout.Label(string.Empty, new GUILayoutOption[]
                             {
                                 ACCTexturesView.uiParams.optBtnWidth
                             });
                         }
                         if (flag3)
                         {
                             ACCTexturesView.uiParams.textStyle.fontSize = (int)((double)ACCTexturesView.fontSizeS * 0.8);
                         }
                         text2 = GUILayout.TextField(text2, ACCTexturesView.uiParams.textStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.contentWidth
                         });
                         acctexture.SetName(text2);
                         if (flag3)
                         {
                             ACCTexturesView.uiParams.textStyle.fontSize = ACCTexturesView.fontSize;
                         }
                         GUI.enabled = acctexture.dirty;
                         if ((ACCTexturesView.settings.toonComboAutoApply && flag2) || GUILayout.Button("適", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.uiParams.optBtnWidth
                         }))
                         {
                             Texture texture = this.ChangeTexFile(this.textureDir, acctexture.editname, this.matNo, acctexture.propName);
                             if (texture != null)
                             {
                                 acctexture.tex = texture;
                             }
                             acctexture.dirty = false;
                         }
                         GUI.enabled = true;
                         if (GUILayout.Button("...", ACCTexturesView.uiParams.bStyle, new GUILayoutOption[]
                         {
                             ACCTexturesView.uiParams.optBtnWidth
                         }))
                         {
                             this.OpenFileBrowser(this.matNo, acctexture);
                         }
                     }
                     finally
                     {
                         GUILayout.EndHorizontal();
                     }
                     if (acctexture.expand)
                     {
                         GUILayout.BeginVertical(new GUILayoutOption[0]);
                         try
                         {
                             Vector2    textureOffset = this.material.GetTextureOffset(acctexture.prop.propId);
                             ACCTexture tex           = acctexture;
                             if (this.DrawSliders("offset", ref textureOffset, -1f, 1f, () => tex.original.texOffset, false))
                             {
                                 this.material.SetTextureOffset(acctexture.prop.propId, textureOffset);
                             }
                             Vector2 textureScale = this.material.GetTextureScale(acctexture.prop.propId);
                             if (this.DrawSliders("scale ", ref textureScale, 0.001f, 20f, () => tex.original.texScale, true))
                             {
                                 this.material.SetTextureScale(acctexture.prop.propId, textureScale);
                             }
                         }
                         finally
                         {
                             GUILayout.EndVertical();
                         }
                     }
                 }
             }
         }
     }
     finally
     {
         GUILayout.EndVertical();
     }
 }
        public void Show(bool reload) {
            // TODO tooltipをステータスバーに表示
            GUILayout.BeginVertical();
            try {
                GUILayout.BeginHorizontal();
                try {
                    var texIcon = expand? MinusIcon : PlusIcon;
                    if (GUILayout.Button(texIcon, bStyleLeft, optUnitHeight, optIconWidth)) {
                        expand = !expand;
                    }
                    if (GUILayout.Button(edited.name, bStyleLeft, optUnitHeight)) {
                        expand = !expand;
                    }
                    if (!expand) return;

                } finally {
                    GUILayout.EndHorizontal();
                }

                GUILayout.BeginHorizontal();
                try {
                    // コピー
                    if (GUILayout.Button(CopyIcon, optUnitHeight,optButonWidthS)) {
                        
                        ClipboardHelper.clipBoard = MateHandler.Instance.ToText(edited);
                        if (tipsCall != null) {
                            tipsCall("マテリアル情報をクリップボードに\nコピーしました");
                        }
                    }

                    GUI.enabled &= clipHandler.isMateText;
                    var icons = PasteIcon;
                    if (GUILayout.Button(icons[0], optUnitHeight,optButonWidthS)) {
                        try {
                            MateHandler.Instance.Write(edited, clipHandler.mateText);
                            if (tipsCall != null) {
                                tipsCall("マテリアル情報を貼付けました");
                            }
                        } catch(Exception e) {
                            LogUtil.Error("failed to import mateText", e);
                        }
                    }
                    includeOthers = GUILayout.Toggle(includeOthers, "CF", uiParams.tStyleSS);
                    includeShader = GUILayout.Toggle(includeShader, "S", uiParams.tStyleSS);
                    includeTex    = GUILayout.Toggle(includeTex, "T", uiParams.tStyleSS);
                    GUI.enabled &= (includeTex |includeShader| includeOthers);
                    if (GUILayout.Button(icons[1], optUnitHeight,optButonWidth)) {
                        try {
                            int FLAG = 0;
                            if (includeTex)    FLAG |= MateHandler.MATE_TEX;
                            if (includeShader) FLAG |= MateHandler.MATE_SHADER;
                            if (includeOthers) FLAG |= MateHandler.MATE_COLOR | MateHandler.MATE_FLOAT;
                            LogUtil.DebugF("flag: tex={0}, shader={1}, others={2}", includeTex, includeShader, includeOthers);
                            MateHandler.Instance.Write(edited, clipHandler.mateText, FLAG);
                        } catch(Exception e) {
                            LogUtil.Error("failed to import mateText", e);
                        }
                        if (tipsCall != null) {
                            tipsCall("マテリアル情報を貼付けました");
                        }
                    }
                } finally {
                    GUI.enabled = true;
                    GUILayout.EndHorizontal();
                }

                Material material = edited.material;
                int idx = edited.type.idx;
    
                if (shaderCombo == null) {
                    GUIContent selected = (idx >= 0 && idx < ShaderNames.Length) ? ShaderNames[idx] : GUIContent.none;
                    shaderCombo = new ComboBoxLO(selected, ShaderNames, uiParams.bStyleSC, uiParams.boxStyle, uiParams.listStyle, false);
                } else {
                    shaderCombo.SelectedItemIndex = idx;
                }
                shaderCombo.Show(GUILayout.ExpandWidth(true));//uiParams.optInsideWidth);
    
                int selectedIdx = shaderCombo.SelectedItemIndex;
                if (idx != selectedIdx && selectedIdx != -1) {
                    LogUtil.Debug("shader changed", idx, "=>", selectedIdx);
                    // シェーダ変更
                    var shaderName0 = ShaderNames[selectedIdx].text;
                    edited.ChangeShader(shaderName0, selectedIdx);
                }
                // MaterialType mat = edited.type;
                if (reload) {
                    edited.renderQueue.Set( material.renderQueue );
                }
    
                SetupFloatSlider("RQ", edited.renderQueue,
                                 edited.renderQueue.range.editMin, edited.renderQueue.range.editMax,
                                 (rq) => {
                                     material.SetFloat(ShaderPropType.RenderQueue.propId, rq);
                                     material.renderQueue = (int)rq;
                                 }, ShaderPropType.RenderQueue.presetVals);


                ShaderType sdType = edited.type;
                for (int i=0; i< sdType.colProps.Length; i++) {
                    var colProp = sdType.colProps[i];
                    var editColor = edited.editColors[i];
                    if (reload) {
                        editColor.Set(material.GetColor(colProp.propId));
                    } else {
                        if (!editColor.val.HasValue) {
                            editColor.Set(colProp.defaultVal);
                            LogUtil.DebugF("value is empty. set white. color={0}, vals={1}, syncs={2}",
                                editColor.val, editColor.editVals, editColor.isSyncs);
                        }
                    }
                        
                    Color beforeColor = editColor.val.Value;
                    setColorSlider(colProp.name, ref editColor, colProp.colorType);
                    if (editColor.val.Value != beforeColor) {
                        material.SetColor(colProp.propId, editColor.val.Value);
                    }   
                }
                
                for (int i=0; i< sdType.fProps.Length; i++) {
                    var prop = sdType.fProps[i];
                    switch (prop.valType) {
                        case ValType.Float:
                            // slider
                            var fprop = prop;
                            if (reload) {
                                edited.editVals[i].Set(material.GetFloat(fprop.propId));
                            }
                            // fprop.SetValue(mat, val);
                            SetupFloatSlider(prop.name, edited.editVals[i],
                                             fprop.sliderMin, fprop.sliderMax, 
                                             (val) => fprop.SetValue(material, val),
                                              fprop.opts, fprop.presetVals);
                            break;
                        case ValType.Bool:
                            // TODO チェックボックス
                            break;
                    }
                }

            } finally {
                GUILayout.EndVertical();
            }
        }
Пример #4
0
        public void Show()
        {
            GUILayout.BeginVertical(inboxStyle);
            try {
                string matName = (expand? "- " : "+ ") + material.name;
                if (GUILayout.Button(matName, uiParams.lStyleC))
                {
                    expand = !expand;
                }
                if (!expand)
                {
                    return;
                }

                foreach (ACCTexture editTex in edited)
                {
                    bool bTargetElement = (matNo == editTarget.matNo && editTex.propKey == editTarget.propKey);

                    GUILayout.BeginHorizontal();
                    try {
                        // エディット用スライダーの開閉
                        if (!textureModifier.IsValidTarget(holder.currentMaid, holder.currentSlot.Name, material, editTex.propName))
                        {
                            // 参照先が Texture2D が取れなかった (例 : RenderTexture ) 場合は何もしない
                            var tmp = GUI.enabled;
                            GUI.enabled = false;
                            GUILayout.Button("+変更", uiParams.bStyle, buttonLWidth);
                            GUI.enabled = tmp;
                        }
                        else if (bTargetElement)
                        {
                            // エディット中のテクスチャの場合
                            if (GUILayout.Button("-変更", uiParams.bStyle, buttonLWidth))
                            {
                                editTarget.Clear();
                            }
                        }
                        else
                        {
                            // エディット中以外のテクスチャの場合
                            if (GUILayout.Button("+変更", uiParams.bStyle, buttonLWidth))
                            {
                                editTarget.slotName = holder.currentSlot.Name;
                                editTarget.matNo    = matNo;
                                editTarget.propName = editTex.propName;
                                editTarget.propKey  = editTex.propKey;
                            }
                        }
                        GUILayout.Label(editTex.propName, uiParams.lStyle);
                        if (bTargetElement && editTex.type.hasShadow && editTex.propKey == ShaderPropType.MainTex.key)
                        {
                            if (GUILayout.Button("_ShadowTexに反映", uiParams.bStyleSC))
                            {
                                // 現在のFilterを_ShadowTexにも反映
                                textureModifier.DuplicateFilter(holder.currentMaid, holder.currentSlot.Name, material, editTex.propName, "_ShadowTex");
                            }
                        }
                    } finally {
                        GUILayout.EndHorizontal();
                    }

                    // テクスチャエディット用スライダー
                    if (bTargetElement)
                    {
                        textureModifier.ProcGUI(holder.currentMaid, holder.currentSlot.Name, material, editTex.propName);
                    }

                    float      height     = uiParams.itemHeight;
                    ComboBoxLO combo      = null;
                    bool       cbSelected = false;
                    if (editTex.toonType != ACCTexture.NONE)
                    {
                        if (combos.TryGetValue(editTex.propName, out combo))
                        {
                            if (combo.IsClickedComboButton)
                            {
                                height = combo.ItemCount * uiParams.itemHeight * 0.8f;
                            }
                        }
                        else
                        {
                            combo = new ComboBoxLO(new GUIContent("選"), ItemNames, uiParams.bStyle, uiParams.boxStyle, uiParams.listStyle, true);
                            combo.SetItemWidth(comboWidth);
                            combos[editTex.propName] = combo;
                            combo.SelectItem(editTex.editname);
                        }
                    }
                    GUILayout.BeginHorizontal(GUILayout.Height(height));
                    try {
                        bool   hideField = false;
                        string editName  = editTex.editname;
                        if (editTex.toonType != ACCTexture.NONE)
                        {
                            // 偽コンボボックス
                            int prevSelected = combo.SelectedItemIndex;
                            int selected     = combo.Show(uiParams.optBtnWidth);
                            if (selected != prevSelected)
                            {
                                editName   = ItemNames[selected].text;
                                cbSelected = true;
                            }
                            hideField = combo.IsClickedComboButton;
                        }
                        if (hideField)
                        {
                            uiParams.textStyle.fontSize = (int)(fontSizeS * 0.8);
                        }
                        editName = GUILayout.TextField(editName, uiParams.textStyle, contentWidth);
                        editTex.SetName(editName);

                        if (hideField)
                        {
                            uiParams.textStyle.fontSize = fontSize;
                        }

                        GUI.enabled = editTex.dirty;
                        if ((settings.toonComboAutoApply && cbSelected) ||
                            GUILayout.Button("適", uiParams.bStyle, uiParams.optBtnWidth))
                        {
                            Texture tex = ChangeTexFile(textureDir, editTex.editname, matNo, editTex.propName);
                            if (tex != null)
                            {
                                editTex.tex = tex;
                            }
                            editTex.dirty = false;
                        }
                        GUI.enabled = true;
                        if (GUILayout.Button("...", uiParams.bStyle, uiParams.optBtnWidth))
                        {
                            OpenFileBrowser(matNo, editTex);
                        }
                    } finally {
                        GUILayout.EndHorizontal();
                    }
                }
            } finally {
                GUILayout.EndVertical();
            }
        }
Пример #5
0
        public void Show()
        {
            GUILayout.BeginVertical(inboxStyle);
            try {
                var matName = (expand? "- " : "+ ") + material.name;
                if (GUILayout.Button(matName, uiParams.lStyleC))
                {
                    expand = !expand;
                }
                if (!expand)
                {
                    return;
                }

                foreach (var editTex in edited)
                {
                    var bTargetElement = (matNo == editTarget.matNo && editTex.propKey == editTarget.propKey);

                    if (editTex.prop.Keyword != Keyword.NONE)
                    {
                        if (!material.IsKeywordEnabled(editTex.prop.KeywordString))
                        {
                            continue;
                        }
                    }

                    GUILayout.BeginHorizontal();
                    try {
                        // エディット用スライダーの開閉
                        if (!textureModifier.IsValidTarget(holder.CurrentMaid, holder.CurrentSlot.Name, material, editTex.propName))
                        {
                            // 参照先が Texture2D が取れなかった (例 : RenderTexture ) 場合は何もしない
                            var tmp = GUI.enabled;
                            GUI.enabled = false;
                            GUILayout.Button("+変更", uiParams.bStyle, buttonLWidth);
                            GUI.enabled = tmp;
                        }
                        else if (bTargetElement)
                        {
                            // エディット中のテクスチャの場合
                            if (GUILayout.Button("-変更", uiParams.bStyle, buttonLWidth))
                            {
                                editTarget.Clear();
                            }
                        }
                        else
                        {
                            // エディット中以外のテクスチャの場合
                            if (GUILayout.Button("+変更", uiParams.bStyle, buttonLWidth))
                            {
                                editTarget.slotName = holder.CurrentSlot.Name;
                                editTarget.matNo    = matNo;
                                editTarget.propName = editTex.propName;
                                editTarget.propKey  = editTex.propKey;
                            }
                        }
                        GUILayout.Label(editTex.propName, uiParams.lStyle);
                        if (bTargetElement && editTex.type.hasShadow && editTex.propKey == ShaderPropType.MainTex.key)
                        {
                            if (GUILayout.Button("_ShadowTexに反映", uiParams.bStyleSC))
                            {
                                // 現在のFilterを_ShadowTexにも反映
                                textureModifier.DuplicateFilter(holder.CurrentMaid, holder.CurrentSlot.Name, material, editTex.propName, "_ShadowTex");
                            }
                        }

                        if (GUILayout.Button("opt", uiParams.bStyleSC, restWidth))
                        {
                            editTex.expand = !editTex.expand;
                        }
                    } finally {
                        GUILayout.EndHorizontal();
                    }

                    // テクスチャエディット用スライダー
                    if (bTargetElement)
                    {
                        textureModifier.ProcGUI(holder.CurrentMaid, holder.CurrentSlot.Name, material, editTex.propName);
                    }

                    float      height     = uiParams.itemHeight;
                    ComboBoxLO combo      = null;
                    var        cbSelected = false;
                    if (editTex.toonType != ACCTexture.NONE)
                    {
                        if (combos.TryGetValue(editTex.propName, out combo))
                        {
                            if (combo.IsClickedComboButton)
                            {
                                height = combo.ItemCount * uiParams.itemHeight * 0.8f;
                            }
                        }
                        else
                        {
                            combo = new ComboBoxLO(new GUIContent("選"), ItemNames, uiParams.bStyle, uiParams.boxStyle, uiParams.listStyle, true);
                            combo.SetItemWidth(comboWidth);
                            combos[editTex.propName] = combo;
                            combo.SelectItem(editTex.editname);
                        }
                    }
                    GUILayout.BeginHorizontal(GUILayout.Height(height));
                    try {
                        var hideField = false;
                        var editName  = editTex.editname;
                        if (editTex.toonType != ACCTexture.NONE)
                        {
                            // 偽コンボボックス
                            var prevSelected = combo.SelectedItemIndex;
                            var selected     = combo.Show(uiParams.optBtnWidth);
                            if (selected != prevSelected)
                            {
                                editName   = ItemNames[selected].text;
                                cbSelected = true;
                            }
                            hideField = combo.IsClickedComboButton;
                        }
                        else
                        {
                            GUILayout.Label(string.Empty, uiParams.optBtnWidth);
                        }
                        if (hideField)
                        {
                            uiParams.textStyle.fontSize = (int)(fontSizeS * 0.8);
                        }
                        editName = GUILayout.TextField(editName, uiParams.textStyle, contentWidth);
                        editTex.SetName(editName);

                        if (hideField)
                        {
                            uiParams.textStyle.fontSize = fontSize;
                        }

                        GUI.enabled = editTex.dirty;
                        if ((settings.toonComboAutoApply && cbSelected) ||
                            GUILayout.Button("適", uiParams.bStyle, uiParams.optBtnWidth))
                        {
                            var tex = ChangeTexFile(textureDir, editTex.editname, matNo, editTex.propName);
                            if (tex != null)
                            {
                                editTex.tex = tex;
                            }
                            editTex.dirty = false;
                        }
                        GUI.enabled = true;
                        if (GUILayout.Button("...", uiParams.bStyle, uiParams.optBtnWidth))
                        {
                            OpenFileBrowser(matNo, editTex);
                        }
                    } finally {
                        GUILayout.EndHorizontal();
                    }

                    if (!editTex.expand)
                    {
                        continue;
                    }

                    GUILayout.BeginVertical();
                    try {
#if UNITY_5_6_OR_NEWER
                        var offset = material.GetTextureOffset(editTex.prop.propId);
                        var tex    = editTex;
                        if (DrawSliders("offset", ref offset, -1, 1, () => tex.original.texOffset))
                        {
                            material.SetTextureOffset(editTex.prop.propId, offset);
                        }

                        var scale = material.GetTextureScale(editTex.prop.propId);
                        if (DrawSliders("scale ", ref scale, 0.001f, 20f, () => tex.original.texScale, true))
                        {
                            material.SetTextureScale(editTex.prop.propId, scale);
                        }
#else
                        var offset = material.GetTextureOffset(editTex.prop.keyName);
                        var tex    = editTex;
                        if (DrawSliders("offset", ref offset, -1, 1, () => tex.original.texOffset))
                        {
                            material.SetTextureOffset(editTex.prop.keyName, offset);
                        }

                        var scale = material.GetTextureScale(editTex.prop.keyName);
                        if (DrawSliders("scale ", ref scale, 0.001f, 20f, () => tex.original.texScale, true))
                        {
                            material.SetTextureScale(editTex.prop.keyName, scale);
                        }
#endif
                    } finally {
                        GUILayout.EndVertical();
                    }
                }
            } finally {
                GUILayout.EndVertical();
            }
        }
        public void Show() {

            GUILayout.BeginVertical(inboxStyle);
            try {
                string matName = (expand? "- " : "+ ") + material.name;
                if (GUILayout.Button(matName, uiParams.lStyleC)) {
                    expand = !expand;
                }
                if (!expand) return;

                foreach (ACCTexture editTex in edited) {
                    bool bTargetElement = (matNo == editTarget.matNo && editTex.propKey == editTarget.propKey);
    
                    GUILayout.BeginHorizontal();
                    try {
                        // エディット用スライダーの開閉
                        if (!textureModifier.IsValidTarget(holder.currentMaid, holder.currentSlot.Name, material, editTex.propName)) {
                            // 参照先が Texture2D が取れなかった (例 : RenderTexture ) 場合は何もしない
                            var tmp = GUI.enabled;
                            GUI.enabled = false;
                            GUILayout.Button("+変更", uiParams.bStyle, buttonLWidth);
                            GUI.enabled = tmp;
                        } else if (bTargetElement) {
                            // エディット中のテクスチャの場合
                            if (GUILayout.Button("-変更", uiParams.bStyle, buttonLWidth)) {
                                editTarget.Clear();
                            }
                        } else {
                            // エディット中以外のテクスチャの場合
                            if (GUILayout.Button("+変更", uiParams.bStyle, buttonLWidth)) {
                                editTarget.slotName = holder.currentSlot.Name;
                                editTarget.matNo = matNo;
                                editTarget.propName = editTex.propName;
                                editTarget.propKey  = editTex.propKey;
                            }
                        }
                        GUILayout.Label(editTex.propName, uiParams.lStyle);
                        if (bTargetElement && editTex.type.hasShadow && editTex.propKey == ShaderPropType.MainTex.key) {
                            if ( GUILayout.Button("_ShadowTexに反映", uiParams.bStyleSC) ) {
                                // 現在のFilterを_ShadowTexにも反映 
                                textureModifier.DuplicateFilter(holder.currentMaid, holder.currentSlot.Name, material, editTex.propName, "_ShadowTex");
                            }
                        }
                    } finally {
                        GUILayout.EndHorizontal();
                    }
    
                    // テクスチャエディット用スライダー
                    if (bTargetElement) {
                        textureModifier.ProcGUI(holder.currentMaid, holder.currentSlot.Name, material, editTex.propName);
                    }
        
                    float height = uiParams.itemHeight;
                    ComboBoxLO combo = null;
                    bool cbSelected = false;
                    if (editTex.toonType != ACCTexture.NONE) {
                        if (combos.TryGetValue(editTex.propName, out combo)) {
                            if (combo.IsClickedComboButton) {
                                height = combo.ItemCount*uiParams.itemHeight*0.8f;
                            }
                        } else {
                            combo = new ComboBoxLO(new GUIContent("選"), ItemNames, uiParams.bStyle, uiParams.boxStyle, uiParams.listStyle, true);
                            combo.SetItemWidth(comboWidth);
                            combos[editTex.propName] = combo;
                            combo.SelectItem(editTex.editname);
                        }
                    }
                    GUILayout.BeginHorizontal(GUILayout.Height(height));
                    try {
                        bool hideField = false;
                        string editName = editTex.editname;
                        if (editTex.toonType != ACCTexture.NONE) {
                            // 偽コンボボックス
                            int prevSelected = combo.SelectedItemIndex;
                            int selected = combo.Show(uiParams.optBtnWidth);
                            if (selected != prevSelected) {
                                editName = ItemNames[selected].text;
                                cbSelected = true;
                            }
                            hideField = combo.IsClickedComboButton;
                        }
                        if (hideField) uiParams.textStyle.fontSize = (int)(fontSizeS*0.8);
                        editName = GUILayout.TextField(editName, uiParams.textStyle, contentWidth);
                        editTex.SetName(editName);

                        if (hideField) uiParams.textStyle.fontSize = fontSize;
    
                        GUI.enabled = editTex.dirty;
                        if ((settings.toonComboAutoApply && cbSelected)
                            || GUILayout.Button("適", uiParams.bStyle, uiParams.optBtnWidth)) {
                            Texture tex = ChangeTexFile(textureDir, editTex.editname, matNo, editTex.propName);
                            if (tex != null) editTex.tex = tex;
                            editTex.dirty = false;
                        }
                        GUI.enabled = true;
                        if (GUILayout.Button("...", uiParams.bStyle, uiParams.optBtnWidth)) {
                            OpenFileBrowser(matNo, editTex);
                        }
                    } finally {
                        GUILayout.EndHorizontal();
                    }
                }
            } finally {
                GUILayout.EndVertical();
            }
        }