private void Reload() { _secondPop.Move(_firstPopCell, _reloadingTime, () => { _secondPop.transform.SetParent(_firstPopCell.transform); _firstPop = _secondPop; _secondPop = GetNewPop(_secondPopCell); _isActive = true; }); }
public void Detach(bool deactivatePop = false) { if (_pop != null) { if (deactivatePop) { _pop.Deactivate(); } else { _pop.transform.SetParent(null); _pop.Detach(); } } _pop = null; }
public void SwapPops() { if (_isActive) { _isActive = false; _firstPop.Move(_secondPopCell, _reloadingTime, () => { _firstPop.transform.SetParent(_secondPopCell.transform); }); _secondPop.Move(_firstPopCell, _reloadingTime, () => { _secondPop.transform.SetParent(_firstPopCell.transform); var temp = _firstPop; _firstPop = _secondPop; _secondPop = temp; _isActive = true; }); } }
public void Activate() { _firstPop = GetNewPop(_firstPopCell); _secondPop = GetNewPop(_secondPopCell); this.WaitForSeconds(_activationTime, () => _isActive = true); }
public void Attach(Pop pop) { _pop = pop; pop.transform.SetParent(transform); pop.transform.localPosition = Vector3.zero; }