Exemplo n.º 1
0
    protected override void Update()
    {
        base.Update();

        _rotationTimer += Time.deltaTime;

        if (_rotationTimer >= _currentRotationDirectionChangeTime)
        {
            _rotationTimer                      = 0f;
            _rotationAmountPerSecond           *= -1;
            _currentRotationDirectionChangeTime =
                Random.Range(_minRotationDirectionChangeTime, _maxRotationDirectionChangeTime);
        }

        AngleDefinition.DoAngleRotation(_rotationAmountPerSecond);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     _unitAngle    = GetComponent <AngleDefinition>();
     _lineRenderer = GetComponent <LineRenderer>();
 }
Exemplo n.º 3
0
 private void Awake()
 {
     _player       = FindObjectOfType <Player>();
     _unitAngle    = GetComponent <AngleDefinition>();
     _defaultColor = GetComponent <SpriteRenderer>().color;
 }