private void AddNewObject() { int poolIndex = Random.Range(0, _prefabs.Count); GameObject newObject; newObject = Instantiate(_prefabs[poolIndex], transform); RecycledObject_Dynamic recycledObject = newObject.GetComponent <RecycledObject_Dynamic>(); recycledObject.Setup(this); newObject.SetActive(false); _freeObject.Add(newObject); }
private void Start() { _recycledObject = GetComponent <RecycledObject_Dynamic>(); }