Example #1
0
    IEnumerator OpenBeautySkinUI(BeautySkinType type)
    {
        if (type == BeautySkinType.None)
        {
            yield return(LoadBeautyBundle());

            yield return(LoadMakeupBundle());
        }

        currentBeautySkinType = type;
        currentItemType       = ItemType.Beauty;

        CloseAllBeautySkinContent();
        GameObject panel = BeautySkinContentPanels[0];

        BeautyOptionContentTrans.localPosition = Vector3.zero;
        var layout = BeautyOptionContentTrans.GetComponent <HorizontalLayoutGroup>();

        layout.padding.left  = 20;
        layout.padding.right = 20;
        BeautySkinContentPanels[3].SetActive(true);
        ClearBeautySkinOptions();

        if (type == BeautySkinType.BeautySkin)
        {
            BeautySkinSelecterOptions[0].GetComponent <Text>().color = highlightColor;

            AddBeautySkinOptions(0, BeautyConfig.beautySkin_1[0]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                Beauty bi = BeautyConfig.beautySkin_1[0];
                if (currentSelected != go)
                {
                    currentSelected = go;
                    UnSelectAllBeautySkinOptions();
                    go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(bi.type, bi.iconid_1);
                    go.GetComponentInChildren <Text>().color   = highlightColor;
                    BeautySkinContentPanels[2].SetActive(false);
                    BeautySkinContentPanels[1].SetActive(false);
                }
                else
                {
                    bi.currentvalue = bi.currentvalue == bi.disablevalue ? bi.maxvalue : bi.disablevalue;
                    rtt.SetItemParamd(BeautySkinItemName, BeautyConfig.beautySkin_1[0].paramword, bi.currentvalue);
                    SwitchBeautyOptionUIState(bi, go);
                }
            });

            GameObject bgo1 = AddBeautySkinOptions(1, BeautyConfig.beautySkin_1[2]);
            bgo1.GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                Beauty bi1 = BeautyConfig.beautySkin_1[1];
                Beauty bi2 = BeautyConfig.beautySkin_1[2];

                if (currentSelected != go)
                {
                    currentSelected = go;
                    UnSelectAllBeautySkinOptions();
                    go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(bi2.type, bi2.iconid_1);
                    go.GetComponentInChildren <Text>().color   = highlightColor;
                    BeautySkinContentPanels[2].SetActive(false);
                    BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                    BeautySkin_Slider.minValue = 0;
                    BeautySkin_Slider.maxValue = bi2.maxvalue;
                    BeautySkin_Slider.value    = bi2.currentvalue;
                    BeautySkin_Slider.onValueChanged.AddListener(delegate
                    {
                        bi2.currentvalue = BeautySkin_Slider.value;
                        rtt.SetItemParamd(BeautySkinItemName, bi2.paramword, bi2.currentvalue);
                        SwitchBeautyOptionUIState(bi2, go);
                    });
                    BeautySkinContentPanels[1].SetActive(true);
                }
                else
                {
                    bi1.currentvalue++;
                    bi1.currentvalue = bi1.currentvalue % (bi1.maxvalue + 1); //0~2 循环
                    //bi1.currentvalue = bi1.currentvalue == bi1.disablevalue ? bi1.maxvalue : bi1.disablevalue;
                    if (bi1.currentvalue == 0)
                    {
                        go.GetComponentInChildren <Text>().text = "清晰磨皮";
                    }
                    else if (bi1.currentvalue == 1)
                    {
                        go.GetComponentInChildren <Text>().text = "重度磨皮";
                    }
                    else if (bi1.currentvalue == 2)
                    {
                        go.GetComponentInChildren <Text>().text = "精细磨皮";
                    }
                    rtt.SetItemParamd(BeautySkinItemName, BeautyConfig.beautySkin_1[1].paramword, bi1.currentvalue);
                }
            });
            if (BeautyConfig.beautySkin_1[1].currentvalue == 0)
            {
                bgo1.GetComponentInChildren <Text>().text = "清晰磨皮";
            }
            else if (BeautyConfig.beautySkin_1[1].currentvalue == 1)
            {
                bgo1.GetComponentInChildren <Text>().text = "重度磨皮";
            }
            else if (BeautyConfig.beautySkin_1[1].currentvalue == 2)
            {
                bgo1.GetComponentInChildren <Text>().text = "精细磨皮";
            }

            for (int i = 3; i < BeautyConfig.beautySkin_1.Length; i++)
            {
                AddBeautySkinOptions(i, BeautyConfig.beautySkin_1[i]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    if (currentSelected != go)
                    {
                        Beauty bi = null;
                        foreach (var bgo in BeautyGOs)
                        {
                            if (bgo.Value == go)
                            {
                                bi = bgo.Key;
                            }
                        }
                        if (bi == null)
                        {
                            Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                            return;
                        }
                        currentSelected = go;
                        UnSelectAllBeautySkinOptions();
                        go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(bi.type, bi.iconid_1);
                        go.GetComponentInChildren <Text>().color   = highlightColor;
                        BeautySkinContentPanels[2].SetActive(false);
                        BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                        BeautySkin_Slider.minValue = 0;
                        BeautySkin_Slider.maxValue = bi.maxvalue;
                        BeautySkin_Slider.value    = bi.currentvalue;
                        BeautySkin_Slider.onValueChanged.AddListener(delegate
                        {
                            bi.currentvalue = BeautySkin_Slider.value;
                            rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.currentvalue);
                            SwitchBeautyOptionUIState(bi, go);
                        });
                        BeautySkinContentPanels[1].SetActive(true);
                    }
                });
            }

            panel.SetActive(true);
            BeautySkinContentPanels[4].SetActive(true);
        }
        else if (type == BeautySkinType.BeautyShape)
        {
            BeautySkinSelecterOptions[1].GetComponent <Text>().color = highlightColor;

            GameObject bgo1 = AddBeautySkinOptions(1, BeautyConfig.beautySkin_2[0]);
            bgo1.GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                if (currentSelected != go)
                {
                    Beauty bi       = BeautyConfig.beautySkin_2[0];
                    currentSelected = go;
                    UnSelectAllBeautySkinOptions();
                    go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(bi.type, bi.iconid_1);
                    go.GetComponentInChildren <Text>().color   = highlightColor;
                    BeautySkinContentPanels[1].SetActive(false);
                    BeautySkinContentPanels[2].SetActive(true);
                }
            });
            bgo1.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(BeautyConfig.beautySkin_2[0].type, BeautyConfig.beautySkin_2[0].iconid_1);
            bgo1.GetComponentInChildren <Text>().color   = highlightColor;

            for (int i = 1; i < BeautyConfig.beautySkin_2.Length; i++)
            {
                AddBeautySkinOptions(i, BeautyConfig.beautySkin_2[i]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    if (currentSelected != go)
                    {
                        Beauty bi = null;
                        foreach (var bgo in BeautyGOs)
                        {
                            if (bgo.Value == go)
                            {
                                bi = bgo.Key;
                            }
                        }
                        if (bi == null)
                        {
                            Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                            return;
                        }
                        currentSelected = go;
                        UnSelectAllBeautySkinOptions();
                        go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(bi.type, bi.iconid_1);
                        go.GetComponentInChildren <Text>().color   = highlightColor;
                        BeautySkinContentPanels[2].SetActive(false);
                        BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                        BeautySkin_Slider.minValue = 0;
                        BeautySkin_Slider.maxValue = bi.maxvalue;
                        BeautySkin_Slider.value    = bi.currentvalue;
                        BeautySkin_Slider.onValueChanged.AddListener(delegate
                        {
                            bi.currentvalue = BeautySkin_Slider.value;
                            rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.currentvalue);
                            SwitchBeautyOptionUIState(bi, go);
                        });
                        BeautySkinContentPanels[1].SetActive(true);
                    }
                });
            }

            for (int i = 0; i < BeautySkin_FaceShape.Length; i++)
            {
                BeautySkin_FaceShape[i].GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    BeautyConfig.beautySkin_2[0].currentvalue = int.Parse(go.name);
                    OpenBeautyShapeUI();
                });
            }
            if (BeautyConfig.beautySkin_2[0].currentvalue == -1)
            {
                BeautyConfig.beautySkin_2[0].currentvalue = 4;
            }
            else if (BeautyConfig.beautySkin_2[0].currentvalue == -5)
            {
                BeautyConfig.beautySkin_2[0].currentvalue = 3;
            }
            OpenBeautyShapeUI();

            panel.SetActive(true);
            BeautySkinContentPanels[1].SetActive(false);
            BeautySkinContentPanels[2].SetActive(true);
            BeautySkinContentPanels[4].SetActive(true);
        }
        else if (type == BeautySkinType.BeautyFilter)
        {
            BeautySkinSelecterOptions[2].GetComponent <Text>().color = highlightColor;
            string currentfiltername = rtt.GetItemParams(BeautySkinItemName, "filter_name");
            foreach (var bi in BeautyConfig.beautySkin_3)
            {
                GameObject go = AddBeautyFilterOptions(bi);
                if (string.Compare(bi.paramword, currentfiltername, true) == 0)
                {
                    currentSelected = go;
                    go.transform.Find("Image_bg").gameObject.SetActive(true);
                }
            }

            BeautySkin_Slider.onValueChanged.RemoveAllListeners();
            BeautySkin_Slider.minValue = 0;
            BeautySkin_Slider.maxValue = 1;
            BeautySkin_Slider.value    = (float)rtt.GetItemParamd(BeautySkinItemName, "filter_level");
            BeautySkin_Slider.onValueChanged.AddListener(delegate
            {
                rtt.SetItemParamd(BeautySkinItemName, "filter_level", BeautySkin_Slider.value);
            });
            panel.SetActive(true);
            BeautySkinContentPanels[1].SetActive(true);
            BeautySkinContentPanels[2].SetActive(false);
            BeautySkinContentPanels[4].SetActive(true);
        }
        else if (type == BeautySkinType.MakeupGroup)
        {
            BeautySkinSelecterOptions[3].GetComponent <Text>().color = highlightColor;

            foreach (var mg in BeautyConfig.makeupGroup_1)
            {
                GameObject go = AddMakeupOptions(mg);
                if (string.Compare(mg.name, currentSelectedMakeupName, true) == 0)
                {
                    //currentSelected = go;
                    //go.transform.Find("Image_bg").gameObject.SetActive(true);
                    go.GetComponent <AddClickEvent>().onClick(go);
                }
            }
            if (string.Compare(BeautyConfig.makeupGroup_1[0].name, currentSelectedMakeupName, true) != 0)
            {
                BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                BeautySkin_Slider.minValue = 0;
                BeautySkin_Slider.maxValue = 1;
                BeautySkin_Slider.value    = (float)rtt.GetItemParamd(MakeupItemName, "makeup_intensity");
                BeautySkin_Slider.onValueChanged.AddListener(delegate
                {
                    rtt.SetItemParamd(MakeupItemName, "makeup_intensity", BeautySkin_Slider.value);
                    float v = BeautySkin_Slider.value * currentMakeupfilterV;
                    v       = v > 1 ? 1 : v;
                    v       = v < 0 ? 0 : v;
                    rtt.SetItemParamd(BeautySkinItemName, "filter_level", v);
                });
                BeautySkinContentPanels[1].SetActive(true);
            }
            else
            {
                BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                BeautySkinContentPanels[1].SetActive(false);
            }

            panel.SetActive(true);
            BeautySkinContentPanels[2].SetActive(false);
            BeautySkinContentPanels[4].SetActive(true);
        }

        BeautySkinContent.SetActive(true);
        BeautySkinSelecter.SetActive(true);
    }
Example #2
0
    void OpenBeautySkinUI(BeautySkinType type)
    {
        currentBeautySkinType = type;
        currentItemType       = ItemType.Beauty;

        StartCoroutine(rtt.LoadItem(ItemConfig.beautySkin[0]));
        CloseAllBeautySkinContent();
        GameObject panel = BeautySkinContentPanels[0];

        panel.GetComponent <ScrollRect>().content.localPosition = Vector3.zero;
        BeautySkinContentPanels[3].gameObject.SetActive(true);
        ClearBeautySkinOptions();

        if (type == BeautySkinType.BeautySkin)
        {
            BeautySkinSelecterOptions[0].GetComponent <Text>().color = highlightColor;

            AddBeautySkinOptions(0, BeautyConfig.beautySkin_1[0]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                Beauty bi = null;
                foreach (var bgo in BeautyGOs)
                {
                    if (bgo.Value == go)
                    {
                        bi = bgo.Key;
                    }
                }
                if (bi == null)
                {
                    Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                    return;
                }
                if (currentSelected != go)
                {
                    currentSelected = go;
                    UnSelectAllBeautySkinOptions();
                    go.transform.Find("Image_bg").gameObject.SetActive(true);
                    BeautySkinContentPanels[2].SetActive(false);
                    BeautySkinContentPanels[1].SetActive(false);
                }
                //else
                {
                    bi.ifenable     = !bi.ifenable;
                    bi.currentvalue = bi.ifenable ? 1 : 0;
                    rtt.SetItemParamd(BeautySkinItemName, BeautyConfig.beautySkin_1[0].paramword, bi.currentvalue);
                    SwitchBeautyOptionUIState(bi, go);
                }
            });

            GameObject bgo1 = AddBeautySkinOptions(1, BeautyConfig.beautySkin_1[1]);
            bgo1.GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                Beauty bi = null;
                foreach (var bgo in BeautyGOs)
                {
                    if (bgo.Value == go)
                    {
                        bi = bgo.Key;
                    }
                }
                if (bi == null)
                {
                    Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                    return;
                }
                if (currentSelected != go)
                {
                    currentSelected = go;
                    UnSelectAllBeautySkinOptions();
                    go.transform.Find("Image_bg").gameObject.SetActive(true);
                    BeautySkinContentPanels[2].SetActive(false);
                    BeautySkinContentPanels[1].SetActive(false);
                }
                //else
                {
                    bi.ifenable     = !bi.ifenable;
                    bi.currentvalue = bi.ifenable ? 1 : 0;
                    if (bi.ifenable)
                    {
                        go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(0, bi.iconid_0);
                        go.GetComponentInChildren <Text>().text    = "朦胧磨皮";
                    }
                    else
                    {
                        go.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(0, bi.iconid_1);
                        go.GetComponentInChildren <Text>().text    = "清晰磨皮";
                    }
                    rtt.SetItemParamd(BeautySkinItemName, BeautyConfig.beautySkin_1[1].paramword, bi.currentvalue);
                }
            });
            if (BeautyConfig.beautySkin_1[1].ifenable)
            {
                bgo1.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(0, BeautyConfig.beautySkin_1[1].iconid_0);
                bgo1.GetComponentInChildren <Text>().text    = "朦胧磨皮";
            }
            else
            {
                bgo1.GetComponentInChildren <Image>().sprite = uisprites.GetSprite(0, BeautyConfig.beautySkin_1[1].iconid_1);
                bgo1.GetComponentInChildren <Text>().text    = "清晰磨皮";
            }
            bgo1.GetComponentInChildren <Text>().color = highlightColor;

            for (int i = 2; i < BeautyConfig.beautySkin_1.Length - 1; i++)
            {
                AddBeautySkinOptions(i, BeautyConfig.beautySkin_1[i]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    Beauty bi = null;
                    foreach (var bgo in BeautyGOs)
                    {
                        if (bgo.Value == go)
                        {
                            bi = bgo.Key;
                        }
                    }
                    if (bi == null)
                    {
                        Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                        return;
                    }
                    if (currentSelected != go)
                    {
                        currentSelected = go;
                        UnSelectAllBeautySkinOptions();
                        go.transform.Find("Image_bg").gameObject.SetActive(true);
                        BeautySkinContentPanels[2].SetActive(false);
                        BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                        BeautySkin_Slider.minValue = 0;
                        BeautySkin_Slider.maxValue = bi.maxvalue;
                        BeautySkin_Slider.value    = bi.currentvalue;
                        BeautySkin_Slider.onValueChanged.AddListener(delegate
                        {
                            bi.currentvalue = BeautySkin_Slider.value;
                            rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.currentvalue);
                        });
                        if (!bi.ifenable)
                        {
                            bi.ifenable = true;
                            rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.currentvalue);
                            SwitchBeautyOptionUIState(bi, go);
                        }
                        BeautySkinContentPanels[1].SetActive(true);
                    }
                    else
                    {
                        bi.ifenable = !bi.ifenable;
                        rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.ifenable ? bi.currentvalue : bi.disablevalue);
                        SwitchBeautyOptionUIState(bi, go);
                        BeautySkinContentPanels[1].SetActive(bi.ifenable);
                    }
                });
            }

            AddBeautySkinOptions(BeautyConfig.beautySkin_1.Length - 1, BeautyConfig.beautySkin_1[BeautyConfig.beautySkin_1.Length - 1]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                foreach (var bgo in BeautyGOs)
                {
                    bgo.Key.currentvalue = bgo.Key.defaultvalue;
                    rtt.SetItemParamd(BeautySkinItemName, bgo.Key.paramword, bgo.Key.currentvalue);
                    bgo.Key.ifenable = bgo.Key.currentvalue == bgo.Key.disablevalue ? false : true;
                    SwitchBeautyOptionUIState(bgo.Key, bgo.Value);
                }
                currentSelected = null;
                UnSelectAllBeautySkinOptions();
                BeautySkinContentPanels[2].SetActive(false);
                BeautySkinContentPanels[1].SetActive(false);
            });

            panel.SetActive(true);
        }
        else if (type == BeautySkinType.BeautyShape)
        {
            BeautySkinSelecterOptions[1].GetComponent <Text>().color = highlightColor;

            AddBeautySkinOptions(0, BeautyConfig.beautySkin_2[0]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                Beauty bi = null;
                foreach (var bgo in BeautyGOs)
                {
                    if (bgo.Value == go)
                    {
                        bi = bgo.Key;
                    }
                }
                if (bi == null)
                {
                    Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                    return;
                }
                if (currentSelected != go)
                {
                    currentSelected = go;
                    UnSelectAllBeautySkinOptions();
                    go.transform.Find("Image_bg").gameObject.SetActive(true);
                    BeautySkinContentPanels[1].SetActive(false);
                    BeautySkinContentPanels[2].SetActive(true);
                }
            });
            for (int i = 1; i < BeautyConfig.beautySkin_2.Length - 1; i++)
            {
                AddBeautySkinOptions(i, BeautyConfig.beautySkin_2[i]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    Beauty bi = null;
                    foreach (var bgo in BeautyGOs)
                    {
                        if (bgo.Value == go)
                        {
                            bi = bgo.Key;
                        }
                    }
                    if (bi == null)
                    {
                        Debug.Log("Undefined BeautyGO!!! name=" + go.name);
                        return;
                    }
                    if (currentSelected != go)
                    {
                        currentSelected = go;
                        UnSelectAllBeautySkinOptions();
                        go.transform.Find("Image_bg").gameObject.SetActive(true);
                        BeautySkinContentPanels[2].SetActive(false);
                        BeautySkin_Slider.onValueChanged.RemoveAllListeners();
                        BeautySkin_Slider.minValue = 0;
                        BeautySkin_Slider.maxValue = bi.maxvalue;
                        BeautySkin_Slider.value    = bi.currentvalue;
                        BeautySkin_Slider.onValueChanged.AddListener(delegate
                        {
                            bi.currentvalue = BeautySkin_Slider.value;
                            rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.currentvalue);
                        });
                        if (!bi.ifenable)
                        {
                            bi.ifenable = true;
                            rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.currentvalue);
                            SwitchBeautyOptionUIState(bi, go);
                        }
                        BeautySkinContentPanels[1].SetActive(true);
                    }
                    else
                    {
                        bi.ifenable = !bi.ifenable;
                        rtt.SetItemParamd(BeautySkinItemName, bi.paramword, bi.ifenable ? bi.currentvalue : bi.disablevalue);
                        SwitchBeautyOptionUIState(bi, go);
                        BeautySkinContentPanels[1].SetActive(bi.ifenable);
                    }
                });
            }
            AddBeautySkinOptions(BeautyConfig.beautySkin_2.Length - 1, BeautyConfig.beautySkin_2[BeautyConfig.beautySkin_2.Length - 1]).GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
            {
                foreach (var bgo in BeautyGOs)
                {
                    if (bgo.Key.paramword != BeautyConfig.beautySkin_2[0].paramword)
                    {
                        bgo.Key.currentvalue = bgo.Key.defaultvalue;
                        rtt.SetItemParamd(BeautySkinItemName, bgo.Key.paramword, bgo.Key.currentvalue);
                        bgo.Key.ifenable = bgo.Key.currentvalue == bgo.Key.disablevalue ? false : true;
                        SwitchBeautyOptionUIState(bgo.Key, bgo.Value);
                    }
                }
                currentSelected = null;
                UnSelectAllBeautySkinOptions();
                BeautySkinContentPanels[2].SetActive(false);
                BeautySkinContentPanels[1].SetActive(false);
            });

            for (int i = 0; i < BeautySkin_FaceShape.Length; i++)
            {
                BeautySkin_FaceShape[i].GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    BeautyConfig.beautySkin_2[0].currentvalue = int.Parse(go.name);
                    BeautyConfig.beautySkin_2[0].ifenable     = BeautyConfig.beautySkin_2[0].currentvalue == BeautyConfig.beautySkin_2[0].disablevalue ? false : true;
                    SwitchBeautyOptionUIState(BeautyConfig.beautySkin_2[0], BeautyGOs[BeautyConfig.beautySkin_2[0]]);
                    OpenBeautyShapeUI();
                });
            }
            if (BeautyConfig.beautySkin_2[0].currentvalue == -1)
            {
                BeautyConfig.beautySkin_2[0].currentvalue = 4;
            }
            OpenBeautyShapeUI();

            panel.SetActive(true);
            BeautySkinContentPanels[1].SetActive(false);
            BeautySkinContentPanels[2].SetActive(true);
        }
        else if (type == BeautySkinType.BeautyFilter)
        {
            BeautySkinSelecterOptions[2].GetComponent <Text>().color = highlightColor;
            string currentfiltername = rtt.GetItemParams(BeautySkinItemName, "filter_name");
            foreach (var bi in BeautyConfig.beautySkin_3)
            {
                GameObject go = AddBeautyFilterOptions(bi);
                if (string.Compare(bi.paramword, currentfiltername, true) == 0)
                {
                    currentSelected = go;
                    go.transform.Find("Image_bg").gameObject.SetActive(true);
                }
            }

            BeautySkin_Slider.onValueChanged.RemoveAllListeners();
            BeautySkin_Slider.minValue = 0;
            BeautySkin_Slider.maxValue = 1;
            BeautySkin_Slider.value    = (float)rtt.GetItemParamd(BeautySkinItemName, "filter_level");
            BeautySkin_Slider.onValueChanged.AddListener(delegate
            {
                rtt.SetItemParamd(BeautySkinItemName, "filter_level", BeautySkin_Slider.value);
            });
            panel.SetActive(true);
            BeautySkinContentPanels[1].SetActive(true);
            BeautySkinContentPanels[2].SetActive(false);
        }
        else if (type == BeautySkinType.Filter)
        {
            BeautySkinSelecterOptions[3].GetComponent <Text>().color = highlightColor;
            string currentfiltername = rtt.GetItemParams(BeautySkinItemName, "filter_name");
            foreach (var bi in BeautyConfig.beautySkin_4)
            {
                GameObject go   = AddBeautyFilterOptions(bi);
                var        test = string.Compare(bi.paramword, currentfiltername, true);
                if (string.Compare(bi.paramword, currentfiltername, true) == 0)
                {
                    currentSelected = go;
                    go.transform.Find("Image_bg").gameObject.SetActive(true);
                }
            }

            BeautySkin_Slider.onValueChanged.RemoveAllListeners();
            BeautySkin_Slider.minValue = 0;
            BeautySkin_Slider.maxValue = 1;
            BeautySkin_Slider.value    = (float)rtt.GetItemParamd(BeautySkinItemName, "filter_level");
            BeautySkin_Slider.onValueChanged.AddListener(delegate
            {
                rtt.SetItemParamd(BeautySkinItemName, "filter_level", BeautySkin_Slider.value);
            });

            panel.SetActive(true);
            BeautySkinContentPanels[1].SetActive(true);
            BeautySkinContentPanels[2].SetActive(false);
        }

        BeautySkinContent.SetActive(true);
        BeautySkinSelecter.SetActive(true);
    }