protected override void Update() { base.Update(); _rotationTimer += Time.deltaTime; if (_rotationTimer >= _currentRotationDirectionChangeTime) { _rotationTimer = 0f; _rotationAmountPerSecond *= -1; _currentRotationDirectionChangeTime = Random.Range(_minRotationDirectionChangeTime, _maxRotationDirectionChangeTime); } AngleDefinition.DoAngleRotation(_rotationAmountPerSecond); }
private void Awake() { _unitAngle = GetComponent <AngleDefinition>(); _lineRenderer = GetComponent <LineRenderer>(); }
private void Awake() { _player = FindObjectOfType <Player>(); _unitAngle = GetComponent <AngleDefinition>(); _defaultColor = GetComponent <SpriteRenderer>().color; }