public k514ItemController GetPooledItem(ITEM_TYPE index) { int Cnt = itemDisablePool[(int)index].Count; k514ItemController tmp = (itemDisablePool[(int)index])[Cnt - 1]; tmp.gameObject.SetActive(true); itemDisablePool[(int)index].RemoveAt(Cnt - 1); return(tmp); }
public override void PopItem() { k514ItemController tmp = Random.Range(0, 10) > 7 ? k514SystemManager.ItemMgr.GetPooledItem(ITEM_TYPE.SCORE) : k514SystemManager.ItemMgr.GetPooledItem(ITEM_TYPE.POWER); Transform tmp2 = null; if (tmp != null) { tmp2 = tmp.transform; tmp2.position = transform.position; } int cnt = Random.Range(4, 10); for (int i = 0; i < cnt; i++) { tmp = k514SystemManager.ItemMgr.GetPooledItem(ITEM_TYPE.SCORE); if (tmp != null) { tmp2 = tmp.transform; tmp2.position = transform.position + new Vector3(Random.Range(-3f, 3f), Random.Range(-3f, 3f), Random.Range(-2f, 2f)); } } }
public void KillItem(k514ItemController item, ITEM_TYPE index) { item.gameObject.SetActive(false); itemDisablePool[(int)index].Add(item); }