コード例 #1
0
ファイル: ListBinding.cs プロジェクト: musaozey/MiniBind
        private void CreateItems(string s)
        {
            string[] splittedString = s.Split(LIST_STRING_SEPERATOR);

            for (int i = 0; i < splittedString.Length; i++)
            {
                ListItemBinding item = GetItemFromPool();
                item.transform.SetParent(transform);
                item.SetKey(splittedString[i]);
                item.transform.localScale = Vector3.one;
                item.transform.position   = Vector3.zero;
                items.Add(item);
                item.gameObject.SetActive(true);
            }

            if (gameObject.activeInHierarchy)
            {
                notifyCoroutine = StartCoroutine(NotifyOnItemsCreated());
            }
        }
コード例 #2
0
ファイル: ListBinding.cs プロジェクト: musaozey/MiniBind
 private void ReturnItemToPool(ListItemBinding item)
 {
     item.gameObject.SetActive(false);
     item.transform.SetParent(null);
     pooledItems.Add(item);
 }