Ejemplo n.º 1
0
    //아이템 구매하거나 겟 할때 호출 하게 해야함
    public void UpdateWeaponInventorySlot()
    {
        //무기 갱신
        if (m_LoopScrollRect.totalCount < CUserData.GetInstance.m_weaponInvenList.Count || m_LoopScrollRect.totalCount > CUserData.GetInstance.m_weaponInvenList.Count)
        {
            m_LoopScrollRect.totalCount = CUserData.GetInstance.m_weaponInvenList.Count; //인벤토리 슬롯 갯수 갱신
        }

        m_LoopScrollRect.RefillCells(); // 인벤토리 생성함수 호출
        m_LoopScrollRect.RefreshCells();
    }
Ejemplo n.º 2
0
 public void InitData()
 {
     mainScrollRect.totalCount = listChipInfo.Count;
     if (currentChip != null)
     {
         // mainScrollRect.SrollToCell(Mathf.Clamp(currentChip.index, 0, listChipDetail.Count - 1), 10000f);
         mainScrollRect.RefillCells(Mathf.Clamp(currentChip.index - 2, 0, listChipDetail.Count - 1));
     }
     else
     {
         mainScrollRect.RefillCells();
     }
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.F))
     {
         m_LoopScrollRect.RefillCells(m_DataCount, offset);
     }
 }
Ejemplo n.º 5
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();
    }
Ejemplo n.º 6
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();
    }
Ejemplo n.º 7
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();
        }
        if (GUILayout.Button("RefillCellsToEnd"))
        {
            scroll.RefillCells(scroll.totalCount - 1);
        }

        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();
    }
Ejemplo n.º 8
0
 public void Reset(ObservableList <TVm> items, LoopScrollRect loopScrollRect)
 {
     itemsVm             = items;
     this.loopScrollRect = loopScrollRect;
     items.AddListener(OnListChanged);
     loopScrollRect.totalCount  = items.Count;
     loopScrollRect.OnItemShow += OnItemChanged;
     loopScrollRect.RefillCells();
 }
Ejemplo n.º 9
0
 void CreatePanelAppInfo()
 {
     for (int i = 0; i < DataManager.instance.installAppData.listCurrentAppDetail.Count; i++)
     {
         listCurrentAppDetail.Add(DataManager.instance.installAppData.listCurrentAppDetail[i].ShallowCopy());
     }
     mainScrollRect.totalCount = listCurrentAppDetail.Count;
     mainScrollRect.RefillCells();
 }
Ejemplo n.º 10
0
    public void AddFile()
    {
        var AM = AppManager.Instance;

        switch (AM.way)
        {
        case 1: Debug.Log("_path222 " + _path); SurfaceAddFile(_path); break;

        case 2: BoxAddFile(_path); break;

        case 3: PipeAddFile(_path); break;

        case 4: ChannelAddFile(_path); break;
        }
        scroll.RefillCells();
    }//файл
Ejemplo n.º 11
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();
 }
Ejemplo n.º 12
0
    private async Task ReadFiles()
    {
        pathToReserve = path;
        //
        //pathToReserve = Application.persistentDataPath + "/SongText";

        if (Directory.Exists(pathToReserve) || GetReservedSpace() != 0)
        {
            await FileRead();
        }
        loopScrool.totalCount = list_songs.songs.Count;
        loopScrool.RefillCells();
    }
Ejemplo n.º 13
0
        public void OnDataSourceRecreated(bool isSuccess, IList dataSource)
        {
            _isAwaitingForResponse = false;
            EnableSpinner(false);

            if (!isSuccess)
            {
                return;
            }

            _scrollRect.dataSource = dataSource;
            _scrollRect.RefillCells();
        }
Ejemplo n.º 14
0
    public void DisplayCards(IList data, bool refillCells = true)
    {
        _cardsScrollRect.dataSource = data;

        if (refillCells)
        {
            _cardsScrollRect.RefillCells();
        }
        else
        {
            _cardsScrollRect.RefreshCells();
        }
    }
Ejemplo n.º 15
0
    /// <summary>
    /// 修改列表滑动状态
    /// </summary>
    /// <param name="type">0:始终显示最新数据 2:停留当前界面</param>
    public void ChangeListSlideType(int type)
    {
        //Debug.Log("更改列表填充状态");
        switch (type)
        {
        case 0:
            _loopScrollRect.RefillCellsFromEnd(0);
            break;

        case 1:
            _loopScrollRect.RefillCells();
            break;
        }
    }
Ejemplo n.º 16
0
 public void ViewPref()
 {
     try
     {
         var AM = AppManager.Instance;
         var P  = AppManager.Instance.places.places;
         if (P[AM.PlaceN].channel[AM.ChannelN].note.Count > 0)
         {
             scroll.totalCount = P[AM.PlaceN].channel[AM.ChannelN].note.Count;
             scroll.RefillCells();
         }
     }
     catch { }
 }//обновление префаба
Ejemplo n.º 17
0
 public void ViewCargoPref()
 {
     try
     {
         var AM = AppManager.Instance;
         var R  = AppManager.Instance.res.lines;
         if (R.Count > 0)
         {
             scroll.totalCount = R.Count;
             scroll.RefillCells();
         }
     }
     catch { }
 }
Ejemplo n.º 18
0
        void Start()
        {
            _scrollRect = GetComponent <LoopScrollRect>();
            var dataSource = new LoopScrollPrefabSource();

            dataSource.prefabName = ObjectResourceName;
            _scrollRect.Init(dataSource, LoopScrollSendIndexSource.Instance);
            for (int i = 0; i < totalCount; i++)
            {
                _scrollRect.AddItem((object)i, false);
            }

            _scrollRect.RefillCells();
        }
Ejemplo n.º 19
0
 public void ViewPref()
 {
     try
     {
         var AM = AppManager.Instance;
         var P  = AppManager.Instance.places.places;
         if (P[AM.PlaceN].pipe[AM.PipeN].note.Count > 0)
         {
             scroll.totalCount = P[AM.PlaceN].pipe[AM.PipeN].note.Count;
             scroll.RefillCells();
         }
     }
     catch { }
 }
Ejemplo n.º 20
0
 private async Task InitializeScreen()
 {
     while (WebHandler.Instance == null || AppManager.Instance == null || AppManager.Instance.userInfo.user.phone == "")
     {
         await new WaitForSeconds(.01f);
     }
     await WebHandler.Instance.GetUserDataWraper("?uid=" + AppManager.Instance.curent_userprofile_id
                                                 , (resp) =>
     {
         //                Debug.Log(resp);
         JsonUtility.FromJsonOverwrite(resp, AppManager.Instance.curentUserInfo);
         loopScrollRect.totalCount = AppManager.Instance.curentUserInfo.user.reviews.Count;
         loopScrollRect.RefillCells();
     });
 }
Ejemplo n.º 21
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();
        }
    }
Ejemplo n.º 22
0
    void CreatePanelServerOptionInfo()
    {
        for (int i = 0; i < DataManager.instance.subServerData.listSubServerDetail.Count; i++)
        {
            if (!DataManager.instance.subServerData.listSubServerDetail[i].beingError)
            {
                listRoomDetail.Add(DataManager.instance.subServerData.listSubServerDetail[i]);
            }
        }
        for (int i = 0; i < DataManager.instance.subServerData.listSubServerDetail.Count; i++)
        {
            if (DataManager.instance.subServerData.listSubServerDetail[i].beingError)
            {
                listRoomDetail.Add(DataManager.instance.subServerData.listSubServerDetail[i]);
            }
        }

        mainScrollRect.totalCount = listRoomDetail.Count;
        mainScrollRect.RefillCells();
    }
    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();
    }
Ejemplo n.º 24
0
 public void BeginInCount(int beginCount)
 {
     Debug.Log("BeginInCount = " + beginCount);
     ls.RefillCells(beginCount);
 }
Ejemplo n.º 25
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;
        }
Ejemplo n.º 26
0
 void Start()
 {
     test1.ITEM_MAX_COUNT = 55;
     test1.RefillCells();
 }
Ejemplo n.º 27
0
 /// <summary>
 /// 更改列表
 /// </summary>
 /// <param name="coutn"></param>
 void ChangeList(int coutn)
 {
     _loopScrollRect.ClearCells();
     _loopScrollRect.totalCount = coutn;
     _loopScrollRect.RefillCells();
 }
Ejemplo n.º 28
0
 void Start()
 {
     ls            = GetComponent <LoopScrollRect>();
     ls.totalCount = totalCount;
     ls.RefillCells();
 }