void GetProp(GCGarbageItem prop) { if (isDebug) { print("Get " + prop.name); } closePropList.Remove(prop); Destroy(prop.gameObject); }
public void CreateItem() { float x = Random.Range(-1f, 1f); float z = Random.Range(-1f, 1f); Vector3 direction = new Vector3(x, 0, z); GameObject obj = Instantiate(createItemPrefab) as GameObject; obj.transform.position = transform.position + Random.Range(0, distance) * direction; obj.transform.parent = transform; createItem = obj.GetComponent <GCGarbageItem>(); }
void ChangeSelectProp(GCGarbageItem targetProp, bool direct = true) { if (targetProp == null) { curSelectProp = null; return; } if (direct) { GetProp(targetProp); return; } if (curSelectProp != targetProp) { curSelectProp = targetProp; } }
public void OnLostProp(GCGarbageItem item) { closePropList.Remove(item); SelectInPropsList(); }
public void OnCloseProp(GCGarbageItem item) { closePropList.Add(item); SelectInPropsList(); }