コード例 #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();
    }
コード例 #2
0
    public void DisplayCards(IList data, bool refillCells = true)
    {
        _cardsScrollRect.dataSource = data;

        if (refillCells)
        {
            _cardsScrollRect.RefillCells();
        }
        else
        {
            _cardsScrollRect.RefreshCells();
        }
    }
コード例 #3
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();
    }
コード例 #4
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();
        }
コード例 #5
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();
    }
コード例 #6
0
        IEnumerator DelayRefreshList()
        {
            yield return(null);

            loopScrollRect.totalCount = itemsVm.Count;
            loopScrollRect.RefreshCells();
            delayRefreshCoroutine = null;
        }
コード例 #7
0
        public void OnDataSourceUpdated(bool isSuccess)
        {
            _isAwaitingForResponse = false;
            EnableSpinner(false);

            if (!isSuccess)
            {
                return;
            }

            _scrollRect.RefreshCells();
        }
コード例 #8
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();
        }
コード例 #9
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();
        }
    }