示例#1
0
    void _back()
    {
        InputField.text = string.Empty;
        Debug.Log(" 点击了返回按钮。");
        if (IsFormScan)
        {
            Destroy(HomeViewController.Instance.GetComponent <DataHelper>());
        }
        else
        {
            Destroy(AppHomeViewController.Instance.GetComponent <DataHelper>());
        }
        List <GameObject> list = new List <GameObject>();

        for (int i = 0; i < ContentPanel.transform.childCount; ++i)
        {
            list.Add(ContentPanel.transform.GetChild(i).gameObject);
        }
        foreach (var obj in list)
        {
            DestroyImmediate(obj, true);
        }
        //Destroy(ContentPanel.transform.GetChild(i).gameObject);
        StopAllCoroutines();
        DataHelper.Instance.StopAllCoroutines();
        tabfun.helper.Coroutine.Instance.StopAllCoroutines();
        ScorllPanel.SetActive(false);
        AssetBundle.UnloadAllAssetBundles(true);
        Resources.UnloadUnusedAssets();
        System.GC.Collect();
        if (!canHide && !canShow)
        {
            canHide = true;
        }
    }
示例#2
0
    void searchHandle_plus(string _string)
    {
        List <GameObject> list = new List <GameObject>();

        for (int i = 0; i < ContentPanel.transform.childCount; ++i)
        {
            list.Add(ContentPanel.transform.GetChild(i).gameObject);
        }
        foreach (var obj in list)
        {
            DestroyImmediate(obj, true);
        }
        //Destroy(ContentPanel.transform.GetChild(i).gameObject);
        StopAllCoroutines();
        DataHelper.Instance.StopAllCoroutines();
        tabfun.helper.Coroutine.Instance.StopAllCoroutines();
        ScorllPanel.SetActive(false);
        AssetBundle.UnloadAllAssetBundles(true);
        Resources.UnloadUnusedAssets();
        System.GC.Collect();
        if (_string == string.Empty)
        {
            HelloText.text = "请输入搜索内容";
            HelloText.gameObject.SetActive(true);
            return;
        }
        AnimationImage.gameObject.SetActive(true);
        StartCoroutine(_searchHandle_plus(_string));
    }
示例#3
0
    IEnumerator rePosScorllPanel()
    {
        yield return(new WaitForEndOfFrame());

        if (ContentPanel.transform.childCount > 0)
        {
            ScorllPanel.SetActive(true);
        }
        ScorllPanel.GetComponent <RectTransform>().anchoredPosition3D = new Vector3(0, ScorllPanel.GetComponent <RectTransform>().anchoredPosition3D.y, 0);
        AnimationImage.gameObject.SetActive(false);
    }
示例#4
0
 void _ui_events()
 {
     InputField.keyboardType = TouchScreenKeyboardType.NamePhonePad;
     ScorllPanel.SetActive(false);
     AnimationImage.gameObject.SetActive(false);
     BackButton.onClick.AddListener(_back);
     InputField.onEndEdit.AddListener((str) => { searchHandle_plus(str); });
     SearchButton.onClick.AddListener(_searchButtonClick);
     MoreButton.onClick.AddListener(() => {
         MoreButton.gameObject.SetActive(false);
         MaskPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(Display.main.systemWidth, Display.main.systemHeight - Mathf.Abs(ScorllPanel.GetComponent <RectTransform>().anchoredPosition3D.y));
     });
     ScorllPanel.GetComponent <ScrollRect>().onValueChanged.AddListener((v2) => {
         if (MoreButton.gameObject.activeSelf && v2.y < 1.0f)
         {
             ScorllPanel.GetComponent <ScrollRect>().normalizedPosition = new Vector2(0, 1);
         }
     });
 }