コード例 #1
0
        public RecycledListItem CreateItem(Transform parent)
        {
            ObjectReferencePickerItem item = (ObjectReferencePickerItem)Instantiate(referenceItemPrefab, parent, false);

            item.Skin = Skin;

            return(item);
        }
コード例 #2
0
        public void Close()
        {
            onReferenceChanged      = null;
            initialValue            = null;
            currentlySelectedObject = null;
            currentlySelectedItem   = null;

            references.Clear();
            filteredReferences.Clear();

            gameObject.SetActive(false);
        }
コード例 #3
0
        public void OnItemClicked(RecycledListItem item)
        {
            if (currentlySelectedItem != null)
            {
                currentlySelectedItem.IsSelected = false;
            }

            currentlySelectedItem            = (ObjectReferencePickerItem)item;
            currentlySelectedObject          = currentlySelectedItem.Reference;
            currentlySelectedItem.IsSelected = true;

            if (onReferenceChanged != null)
            {
                onReferenceChanged(currentlySelectedItem.Reference);
            }
        }
コード例 #4
0
        public void SetItemContent(RecycledListItem item)
        {
            ObjectReferencePickerItem it = (ObjectReferencePickerItem)item;

            it.SetContent(filteredReferences[it.Position]);

            if (it.Reference == currentlySelectedObject)
            {
                it.IsSelected         = true;
                currentlySelectedItem = it;
            }
            else
            {
                it.IsSelected = false;
            }

            it.Skin = Skin;
        }