Ejemplo n.º 1
0
    void RegisterUIFunc()
    {
        Btn_Switch.onClick.AddListener(delegate { rtt.SwitchCamera(); });
        Btn_Back.onClick.AddListener(delegate {
            if (musiccor != null)
            {
                StopCoroutine(musiccor);
                musiccor = null;
                audios.Stop();
            }
            Canvas_TopUI.SetActive(true);
            rtt.UnLoadItem(rtt.GetCurrentItemName());
            CloseBeautySkinUI();
            CloseItemUI();
        });
        Btn_Cancel.onClick.AddListener(OnCancelTakePicture);
        Btn_SavePic.onClick.AddListener(OnSavePicture);
        Btn_TakePic_mini_1.onClick.AddListener(TakePicture);
        Btn_TakePic_mini_2.onClick.AddListener(TakePicture);

        for (int i = 0; i < ItemSelecters.Length; i++)
        {
            if (ItemSelecters[i].activeSelf)
            {
                ItemSelecters[i].GetComponent <AddClickEvent>().AddListener(delegate(GameObject go)
                {
                    int id = int.Parse(go.name);
                    if (id == 0)
                    {
                        OpenBeautySkinUI(BeautySkinType.None);
                    }
                    else
                    {
                        OpenItemsUI((ItemType)id);
                    }
                    Canvas_TopUI.SetActive(false);
                });
            }
        }

        rtt.RawImg_BackGroud.GetComponent <AddClickEvent>().AddListener(delegate {
            if (currentItemType == ItemType.Beauty)
            {
                CloseAllBeautySkinContent();
                BeautySkinContentPanels[3].gameObject.SetActive(true);
            }
        });

        BeautySkinSelecterOptions[0].GetComponent <AddClickEvent>().AddListener(delegate { OpenBeautySkinUI(BeautySkinType.BeautySkin); });
        BeautySkinSelecterOptions[1].GetComponent <AddClickEvent>().AddListener(delegate { OpenBeautySkinUI(BeautySkinType.BeautyShape); });
        BeautySkinSelecterOptions[2].GetComponent <AddClickEvent>().AddListener(delegate { OpenBeautySkinUI(BeautySkinType.BeautyFilter); });
        BeautySkinSelecterOptions[3].GetComponent <AddClickEvent>().AddListener(delegate { OpenBeautySkinUI(BeautySkinType.Filter); });
    }