예제 #1
0
 /// <summary>
 /// 更改列表
 /// </summary>
 /// <param name="coutn"></param>
 void ChangeList(int coutn)
 {
     if (_chatSlideListStateInspection._IsDrag)
     {
         _loopScrollRect.totalCount = coutn;
         return;
     }
     if (_loopScrollRect == null)
     {
         return;
     }
     _loopScrollRect.ClearCells();
     _loopScrollRect.totalCount = coutn;
     ChangeListSlideType(0);
 }
예제 #2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        EditorGUILayout.Space();

        LoopScrollRect scroll = (LoopScrollRect)target;

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Clear"))
        {
            scroll.ClearCells();
        }
        if (GUILayout.Button("Refresh"))
        {
            scroll.RefreshCells();
        }
        if (GUILayout.Button("Refill"))
        {
            scroll.RefillCells(50);
        }
        if (GUILayout.Button("RefillFromEnd"))
        {
            scroll.RefillCellsFromEnd();
        }
        EditorGUILayout.EndHorizontal();
    }
예제 #3
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            EditorGUILayout.Space();

            LoopScrollRect scroll = (LoopScrollRect)target;

            //scroll.m_PrefabGameObject = EditorGUILayout.ObjectField("Prefab", scroll.m_PrefabGameObject, typeof(GameObject), true, null) as GameObject;

            scroll.totalCount       = EditorGUILayout.IntField("Total Count", scroll.totalCount);
            scroll.threshold        = Mathf.Max(10, EditorGUILayout.FloatField("Threshold", scroll.threshold));
            scroll.reverseDirection = EditorGUILayout.Toggle("Reverse Direction", scroll.reverseDirection);
            scroll.rubberScale      = Mathf.Max(0, EditorGUILayout.FloatField("Rubber Scale", scroll.rubberScale));
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Clear"))
            {
                scroll.ClearCells();
            }
            if (GUILayout.Button("Refill"))
            {
                scroll.RefillCells();
            }
            if (GUILayout.Button("Refresh"))
            {
                scroll.RefreshCells();
            }
            EditorGUILayout.EndHorizontal();
        }
예제 #4
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        EditorGUILayout.Space();

        LoopScrollRect scroll = (LoopScrollRect)target;

        if (GUILayout.Button("Create PoolObject"))
        {
            var _tf = scroll.transform.Find(LoopScrollPrefabSource.__POOLSNAME);

            if (!_tf)
            {
                GameObject _gameObject = new GameObject(LoopScrollPrefabSource.__POOLSNAME);

                _gameObject.transform.SetParent(scroll.transform);
                _gameObject.transform.localScale    = Vector3.one;
                _gameObject.transform.localPosition = Vector3.zero;

                _tf = _gameObject.transform;
            }

            scroll.prefabSource.PoolGameObject = _tf;

            Debug.Log("Create Suc!");
        }

        GUI.enabled = Application.isPlaying;

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Clear"))
        {
            scroll.ClearCells();
        }
        if (GUILayout.Button("Refresh"))
        {
            scroll.RefreshCells();
        }
        if (GUILayout.Button("Refill"))
        {
            scroll.RefillCells();
        }
        if (GUILayout.Button("RefillFromEnd"))
        {
            scroll.RefillCellsFromEnd();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUIUtility.labelWidth = 45;
        float w = (EditorGUIUtility.currentViewWidth - 100) / 2;

        EditorGUILayout.BeginHorizontal();
        index = EditorGUILayout.IntField("Index", index, GUILayout.Width(w));
        speed = EditorGUILayout.FloatField("Speed", speed, GUILayout.Width(w));
        if (GUILayout.Button("Scroll", GUILayout.Width(45)))
        {
            scroll.SrollToCell(index, speed);
        }
        EditorGUILayout.EndHorizontal();
    }
예제 #5
0
 /// <summary>
 /// 更改列表
 /// </summary>
 /// <param name="coutn"></param>
 void ChangeList(int coutn)
 {
     _loopScrollRect.ClearCells();
     _loopScrollRect.totalCount = coutn;
     //添加循环列表itme引用丢失防误
     if (_loopScrollRect.prefabSource.prefabGO == null)
     {
         _loopScrollRect.prefabSource.prefabGO = _listItem.gameObject;
     }
     _loopScrollRect.RefillCells();
 }
예제 #6
0
    public override void ResetData()
    {
        StopAllCoroutines();
        currentState                 = State.Hide;
        myCanvasGroup.alpha          = 0f;
        myCanvasGroup.blocksRaycasts = false;

        panelFocusScreen.gameObject.SetActive(false);

        if (listCurrentAppDetail != null && listCurrentAppDetail.Count > 0)
        {
            listCurrentAppDetail.Clear();
        }
        panelLoading.gameObject.SetActive(false);
        txtEmpty.gameObject.SetActive(false);
        mainScrollRect.ClearCells();

        timeCanPressGetReward = System.DateTime.Now;

        isInitialized = false;
    }
예제 #7
0
        public void InitScrollView(GameObject go, int count, string cellName, int focusIndex = -1)
        {
            LoopScrollRect component = go.GetComponent <LoopScrollRect>();

            if (component != null)
            {
                component.prefabPool = this.EasyObjectPool;
                component.SetPrefabToPool(cellName);
                component.ClearCells();
                component.totalCount = count;
                component.focusIndex = focusIndex;
            }
        }
예제 #8
0
    public override void ResetData()
    {
        StopAllCoroutines();
        currentState                 = State.Hide;
        myCanvasGroup.alpha          = 0f;
        myCanvasGroup.blocksRaycasts = false;

        if (listRoomDetail != null && listRoomDetail.Count > 0)
        {
            listRoomDetail.Clear();
        }

        mainScrollRect.ClearCells();
    }
예제 #9
0
    public void OnEnable()
    {
        var AM = AppManager.Instance;

        SendVoiceMessageButton.onClick.AddListener(() => RecordVoice());
        parent.text = AM.path2;
        scroll.ClearCells();
        if (AM.openNoteMedia)
        {
            ViewNoteMediaPref();
        }
        else
        {
            ViewPref();
        }
    }
예제 #10
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            EditorGUILayout.Space();

            LoopScrollRect scroll = (LoopScrollRect)target;

            GUI.enabled = Application.isPlaying;

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Clear"))
            {
                scroll.ClearCells();
            }

            if (GUILayout.Button("Refresh"))
            {
                scroll.RefreshCells();
            }

            if (GUILayout.Button("Refill"))
            {
                scroll.RefillCells();
            }

            if (GUILayout.Button("RefillFromEnd"))
            {
                scroll.RefillCellsFromEnd();
            }

            EditorGUILayout.EndHorizontal();

            EditorGUIUtility.labelWidth = 45;
            float w = (EditorGUIUtility.currentViewWidth - 100) / 2;

            EditorGUILayout.BeginHorizontal();
            index = EditorGUILayout.IntField("Index", index, GUILayout.Width(w));
            speed = EditorGUILayout.FloatField("Speed", speed, GUILayout.Width(w));
            if (GUILayout.Button("Scroll", GUILayout.Width(45)))
            {
                scroll.SrollToCell(index, speed);
            }

            EditorGUILayout.EndHorizontal();
        }
예제 #11
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            m_LoopScrollRect.RefillCells(m_DataCount);
        }


        if (Input.GetKeyDown(KeyCode.C))
        {
            m_LoopScrollRect.ClearCells();
        }

        if (Input.GetKeyDown(KeyCode.F))
        {
            m_LoopScrollRect.RefreshCells();
        }
    }
    public override void OnInspectorGUI()
    {
        LoopScrollRect scroll = (LoopScrollRect)target;

        scroll.initInStart      = EditorGUILayout.Toggle("Init in Start", scroll.initInStart);
        scroll.prefabPool       = (MarchingBytes.EasyObjectPool)EditorGUILayout.ObjectField("Prefab Pool", scroll.prefabPool, typeof(MarchingBytes.EasyObjectPool), true);
        scroll.prefabPoolName   = EditorGUILayout.TextField("Prefab Pool Name", scroll.prefabPoolName);
        scroll.totalCount       = EditorGUILayout.IntField("Total Count", scroll.totalCount);
        scroll.cacheExtendCount = Mathf.Max(1, EditorGUILayout.IntField("Cache Extend Count", scroll.cacheExtendCount));
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Clear Cells"))
        {
            scroll.ClearCells();
        }
        if (GUILayout.Button("Refill Cells"))
        {
            scroll.RefillCells();
        }
        EditorGUILayout.EndHorizontal();
        base.OnInspectorGUI();
    }
예제 #13
0
 private void ClearSearchResults()
 {
     _scrollRect.ClearCells();
     _scrollRect.dataSource = null;
 }
예제 #14
0
        public void MakeGames(bool force = false)
        {
            Debug.Log("building games " + name);

            //if (force || !hasInitialized) {
            scrollRect.ClearCells();
            foreach (RectTransform child in spawnRect)
            {
                Destroy(child.gameObject);
            }
            //}

            //gamesGroup.Clear();
            gameDataList.Clear();


            //Sort the data, and then get the game data from the sorted:
            List <LibraryGameData> tempSort = LibraryHelper.I.GetSortedGameData(sortMode);


            int spawnCount = 0;

            foreach (LibraryGameData gameData in tempSort)
            {
                //Based on the display mode, we don't dlisplay some games:

                switch (displayMode)
                {
                case LibraryDisplayMode.Applications:
                    if (gameData.gameType == LibraryGameType.Overlay || gameData.gameType == LibraryGameType.Core)
                    {
                        continue;
                    }
                    break;

                case LibraryDisplayMode.Revive:
                    if (gameData.gameType != LibraryGameType.Revive)
                    {
                        continue;
                    }
                    break;

                case LibraryDisplayMode.Favorites:
                    if (!gameData.isFavorite)
                    {
                        continue;
                    }
                    break;

                case LibraryDisplayMode.Misc:
                    if (gameData.gameType == LibraryGameType.Application || gameData.gameType == LibraryGameType.Revive)
                    {
                        continue;
                    }
                    break;
                }

                //gameDataList.Add(gameData);
                gameDataList.Add(gameData);

                spawnCount++;

                if (spawnCount >= spawnLimit)
                {
                    break;
                }
            }


            /*if (force || !hasInitialized) {
             *      scrollRect.ClearCells();
             *      foreach (RectTransform child in spawnRect) {
             *              Destroy(child.gameObject);
             *      }
             * }*/



            scrollRect.totalCount = gameDataList.Count;


            if (force || !hasInitialized)
            {
                //scrollRect.RefillCellsFromEnd();
                //scrollRect.RefillCells();
            }
            else
            {
                //scrollRect.RefreshCells();
            }

            scrollRect.RefillCells();

            scrollRect.SrollToCell(0, 1000);

            hasInitialized = true;
        }
예제 #15
0
 /// <summary>
 /// 更改列表
 /// </summary>
 /// <param name="coutn"></param>
 void ChangeList(int coutn)
 {
     _loopScrollRect.ClearCells();
     _loopScrollRect.totalCount = coutn;
     _loopScrollRect.RefillCells();
 }
예제 #16
0
 public void SelfDestruction()
 {
     mainScrollRect.ClearCells();
 }