private void AddPlatform(int platformNumber) { var newPlatform = Instantiate(_currentTemplate, transform.position + Vector3.down * _platformHeight * platformNumber, Quaternion.Euler(0, _angleStep * platformNumber, 0), transform); _spawnedPlatforms.Add(newPlatform); PlatformCountChanged?.Invoke(_destroyedPlatforms, _platformCount); }
private void OnPlatformDestroyed(Platform platform) { _spawnedPlatforms.Remove(platform); if (_spawnedPlatforms.Count >= 1) { _spawnedPlatforms[0].ActivatePlatform(); } Destroy(platform.gameObject); PlatformCountChanged?.Invoke(_destroyedPlatforms, _platformCount); }