Exemplo n.º 1
0
        private void SetSpawnData()
        {
            for (var i = 0; i < _managedCount; i++)
            {
                _renderers[i].material.mainTexture = _powerupData.Image;
            }

            var spawnRotation = _deterministicRandomProvider.Next(_powerupData.SpawnRotation);

            MovementUtils.SetRotation(Transform, spawnRotation);
        }
Exemplo n.º 2
0
        private void ApplySpawnData()
        {
            for (var i = 0; i < _managedCount; i++)
            {
                _renderers[i].enabled = _obstacleData.IsEnabled(i);
                if (_renderers[i].enabled)
                {
                    _fatalCollisions.Add(i);
                }
            }

            _canSpin = _deterministicRandomProvider.NextBool(_levelData.RotationProbability);

            MovementUtils.SetRotation(Transform, GetNextSpawnRotation());
        }
Exemplo n.º 3
0
 private void SetZ(float z)
 {
     MovementUtils.SetPositionForObstacle(Transform, z);
 }
Exemplo n.º 4
0
 private float GetNextTargetRotation() => _canSpin
     ? _deterministicRandomProvider.Next(_obstacleData.TargetRotation)
     : MovementUtils.GetCurrentRotation(Transform);
Exemplo n.º 5
0
 private void StartTween()
 {
     _animationTween = LeanTween.value(0f, _tiling, _loopInSeconds).setLoopClamp().setOnUpdate(tiling =>
                                                                                               MovementUtils.SetTexturePosition(_material, _textureId, _materialXOffset, -tiling)).setDelay(_delayBeforeStart);
 }
Exemplo n.º 6
0
 public void Reset()
 {
     ResetTween();
     MovementUtils.SetTexturePosition(_material, _textureId, _materialXOffset, 0f);
 }