Пример #1
0
    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);
    }
Пример #2
0
 private void Start()
 {
     _recycledObject = GetComponent <RecycledObject_Dynamic>();
 }