public void RespawnObject(CollectableObject collectableObject) { foreach (var so in collectedProfileList) { if (so.myType == collectableObject.collectableProfile.myType) { collectedProfileList.Remove(so); break; } } }
public void CollectObject(CollectableObject collectableObject) { if (collectedProfileList.Count >= maxItemCount) { Debug.Log("Doldu"); return; } var cloneObject = Instantiate(collectableImagePrefab, bagContentTransform); _collectableImageList.Add(cloneObject); cloneObject.myImage.sprite = collectableObject.collectableProfile.myUISprite; collectedProfileList.Add(collectableObject.collectableProfile); cloneObject.myObject = collectableObject; cloneObject.myObject.gameObject.SetActive(false); }