private void SpawnSlotAsync(int index) { if (index >= _size) { AsyncGenerationCompleted(); } else { void Next() { index++; SpawnSlotAsync(index); } if (_slotsSpawner == null) { _slotsSpawner = new AssetsSpawner(); } _slotsSpawner.Instantiate <Slot>(slotReference, (response => { response.rectTransform.SetParent(slotsHolder); _slots.Add(response); Next(); }), (error => { Debug.LogWarning($"Failed to instantiate slot {error}"); Next(); })); } }
protected override void ReleaseReferences() { viewTweener = null; viewFades = null; spinBtn = null; slotsHolder = null; config = null; slotReference = null; _slotsSpawner = null; _slots = null; Matrix = null; _columns = null; }