Example #1
0
    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);
    }
Example #2
0
    private void OnPlatformDestroyed(Platform platform)
    {
        _spawnedPlatforms.Remove(platform);
        if (_spawnedPlatforms.Count >= 1)
        {
            _spawnedPlatforms[0].ActivatePlatform();
        }

        Destroy(platform.gameObject);

        PlatformCountChanged?.Invoke(_destroyedPlatforms, _platformCount);
    }